vendor: 19,501 bytes, lines 1-2
1/*! For license information please see 1504.51c32670.chunk.js.LICENSE.txt */ 2(self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[1504],{63573:function(t,e){var n,i,r;i=[],void 0===(r="function"===typeof(n=function(){"use strict";function t(t,e,n){this.low=0|t,this.high=0|e,this.unsigned=!!n}function e(t){return!0===(t&&t.__isLong__)}t.prototype.__isLong__,Object.defineProperty(t.prototype,"__isLong__",{value:!0,enumerable:!1,configurable:!1}),t.isLong=e;var n={},i={};function r(t,e){var r,o,a;return e?(a=0<=(t>>>=0)&&t<256)&&(o=i[t])?o:(r=s(t,(0|t)<0?-1:0,!0),a&&(i[t]=r),r):(a=-128<=(t|=0)&&t<128)&&(o=n[t])?o:(r=s(t,t<0?-1:0,!1),a&&(n[t]=r),r)}function o(t,e){if(isNaN(t)||!isFinite(t))return e?g:A;if(e){if(t<0)return g;if(t>=d)return b}else{if(t<=-p)return x;if(t+1>=p)return v}return t<0?o(-t,e).neg():s(t%h|0,t/h|0,e)}function s(e,n,i){return new t(e,n,i)}t.fromInt=r,t.fromNumber=o,t.fromBits=s;var a=Math.pow;function l(t,e,n){if(0===t.length)throw Error("empty string");if("NaN"===t||"Infinity"===t||"+Infinity"===t||"-Infinity"===t)return A;if("number"===typeof e?(n=e,e=!1):e=!!e,(n=n||10)<2||36<n)throw RangeError("radix");var i;if((i=t.indexOf("-"))>0)throw Error("interior hyphen");if(0===i)return l(t.substring(1),e,n).neg();for(var r=o(a(n,8)),s=A,c=0;c<t.length;c+=8){var u=Math.min(8,t.length-c),h=parseInt(t.substring(c,c+u),n);if(u<8){var d=o(a(n,u));s=s.mul(d).add(o(h))}else s=(s=s.mul(r)).add(o(h))}return s.unsigned=e,s}function c(e){return e instanceof t?e:"number"===typeof e?o(e):"string"===typeof e?l(e):s(e.low,e.high,e.unsigned)}t.fromString=l,t.fromValue=c;var u=65536,h=u*u,d=h*h,p=d/2,f=r(1<<24),A=r(0);t.ZERO=A;var g=r(0,!0);t.UZERO=g;var m=r(1);t.ONE=m;var y=r(1,!0);t.UONE=y;var _=r(-1);t.NEG_ONE=_;var v=s(-1,2147483647,!1);t.MAX_VALUE=v;var b=s(-1,-1,!0);t.MAX_UNSIGNED_VALUE=b;var x=s(0,-2147483648,!1);t.MIN_VALUE=x;var w=t.prototype;return w.toInt=function(){return this.unsigned?this.low>>>0:this.low},w.toNumber=function(){return this.unsigned?(this.high>>>0)*h+(this.low>>>0):this.high*h+(this.low>>>0)},w.toString=function(t){if((t=t||10)<2||36<t)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(x)){var e=o(t),n=this.div(e),i=n.mul(e).sub(this);return n.toString(t)+i.toInt().toString(t)}return"-"+this.neg().toString(t)}for(var r=o(a(t,6),this.unsigned),s=this,l="";;){var c=s.div(r),u=(s.sub(c.mul(r)).toInt()>>>0).toString(t);if((s=c).isZero())return u+l;for(;u.length<6;)u="0"+u;l=""+u+l}},w.getHighBits=function(){return this.high},w.getHighBitsUnsigned=function(){return this.high>>>0},w.getLowBits=function(){return this.low},w.getLowBitsUnsigned=function(){return this.low>>>0},w.getNumBitsAbs=function(){if(this.isNegative())return this.eq(x)?64:this.neg().getNumBitsAbs();for(var t=0!=this.high?this.high:this.low,e=31;e>0&&0==(t&1<<e);e--);return 0!=this.high?e+33:e+1},w.isZero=function(){return 0===this.high&&0===this.low},w.isNegative=function(){return!this.unsigned&&this.high<0},w.isPositive=function(){return this.unsigned||this.high>=0},w.isOdd=function(){return 1===(1&this.low)},w.isEven=function(){return 0===(1&this.low)},w.equals=function(t){return e(t)||(t=c(t)),(this.unsigned===t.unsigned||this.high>>>31!==1||t.high>>>31!==1)&&this.high===t.high&&this.low===t.low},w.eq=w.equals,w.notEquals=function(t){return!this.eq(t)},w.neq=w.notEquals,w.lessThan=function(t){return this.comp(t)<0},w.lt=w.lessThan,w.lessThanOrEqual=function(t){return this.comp(t)<=0},w.lte=w.lessThanOrEqual,w.greaterThan=function(t){return this.comp(t)>0},w.gt=w.greaterThan,w.greaterThanOrEqual=function(t){return this.comp(t)>=0},w.gte=w.greaterThanOrEqual,w.compare=function(t){if(e(t)||(t=c(t)),this.eq(t))return 0;var n=this.isNegative(),i=t.isNegative();return n&&!i?-1:!n&&i?1:this.unsigned?t.high>>>0>this.high>>>0||t.high===this.high&&t.low>>>0>this.low>>>0?-1:1:this.sub(t).isNegative()?-1:1},w.comp=w.compare,w.negate=function(){return!this.unsigned&&this.eq(x)?x:this.not().add(m)},w.neg=w.negate,w.add=function(t){e(t)||(t=c(t));var n=this.high>>>16,i=65535&this.high,r=this.low>>>16,o=65535&this.low,a=t.high>>>16,l=65535&t.high,u=t.low>>>16,h=0,d=0,p=0,f=0;return p+=(f+=o+(65535&t.low))>>>16,d+=(p+=r+u)>>>16,h+=(d+=i+l)>>>16,h+=n+a,s((p&=65535)<<16|(f&=65535),(h&=65535)<<16|(d&=65535),this.unsigned)},w.subtract=function(t){return e(t)||(t=c(t)),this.add(t.neg())},w.sub=w.subtract,w.multiply=function(t){if(this.isZero())return A;if(e(t)||(t=c(t)),t.isZero())return A;if(this.eq(x))return t.isOdd()?x:A;if(t.eq(x))return this.isOdd()?x:A;if(this.isNegative())return t.isNegative()?this.neg().mul(t.neg()):this.neg().mul(t).neg();if(t.isNegative())return this.mul(t.neg()).neg();if(this.lt(f)&&t.lt(f))return o(this.toNumber()*t.toNumber(),this.unsigned);var n=this.high>>>16,i=65535&this.high,r=this.low>>>16,a=65535&this.low,l=t.high>>>16,u=65535&t.high,h=t.low>>>16,d=65535&t.low,p=0,g=0,m=0,y=0;return m+=(y+=a*d)>>>16,g+=(m+=r*d)>>>16,m&=65535,g+=(m+=a*h)>>>16,p+=(g+=i*d)>>>16,g&=65535,p+=(g+=r*h)>>>16,g&=65535,p+=(g+=a*u)>>>16,p+=n*d+i*h+r*u+a*l,s((m&=65535)<<16|(y&=65535),(p&=65535)<<16|(g&=65535),this.unsigned)},w.mul=w.multiply,w.divide=function(t){if(e(t)||(t=c(t)),t.isZero())throw Error("division by zero");if(this.isZero())return this.unsigned?g:A;var n,i,r;if(this.unsigned){if(t.unsigned||(t=t.toUnsigned()),t.gt(this))return g;if(t.gt(this.shru(1)))return y;r=g}else{if(this.eq(x))return t.eq(m)||t.eq(_)?x:t.eq(x)?m:(n=this.shr(1).div(t).shl(1)).eq(A)?t.isNegative()?m:_:(i=this.sub(t.mul(n)),r=n.add(i.div(t)));if(t.eq(x))return this.unsigned?g:A;if(this.isNegative())return t.isNegative()?this.neg().div(t.neg()):this.neg().div(t).neg();if(t.isNegative())return this.div(t.neg()).neg();r=A}for(i=this;i.gte(t);){n=Math.max(1,Math.floor(i.toNumber()/t.toNumber()));for(var s=Math.ceil(Math.log(n)/Math.LN2),l=s<=48?1:a(2,s-48),u=o(n),h=u.mul(t);h.isNegative()||h.gt(i);)h=(u=o(n-=l,this.unsigned)).mul(t);u.isZero()&&(u=m),r=r.add(u),i=i.sub(h)}return r},w.div=w.divide,w.modulo=function(t){return e(t)||(t=c(t)),this.sub(this.div(t).mul(t))},w.mod=w.modulo,w.not=function(){return s(~this.low,~this.high,this.unsigned)},w.and=function(t){return e(t)||(t=c(t)),s(this.low&t.low,this.high&t.high,this.unsigned)},w.or=function(t){return e(t)||(t=c(t)),s(this.low|t.low,this.high|t.high,this.unsigned)},w.xor=function(t){return e(t)||(t=c(t)),s(this.low^t.low,this.high^t.high,this.unsigned)},w.shiftLeft=function(t){return e(t)&&(t=t.toInt()),0===(t&=63)?this:t<32?s(this.low<<t,this.high<<t|this.low>>>32-t,this.unsigned):s(0,this.low<<t-32,this.unsigned)},w.shl=w.shiftLeft,w.shiftRight=function(t){return e(t)&&(t=t.toInt()),0===(t&=63)?this:t<32?s(this.low>>>t|this.high<<32-t,this.high>>t,this.unsigned):s(this.high>>t-32,this.high>=0?0:-1,this.unsigned)},w.shr=w.shiftRight,w.shiftRightUnsigned=function(t){if(e(t)&&(t=t.toInt()),0===(t&=63))return this;var n=this.high;return t<32?s(this.low>>>t|n<<32-t,n>>>t,this.unsigned):s(32===t?n:n>>>t-32,0,this.unsigned)},w.shru=w.shiftRightUnsigned,w.toSigned=function(){return this.unsigned?s(this.low,this.high,!1):this},w.toUnsigned=function(){return this.unsigned?this:s(this.low,this.high,!0)},w.toBytes=function(t){return t?this.toBytesLE():this.toBytesBE()},w.toBytesLE=function(){var t=this.high,e=this.low;return[255&e,e>>>8&255,e>>>16&255,e>>>24&255,255&t,t>>>8&255,t>>>16&255,t>>>24&255]},w.toBytesBE=function(){var t=this.high,e=this.low;return[t>>>24&255,t>>>16&255,t>>>8&255,255&t,e>>>24&255,e>>>16&255,e>>>8&255,255&e]},t})?n.apply(e,i):n)||(t.exports=r)},68994:(t,e,n)=>{"use strict";n.d(e,{b:()=>s});var i=n(68102),r=n(58878),o=n(68622),s=r.forwardRef((function(t,e){return r.createElement(o.I,(0,i.A)({iconAttrs:{fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},t,{ref:e}),r.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),r.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"}))}));s.displayName="Close"},30765:(t,e,n)=>{var i=n(56902);function r(t){return{type:"Feature",geometry:i.tileToGeoJSON(t),properties:{}}}function o(t,e){var n,r,o=t.coordinates,a=e.max_zoom,h={},d=[];if("Point"===t.type)return[i.pointToTile(o[0],o[1],a)];if("MultiPoint"===t.type)for(n=0;n<o.length;n++)h[u((r=i.pointToTile(o[n][0],o[n][1],a))[0],r[1],r[2])]=!0;else if("LineString"===t.type)l(h,o,a);else if("MultiLineString"===t.type)for(n=0;n<o.length;n++)l(h,o[n],a);else if("Polygon"===t.type)s(h,d,o,a);else{if("MultiPolygon"!==t.type)throw new Error("Geometry type not implemented");for(n=0;n<o.length;n++)s(h,d,o[n],a)}if(e.min_zoom!==a){var p=d.length;for(c(h,d),n=0;n<p;n++){var f=d[n];h[u(f[0],f[1],f[2])]=!0}return function(t,e,n){for(var i=[],r=n.max_zoom;r>n.min_zoom;r--){for(var o={},s=[],a=0;a<e.length;a++){var l=e[a];if(l[0]%2===0&&l[1]%2===0){var c=u(l[0]+1,l[1],r),h=u(l[0],l[1]+1,r),d=u(l[0]+1,l[1]+1,r);if(t[c]&&t[h]&&t[d]){t[u(l[0],l[1],l[2])]=!1,t[c]=!1,t[h]=!1,t[d]=!1;var p=[l[0]/2,l[1]/2,r-1];r-1===n.min_zoom?i.push(p):(o[u(l[0]/2,l[1]/2,r-1)]=!0,s.push(p))}}}for(a=0;a<e.length;a++)t[u((l=e[a])[0],l[1],l[2])]&&i.push(l);t=o,e=s}return i}(h,d,e)}return c(h,d),d}function s(t,e,n,i){for(var r=[],o=0;o<n.length;o++){var s=[];l(t,n[o],i,s);for(var c=0,h=s.length,d=h-1;c<h;d=c++){var p=(c+1)%h,f=s[c][1];(f>s[d][1]||f>s[p][1])&&(f<s[d][1]||f<s[p][1])&&f!==s[p][1]&&r.push(s[c])}}for(r.sort(a),o=0;o<r.length;o+=2){f=r[o][1];for(var A=r[o][0]+1;A<r[o+1][0];A++){t[u(A,f,i)]||e.push([A,f,i])}}}function a(t,e){return t[1]-e[1]||t[0]-e[0]}function l(t,e,n,r){for(var o,s,a=0;a<e.length-1;a++){var l=i.pointToTileFraction(e[a][0],e[a][1],n),c=i.pointToTileFraction(e[a+1][0],e[a+1][1],n),h=l[0],d=l[1],p=c[0]-h,f=c[1]-d;if(0!==f||0!==p){var A=p>0?1:-1,g=f>0?1:-1,m=Math.floor(h),y=Math.floor(d),_=0===p?1/0:Math.abs(((p>0?1:0)+m-h)/p),v=0===f?1/0:Math.abs(((f>0?1:0)+y-d)/f),b=Math.abs(A/p),x=Math.abs(g/f);for(m===o&&y===s||(t[u(m,y,n)]=!0,r&&y!==s&&r.push([m,y]),o=m,s=y);_<1||v<1;)_<v?(_+=b,m+=A):(v+=x,y+=g),t[u(m,y,n)]=!0,r&&y!==s&&r.push([m,y]),o=m,s=y}}r&&y===r[0][1]&&r.pop()}function c(t,e){for(var n=Object.keys(t),i=0;i<n.length;i++)e.push(h(+n[i]))}function u(t,e,n){return 32*(2*(1<<n)*e+t)+n}function h(t){var e=t%32,n=2*(1<<e),i=(t-e)/32,r=i%n;return[r,(i-r)/n%n,e]}},35008:t=>{"use strict";function e(t,e,i){i=i||2;var o,s,a,l,h,d,f,A=e&&e.length,g=A?e[0]*i:t.length,m=n(t,0,g,i,!0),y=[];if(!m||m.next===m.prev)return y;if(A&&(m=function(t,e,i,r){var o,s,a,l=[];for(o=0,s=e.length;o<s;o++)(a=n(t,e[o]*r,o<s-1?e[o+1]*r:t.length,r,!1))===a.next&&(a.steiner=!0),l.push(p(a));for(l.sort(c),o=0;o<l.length;o++)i=u(l[o],i);return i}(t,e,m,i)),t.length>80*i){o=a=t[0],s=l=t[1];for(var _=i;_<g;_+=i)(h=t[_])<o&&(o=h),(d=t[_+1])<s&&(s=d),h>a&&(a=h),d>l&&(l=d);f=0!==(f=Math.max(a-o,l-s))?32767/f:0}return r(m,y,i,o,s,f,0),y}function n(t,e,n,i,r){var o,s;if(r===T(t,e,n,i)>0)for(o=e;o<n;o+=i)s=w(o,t[o],t[o+1],s);else for(o=n-i;o>=e;o-=i)s=w(o,t[o],t[o+1],s);return s&&m(s,s.next)&&(E(s),s=s.next),s}function i(t,e){if(!t)return t;e||(e=t);var n,i=t;do{if(n=!1,i.steiner||!m(i,i.next)&&0!==g(i.prev,i,i.next))i=i.next;else{if(E(i),(i=e=i.prev)===i.next)break;n=!0}}while(n||i!==e);return e}function r(t,e,n,c,u,h,p){if(t){!p&&h&&function(t,e,n,i){var r=t;do{0===r.z&&(r.z=d(r.x,r.y,e,n,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,function(t){var e,n,i,r,o,s,a,l,c=1;do{for(n=t,t=null,o=null,s=0;n;){for(s++,i=n,a=0,e=0;e<c&&(a++,i=i.nextZ);e++);for(l=c;a>0||l>0&&i;)0!==a&&(0===l||!i||n.z<=i.z)?(r=n,n=n.nextZ,a--):(r=i,i=i.nextZ,l--),o?o.nextZ=r:t=r,r.prevZ=o,o=r;n=i}o.nextZ=null,c*=2}while(s>1)}(r)}(t,c,u,h);for(var f,A,g=t;t.prev!==t.next;)if(f=t.prev,A=t.next,h?s(t,c,u,h):o(t))e.push(f.i/n|0),e.push(t.i/n|0),e.push(A.i/n|0),E(t),t=A.next,g=A.next;else if((t=A)===g){p?1===p?r(t=a(i(t),e,n),e,n,c,u,h,2):2===p&&l(t,e,n,c,u,h):r(i(t),e,n,c,u,h,1);break}}}function o(t){var e=t.prev,n=t,i=t.next;if(g(e,n,i)>=0)return!1;for(var r=e.x,o=n.x,s=i.x,a=e.y,l=n.y,c=i.y,u=r<o?r<s?r:s:o<s?o:s,h=a<l?a<c?a:c:l<c?l:c,d=r>o?r>s?r:s:o>s?o:s,p=a>l?a>c?a:c:l>c?l:c,A=i.next;A!==e;){if(A.x>=u&&A.x<=d&&A.y>=h&&A.y<=p&&f(r,a,o,l,s,c,A.x,A.y)&&g(A.prev,A,A.next)>=0)return!1;A=A.next}return!0}function s(t,e,n,i){var r=t.prev,o=t,s=t.next;if(g(r,o,s)>=0)return!1;for(var a=r.x,l=o.x,c=s.x,u=r.y,h=o.y,p=s.y,A=a<l?a<c?a:c:l<c?l:c,m=u<h?u<p?u:p:h<p?h:p,y=a>l?a>c?a:c:l>c?l:c,_=u>h?u>p?u:p:h>p?h:p,v=d(A,m,e,n,i),b=d(y,_,e,n,i),x=t.prevZ,w=t.nextZ;x&&x.z>=v&&w&&w.z<=b;){if(x.x>=A&&x.x<=y&&x.y>=m&&x.y<=_&&x!==r&&x!==s&&f(a,u,l,h,c,p,x.x,x.y)&&g(x.prev,x,x.next)>=0)return!1;if(x=x.prevZ,w.x>=A&&w.x<=y&&w.y>=m&&w.y<=_&&w!==r&&w!==s&&f(a,u,l,h,c,p,w.x,w.y)&&g(w.prev,w,w.next)>=0)return!1;w=w.nextZ}for(;x&&x.z>=v;){if(x.x>=A&&x.x<=y&&x.y>=m&&x.y<=_&&x!==r&&x!==s&&f(a,u,l,h,c,p,x.x,x.y)&&g(x.prev,x,x.next)>=0)return!1;x=x.prevZ}for(;w&&w.z<=b;){if(w.x>=A&&w.x<=y&&w.y>=m&&w.y<=_&&w!==r&&w!==s&&f(a,u,l,h,c,p,w.x,w.y)&&g(w.prev,w,w.next)>=0)return!1;w=w.nextZ}return!0}function a(t,e,n){var r=t;do{var o=r.prev,s=r.next.next;!m(o,s)&&y(o,r,r.next,s)&&b(o,s)&&b(s,o)&&(e.push(o.i/n|0),e.push(r.i/n|0),e.push(s.i/n|0),E(r),E(r.next),r=t=s),r=r.next}while(r!==t);return i(r)}function l(t,e,n,o,s,a){var l=t;do{for(var c=l.next.next;c!==l.prev;){if(l.i!==c.i&&A(l,c)){var u=x(l,c);return l=i(l,l.next),u=i(u,u.next),r(l,e,n,o,s,a,0),void r(u,e,n,o,s,a,0)}c=c.next}l=l.next}while(l!==t)}function c(t,e){return t.x-e.x}function u(t,e){var n=function(t,e){var n,i=e,r=t.x,o=t.y,s=-1/0;do{if(o<=i.y&&o>=i.next.y&&i.next.y!==i.y){var a=i.x+(o-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(a<=r&&a>s&&(s=a,n=i.x<i.next.x?i:i.next,a===r))return n}i=i.next}while(i!==e);if(!n)return null;var l,c=n,u=n.x,d=n.y,p=1/0;i=n;do{r>=i.x&&i.x>=u&&r!==i.x&&f(o<d?r:s,o,u,d,o<d?s:r,o,i.x,i.y)&&(l=Math.abs(o-i.y)/(r-i.x),b(i,t)&&(l<p||l===p&&(i.x>n.x||i.x===n.x&&h(n,i)))&&(n=i,p=l)),i=i.next}while(i!==c);return n}(t,e);if(!n)return e;var r=x(n,t);return i(r,r.next),i(n,n.next)}function h(t,e){return g(t.prev,t,e.prev)<0&&g(e.next,t,t.next)<0}function d(t,e,n,i,r){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-n)*r|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-i)*r|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function p(t){var e=t,n=t;do{(e.x<n.x||e.x===n.x&&e.y<n.y)&&(n=e),e=e.next}while(e!==t);return n}function f(t,e,n,i,r,o,s,a){return(r-s)*(e-a)>=(t-s)*(o-a)&&(t-s)*(i-a)>=(n-s)*(e-a)&&(n-s)*(o-a)>=(r-s)*(i-a)}function A(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&y(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}(t,e)&&(b(t,e)&&b(e,t)&&function(t,e){var n=t,i=!1,r=(t.x+e.x)/2,o=(t.y+e.y)/2;do{n.y>o!==n.next.y>o&&n.next.y!==n.y&&r<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next}while(n!==t);return i}(t,e)&&(g(t.prev,t,e.prev)||g(t,e.prev,e))||m(t,e)&&g(t.prev,t,t.next)>0&&g(e.prev,e,e.next)>0)}function g(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function m(t,e){return t.x===e.x&&t.y===e.y}function y(t,e,n,i){var r=v(g(t,e,n)),o=v(g(t,e,i)),s=v(g(n,i,t)),a=v(g(n,i,e));return r!==o&&s!==a||(!(0!==r||!_(t,n,e))||(!(0!==o||!_(t,i,e))||(!(0!==s||!_(n,t,i))||!(0!==a||!_(n,e,i)))))}function _(t,e,n){return e.x<=Math.max(t.x,n.x)&&e.x>=Math.min(t.x,n.x)&&e.y<=Math.max(t.y,n.y)&&e.y>=Math.min(t.y,n.y)}function v(t){return t>0?1:t<0?-1:0}function b(t,e){return g(t.prev,t,t.next)<0?g(t,e,t.next)>=0&&g(t,t.prev,e)>=0:g(t,e,t.prev)<0||g(t,t.next,e)<0}function x(t,e){var n=new C(t.i,t.x,t.y),i=new C(e.i,e.x,e.y),r=t.next,o=e.prev;return t.next=e,e.prev=t,n.next=r,r.prev=n,i.next=n,n.prev=i,o.next=i,i.prev=o,i}function w(t,e,n,i){var r=new C(t,e,n);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function E(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function C(t,e,n){this.i=t,this.x=e,this.y=n,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function T(t,e,n,i){for(var r=0,o=e,s=n-i;o<n;o+=i)r+=(t[s]-t[o])*(t[o+1]+t[s+1]),s=o;return r}t.exports=e,t.exports.default=e,e.deviation=function(t,e,n,i){var r=e&&e.length,o=r?e[0]*n:t.length,s=Math.abs(T(t,0,o,n));if(r)for(var a=0,l=e.length;a<l;a++){var c=e[a]*n,u=a<l-1?e[a+1]*n:t.length;s-=Math.abs(T(t,c,u,n))}var h=0;for(a=0;a<i.length;a+=3){var d=i[a]*n,p=i[a+1]*n,f=i[a+2]*n;h+=Math.abs((t[d]-t[f])*(t[p+1]-t[d+1])-(t[d]-t[p])*(t[f+1]-t[d+1]))}return 0===s&&0===h?0:Math.abs((h-s)/s)},e.flatten=function(t){for(var e=t[0][0].length,n={vertices:[],holes:[],dimensions:e},i=0,r=0;r<t.length;r++){for(var o=0;o<t[r].length;o++)for(var s=0;s<e;s++)n.vertices.push(t[r][o][s]);r>0&&(i+=t[r-1].length,n.holes.push(i))}return n}},27756:(t,e,n)=>{"use strict";const i=n(7268),r=n(75505),o=n(29522);t.exports={XMLParser:r,XMLValidator:i,XMLBuilder:o}},34940:(t,e)=>{"use strict";const n=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",i="["+n+"]["+(n+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040")+"]*",r=new RegExp("^"+i+"$");e.isExist=function(t){return"undefined"!==typeof t},e.isEmptyObject=function(t){return 0===Object.keys(t).length},e.merge=function(t,e,n){if(e){const i=Object.keys(e),r=i.length;for(let o=0;o<r;o++)t[i[o]]="strict"===n?[e[i[o]]]:e[i[o]]}},e.getValue=function(t){return e.isExist(t)?t:""},e.isName=function(t){const e=r.exec(t);return!(null===e||"undefined"===typeof e)},e.getAllMatches=function(t,e){const n=[];let i=e.exec(t);for(;i;){const r=[];r.startIndex=e.lastIndex-i[0].length;const o=i.length;for(let t=0;t<o;t++)r.push(i[t]);n.push(r),i=e.exec(t)}return n},e.nameRegexp=i},7268:(t,e,n)=>{"use strict";const i=n(34940),r={allowBooleanAttributes:!1,unpairedTags:[]};function o(t){return" "===t||"\t"===t||"\n"===t||"\r"===t}function s(t,e){const n=e;for(;e<t.length;e++)if("?"!=t[e]&&" "!=t[e]);else{const i=t.substr(n,e-n);if(e>5&&"xml"===i)return f("InvalidXml","XML declaration allowed only at the start of the document.",g(t,e));if("?"==t[e]&&">"==t[e+1]){e++;break}}return e}function a(t,e){if(t.length>e+5&&"-"===t[e+1]&&"-"===t[e+2]){for(e+=3;e<t.length;e++)if("-"===t[e]&&"-"===t[e+1]&&">"===t[e+2]){e+=2;break}}else if(t.length>e+8&&"D"===t[e+1]&&"O"===t[e+2]&&"C"===t[e+3]&&"T"===t[e+4]&&"Y"===t[e+5]&&"P"===t[e+6]&&"E"===t[e+7]){let n=1;for(e+=8;e<t.length;e++)if("<"===t[e])n++;else if(">"===t[e]&&(n--,0===n))break}else if(t.length>e+9&&"["===t[e+1]&&"C"===t[e+2]&&"D"===t[e+3]&&"A"===t[e+4]&&"T"===t[e+5]&&"A"===t[e+6]&&"["===t[e+7])for(e+=8;e<t.length;e++)if("]"===t[e]&&"]"===t[e+1]&&">"===t[e+2]){e+=2;break}return e}e.validate=function(t,e){e=Object.assign({},r,e);const n=[];let l=!1,c=!1;"\ufeff"===t[0]&&(t=t.substr(1));for(let r=0;r<t.length;r++)if("<"===t[r]&&"?"===t[r+1]){if(r+=2,r=s(t,r),r.err)return r}else{if("<"!==t[r]){if(o(t[r]))continue;return f("InvalidChar","char '"+t[r]+"' is not expected.",g(t,r))}{let A=r;if(r++,"!"===t[r]){r=a(t,r);continue}{let m=!1;"/"===t[r]&&(m=!0,r++);let y="";for(;r<t.length&&">"!==t[r]&&" "!==t[r]&&"\t"!==t[r]&&"\n"!==t[r]&&"\r"!==t[r];r++)y+=t[r];if(y=y.trim(),"/"===y[y.length-1]&&(y=y.substring(0,y.length-1),r--),h=y,!i.isName(h)){let e;return e=0===y.trim().length?"Invalid space after '<'.":"Tag '"+y+"' is an invali
2d name.",f("InvalidTag",e,g(t,r))}const _=u(t,r);if(!1===_)return f("InvalidAttr","Attributes for '"+y+"' have open quote.",g(t,r));let v=_.value;if(r=_.index,"/"===v[v.length-1]){const n=r-v.length;v=v.substring(0,v.length-1);const i=d(v,e);if(!0!==i)return f(i.err.code,i.err.msg,g(t,n+i.err.line));l=!0}else if(m){if(!_.tagClosed)return f("InvalidTag","Closing tag '"+y+"' doesn't have proper closing.",g(t,r));if(v.trim().length>0)return f("InvalidTag","Closing tag '"+y+"' can't have attributes or invalid starting.",g(t,A));if(0===n.length)return f("InvalidTag","Closing tag '"+y+"' has not been opened.",g(t,A));{const e=n.pop();if(y!==e.tagName){let n=g(t,e.tagStartPos);return f("InvalidTag","Expected closing tag '"+e.tagName+"' (opened in line "+n.line+", col "+n.col+") instead of closing tag '"+y+"'.",g(t,A))}0==n.length&&(c=!0)}}else{const i=d(v,e);if(!0!==i)return f(i.err.code,i.err.msg,g(t,r-v.length+i.err.line));if(!0===c)return f("InvalidXml","Multiple possible root nodes found.",g(t,r));-1!==e.unpairedTags.indexOf(y)||n.push({tagName:y,tagStartPos:A}),l=!0}for(r++;r<t.length;r++)if("<"===t[r]){if("!"===t[r+1]){r++,r=a(t,r);continue}if("?"!==t[r+1])break;if(r=s(t,++r),r.err)return r}else if("&"===t[r]){const e=p(t,r);if(-1==e)return f("InvalidChar","char '&' is not expected.",g(t,r));r=e}else if(!0===c&&!o(t[r]))return f("InvalidXml","Extra text at the end",g(t,r));"<"===t[r]&&r--}}}var h;return l?1==n.length?f("InvalidTag","Unclosed tag '"+n[0].tagName+"'.",g(t,n[0].tagStartPos)):!(n.length>0)||f("InvalidXml","Invalid '"+JSON.stringify(n.map((t=>t.tagName)),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1}):f("InvalidXml","Start tag expected.",1)};const l='"',c="'";function u(t,e){let n="",i="",r=!1;for(;e<t.length;e++){if(t[e]===l||t[e]===c)""===i?i=t[e]:i!==t[e]||(i="");else if(">"===t[e]&&""===i){r=!0;break}n+=t[e]}return""===i&&{value:n,index:e,tagClosed:r}}const h=new RegExp("(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['\"])(([\\s\\S])*?)\\5)?","g");function d(t,e){const n=i.getAllMatches(t,h),r={};for(let i=0;i<n.length;i++){if(0===n[i][1].length)return f("InvalidAttr","Attribute '"+n[i][2]+"' has no space in starting.",m(n[i]));if(void 0!==n[i][3]&&void 0===n[i][4])return f("InvalidAttr","Attribute '"+n[i][2]+"' is without value.",m(n[i]));if(void 0===n[i][3]&&!e.allowBooleanAttributes)return f("InvalidAttr","boolean attribute '"+n[i][2]+"' is not allowed.",m(n[i]));const t=n[i][2];if(!A(t))return f("InvalidAttr","Attribute '"+t+"' is an invalid name.",m(n[i]));if(r.hasOwnProperty(t))return f("InvalidAttr","Attribute '"+t+"' is repeated.",m(n[i]));r[t]=1}return!0}function p(t,e){if(";"===t[++e])return-1;if("#"===t[e])return function(t,e){let n=/\d/;for("x"===t[e]&&(e++,n=/[\da-fA-F]/);e<t.length;e++){if(";"===t[e])return e;if(!t[e].match(n))break}return-1}(t,++e);let n=0;for(;e<t.length;e++,n++)if(!(t[e].match(/\w/)&&n<20)){if(";"===t[e])break;return-1}return e}function f(t,e,n){return{err:{code:t,msg:e,line:n.line||n,col:n.col}}}function A(t){return i.isName(t)}function g(t,e){const n=t.substring(0,e).split(/\r?\n/);return{line:n.length,col:n[n.length-1].length+1}}function m(t){return t.startIndex+t[1].length}},29522:(t,e,n)=>{"use strict";const i=n(75846),r={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(t,e){return e},attributeValueProcessor:function(t,e){return e},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:new RegExp("&","g"),val:"&"},{regex:new RegExp(">","g"),val:">"},{regex:new RegExp("<","g"),val:"<"},{regex:new RegExp("'","g"),val:"'"},{regex:new RegExp('"',"g"),val:"""}],processEntities:!0,stopNodes:[],oneListGroup:!1};function o(t){this.options=Object.assign({},r,t),this.options.ignoreAttributes||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=l),this.processTextOrObjNode=s,this.options.format?(this.indentate=a,this.tagEndChar=">\n",this.newLine="\n"):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}function s(t,e,n){const i=this.j2x(t,n+1);return void 0!==t[this.options.textNodeName]&&1===Object.keys(t).length?this.buildTextValNo
vendor: 22,189 bytes, line 2
2de(t[this.options.textNodeName],e,i.attrStr,n):this.buildObjectNode(i.val,e,i.attrStr,n)}function a(t){return this.options.indentBy.repeat(t)}function l(t){return!(!t.startsWith(this.options.attributeNamePrefix)||t===this.options.textNodeName)&&t.substr(this.attrPrefixLen)}o.prototype.build=function(t){return this.options.preserveOrder?i(t,this.options):(Array.isArray(t)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(t={[this.options.arrayNodeName]:t}),this.j2x(t,0).val)},o.prototype.j2x=function(t,e){let n="",i="";for(let r in t)if(Object.prototype.hasOwnProperty.call(t,r))if("undefined"===typeof t[r])this.isAttribute(r)&&(i+="");else if(null===t[r])this.isAttribute(r)?i+="":"?"===r[0]?i+=this.indentate(e)+"<"+r+"?"+this.tagEndChar:i+=this.indentate(e)+"<"+r+"/"+this.tagEndChar;else if(t[r]instanceof Date)i+=this.buildTextValNode(t[r],r,"",e);else if("object"!==typeof t[r]){const o=this.isAttribute(r);if(o)n+=this.buildAttrPairStr(o,""+t[r]);else if(r===this.options.textNodeName){let e=this.options.tagValueProcessor(r,""+t[r]);i+=this.replaceEntitiesValue(e)}else i+=this.buildTextValNode(t[r],r,"",e)}else if(Array.isArray(t[r])){const n=t[r].length;let o="",s="";for(let a=0;a<n;a++){const n=t[r][a];if("undefined"===typeof n);else if(null===n)"?"===r[0]?i+=this.indentate(e)+"<"+r+"?"+this.tagEndChar:i+=this.indentate(e)+"<"+r+"/"+this.tagEndChar;else if("object"===typeof n)if(this.options.oneListGroup){const t=this.j2x(n,e+1);o+=t.val,this.options.attributesGroupName&&n.hasOwnProperty(this.options.attributesGroupName)&&(s+=t.attrStr)}else o+=this.processTextOrObjNode(n,r,e);else if(this.options.oneListGroup){let t=this.options.tagValueProcessor(r,n);t=this.replaceEntitiesValue(t),o+=t}else o+=this.buildTextValNode(n,r,"",e)}this.options.oneListGroup&&(o=this.buildObjectNode(o,r,s,e)),i+=o}else if(this.options.attributesGroupName&&r===this.options.attributesGroupName){const e=Object.keys(t[r]),i=e.length;for(let o=0;o<i;o++)n+=this.buildAttrPairStr(e[o],""+t[r][e[o]])}else i+=this.processTextOrObjNode(t[r],r,e);return{attrStr:n,val:i}},o.prototype.buildAttrPairStr=function(t,e){return e=this.options.attributeValueProcessor(t,""+e),e=this.replaceEntitiesValue(e),this.options.suppressBooleanAttributes&&"true"===e?" "+t:" "+t+'="'+e+'"'},o.prototype.buildObjectNode=function(t,e,n,i){if(""===t)return"?"===e[0]?this.indentate(i)+"<"+e+n+"?"+this.tagEndChar:this.indentate(i)+"<"+e+n+this.closeTag(e)+this.tagEndChar;{let r="</"+e+this.tagEndChar,o="";return"?"===e[0]&&(o="?",r=""),!n&&""!==n||-1!==t.indexOf("<")?!1!==this.options.commentPropName&&e===this.options.commentPropName&&0===o.length?this.indentate(i)+`\x3c!--${t}--\x3e`+this.newLine:this.indentate(i)+"<"+e+n+o+this.tagEndChar+t+this.indentate(i)+r:this.indentate(i)+"<"+e+n+o+">"+t+r}},o.prototype.closeTag=function(t){let e="";return-1!==this.options.unpairedTags.indexOf(t)?this.options.suppressUnpairedNode||(e="/"):e=this.options.suppressEmptyNode?"/":`></${t}`,e},o.prototype.buildTextValNode=function(t,e,n,i){if(!1!==this.options.cdataPropName&&e===this.options.cdataPropName)return this.indentate(i)+`<![CDATA[${t}]]>`+this.newLine;if(!1!==this.options.commentPropName&&e===this.options.commentPropName)return this.indentate(i)+`\x3c!--${t}--\x3e`+this.newLine;if("?"===e[0])return this.indentate(i)+"<"+e+n+"?"+this.tagEndChar;{let r=this.options.tagValueProcessor(e,t);return r=this.replaceEntitiesValue(r),""===r?this.indentate(i)+"<"+e+n+this.closeTag(e)+this.tagEndChar:this.indentate(i)+"<"+e+n+">"+r+"</"+e+this.tagEndChar}},o.prototype.replaceEntitiesValue=function(t){if(t&&t.length>0&&this.options.processEntities)for(let e=0;e<this.options.entities.length;e++){const n=this.options.entities[e];t=t.replace(n.regex,n.val)}return t},t.exports=o},75846:t=>{function e(t,s,a,l){let c="",u=!1;for(let h=0;h<t.length;h++){const d=t[h],p=n(d);if(void 0===p)continue;let f="";if(f=0===a.length?p:`${a}.${p}`,p===s.textNodeName){let t=d[p];r(f,s)||(t=s.tagValueProcessor(p,t),t=o(t,s)),u&&(c+=l),c+=t,u=!1;continue}if(p===s.cdataPropName){u&&(c+=l),c+=`<![CDATA[${d[p][0][s.textNodeName]}]]>`,u=!1;continue}if(p===s.commentPropName){c+=l+`\x3c!--${d[p][0][s.textNodeName]}--\x3e`,u=!0;continue}if("?"===p[0]){const t=i(d[":@"],s),e="?xml"===p?"":l;let n=d[p][0][s.textNodeName];n=0!==n.length?" "+n:"",c+=e+`<${p}${n}${t}?>`,u=!0;continue}let A=l;""!==A&&(A+=s.indentBy);const g=l+`<${p}${i(d[":@"],s)}`,m=e(d[p],s,f,A);-1!==s.unpairedTags.indexOf(p)?s.suppressUnpairedNode?c+=g+">":c+=g+"/>":m&&0!==m.length||!s.suppressEmptyNode?m&&m.endsWith(">")?c+=g+`>${m}${l}</${p}>`:(c+=g+">",m&&""!==l&&(m.includes("/>")||m.includes("</"))?c+=l+s.indentBy+m+l:c+=m,c+=`</${p}>`):c+=g+"/>",u=!0}return c}function n(t){const e=Object.keys(t);for(let n=0;n<e.length;n++){const i=e[n];if(t.hasOwnProperty(i)&&":@"!==i)return i}}function i(t,e){let n="";if(t&&!e.ignoreAttributes)for(let i in t){if(!t.hasOwnProperty(i))continue;let r=e.attributeValueProcessor(i,t[i]);r=o(r,e),!0===r&&e.suppressBooleanAttributes?n+=` ${i.substr(e.attributeNamePrefix.length)}`:n+=` ${i.substr(e.attributeNamePrefix.length)}="${r}"`}return n}function r(t,e){let n=(t=t.substr(0,t.length-e.textNodeName.length-1)).substr(t.lastIndexOf(".")+1);for(let i in e.stopNodes)if(e.stopNodes[i]===t||e.stopNodes[i]==="*."+n)return!0;return!1}function o(t,e){if(t&&t.length>0&&e.processEntities)for(let n=0;n<e.entities.length;n++){const i=e.entities[n];t=t.replace(i.regex,i.val)}return t}t.exports=function(t,n){let i="";return n.format&&n.indentBy.length>0&&(i="\n"),e(t,n,"",i)}},97802:(t,e,n)=>{const i=n(34940);function r(t,e){let n="";for(;e<t.length&&"'"!==t[e]&&'"'!==t[e];e++)n+=t[e];if(n=n.trim(),-1!==n.indexOf(" "))throw new Error("External entites are not supported");const i=t[e++];let r="";for(;e<t.length&&t[e]!==i;e++)r+=t[e];return[n,r,e]}function o(t,e){return"!"===t[e+1]&&"-"===t[e+2]&&"-"===t[e+3]}function s(t,e){return"!"===t[e+1]&&"E"===t[e+2]&&"N"===t[e+3]&&"T"===t[e+4]&&"I"===t[e+5]&&"T"===t[e+6]&&"Y"===t[e+7]}function a(t,e){return"!"===t[e+1]&&"E"===t[e+2]&&"L"===t[e+3]&&"E"===t[e+4]&&"M"===t[e+5]&&"E"===t[e+6]&&"N"===t[e+7]&&"T"===t[e+8]}function l(t,e){return"!"===t[e+1]&&"A"===t[e+2]&&"T"===t[e+3]&&"T"===t[e+4]&&"L"===t[e+5]&&"I"===t[e+6]&&"S"===t[e+7]&&"T"===t[e+8]}function c(t,e){return"!"===t[e+1]&&"N"===t[e+2]&&"O"===t[e+3]&&"T"===t[e+4]&&"A"===t[e+5]&&"T"===t[e+6]&&"I"===t[e+7]&&"O"===t[e+8]&&"N"===t[e+9]}function u(t){if(i.isName(t))return t;throw new Error(`Invalid entity name ${t}`)}t.exports=function(t,e){const n={};if("O"!==t[e+3]||"C"!==t[e+4]||"T"!==t[e+5]||"Y"!==t[e+6]||"P"!==t[e+7]||"E"!==t[e+8])throw new Error("Invalid Tag instead of DOCTYPE");{e+=9;let i=1,h=!1,d=!1,p="";for(;e<t.length;e++)if("<"!==t[e]||d)if(">"===t[e]){if(d?"-"===t[e-1]&&"-"===t[e-2]&&(d=!1,i--):i--,0===i)break}else"["===t[e]?h=!0:p+=t[e];else{if(h&&s(t,e))e+=7,[entityName,val,e]=r(t,e+1),-1===val.indexOf("&")&&(n[u(entityName)]={regx:RegExp(`&${entityName};`,"g"),val:val});else if(h&&a(t,e))e+=8;else if(h&&l(t,e))e+=8;else if(h&&c(t,e))e+=9;else{if(!o)throw new Error("Invalid DOCTYPE");d=!0}i++,p=""}if(0!==i)throw new Error("Unclosed DOCTYPE")}return{entities:n,i:e}}},75322:(t,e)=>{const n={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(t,e){return e},attributeValueProcessor:function(t,e){return e},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(t,e,n){return t}};e.buildOptions=function(t){return Object.assign({},n,t)},e.defaultOptions=n},3226:(t,e,n)=>{"use strict";const i=n(34940),r=n(63618),o=n(97802),s=n(98765);function a(t){const e=Object.keys(t);for(let n=0;n<e.length;n++){const i=e[n];this.lastEntities[i]={regex:new RegExp("&"+i+";","g"),val:t[i]}}}function l(t,e,n,i,r,o,s){if(void 0!==t&&(this.options.trimValues&&!i&&(t=t.trim()),t.length>0)){s||(t=this.replaceEntitiesValue(t));const i=this.options.tagValueProcessor(e,t,n,r,o);if(null===i||void 0===i)return t;if(typeof i!==typeof t||i!==t)return i;if(this.options.trimValues)return v(t,this.options.parseTagValue,this.options.numberParseOptions);return t.trim()===t?v(t,this.options.parseTagValue,this.options.numberParseOptions):t}}function c(t){if(this.options.removeNSPrefix){const e=t.split(":"),n="/"===t.charAt(0)?"/":"";if("xmlns"===e[0])return"";2===e.length&&(t=n+e[1])}return t}const u=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");function h(t,e,n){if(!this.options.ignoreAttributes&&"string"===typeof t){const n=i.getAllMatches(t,u),r=n.length,o={};for(let t=0;t<r;t++){const i=this.resolveNameSpace(n[t][1]);let r=n[t][4],s=this.options.attributeNamePrefix+i;if(i.length)if(this.options.transformAttributeName&&(s=this.options.transformAttributeName(s)),"__proto__"===s&&(s="#__proto__"),void 0!==r){this.options.trimValues&&(r=r.trim()),r=this.replaceEntitiesValue(r);const t=this.options.attributeValueProcessor(i,r,e);o[s]=null===t||void 0===t?r:typeof t!==typeof r||t!==r?t:v(r,this.options.parseAttributeValue,this.options.numberParseOptions)}else this.options.allowBooleanAttributes&&(o[s]=!0)}if(!Object.keys(o).length)return;if(this.options.attributesGroupName){const t={};return t[this.options.attributesGroupName]=o,t}return o}}const d=function(t){t=t.replace(/\r\n?/g,"\n");const e=new r("!xml");let n=e,i="",s="";for(let a=0;a<t.length;a++){if("<"===t[a])if("/"===t[a+1]){const e=m(t,">",a,"Closing Tag is not closed.");let r=t.substring(a+2,e).trim();if(this.options.removeNSPrefix){const t=r.indexOf(":");-1!==t&&(r=r.substr(t+1))}this.options.transformTagName&&(r=this.options.transformTagName(r)),n&&(i=this.saveTextToParentTag(i,n,s));const o=s.substring(s.lastIndexOf(".")+1);if(r&&-1!==this.options.unpairedTags.indexOf(r))throw new Error(`Unpaired tag can not be used as closing tag: </${r}>`);let l=0;o&&-1!==this.options.unpairedTags.indexOf(o)?(l=s.lastIndexOf(".",s.lastIndexOf(".")-1),this.tagsNodeStack.pop()):l=s.lastIndexOf("."),s=s.substring(0,l),n=this.tagsNodeStack.pop(),i="",a=e}else if("?"===t[a+1]){let e=y(t,a,!1,"?>");if(!e)throw new Error("Pi Tag is not closed.");if(i=this.saveTextToParentTag(i,n,s),this.options.ignoreDeclaration&&"?xml"===e.tagName||this.options.ignorePiTags);else{const t=new r(e.tagName);t.add(this.options.textNodeName,""),e.tagName!==e.tagExp&&e.attrExpPresent&&(t[":@"]=this.buildAttributesMap(e.tagExp,s,e.tagName)),this.addChild(n,t,s)}a=e.closeIndex+1}else if("!--"===t.substr(a+1,3)){const e=m(t,"--\x3e",a+4,"Comment is not closed.");if(this.options.commentPropName){const r=t.substring(a+4,e-2);i=this.saveTextToParentTag(i,n,s),n.add(this.options.commentPropName,[{[this.options.textNodeName]:r}])}a=e}else if("!D"===t.substr(a+1,2)){const e=o(t,a);this.docTypeEntities=e.entities,a=e.i}else if("!["===t.substr(a+1,2)){const e=m(t,"]]>",a,"CDATA is not closed.")-2,r=t.substring(a+9,e);i=this.saveTextToParentTag(i,n,s);let o=this.parseTextData(r,n.tagname,s,!0,!1,!0,!0);void 0==o&&(o=""),this.options.cdataPropName?n.add(this.options.cdataPropName,[{[this.options.textNodeName]:r}]):n.add(this.options.textNodeName,o),a=e+2}else{let o=y(t,a,this.options.removeNSPrefix),l=o.tagName;const c=o.rawTagName;let u=o.tagExp,h=o.attrExpPresent,d=o.closeIndex;this.options.transformTagName&&(l=this.options.transformTagName(l)),n&&i&&"!xml"!==n.tagname&&(i=this.saveTextToParentTag(i,n,s,!1));const p=n;if(p&&-1!==this.options.unpairedTags.indexOf(p.tagname)&&(n=this.tagsNodeStack.pop(),s=s.substring(0,s.lastIndexOf("."))),l!==e.tagname&&(s+=s?"."+l:l),this.isItStopNode(this.options.stopNodes,s,l)){let e="";if(u.length>0&&u.lastIndexOf("/")===u.length-1)"/"===l[l.length-1]?(l=l.substr(0,l.length-1),s=s.substr(0,s.length-1),u=l):u=u.substr(0,u.length-1),a=o.closeIndex;else if(-1!==this.options.unpairedTags.indexOf(l))a=o.closeIndex;else{const n=this.readStopNodeData(t,c,d+1);if(!n)throw new Error(`Unexpected end of ${c}`);a=n.i,e=n.tagContent}const i=new r(l);l!==u&&h&&(i[":@"]=this.buildAttributesMap(u,s,l)),e&&(e=this.parseTextData(e,l,s,!0,h,!0,!0)),s=s.substr(0,s.lastIndexOf(".")),i.add(this.options.textNodeName,e),this.addChild(n,i,s)}else{if(u.length>0&&u.lastIndexOf("/")===u.length-1){"/"===l[l.length-1]?(l=l.substr(0,l.length-1),s=s.substr(0,s.length-1),u=l):u=u.substr(0,u.length-1),this.options.transformTagName&&(l=this.options.transformTagName(l));const t=new r(l);l!==u&&h&&(t[":@"]=this.buildAttributesMap(u,s,l)),this.addChild(n,t,s),s=s.substr(0,s.lastIndexOf("."))}else{const t=new r(l);this.tagsNodeStack.push(n),l!==u&&h&&(t[":@"]=this.buildAttributesMap(u,s,l)),this.addChild(n,t,s),n=t}i="",a=d}}else i+=t[a]}return e.child};function p(t,e,n){const i=this.options.updateTag(e.tagname,n,e[":@"]);!1===i||("string"===typeof i?(e.tagname=i,t.addChild(e)):t.addChild(e))}const f=function(t){if(this.options.processEntities){for(let e in this.docTypeEntities){const n=this.docTypeEntities[e];t=t.replace(n.regx,n.val)}for(let e in this.lastEntities){const n=this.lastEntities[e];t=t.replace(n.regex,n.val)}if(this.options.htmlEntities)for(let e in this.htmlEntities){const n=this.htmlEntities[e];t=t.replace(n.regex,n.val)}t=t.replace(this.ampEntity.regex,this.ampEntity.val)}return t};function A(t,e,n,i){return t&&(void 0===i&&(i=0===Object.keys(e.child).length),void 0!==(t=this.parseTextData(t,e.tagname,n,!1,!!e[":@"]&&0!==Object.keys(e[":@"]).length,i))&&""!==t&&e.add(this.options.textNodeName,t),t=""),t}function g(t,e,n){const i="*."+n;for(const r in t){const n=t[r];if(i===n||e===n)return!0}return!1}function m(t,e,n,i){const r=t.indexOf(e,n);if(-1===r)throw new Error(i);return r+e.length-1}function y(t,e,n){const i=function(t,e){let n,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:">",r="";for(let o=e;o<t.length;o++){let e=t[o];if(n)e===n&&(n="");else if('"'===e||"'"===e)n=e;else if(e===i[0]){if(!i[1])return{data:r,index:o};if(t[o+1]===i[1])return{data:r,index:o}}else"\t"===e&&(e=" ");r+=e}}(t,e+1,arguments.length>3&&void 0!==arguments[3]?arguments[3]:">");if(!i)return;let r=i.data;const o=i.index,s=r.search(/\s/);let a=r,l=!0;-1!==s&&(a=r.substring(0,s),r=r.substring(s+1).trimStart());const c=a;if(n){const t=a.indexOf(":");-1!==t&&(a=a.substr(t+1),l=a!==i.data.substr(t+1))}return{tagName:a,tagExp:r,closeIndex:o,attrExpPresent:l,rawTagName:c}}function _(t,e,n){const i=n;let r=1;for(;n<t.length;n++)if("<"===t[n])if("/"===t[n+1]){const o=m(t,">",n,`${e} is not closed`);if(t.substring(n+2,o).trim()===e&&(r--,0===r))return{tagContent:t.substring(i,n),i:o};n=o}else if("?"===t[n+1]){n=m(t,"?>",n+1,"StopNode is not closed.")}else if("!--"===t.substr(n+1,3)){n=m(t,"--\x3e",n+3,"StopNode is not closed.")}else if("!["===t.substr(n+1,2)){n=m(t,"]]>",n,"StopNode is not closed.")-2}else{const i=y(t,n,">");if(i){(i&&i.tagName)===e&&"/"!==i.tagExp[i.tagExp.length-1]&&r++,n=i.closeIndex}}}function v(t,e,n){if(e&&"string"===typeof t){const e=t.trim();return"true"===e||"false"!==e&&s(t,n)}return i.isExist(t)?t:""}t.exports=class{constructor(t){this.options=t,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:"'"},gt:{regex:/&(gt|#62|#x3E);/g,val:">"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"\xa2"},pound:{regex:/&(pound|#163);/g,val:"\xa3"},yen:{regex:/&(yen|#165);/g,val:"\xa5"},euro:{regex:/&(euro|#8364);/g,val:"\u20ac"},copyright:{regex:/&(copy|#169);/g,val:"\xa9"},reg:{regex:/&(reg|#174);/g,val:"\xae"},inr:{regex:/&(inr|#8377);/g,val:"\u20b9"},num_dec:{regex:/&#([0-9]{1,7});/g,val:(t,e)=>String.fromCharCode(Number.parseInt(e,10))},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:(t,e)=>String.fromCharCode(Number.parseInt(e,16))}},this.addExternalEntities=a,this.parseXml=d,this.parseTextData=l,this.resolveNameSpace=c,this.buildAttributesMap=h,this.isItStopNode=g,this.replaceEntitiesValue=f,this.readStopNodeData=_,this.saveTextToParentTag=A,this.addChild=p}}},75505:(t,e,n)=>{const{buildOptions:i}=n(75322),r=n(3226),{prettify:o}=n(5059),s=n(7268);t.exports=class{constructor(t){this.externalEntities={},this.options=i(t)}parse(t,e){if("string"===typeof t);else{if(!t.toString)throw new Error("XML data is accepted in String or Bytes[] form.");t=t.toString()}if(e){!0===e&&(e={});const n=s.validate(t,e);if(!0!==n)throw Error(`${n.err.msg}:${n.err.line}:${n.err.col}`)}const n=new r(this.options);n.addExternalEntities(this.externalEntities);const i=n.parseXml(t);return this.options.preserveOrder||void 0===i?i:o(i,this.options)}addEntity(t,e){if(-1!==e.indexOf("&"))throw new Error("Entity value can't have '&'");if(-1!==t.indexOf("&")||-1!==t.indexOf(";"))throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '
'");if("&"===e)throw new Error("An entity with value '&' is not permitted");this.externalEntities[t]=e}}},5059:(t,e)=>{"use strict";function n(t,e,s){let a;const l={};for(let c=0;c<t.length;c++){const u=t[c],h=i(u);let d="";if(d=void 0===s?h:s+"."+h,h===e.textNodeName)void 0===a?a=u[h]:a+=""+u[h];else{if(void 0===h)continue;if(u[h]){let t=n(u[h],e,d);const i=o(t,e);u[":@"]?r(t,u[":@"],d,e):1!==Object.keys(t).length||void 0===t[e.textNodeName]||e.alwaysCreateTextNode?0===Object.keys(t).length&&(e.alwaysCreateTextNode?t[e.textNodeName]="":t=""):t=t[e.textNodeName],void 0!==l[h]&&l.hasOwnProperty(h)?(Array.isArray(l[h])||(l[h]=[l[h]]),l[h].push(t)):e.isArray(h,d,i)?l[h]=[t]:l[h]=t}}}return"string"===typeof a?a.length>0&&(l[e.textNodeName]=a):void 0!==a&&(l[e.textNodeName]=a),l}function i(t){const e=Object.keys(t);for(let n=0;n<e.length;n++){const t=e[n];if(":@"!==t)return t}}function r(t,e,n,i){if(e){const r=Object.keys(e),o=r.length;for(let s=0;s<o;s++){const o=r[s];i.isArray(o,n+"."+o,!0,!0)?t[o]=[e[o]]:t[o]=e[o]}}}function o(t,e){const{textNodeName:n}=e,i=Object.keys(t).length;return 0===i||!(1!==i||!t[n]&&"boolean"!==typeof t[n]&&0!==t[n])}e.prettify=function(t,e){return n(t,e)}},63618:t=>{"use strict";t.exports=class{constructor(t){this.tagname=t,this.child=[],this[":@"]={}}add(t,e){"__proto__"===t&&(t="#__proto__"),this.child.push({[t]:e})}addChild(t){"__proto__"===t.tagname&&(t.tagname="#__proto__"),t[":@"]&&Object.keys(t[":@"]).length>0?this.child.push({[t.tagname]:t.child,":@":t[":@"]}):this.child.push({[t.tagname]:t.child})}}},79437:(t,e,n)=>{"use strict";n.d(e,{Au:()=>rt,Hn:()=>J,PB:()=>Q,QN:()=>I,QO:()=>st,Sg:()=>Y,Wq:()=>ot,Wy:()=>at,_k:()=>$,a0:()=>lt,r1:()=>it,s7:()=>et,u$:()=>tt,uE:()=>nt});var i=function(t){var e,n="undefined"!==typeof(t=t||{})?t:{},i={};for(e in n)n.hasOwnProperty(e)&&(i[e]=n[e]);var r,o=[],s="";"undefined"!==typeof document&&document.currentScript&&(s=document.currentScript.src),s=0!==s.indexOf("blob:")?s.substr(0,s.lastIndexOf("/")+1):"",r=function(t,e,n){var i=new XMLHttpRequest;i.open("GET",t,!0),i.responseType="arraybuffer",i.onload=function(){if(200==i.status||0==i.status&&i.response)e(i.response);else{var r=X(t);r?e(r.buffer):n()}},i.onerror=n,i.send(null)};var a=n.print||console.log.bind(console),l=n.printErr||console.warn.bind(console);for(e in i)i.hasOwnProperty(e)&&(n[e]=i[e]);i=null,n.arguments&&(o=n.arguments);var c=0;var u=!1;function h(t){var e,i=n["_"+t];return e="Cannot call unknown function "+t+", make sure it is exported",i||at("Assertion failed: "+e),i}function d(t,e,n,i,r){var o={string:function(t){var e=0;if(null!==t&&void 0!==t&&0!==t){var n=1+(t.length<<2);(function(t,e,n){(function(t,e,n,i){if(!(i>0))return 0;for(var r=n,o=n+i-1,s=0;s<t.length;++s){var a=t.charCodeAt(s);if(a>=55296&&a<=57343)a=65536+((1023&a)<<10)|1023&t.charCodeAt(++s);if(a<=127){if(n>=o)break;e[n++]=a}else if(a<=2047){if(n+1>=o)break;e[n++]=192|a>>6,e[n++]=128|63&a}else if(a<=65535){if(n+2>=o)break;e[n++]=224|a>>12,e[n++]=128|a>>6&63,e[n++]=128|63&a}else{if(n+3>=o)break;e[n++]=240|a>>18,e[n++]=128|a>>12&63,e[n++]=128|a>>6&63,e[n++]=128|63&a}}e[n]=0})(t,m,e,n)})(t,e=$(n),n)}return e},array:function(t){var e=$(t.length);return function(t,e){g.set(t,e)}(t,e),e}};var s=h(t),a=[],l=0;if(i)for(var c=0;c<i.length;c++){var u=o[n[c]];u?(0===l&&(l=et()),a[c]=u(i[c])):a[c]=i[c]}var d=s.apply(null,a);return d=function(t){return"string"===e?f(t):"boolean"===e?Boolean(t):t}(d),0!==l&&tt(l),d}var p="undefined"!==typeof TextDecoder?new TextDecoder("utf8"):void 0;function f(t,e){return t?function(t,e,n){for(var i=e+n,r=e;t[r]&&!(r>=i);)++r;if(r-e>16&&t.subarray&&p)return p.decode(t.subarray(e,r));for(var o="";e<r;){var s=t[e++];if(128&s){var a=63&t[e++];if(192!=(224&s)){var l=63&t[e++];if((s=224==(240&s)?(15&s)<<12|a<<6|l:(7&s)<<18|a<<12|l<<6|63&t[e++])<65536)o+=String.fromCharCode(s);else{var c=s-65536;o+=String.fromCharCode(55296|c>>10,56320|1023&c)}}else o+=String.fromCharCode((31&s)<<6|a)}else o+=String.fromCharCode(s)}return o}(m,t,e):""}var A,g,m,y,_,v,b;"undefined"!==typeof TextDecoder&&new TextDecoder("utf-16le");function x(t,e){return t%e>0&&(t+=e-t%e),t}function w(t){A=t,n.HEAP8=g=new Int8Array(t),n.HEAP16=y=new Int16Array(t),n.HEAP32=_=new Int32Array(t),n.HEAPU8=m=new Uint8Array(t),n.HEAPU16=new Uint16Array(t),n.HEAPU32=new Uint32Array(t),n.HEAPF32=v=new Float32Array(t),n.HEAPF64=b=new Float64Array(t)}var E=n.TOTAL_MEMORY||33554432;function C(t){for(;t.length>0;){var e=t.shift();if("function"!=typeof e){var i=e.func;"number"===typeof i?void 0===e.arg?n.dynCall_v(i):n.dynCall_vi(i,e.arg):i(void 0===e.arg?null:e.arg)}else e()}}E=(A=n.buffer?n.buffer:new ArrayBuffer(E)).byteLength,w(A),_[6032]=5267040;var T=[],S=[],P=[],M=[];var I=Math.abs,B=Math.ceil,R=Math.floor,L=Math.min,O=0,D=null,k=null;n.preloadedImages={},n.preloadedAudios={};var F,N,z=null,U="data:application/octet-stream;base64,";function G(t){return String.prototype.startsWith?t.startsWith(U):0===t.indexOf(U)}z
vendor: 19,357 bytes, line 2
2="data:application/octet-stream;base64,AAAAAAAAAAAAAAAAAQAAAAIAAAADAAAABAAAAAUAAAAGAAAAAQAAAAQAAAADAAAABgAAAAUAAAACAAAAAAAAAAIAAAADAAAAAQAAAAQAAAAGAAAAAAAAAAUAAAADAAAABgAAAAQAAAAFAAAAAAAAAAEAAAACAAAABAAAAAUAAAAGAAAAAAAAAAIAAAADAAAAAQAAAAUAAAACAAAAAAAAAAEAAAADAAAABgAAAAQAAAAGAAAAAAAAAAUAAAACAAAAAQAAAAQAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAEAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAIAAAADAAAAAAAAAAAAAAACAAAAAAAAAAEAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAABAAAAAYAAAAAAAAABQAAAAAAAAAAAAAABAAAAAUAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAYAAAAAAAAABgAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAgAAAAMAAAAEAAAABQAAAAYAAAABAAAAAgAAAAMAAAAEAAAABQAAAAYAAAAAAAAAAgAAAAMAAAAEAAAABQAAAAYAAAAAAAAAAQAAAAMAAAAEAAAABQAAAAYAAAAAAAAAAQAAAAIAAAAEAAAABQAAAAYAAAAAAAAAAQAAAAIAAAADAAAABQAAAAYAAAAAAAAAAQAAAAIAAAADAAAABAAAAAYAAAAAAAAAAQAAAAIAAAADAAAABAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAwAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAgAAAAIAAAAAAAAAAAAAAAYAAAAAAAAAAwAAAAIAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAFAAAABAAAAAAAAAABAAAAAAAAAAAAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAYAAAAAAAAABAAAAAAAAAAGAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAFAAAAAgAAAAQAAAADAAAACAAAAAEAAAAHAAAABgAAAAkAAAAAAAAAAwAAAAIAAAACAAAABgAAAAoAAAALAAAAAAAAAAEAAAAFAAAAAwAAAA0AAAABAAAABwAAAAQAAAAMAAAAAAAAAAQAAAB/AAAADwAAAAgAAAADAAAAAAAAAAwAAAAFAAAAAgAAABIAAAAKAAAACAAAAAAAAAAQAAAABgAAAA4AAAALAAAAEQAAAAEAAAAJAAAAAgAAAAcAAAAVAAAACQAAABMAAAADAAAADQAAAAEAAAAIAAAABQAAABYAAAAQAAAABAAAAAAAAAAPAAAACQAAABMAAAAOAAAAFAAAAAEAAAAHAAAABgAAAAoAAAALAAAAGAAAABcAAAAFAAAAAgAAABIAAAALAAAAEQAAABcAAAAZAAAAAgAAAAYAAAAKAAAADAAAABwAAAANAAAAGgAAAAQAAAAPAAAAAwAAAA0AAAAaAAAAFQAAAB0AAAADAAAADAAAAAcAAAAOAAAAfwAAABEAAAAbAAAACQAAABQAAAAGAAAADwAAABYAAAAcAAAAHwAAAAQAAAAIAAAADAAAABAAAAASAAAAIQAAAB4AAAAIAAAABQAAABYAAAARAAAACwAAAA4AAAAGAAAAIwAAABkAAAAbAAAAEgAAABgAAAAeAAAAIAAAAAUAAAAKAAAAEAAAABMAAAAiAAAAFAAAACQAAAAHAAAAFQAAAAkAAAAUAAAADgAAABMAAAAJAAAAKAAAABsAAAAkAAAAFQAAACYAAAATAAAAIgAAAA0AAAAdAAAABwAAABYAAAAQAAAAKQAAACEAAAAPAAAACAAAAB8AAAAXAAAAGAAAAAsAAAAKAAAAJwAAACUAAAAZAAAAGAAAAH8AAAAgAAAAJQAAAAoAAAAXAAAAEgAAABkAAAAXAAAAEQAAAAsAAAAtAAAAJwAAACMAAAAaAAAAKgAAAB0AAAArAAAADAAAABwAAAANAAAAGwAAACgAAAAjAAAALgAAAA4AAAAUAAAAEQAAABwAAAAfAAAAKgAAACwAAAAMAAAADwAAABoAAAAdAAAAKwAAACYAAAAvAAAADQAAABoAAAAVAAAAHgAAACAAAAAwAAAAMgAAABAAAAASAAAAIQAAAB8AAAApAAAALAAAADUAAAAPAAAAFgAAABwAAAAgAAAAHgAAABgAAAASAAAANAAAADIAAAAlAAAAIQAAAB4AAAAxAAAAMAAAABYAAAAQAAAAKQAAACIAAAATAAAAJgAAABUAAAA2AAAAJAAAADMAAAAjAAAALgAAAC0AAAA4AAAAEQAAABsAAAAZAAAAJAAAABQAAAAiAAAAEwAAADcAAAAoAAAANgAAACUAAAAnAAAANAAAADkAAAAYAAAAFwAAACAAAAAmAAAAfwAAACIAAAAzAAAAHQAAAC8AAAAVAAAAJwAAACUAAAAZAAAAFwAAADsAAAA5AAAALQAAACgAAAAbAAAAJAAAABQAAAA8AAAALgAAADcAAAApAAAAMQAAADUAAAA9AAAAFgAAACEAAAAfAAAAKgAAADoAAAArAAAAPgAAABwAAAAsAAAAGgAAACsAAAA+AAAALwAAAEAAAAAaAAAAKgAAAB0AAAAsAAAANQAAADoAAABBAAAAHAAAAB8AAAAqAAAALQAAACcAAAAjAAAAGQAAAD8AAAA7AAAAOAAAAC4AAAA8AAAAOAAAAEQAAAAbAAAAKAAAACMAAAAvAAAAJgAAACsAAAAdAAAARQAAADMAAABAAAAAMAAAADEAAAAeAAAAIQAAAEMAAABCAAAAMgAAADEAAAB/AAAAPQAAAEIAAAAhAAAAMAAAACkAAAAyAAAAMAAAACAAAAAeAAAARgAAAEMAAAA0AAAAMwAAAEUAAAA2AAAARwAAACYAAAAvAAAAIgAAADQAAAA5AAAARgAAAEoAAAAgAAAAJQAAADIAAAA1AAAAPQAAAEEAAABLAAAAHwAAACkAAAAsAAAANgAAAEcAAAA3AAAASQAAACIAAAAzAAAAJAAAADcAAAAoAAAANgAAACQAAABIAAAAPAAAAEkAAAA4AAAARAAAAD8AAABNAAAAIwAAAC4AAAAtAAAAOQAAADsAAABKAAAATgAAACUAAAAnAAAANAAAADoAAAB/AAAAPgAAAEwAAAAsAAAAQQAAACoAAAA7AAAAPwAAAE4AAABPAAAAJwAAAC0AAAA5AAAAPAAAAEgAAABEAAAAUAAAACgAAAA3AAAALgAAAD0AAAA1AAAAMQAAACkAAABRAAAASwAAAEIAAAA+AAAAKwAAADoAAAAqAAAAUgAAAEAAAABMAAAAPwAAAH8AAAA4AAAALQAAAE8AAAA7AAAATQAAAEAAAAAvAAAAPgAAACsAAABUAAAARQAAAFIAAABBAAAAOgAAADUAAAAsAAAAVgAAAEwAAABLAAAAQgAAAEMAAABRAAAAVQAAADEAAAAwAAAAPQAAAEMAAABCAAAAMgAAADAAAABXAAAAVQAAAEYAAABEAAAAOAAAADwAAAAuAAAAWgAAAE0AAABQAAAARQAAADMAAABAAAAALwAAAFkAAABHAAAAVAAAAEYAAABDAAAANAAAADIAAABTAAAAVwAAAEoAAABHAAAAWQAAAEkAAABbAAAAMwAAAEUAAAA2AAAASAAAAH8AAABJAAAANwAAAFAAAAA8AAAAWAAAAEkAAABbAAAASAAAAFgAAAA2AAAARwAAADcAAABKAAAATgAAAFMAAABcAAAANAAAADkAAABGAAAASwAAAEEAAAA9AAAANQAAAF4AAABWAAAAUQAAAEwAAABWAAAAUgAAAGAAAAA6AAAAQQAAAD4AAABNAAAAPwAAAEQAAAA4AAAAXQAAAE8AAABaAAAATgAAAEoAAAA7AAAAOQAAAF8AAABcAAAATwAAAE8AAABOAAAAPwAAADsAAABdAAAAXwAAAE0AAABQAAAARAAAAEgAAAA8AAAAYwAAAFoAAABYAAAAUQAAAFUAAABeAAAAZQAAAD0AAABCAAAASwAAAFIAAABgAAAAVAAAAGIAAAA+AAAATAAAAEAAAABTAAAAfwAAAEoAAABGAAAAZAAAAFcAAABcAAAAVAAAAEUAAABSAAAAQAAAAGEAAABZAAAAYgAAAFUAAABXAAAAZQAAAGYAAABCAAAAQwAAAFEAAABWAAAATAAAAEsAAABBAAAAaAAAAGAAAABeAAAAVwAAAFMAAABmAAAAZAAAAEMAAABGAAAAVQAAAFgAAABIAAAAWwAAAEkAAABjAAAAUAAAAGkAAABZAAAAYQAAAFsAAABnAAAARQAAAFQAAABHAAAAWgAAAE0AAABQAAAARAAAAGoAAABdAAAAYwAAAFsAAABJAAAAWQAAAEcAAABpAAAAWAAAAGcAAABcAAAAUwAAAE4AAABKAAAAbAAAAGQAAABfAAAAXQAAAE8AAABaAAAATQAAAG0AAABfAAAAagAAAF4AAABWAAAAUQAAAEsAAABrAAAAaAAAAGUAAABfAAAAXAAAAE8AAABOAAAAbQAAAGwAAABdAAAAYAAAAGgAAABiAAAAbgAAAEwAAABWAAAAUgAAAGEAAAB/AAAAYgAAAFQAAABnAAAAWQAAAG8AAABiAAAAbgAAAGEAAABvAAAAUgAAAGAAAABUAAAAYwAAAFAAAABpAAAAWAAAAGoAAABaAAAAcQAAAGQAAABmAAAAUwAAAFcAAABsAAAAcgAAAFwAAABlAAAAZgAAAGsAAABwAAAAUQAAAFUAAABeAAAAZgAAAGUAAABXAAAAVQAAAHIAAABwAAAAZAAAAGcAAABbAAAAYQAAAFkAAAB0AAAAaQAAAG8AAABoAAAAawAAAG4AAABzAAAAVgAAAF4AAABgAAAAaQAAAFgAAABnAAAAWwAAAHEAAABjAAAAdAAAAGoAAABdAAAAYwAAAFoAAAB1AAAAbQAAAHEAAABrAAAAfwAAAGUAAABeAAAAcwAAAGgAAABwAAAAbAAAAGQAAABfAAAAXAAAAHYAAAByAAAAbQAAAG0AAABsAAAAXQAAAF8AAAB1AAAAdgAAAGoAAABuAAAAYgAAAGgAAABgAAAAdwAAAG8AAABzAAAAbwAAAGEAAABuAAAAYgAAAHQAAABnAAAAdwAAAHAAAABrAAAAZgAAAGUAAAB4AAAAcwAAAHIAAABxAAAAYwAAAHQAAABpAAAAdQAAAGoAAAB5AAAAcgAAAHAAAABkAAAAZgAAAHYAAAB4AAAAbAAAAHMAAABuAAAAawAAAGgAAAB4AAAAdwAAAHAAAAB0AAAAZwAAAHcAAABvAAAAcQAAAGkAAAB5AAAAdQAAAH8AAABtAAAAdgAAAHEAAAB5AAAAagAAAHYAAAB4AAAAbAAAAHIAAAB1AAAAeQAAAG0AAAB3AAAAbwAAAHMAAABuAAAAeQAAAHQAAAB4AAAAeAAAAHMAAAByAAAAcAAAAHkAAAB3AAAAdgAAAHkAAAB0AAAAeAAAAHcAAAB1AAAAcQAAAHYAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAABAAAABQAAAAEAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAACAAAABQAAAAEAAAAAAAAA/////wEAAAAAAAAAAwAAAAQAAAACAAAAAAAAAAAAAAABAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAMAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAFAAAAAQAAAAAAAAAAAAAAAQAAAAMAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAADAAAAAAAAAAAAAAABAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAADAAAABQAAAAEAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABAAAAAAAAAP////8DAAAAAAAAAAUAAAACAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAEAAAABQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAFAAAABQAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAD/////AwAAAAAAAAAFAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAAAAAABAAAAAwAAAAAAAAAAAAAAAQAAAAAAAAADAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAQAAAAMAAAAAAAAAAAAAAAEAAAAAAAAAAwAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAADAAAAAAAAAP////8DAAAAAAAAAAUAAAACAAAAAAAAAAAAAAADAAAAAAAAAAAAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAUAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAFAAAABQAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAwAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAADAAAAAwAAAAMAAAAAAAAAAwAAAAAAAAAAAAAA/////wMAAAAAAAAABQAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAA/////wMAAAAAAAAABQAAAAIAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAMAAAADAAAAAAAAAAAAAAADAAAAAwAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAMAAAADAAAAAwAAAAMAAAAAAAAAAwAAAAAAAAD/////AwAAAAAAAAAFAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAADAAAAAAAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAAAAAD/////AwAAAAAAAAAFAAAAAgAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAADAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAFAAAAAAAAAAAAAAADAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAADAAAAAQAAAAAAAAABAAAAAAAAAAAAAAABAAAAAwAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAADAAAAAAAAAP////8DAAAAAAAAAAUAAAACAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAAAAAADAAAAAwAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAUAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAFAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAA/////wMAAAAAAAAABQAAAAIAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAAFAAAAAAAAAAAAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAEAAAADAAAAAQAAAAAAAAABAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAADAAAAAQAAAAAAAAABAAAAAAAAAAMAAAADAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAAAAAAAAwAAAAUAAAABAAAAAAAAAP////8DAAAAAAAAAAUAAAACAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAABAAAAAUAAAABAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAIAAAAFAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAADAAAAAQAAAAAAAAABAAAAAAAAAAUAAAAAAAAAAAAAAAUAAAAFAAAAAAAAAAAAAAD/////AQAAAAAAAAADAAAABAAAAAIAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAUAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAFAAAAAAAAAAAAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAUAAAABAAAAAAAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAAAAAAEAAAD//////////wEAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAADAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAsAAAACAAAAAAAAAAAAAAABAAAAAgAAAAYAAAAEAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAYAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAcAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAYAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAKAAAAAgAAAAAAAAAAAAAAAQAAAAEAAAAFAAAABgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAABwAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAsAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACgAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAACAAAAAAAAAAAAAAABAAAAAwAAAAcAAAAGAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAABwAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAGAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAADgAAAAIAAAAAAAAAAAAAAAEAAAAAAAAACQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACgAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAMAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAABwAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAsAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAKAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADQAAAAIAAAAAAAAAAAAAAAEAAAAEAAAACAAAAAoAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAALAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAACQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAGAAAAAgAAAAAAAAAAAAAAAQAAAAsAAAAPAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAOAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAIAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAABQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAgAAAAAAAAAAAAAAAQAAAAwAAAAQAAAADAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAoAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAJAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAPAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAADwAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAADQAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAACAAAAAAAAAAAAAAABAAAACgAAABMAAAAIAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAEQAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEQAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAAA8AAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAQAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAACQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAIAAAAAAAAAAAAAAAEAAAANAAAAEQAAAA0AAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAARAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAEwAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAATAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAAEQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAA0AAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAARAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkAAAACAAAAAAAAAAAAAAABAAAADgAAABIAAAAPAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAADwAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABIAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAASAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAEwAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAABEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAATAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEgAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAABIAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAATAAAAAgAAAAAAAAAAAAAAAQAAAP//////////EwAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAATAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAEgAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAASAAAAAAAAABgAAAAAAAAAIQAAAAAAAAAeAAAAAAAAACAAAAADAAAAMQAAAAEAAAAwAAAAAwAAADIAAAADAAAACAAAAAAAAAAFAAAABQAAAAoAAAAFAAAAFgAAAAAAAAAQAAAAAAAAABIAAAAAAAAAKQAAAAEAAAAhAAAAAAAAAB4AAAAAAAAABAAAAAAAAAAAAAAABQAAAAIAAAAFAAAADwAAAAEAAAAIAAAAAAAAAAUAAAAFAAAAHwAAAAEAAAAWAAAAAAAAABAAAAAAAAAAAgAAAAAAAAAGAAAAAAAAAA4AAAAAAAAACgAAAAAAAAALAAAAAAAAABEAAAADAAAAGAAAAAEAAAAXAAAAAwAAABkAAAADAAAAAAAAAAAAAAABAAAABQAAAAkAAAAFAAAABQAAAAAAAAACAAAAAAAAAAYAAAAAAAAAEgAAAAEAAAAKAAAAAAAAAAsAAAAAAAAABAAAAAEAAAADAAAABQAAAAcAAAAFAAAACAAAAAEAAAAAAAAAAAAAAAEAAAAFAAAAEAAAAAEAAAAFAAAAAAAAAAIAAAAAAAAABwAAAAAAAAAVAAAAAAAAACYAAAAAAAAACQAAAAAAAAATAAAAAAAAACIAAAADAAAADgAAAAEAAAAUAAAAAwAAACQAAAADAAAAAwAAAAAAAAANAAAABQAAAB0AAAAFAAAAAQAAAAAAAAAHAAAAAAAAABUAAAAAAAAABgAAAAEAAAAJAAAAAAAAABMAAAAAAAAABAAAAAIAAAAMAAAABQAAABoAAAAFAAAAAAAAAAEAAAADAAAAAAAAAA0AAAAFAAAAAgAAAAEAAAABAAAAAAAAAAcAAAAAAAAAGgAAAAAAAAAqAAAAAAAAADoAAAAAAAAAHQAAAAAAAAArAAAAAAAAAD4AAAADAAAAJgAAAAEAAAAvAAAAAwAAAEAAAAADAAAADAAAAAAAAAAcAAAABQAAACwAAAAFAAAADQAAAAAAAAAaAAAAAAAAACoAAAAAAAAAFQAAAAEAAAAdAAAAAAAAACsAAAAAAAAABAAAAAMAAAAPAAAABQAAAB8AAAAFAAAAAwAAAAEAAAAMAAAAAAAAABwAAAAFAAAABwAAAAEAAAANAAAAAAAAABoAAAAAAAAAHwAAAAAAAAApAAAAAAAAADEAAAAAAAAALAAAAAAAAAA1AAAAAAAAAD0AAAADAAAAOgAAAAEAAABBAAAAAwAAAEsAAAADAAAADwAAAAAAAAAWAAAABQAAACEAAAAFAAAAHAAAAAAAAAAfAAAAAAAAACkAAAAAAAAAKgAAAAEAAAAsAAAAAAAAADUAAAAAAAAABAAAAAQAAAAIAAAABQAAABAAAAAFAAAADAAAAAEAAAAPAAAAAAAAABYAAAAFAAAAGgAAAAEAAAAcAAAAAAAAAB8AAAAAAAAAMgAAAAAAAAAwAAAAAAAAADEAAAADAAAAIAAAAAAAAAAeAAAAAwAAACEAAAADAAAAGAAAAAMAAAASAAAAAwAAABAAAAADAAAARgAAAAAAAABDAAAAAAAAAEIAAAADAAAANAAAAAMAAAAyAAAAAAAAADAAAAAAAAAAJQAAAAMAAAAgAAAAAAAAAB4AAAADAAAAUwAAAAAAAABXAAAAAwAAAFUAAAADAAAASgAAAAMAAABGAAAAAAAAAEMAAAAAAAAAOQAAAAEAAAA0AAAAAwAAADIAAAAAAAAAGQAAAAAAAAAXAAAAAAAAABgAAAADAAAAEQAAAAAAAAALAAAAAwAAAAoAAAADAAAADgAAAAMAAAAGAAAAAwAAAAIAAAADAAAALQAAAAAAAAAnAAAAAAAAACUAAAADAAAAIwAAAAMAAAAZAAAAAAAAABcAAAAAAAAAGwAAAAMAAAARAAAAAAAAAAsAAAADAAAAPwAAAAAAAAA7AAAAAwAAADkAAAADAAAAOAAAAAMAAAAtAAAAAAAAACcAAAAAAAAALgAAAAMAAAAjAAAAAwAAABkAAAAAAAAAJAAAAAAAAAAUAAAAAAAAAA4AAAADAAAAIgAAAAAAAAATAAAAAwAAAAkAAAADAAAAJgAAAAMAAAAVAAAAAwAAAAcAAAADAAAANwAAAAAAAAAoAAAAAAAAABsAAAADAAAANgAAAAMAAAAkAAAAAAAAABQAAAAAAAAAMwAAAAMAAAAiAAAAAAAAABMAAAADAAAASAAAAAAAAAA8AAAAAwAAAC4AAAADAAAASQAAAAMAAAA3AAAAAAAAACgAAAAAAAAARwAAAAMAAAA2AAAAAwAAACQAAAAAAAAAQAAAAAAAAAAvAAAAAAAAACYAAAADAAAAPgAAAAAAAAArAAAAAwAAAB0AAAADAAAAOgAAAAMAAAAqAAAAAwAAABoAAAADAAAAVAAAAAAAAABFAAAAAAAAADMAAAADAAAAUgAAAAMAAABAAAAAAAAAAC8AAAAAAAAATAAAAAMAAAA+AAAAAAAAACsAAAADAAAAYQAAAAAAAABZAAAAAwAAAEcAAAADAAAAYgAAAAMAAABUAAAAAAAAAEUAAAAAAAAAYAAAAAMAAABSAAAAAwAAAEAAAAAAAAAASwAAAAAAAABBAAAAAAAAADoAAAADAAAAPQAAAAAAAAA1AAAAAwAAACwAAAADAAAAMQAAAAMAAAApAAAAAwAAAB8AAAADAAAAXgAAAAAAAABWAAAAAAAAAEwAAAADAAAAUQAAAAMAAABLAAAAAAAAAEEAAAAAAAAAQgAAAAMAAAA9AAAAAAAAADUAAAADAAAAawAAAAAAAABoAAAAAwAAAGAAAAADAAAAZQAAAAMAAABeAAAAAAAAAFYAAAAAAAAAVQAAAAMAAABRAAAAAwAAAEsAAAAAAAAAOQAAAAAAAAA7AAAAAAAAAD8AAAADAAAASgAAAAAAAABOAAAAAwAAAE8AAAADAAAAUwAAAAMAAABcAAAAAwAAAF8AAAADAAAAJQAAAAAAAAAnAAAAAwAAAC0AAAADAAAANAAAAAAAAAA5AAAAAAAAADsAAAAAAAAARgAAAAMAAABKAAAAAAAAAE4AAAADAAAAGAAAAAAAAAAXAAAAAwAAABkAAAADAAAAIAAAAAMAAAAlAAAAAAAAACcAAAADAAAAMgAAAAMAAAA0AAAAAAAAADkAAAAAAAAALgAAAAAAAAA8AAAAAAAAAEgAAAADAAAAOAAAAAAAAABEAAAAAwAAAFAAAAADAAAAPwAAAAMAAABNAAAAAwAAAFoAAAADAAAAGwAAAAAAAAAoAAAAAwAAADcAAAADAAAAIwAAAAAAAAAuAAAAAAAAADwAAAAAAAAALQAAAAMAAAA4AAAAAAAAAEQAAAADAAAADgAAAAAAAAAUAAAAAwAAACQAAAADAAAAEQAAAAMAAAAbAAAAAAAAACgAAAADAAAAGQAAAAMAAAAjAAAAAAAAAC4AAAAAAAAARwAAAAAAAABZAAAAAAAAAGEAAAADAAAASQAAAAAAAABbAAAAAwAAAGcAAAADAAAASAAAAAMAAABYAAAAAwAAAGkAAAADAAAAMwAAAAAAAABFAAAAAwAAAFQAAAADAAAANgAAAAAAAABHAAAAAAAAAFkAAAAAAAAANwAAAAMAAABJAAAAAAAAAFsAAAADAAAAJgAAAAAAAAAvAAAAAwAAAEAAAAADAAAAIgAAAAMAAAAzAAAAAAAAAEUAAAADAAAAJAAAAAMAAAA2AAAAAAAAAEcAAAAAAAAAYAAAAAAAAABoAAAAAAAAAGsAAAADAAAAYgAAAAAAAABuAAAAAwAAAHMAAAADAAAAYQAAAAMAAABvAAAAAwAAAHcAAAADAAAATAAAAAAAAABWAAAAAwAAAF4AAAADAAAAUgAAAAAAAABgAAAAAAAAAGgAAAAAAAAAVAAAAAMAAABiAAAAAAAAAG4AAAADAAAAOgAAAAAAAABBAAAAAwAAAEsAAAADAAAAPgAAAAMAAABMAAAAAAAAAFYAAAADAAAAQAAAAAMAAABSAAAAAAAAAGAAAAAAAAAAVQAAAAAAAABXAAAAAAAAAFMAAAADAAAAZQAAAAAAAABmAAAAAwAAAGQAAAADAAAAawAAAAMAAABwAAAAAwAAAHIAAAADAAAAQgAAAAAAAABDAAAAAwAAAEYAAAADAAAAUQAAAAAAAABVAAAAAAAAAFcAAAAAAAAAXgAAAAMAAABlAAAAAAAAAGYAAAADAAAAMQAAAAAAAAAwAAAAAwAAADIAAAADAAAAPQAAAAMAAABCAAAAAAAAAEMAAAADAAAASwAAAAMAAABRAAAAAAAAAFUAAAAAAAAAXwAAAAAAAABcAAAAAAAAAFMAAAAAAAAATwAAAAAAAABOAAAAAAAAAEoAAAADAAAAPwAAAAEAAAA7AAAAAwAAADkAAAADAAAAbQAAAAAAAABsAAAAAAAAAGQAAAAFAAAAXQAAAAEAAABfAAAAAAAAAFwAAAAAAAAATQAAAAEAAABPAAAAAAAAAE
vendor: 13,862 bytes, line 2
24AAAAAAAAAdQAAAAQAAAB2AAAABQAAAHIAAAAFAAAAagAAAAEAAABtAAAAAAAAAGwAAAAAAAAAWgAAAAEAAABdAAAAAQAAAF8AAAAAAAAAWgAAAAAAAABNAAAAAAAAAD8AAAAAAAAAUAAAAAAAAABEAAAAAAAAADgAAAADAAAASAAAAAEAAAA8AAAAAwAAAC4AAAADAAAAagAAAAAAAABdAAAAAAAAAE8AAAAFAAAAYwAAAAEAAABaAAAAAAAAAE0AAAAAAAAAWAAAAAEAAABQAAAAAAAAAEQAAAAAAAAAdQAAAAMAAABtAAAABQAAAF8AAAAFAAAAcQAAAAEAAABqAAAAAAAAAF0AAAAAAAAAaQAAAAEAAABjAAAAAQAAAFoAAAAAAAAAaQAAAAAAAABYAAAAAAAAAEgAAAAAAAAAZwAAAAAAAABbAAAAAAAAAEkAAAADAAAAYQAAAAEAAABZAAAAAwAAAEcAAAADAAAAcQAAAAAAAABjAAAAAAAAAFAAAAAFAAAAdAAAAAEAAABpAAAAAAAAAFgAAAAAAAAAbwAAAAEAAABnAAAAAAAAAFsAAAAAAAAAdQAAAAIAAABqAAAABQAAAFoAAAAFAAAAeQAAAAEAAABxAAAAAAAAAGMAAAAAAAAAdwAAAAEAAAB0AAAAAQAAAGkAAAAAAAAAdwAAAAAAAABvAAAAAAAAAGEAAAAAAAAAcwAAAAAAAABuAAAAAAAAAGIAAAADAAAAawAAAAEAAABoAAAAAwAAAGAAAAADAAAAeQAAAAAAAAB0AAAAAAAAAGcAAAAFAAAAeAAAAAEAAAB3AAAAAAAAAG8AAAAAAAAAcAAAAAEAAABzAAAAAAAAAG4AAAAAAAAAdQAAAAEAAABxAAAABQAAAGkAAAAFAAAAdgAAAAEAAAB5AAAAAAAAAHQAAAAAAAAAcgAAAAEAAAB4AAAAAQAAAHcAAAAAAAAAcgAAAAAAAABwAAAAAAAAAGsAAAAAAAAAZAAAAAAAAABmAAAAAAAAAGUAAAADAAAAUwAAAAEAAABXAAAAAwAAAFUAAAADAAAAdgAAAAAAAAB4AAAAAAAAAHMAAAAFAAAAbAAAAAEAAAByAAAAAAAAAHAAAAAAAAAAXAAAAAEAAABkAAAAAAAAAGYAAAAAAAAAdQAAAAAAAAB5AAAABQAAAHcAAAAFAAAAbQAAAAEAAAB2AAAAAAAAAHgAAAAAAAAAXwAAAAEAAABsAAAAAQAAAHIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAABAAAAAQAAAAAAAAAAAAAAAQAAAAAAAAABAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAGAAAAAgAAAAUAAAABAAAABAAAAAAAAAAAAAAABQAAAAMAAAABAAAABgAAAAQAAAACAAAAAAAAAH6iBfbytuk/Gq6akm/58z/Xrm0Liez0P5doSdOpSwRAWs602ULg8D/dT7Rcbo/1v1N1RQHFNOM/g9Snx7HW3L8HWsP8Q3jfP6VwOLosutk/9rjk1YQcxj+gnmKMsNn6P/HDeuPFY+M/YHwDjqKhB0Ci19/fCVrbP4UxKkDWOP6/pvljWa09tL9wi7wrQXjnv/Z6yLImkM2/3yTlOzY14D+m+WNZrT20PzwKVQnrQwNA9nrIsiaQzT/g40rFrRQFwPa45NWEHMa/kbslHEZq97/xw3rjxWPjv4cLC2SMBci/otff3wla27+rKF5oIAv0P1N1RQHFNOO/iDJPGyWHBUAHWsP8Q3jfvwQf/by16gXAfqIF9vK26b8XrO0Vh0r+v9eubQuJ7PS/BxLrA0ZZ479azrTZQuDwv1MK1EuItPw/yscgV9Z6FkAwHBR2WjQMQJNRzXsQ5vY/GlUHVJYKF0DONuFv2lMNQNCGZ28QJfk/0WUwoIL36D8ggDOMQuATQNqMOeAy/wZAWFYOYM+M2z/LWC4uH3oSQDE+LyTsMgRAkJzhRGWFGEDd4soovCQQQKqk0DJMEP8/rGmNdwOLBUAW2X/9xCbjP4hu3dcqJhNAzuYItRvdB0CgzW3zJW/sPxotm/Y2TxRAQAk9XmdDDEC1Kx9MKgT3P1M+NctcghZAFVqcLlb0C0Bgzd3sB2b2P77mZDPUWhZAFROHJpUGCEDAfma5CxXtPz1DWq/zYxRAmhYY5824F0DOuQKWSbAOQNCMqrvu3fs/L6DR22K2wT9nAAxPBU8RQGiN6mW43AFAZhu25b633D8c1YgmzowSQNM25BRKWARArGS08/lNxD+LFssHwmMRQLC5aNcxBgJABL9HT0WRF0CjCmJmOGEOQHsuaVzMP/s/TWJCaGGwBUCeu1PAPLzjP9nqN9DZOBNAKE4JcydbCkCGtbd1qjPzP8dgm9U8jhVAtPeKTkVwDkCeCLss5l37P401XMPLmBdAFd29VMVQDUBg0yA55h75Pz6odcYLCRdApBM4rBrkAkDyAVWgQxbRP4XDMnK20hFAymLlF7EmzD8GUgo9XBHlP3lbK7T9COc/k+OhPthhy7+YGEpnrOvCPzBFhLs15u4/epbqB6H4uz9IuuLF5svev6lzLKY31es/CaQ0envF5z8ZY0xlUADXv7zaz7HYEuI/CfbK1sn16T8uAQfWwxLWPzKn/YuFN94/5KdbC1AFu793fyCSnlfvPzK2y4doAMY/NRg5t1/X6b/shq4QJaHDP5yNIAKPOeI/vpn7BSE30r/X4YQrO6nrv78Ziv/Thto/DqJ1Y6+y5z9l51NaxFrlv8QlA65HOLS/86dxiEc96z+Hj0+LFjneP6LzBZ8LTc2/DaJ1Y6+y579l51NaxFrlP8QlA65HOLQ/8qdxiEc967+Jj0+LFjnev6LzBZ8LTc0/1qdbC1AFuz93fyCSnlfvvzK2y4doAMa/NRg5t1/X6T/vhq4QJaHDv5yNIAKPOeK/wJn7BSE30j/W4YQrO6nrP78Ziv/Thtq/CaQ0envF578XY0xlUADXP7zaz7HYEuK/CvbK1sn16b8rAQfWwxLWvzKn/YuFN96/zWLlF7EmzL8GUgo9XBHlv3lbK7T9COe/kOOhPthhyz+cGEpnrOvCvzBFhLs15u6/c5bqB6H4u79IuuLF5sveP6lzLKY31eu/AQAAAP////8HAAAA/////zEAAAD/////VwEAAP////9hCQAA/////6dBAAD/////kcsBAP/////3kAwA/////8H2VwAAAAAAAAAAAAAAAAACAAAA/////w4AAAD/////YgAAAP////+uAgAA/////8ISAAD/////ToMAAP////8ilwMA/////+4hGQD/////gu2vAAAAAAAAAAAAAAAAAAAAAAACAAAA//////////8BAAAAAwAAAP//////////////////////////////////////////////////////////////////////////AQAAAAAAAAACAAAA////////////////AwAAAP//////////////////////////////////////////////////////////////////////////AQAAAAAAAAACAAAA////////////////AwAAAP//////////////////////////////////////////////////////////////////////////AQAAAAAAAAACAAAA////////////////AwAAAP//////////////////////////////////////////////////////////AgAAAP//////////AQAAAAAAAAD/////////////////////AwAAAP////////////////////////////////////////////////////8DAAAA/////////////////////wAAAAD/////////////////////AQAAAP///////////////wIAAAD///////////////////////////////8DAAAA/////////////////////wAAAAD///////////////8CAAAAAQAAAP////////////////////////////////////////////////////8DAAAA/////////////////////wAAAAD///////////////8CAAAAAQAAAP////////////////////////////////////////////////////8DAAAA/////////////////////wAAAAD///////////////8CAAAAAQAAAP////////////////////////////////////////////////////8DAAAA/////////////////////wAAAAD///////////////8CAAAAAQAAAP////////////////////////////////////////////////////8BAAAAAgAAAP///////////////wAAAAD/////////////////////AwAAAP////////////////////////////////////////////////////8BAAAAAgAAAP///////////////wAAAAD/////////////////////AwAAAP////////////////////////////////////////////////////8BAAAAAgAAAP///////////////wAAAAD/////////////////////AwAAAP////////////////////////////////////////////////////8BAAAAAgAAAP///////////////wAAAAD/////////////////////AwAAAP///////////////////////////////wIAAAD///////////////8BAAAA/////////////////////wAAAAD/////////////////////AwAAAP////////////////////////////////////////////////////8DAAAA/////////////////////wAAAAABAAAA//////////8CAAAA//////////////////////////////////////////////////////////8DAAAA////////////////AgAAAAAAAAABAAAA//////////////////////////////////////////////////////////////////////////8DAAAA////////////////AgAAAAAAAAABAAAA//////////////////////////////////////////////////////////////////////////8DAAAA////////////////AgAAAAAAAAABAAAA//////////////////////////////////////////////////////////////////////////8DAAAAAQAAAP//////////AgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAACAAAAAAAAAAIAAAABAAAAAQAAAAIAAAACAAAAAAAAAAUAAAAFAAAAAAAAAAIAAAACAAAAAwAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAgAAAAEAAAACAAAAAgAAAAIAAAAAAAAABQAAAAYAAAAAAAAAAgAAAAIAAAADAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAgAAAAAAAAACAAAAAQAAAAMAAAACAAAAAgAAAAAAAAAFAAAABwAAAAAAAAACAAAAAgAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAACAAAAAAAAAAIAAAABAAAABAAAAAIAAAACAAAAAAAAAAUAAAAIAAAAAAAAAAIAAAACAAAAAwAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAIAAAAAAAAAAgAAAAEAAAAAAAAAAgAAAAIAAAAAAAAABQAAAAkAAAAAAAAAAgAAAAIAAAADAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAKAAAAAgAAAAIAAAAAAAAAAwAAAA4AAAACAAAAAAAAAAIAAAADAAAAAAAAAAAAAAACAAAAAgAAAAMAAAAGAAAAAAAAAAAAAAAAAAAAAAAAAAsAAAACAAAAAgAAAAAAAAADAAAACgAAAAIAAAAAAAAAAgAAAAMAAAABAAAAAAAAAAIAAAACAAAAAwAAAAcAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAIAAAACAAAAAAAAAAMAAAALAAAAAgAAAAAAAAACAAAAAwAAAAIAAAAAAAAAAgAAAAIAAAADAAAACAAAAAAAAAAAAAAAAAAAAAAAAAANAAAAAgAAAAIAAAAAAAAAAwAAAAwAAAACAAAAAAAAAAIAAAADAAAAAwAAAAAAAAACAAAAAgAAAAMAAAAJAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAACAAAAAgAAAAAAAAADAAAADQAAAAIAAAAAAAAAAgAAAAMAAAAEAAAAAAAAAAIAAAACAAAAAwAAAAoAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAIAAAACAAAAAAAAAAMAAAAGAAAAAgAAAAAAAAACAAAAAwAAAA8AAAAAAAAAAgAAAAIAAAADAAAACwAAAAAAAAAAAAAAAAAAAAAAAAAGAAAAAgAAAAIAAAAAAAAAAwAAAAcAAAACAAAAAAAAAAIAAAADAAAAEAAAAAAAAAACAAAAAgAAAAMAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAcAAAACAAAAAgAAAAAAAAADAAAACAAAAAIAAAAAAAAAAgAAAAMAAAARAAAAAAAAAAIAAAACAAAAAwAAAA0AAAAAAAAAAAAAAAAAAAAAAAAACAAAAAIAAAACAAAAAAAAAAMAAAAJAAAAAgAAAAAAAAACAAAAAwAAABIAAAAAAAAAAgAAAAIAAAADAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAJAAAAAgAAAAIAAAAAAAAAAwAAAAUAAAACAAAAAAAAAAIAAAADAAAAEwAAAAAAAAACAAAAAgAAAAMAAAAPAAAAAAAAAAAAAAAAAAAAAAAAABAAAAACAAAAAAAAAAIAAAABAAAAEwAAAAIAAAACAAAAAAAAAAUAAAAKAAAAAAAAAAIAAAACAAAAAwAAABAAAAAAAAAAAAAAAAAAAAAAAAAAEQAAAAIAAAAAAAAAAgAAAAEAAAAPAAAAAgAAAAIAAAAAAAAABQAAAAsAAAAAAAAAAgAAAAIAAAADAAAAEQAAAAAAAAAAAAAAAAAAAAAAAAASAAAAAgAAAAAAAAACAAAAAQAAABAAAAACAAAAAgAAAAAAAAAFAAAADAAAAAAAAAACAAAAAgAAAAMAAAASAAAAAAAAAAAAAAAAAAAAAAAAABMAAAACAAAAAAAAAAIAAAABAAAAEQAAAAIAAAACAAAAAAAAAAUAAAANAAAAAAAAAAIAAAACAAAAAwAAABMAAAAAAAAAAAAAAAAAAAAAAAAADwAAAAIAAAAAAAAAAgAAAAEAAAASAAAAAgAAAAIAAAAAAAAABQAAAA4AAAAAAAAAAgAAAAIAAAADAAAAAgAAAAEAAAAAAAAAAQAAAAIAAAAAAAAAAAAAAAIAAAABAAAAAAAAAAEAAAACAAAAAQAAAAAAAAACAAAAAAAAAAUAAAAEAAAAAAAAAAEAAAAFAAAAAAAAAAAAAAAFAAAABAAAAAAAAAABAAAABQAAAAQAAAAAAAAABQAAAAAAAAACAAAAAQAAAAAAAAABAAAAAgAAAAAAAAAAAAAAAgAAAAEAAAAAAAAAAQAAAAIAAAABAAAAAAAAAAIAAAACAAAAAAAAAAEAAAAAAAAAAAAAAAUAAAAEAAAAAAAAAAEAAAAFAAAAAAAAAAAAAAAFAAAABAAAAAAAAAABAAAABQAAAAQAAAAAAAAABQAAAAUAAAAAAAAAAQAAAAAAAAAAAAAAOgehWlKfUEEz1zLi+JsiQa2og3wcMfVAWCbHorc0yEDi+Yn/Y6mbQJ11/mfsnG9At6bnG4UQQkBvMCQWKqUUQJVmwwswmOc/3hVgVBL3uj//qqOEOdGOPw/WDN4gnGE/H3ANkCUgND+AA8btKgAHPwTXBqJVSdo+XfRQAqsKrj4fc+zLYbSPQklEmCZHv2FCUP+uDso1NEKYtPhwphUHQptxnyFXYdpB7CddZAMmrkGAt1AxSTqBQUibBVdTsFNBSuX3MV+AJkFocv82SLf5QAqmgj7AY81A23VDSEnLoEDGEJVSeDFzQDYrqvBk70VA8U157pcRGUBWfEF+ZKbsP7KBdLHZTpFAqKYk69AqekDbeGY41MdjQD8AZzHK501A1vcrrjubNkD5LnquvBYhQCbiRRD71QlAqt72EbOH8z8Eu+jL1YbdP4uaox/xUcY/abedg1XfsD+BsUdzJ4KZP5wE9YFySIM/rW1kAKMpbT+rZFthVRhWPy4PKlXIs0A/qMZLlwDnMEHByqEF0I0ZQQYSFD8lUQNBPpY+dFs07UAH8BZImBPWQN9RY0I0sMBA2T7kLfc6qUByFYvfhBKTQMq+0Mis1XxA0XQbeQXMZUBJJ5aEGXpQQP7/SY0a6ThAaMD92b/UIkAs8s8yqXoMQNIegOvCk/U/aOi7NZJP4D8AAAAA/////wAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////////////////////////////wAAAAD/////AAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAA/////wAAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAP////8AAAAABQAAAAAAAAAAAAAAAAAAAAAAAAD/////BQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAA/////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////////////////////////////8AAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////////////////////////////AAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAABQAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////////////////////////////wAAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAABAAAAAQAAAAAAAAABAAAAAAAAAAUAAAABAAAAAQAAAAAAAAAAAAAAAQAAAAEAAAAAAAAAAQAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQEAAAAAAAEAAQAAAQEAAAAAAAEAAAABAAAAAQABAAAAAAAAAAAAAAAAAAAAAAcAAAAHAAAAAQAAAAIAAAAEAAAAAwAAAAAAAAAAAAAABwAAAAMAAAABAAAAAgAAAAUAAAAEAAAAAAAAAAAAAAAEAAAABAAAAAAAAAACAAAAAQAAAAMAAAAOAAAABgAAAAsAAAACAAAABwAAAAEAAAAYAAAABQAAAAoAAAABAAAABgAAAAAAAAAmAAAABwAAAAwAAAADAAAACAAAAAIAAAAxAAAACQAAAA4AAAAAAAAABQAAAAQAAAA6AAAACAAAAA0AAAAEAAAACQAAAAMAAAA/AAAACwAAAAYAAAAPAAAACgAAABAAAABIAAAADAAAAAcAAAAQAAAACwAAABEAAABTAAAACgAAAAUAAAATAAAADgAAAA8AAABhAAAADQAAAAgAAAARAAAADAAAABIAAABrAAAADgAAAAkAAAASAAAADQAAABMAAAB1AAAADwAAABMAAAARAAAAEgAAABAAAAAGAAAAAgAAAAMAAAAFAAAABAAAAAAAAAAAAAAAAAAAAAYAAAACAAAAAwAAAAEAAAAFAAAABAAAAAAAAAAAAAAABwAAAAUAAAADAAAABAAAAAEAAAAAAAAAAgAAAAAAAAACAAAAAwAAAAEAAAAFAAAABAAAAAYAAAAAAAAAAAAAAGFsZ29zLmMAaDNOZWlnaGJvclJvdGF0aW9ucwBjb29yZGlqay5jAF91cEFwN0NoZWNrZWQAX3VwQXA3ckNoZWNrZWQAZGlyZWN0ZWRFZGdlLmMAZGlyZWN0ZWRFZGdlVG9Cb3VuZGFyeQBhZGphY2VudEZhY2VEaXJbdG1wRmlqay5mYWNlXVtmaWprLmZhY2VdID09IEtJAGZhY2VpamsuYwBfZmFjZUlqa1BlbnRUb0NlbGxCb3VuZGFyeQBhZGphY2VudEZhY2VEaXJbY2VudGVySUpLLmZhY2VdW2ZhY2UyXSA9PSBLSQBfZmFjZUlqa1RvQ2VsbEJvdW5kYXJ5AGgzSW5kZXguYwBjb21wYWN0Q2VsbHMAbGF0TG5nVG9DZWxsAGNlbGxUb0NoaWxkUG9zAHZhbGlkYXRlQ2hpbGRQb3MAbGF0TG5nLmMAY2VsbEFyZWFSYWRzMgBwb2x5Z29uLT5uZXh0ID09IE5VTEwAbGlua2VkR2VvLmMAYWRkTmV3TGlua2VkUG9seWdvbgBuZXh0ICE9IE5VTEwAbG9vcCAhPSBOVUxMAGFkZE5ld0xpbmtlZExvb3AAcG9seWdvbi0+Zmlyc3QgPT0gTlVMTABhZGRMaW5rZWRMb29wAGNvb3JkICE9IE5VTEwAYWRkTGlua2VkQ29vcmQAbG9vcC0+Zmlyc3QgPT0gTlVMTABpbm5lckxvb3BzICE9IE5VTEwAbm9ybWFsaXplTXVsdGlQb2x5Z29uAGJib3hlcyAhPSBOVUxMAGNhbmRpZGF0ZXMgIT0gTlVMTABmaW5kUG9seWdvbkZvckhvbGUAY2FuZGlkYXRlQkJveGVzICE9IE5VTEwAcmV2RGlyICE9IElOVkFMSURfRElHSVQAbG9jYWxpai5jAGNlbGxUb0xvY2FsSWprAGJhc2VDZWxsICE9IG9yaWdpbkJhc2VDZWxsACEob3JpZ2luT25QZW50ICYmIGluZGV4T25QZW50KQBiYXNlQ2VsbCA9PSBvcmlnaW5CYXNlQ2VsbABiYXNlQ2VsbCAhPSBJTlZBTElEX0JBU0VfQ0VMTABsb2NhbElqa1RvQ2VsbAAhX2lzQmFzZUNlbGxQZW50YWdvbihiYXNlQ2VsbCkAYmFzZUNlbGxSb3RhdGlvbnMgPj0gMABncmlkUGF0aENlbGxzADAAdmVydGV4LmMAY2VsbFRvVmVydGV4AGdyYXBoLT5idWNrZXRzICE9IE5VTEwAdmVydGV4R3JhcGguYwBpbml0VmVydGV4R3JhcGgAbm9kZSAhPSBOVUxMAGFkZFZlcnRleE5vZGU=";function V(t){return t}function j(t){return t.replace(/\b__Z[\w\d_]+/g,(function(t){return t===t?t:t+" ["+t+"]"}))}function H(){var t=new Error;if(!t.stack){try{throw new Error(0)}catch(e){t=e}if(!t.stack)return"(no stack trace available)"}return t.stack.toString()}function W(){return g.length}function q(t){try{var e=new ArrayBuffer(t);if(e.byteLength!=t)return;return new Int8Array(e).set(g),Y(e),w(e),1}catch(n){}}var Z="function"===typeof atob?atob:function(t){var e,n,i,r,o,s,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",l="",c=0;t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");do{e=a.indexOf(t.charAt(c++))<<2|(r=a.indexOf(t.charAt(c++)))>>4,n=(15&r)<<4|(o=a.indexOf(t.charAt(c++)))>>2,i=(3&o)<<6|(s=a.indexOf(t.charAt(c++))),l+=String.fromCharCode(e),64!==o&&(l+=String.fromCharCode(n)),64!==s&&(l+=String.fromCharCode(i))}while(c<t.length);return l};function X(t){if(G(t))return function(t){try{for(var e=Z(t),n=new Uint8Array(e.length),i=0;i<e.length;++i)n[i]=e.charCodeAt(i);return n}catch(r){throw new Error("Converting base64 string to bytes failed.")}}(t.slice(U.length))}var K,Q,J=function(t,e,n){var i=new t.Int8Array(n),r=new t.Int32Array(n),o=(new t.Uint8Array(n),new t.Float32Array(n),new t.Float64Array(n)),s=0|e.o,a=0|e.p,l=t.Math.floor,c=t.Math.abs,u=t.Math.sqrt,h=t.Math.pow,d=t.Math.cos,p=t.Math.sin,f=t.Math.tan,A=t.Math.acos,g=t.Math.asin,m=t.Math.atan,y=t.Math.atan2,_=t.Math.ceil,v=t.Math.imul,b=t.Math.min,x=t.Math.max,w=t.Math.clz32,E=e.b,C=e.c,T=e.d,S=e.e,P=e.f,M=e.g,I=e.h,B=e.i,R=24160;function L(t,e,n,i){return 0|O(t|=0,e|=0,n|=0,i|=0,0)}function O(t,e,n,i,o){var s,a=0,l=0,c=0,u=0;if(s=R,R=R+16|0,l=s,!(0|D(t|=0,e|=0,n|=0,i|=0,o|=0)))return R=s,0|(i=0);do{if((0|n)>=0){if((0|n)>13780509){if(0|(a=0|ee(15,l)))break;l=0|r[(c=l)>>2],c=0|r[c+4>>2]}else u=0|Fe(0|n,0|(a=((0|n)<0)<<31>>31),3,0),c=0|C(),a=0|Re(0|n,0|a,1,0),a=0|Re(0|(a=0|Fe(0|u,0|c,0|a,0|C())),0|C(),1,0),c=0|C(),r[l>>2]=a,r[l+4>>2]=c,l=a;if(Ze(0|i,0,l<<3
vendor: 13,977 bytes, line 2
2),0|o){Ze(0|o,0,l<<2),a=0|k(t,e,n,i,o,l,c,0);break}(a=0|Be(l,4))?(u=0|k(t,e,n,i,a,l,c,0),Ie(a),a=u):a=13}else a=2}while(0);return R=s,0|(u=a)}function D(t,e,n,i,o){t|=0,e|=0,n|=0,i|=0,o|=0;var s,a,l=0,c=0,u=0,h=0,d=0,p=0,f=0,A=0,g=0;if(a=R,R=R+16|0,g=a+8|0,r[(A=s=a)>>2]=t,r[A+4>>2]=e,(0|n)<0)return R=a,0|(g=2);if(r[(l=i)>>2]=t,r[l+4>>2]=e,(l=0!=(0|o))&&(r[o>>2]=0),0|Ft(t,e))return R=a,0|(g=9);r[g>>2]=0;t:do{if((0|n)>=1)if(l)for(p=1,d=0,f=0,A=1,l=t;;){if(!(d|f)){if(0|(l=0|F(l,e,4,g,s)))break t;if(0|Ft(l=0|r[(e=s)>>2],e=0|r[e+4>>2])){l=9;break t}}if(0|(l=0|F(l,e,0|r[22384+(f<<2)>>2],g,s)))break t;if(l=0|r[(e=s)>>2],e=0|r[e+4>>2],r[(t=i+(p<<3)|0)>>2]=l,r[t+4>>2]=e,r[o+(p<<2)>>2]=A,c=(0|(t=d+1|0))==(0|A),h=6==(0|(u=f+1|0)),0|Ft(l,e)){l=9;break t}if((0|(A=A+(h&c&1)|0))>(0|n)){l=0;break}p=p+1|0,d=c?0:t,f=c?h?0:u:f}else for(p=1,d=0,f=0,A=1,l=t;;){if(!(d|f)){if(0|(l=0|F(l,e,4,g,s)))break t;if(0|Ft(l=0|r[(e=s)>>2],e=0|r[e+4>>2])){l=9;break t}}if(0|(l=0|F(l,e,0|r[22384+(f<<2)>>2],g,s)))break t;if(l=0|r[(e=s)>>2],e=0|r[e+4>>2],r[(t=i+(p<<3)|0)>>2]=l,r[t+4>>2]=e,c=(0|(t=d+1|0))==(0|A),h=6==(0|(u=f+1|0)),0|Ft(l,e)){l=9;break t}if((0|(A=A+(h&c&1)|0))>(0|n)){l=0;break}p=p+1|0,d=c?0:t,f=c?h?0:u:f}else l=0}while(0);return R=a,0|(g=l)}function k(t,e,n,i,o,s,a,l){n|=0,i|=0,o|=0,l|=0;var c,u,h,d=0,p=0,f=0,A=0,g=0,m=0,y=0;if(h=R,R=R+16|0,c=h+8|0,u=h,d=0|ze(0|(t|=0),0|(e|=0),0|(s|=0),0|(a|=0)),f=0|C(),!(0==(0|(y=0|r[(m=A=i+(d<<3)|0)>>2]))&0==(0|(m=0|r[m+4>>2]))|(p=(0|y)==(0|t)&(0|m)==(0|e))))do{d=0|Ne(0|(d=0|Re(0|d,0|f,1,0)),0|C(),0|s,0|a),f=0|C(),p=(0|(m=0|r[(y=A=i+(d<<3)|0)>>2]))==(0|t)&(0|(y=0|r[y+4>>2]))==(0|e)}while(!(0==(0|m)&0==(0|y)|p));if(d=o+(d<<2)|0,p&&(0|r[d>>2])<=(0|l))return R=h,0|(y=0);if(r[(y=A)>>2]=t,r[y+4>>2]=e,r[d>>2]=l,(0|l)>=(0|n))return R=h,0|(y=0);switch(p=l+1|0,r[c>>2]=0,0|(d=0|F(t,e,2,c,u))){case 9:g=9;break;case 0:(d=0|k(0|r[(d=u)>>2],0|r[d+4>>2],n,i,o,s,a,p))||(g=9)}t:do{if(9==(0|g)){switch(r[c>>2]=0,0|(d=0|F(t,e,3,c,u))){case 9:break;case 0:if(0|(d=0|k(0|r[(d=u)>>2],0|r[d+4>>2],n,i,o,s,a,p)))break t;break;default:break t}switch(r[c>>2]=0,0|(d=0|F(t,e,1,c,u))){case 9:break;case 0:if(0|(d=0|k(0|r[(d=u)>>2],0|r[d+4>>2],n,i,o,s,a,p)))break t;break;default:break t}switch(r[c>>2]=0,0|(d=0|F(t,e,5,c,u))){case 9:break;case 0:if(0|(d=0|k(0|r[(d=u)>>2],0|r[d+4>>2],n,i,o,s,a,p)))break t;break;default:break t}switch(r[c>>2]=0,0|(d=0|F(t,e,4,c,u))){case 9:break;case 0:if(0|(d=0|k(0|r[(d=u)>>2],0|r[d+4>>2],n,i,o,s,a,p)))break t;break;default:break t}switch(r[c>>2]=0,0|(d=0|F(t,e,6,c,u))){case 9:break;case 0:if(0|(d=0|k(0|r[(d=u)>>2],0|r[d+4>>2],n,i,o,s,a,p)))break t;break;default:break t}return R=h,0|(y=0)}}while(0);return R=h,0|(y=d)}function F(t,e,n,i,o){t|=0,e|=0,o|=0;var s,a,l=0,c=0,u=0,h=0,d=0,p=0,f=0;if((n|=0)>>>0>6)return 0|(o=1);if(d=(0|r[(i|=0)>>2])%6|0,r[i>>2]=d,(0|d)>0){l=0;do{n=0|ft(n),l=l+1|0}while((0|l)<(0|r[i>>2]))}if(d=0|Ge(0|t,0|e,45),C(),(a=127&d)>>>0>121)return 0|(o=5);s=0|Nt(t,e),l=0|Ge(0|t,0|e,52),C(),l&=15;t:do{if(l){for(;;){if(u=0|Ge(0|t,0|e,0|(c=3*(15-l|0)|0)),C(),7==(0|(u&=7))){e=5;break}if(f=0==(0|jt(l)),l=l+-1|0,p=0|Ve(7,0,0|c),e&=~C(),t=0|Ve(0|r[(f?432:16)+(28*u|0)+(n<<2)>>2],0,0|c)|t&~p,e|=c=0|C(),!(n=0|r[(f?640:224)+(28*u|0)+(n<<2)>>2])){n=0;break t}if(!l){h=8;break t}}return 0|e}h=8}while(0);8==(0|h)&&(t|=0|Ve(0|(f=0|r[848+(28*a|0)+(n<<2)>>2]),0,45),e=C()|-1040385&e,n=0|r[4272+(28*a|0)+(n<<2)>>2],127==(127&f)&&(f=0|Ve(0|r[848+(28*a|0)+20>>2],0,45),e=C()|-1040385&e,n=0|r[4272+(28*a|0)+20>>2],t=0|Ut(f|t,e),e=0|C(),r[i>>2]=1+(0|r[i>>2]))),u=0|Ge(0|t,0|e,45),C(),u&=127;t:do{if(0|U(u)){e:do{if(1==(0|Nt(t,e))){if((0|a)!=(0|u)){if(0|H(u,0|r[7696+(28*a|0)>>2])){t=0|Vt(t,e),c=1,e=0|C();break}T(23313,22416,436,22424)}switch(0|s){case 3:t=0|Ut(t,e),e=0|C(),r[i>>2]=1+(0|r[i>>2]),c=0;break e;case 5:t=0|Vt(t,e),e=0|C(),r[i>>2]=5+(0|r[i>>2]),c=0;break e;case 0:return 0|(f=9);default:return 0|(f=1)}}else c=0}while(0);if((0|n)>0){l=0;do{t=0|zt(t,e),e=0|C(),l=l+1|0}while((0|l)!=(0|n))}if((0|a)!=(0|u)){if(!(0|G(u))){if(0!=(0|c)|5!=(0|Nt(t,e)))break;r[i>>2]=1+(0|r[i>>2]);break}switch(127&d){case 8:case 118:break t}3!=(0|Nt(t,e))&&(r[i>>2]=1+(0|r[i>>2]))}}else if((0|n)>0){l=0;do{t=0|Ut(t,e),e=0|C(),l=l+1|0}while((0|l)!=(0|n))}}while(0);return r[i>>2]=((0|r[i>>2])+n|0)%6|0,r[(f=o)>>2]=t,r[f+4>>2]=e,0|(f=0)}function N(t,e,n,i){n|=0,i|=0;var o,s,a,l=0,c=0;for(a=R,R=R+16|0,o=a,s=a+8|0,l=(l=0==(0|Ft(t|=0,e|=0)))?1:2;;){if(r[s>>2]=0,0==(0|F(t,e,l,s,o))&((0|r[(c=o)>>2])==(0|n)?(0|r[c+4>>2])==(0|i):0)){t=4;break}if((l=l+1|0)>>>0>=7){l=7,t=4;break}}return 4==(0|t)?(R=a,0|l):0}function z(t,e,n,i,s,a,l){e|=0,n|=0,i|=0,s|=0,a|=0,l|=0;var c,u,h,d,p,f,A,g,m,y,_=0,v=0,b=0,x=0,w=0,E=0,T=0,S=0,P=0,M=0,I=0,B=0,L=0,O=0,D=0,k=0,F=0,N=0,z=0;if(y=R,R=R+64|0,A=y+48|0,g=y+32|0,m=y+24|0,c=y+8|0,u=y,(0|(v=0|r[(t|=0)>>2]))<=0)return R=y,0|(D=0);for(h=t+4|0,d=A+8|0,p=g+8|0,f=c+8|0,_=0,L=0;;){B=(b=0|r[h>>2])+(L<<4)|0,r[A>>2]=r[B>>2],r[A+4>>2]=r[B+4>>2],r[A+8>>2]=r[B+8>>2],r[A+12>>2]=r[B+12>>2],(0|L)==(v+-1|0)?(r[g>>2]=r[b>>2],r[g+4>>2]=r[b+4>>2],r[g+8>>2]=r[b+8>>2],r[g+12>>2]=r[b+12>>2]):(B=b+(L+1<<4)|0,r[g>>2]=r[B>>2],r[g+4>>2]=r[B+4>>2],r[g+8>>2]=r[B+8>>2],r[g+12>>2]=r[B+12>>2]),v=0|Q(A,g,i,m);t:do{if(v)b=0,_=v;else if(v=0|r[(b=m)>>2],(0|(b=0|r[b+4>>2]))>0|0==(0|b)&v>>>0>0){I=0,B=0;e:for(;;){if(z=+o[A>>3],N=+((M=0|Le(0|v,0|b,0|I,0|B))>>>0)+4294967296*+(0|C()),k=+(v>>>0)+4294967296*+(0|b),F=+(I>>>0)+4294967296*+(0|B),o[c>>3]=z*N/k+ +o[g>>3]*F/k,o[f>>3]=+o[d>>3]*N/k+ +o[p>>3]*F/k,0|(v=0|Ht(c,i,u))){_=v;break}E=0|ze(0|(P=0|r[(M=u)>>2]),0|(M=0|r[M+4>>2]),0|e,0|n),x=0|C(),b=0|r[(w=v=l+(E<<3)|0)>>2],w=0|r[w+4>>2];n:do{if(0==(0|b)&0==(0|w))O=v,D=16;else for(T=0,S=0;;){if((0|T)>(0|n)|(0|T)==(0|n)&S>>>0>e>>>0){_=1;break e}if((0|b)==(0|P)&(0|w)==(0|M))break n;if(E=0|Ne(0|(v=0|Re(0|E,0|x,1,0)),0|C(),0|e,0|n),x=0|C(),S=0|Re(0|S,0|T,1,0),T=0|C(),0==(0|(b=0|r[(w=v=l+(E<<3)|0)>>2]))&0==(0|(w=0|r[w+4>>2]))){O=v,D=16;break}}}while(0);if(16!=(0|D)||(D=0,0==(0|P)&0==(0|M))||(r[(S=O)>>2]=P,r[S+4>>2]=M,S=a+(r[s>>2]<<3)|0,r[S>>2]=P,r[S+4>>2]=M,S=0|Re(0|r[(S=s)>>2],0|r[S+4>>2],1,0),P=0|C(),r[(M=s)>>2]=S,r[M+4>>2]=P),I=0|Re(0|I,0|B,1,0),B=0|C(),v=0|r[(b=m)>>2],!((0|(b=0|r[b+4>>2]))>(0|B)|(0|b)==(0|B)&v>>>0>I>>>0)){b=1;break t}}b=0}else b=1}while(0);if(L=L+1|0,!b){D=21;break}if((0|L)>=(0|(v=0|r[t>>2]))){_=0,D=21;break}}return 21==(0|D)?(R=y,0|_):0}function U(t){return(t|=0)>>>0>121?0|(t=0):0|(t=0|r[7696+(28*t|0)+16>>2])}function G(t){return 4==(0|(t|=0))|117==(0|t)}function V(t){return 0|r[11120+(216*(0|r[(t|=0)>>2])|0)+(72*(0|r[t+4>>2])|0)+(24*(0|r[t+8>>2])|0)+(r[t+12>>2]<<3)>>2]}function j(t){return 0|r[11120+(216*(0|r[(t|=0)>>2])|0)+(72*(0|r[t+4>>2])|0)+(24*(0|r[t+8>>2])|0)+(r[t+12>>2]<<3)+4>>2]}function H(t,e){return e|=0,(0|r[7696+(28*(t|=0)|0)+20>>2])==(0|e)?0|(e=1):0|(e=(0|r[7696+(28*t|0)+24>>2])==(0|e))}function W(t,e){return 0|r[848+(28*(t|=0)|0)+((e|=0)<<2)>>2]}function q(t,e){return e|=0,(0|r[848+(28*(t|=0)|0)>>2])==(0|e)?0|(e=0):(0|r[848+(28*t|0)+4>>2])==(0|e)?0|(e=1):(0|r[848+(28*t|0)+8>>2])==(0|e)?0|(e=2):(0|r[848+(28*t|0)+12>>2])==(0|e)?0|(e=3):(0|r[848+(28*t|0)+16>>2])==(0|e)?0|(e=4):(0|r[848+(28*t|0)+20>>2])==(0|e)?0|(e=5):0|((0|r[848+(28*t|0)+24>>2])==(0|e)?6:7)}function Z(t){return+o[(t|=0)+16>>3]<+o[t+24>>3]|0}function X(t,e){t|=0;var n,i,r=0;return(r=+o[(e|=0)>>3])>=+o[t+8>>3]&&r<=+o[t>>3]?(n=+o[t+16>>3],r=+o[t+24>>3],e=(i=+o[e+8>>3])>=r,t=i<=n&1,n<r?e&&(t=1):e||(t=0),0|(e=0!=(0|t))):0|(e=0)}function K(t,e,n){t|=0,e|=0,n|=0;var i,a,u,h,d,p,f,A=0,g=0,m=0,y=0,v=0,x=0,w=0;p=R,R=R+288|0,d=p+264|0,y=p+96|0,g=(A=m=p)+96|0;do{r[A>>2]=0,A=A+4|0}while((0|A)<(0|g));return 0|(e=0|Kt(e,m))?(R=p,0|(x=e)):(Zt(m=0|r[(g=m)>>2],g=0|r[g+4>>2],d),Xt(m,g,y),h=+te(d,y+8|0),o[d>>3]=+o[t>>3],o[(g=d+8|0)>>3]=+o[t+16>>3],o[y>>3]=+o[t+8>>3],o[(m=y+8|0)>>3]=+o[t+24>>3],a=+te(d,y),w=+o[g>>3]-+o[m>>3],u=+c(+w),f=+o[d>>3]-+o[y>>3],i=+c(+f),0==w|0==f||(w=+je(+u,+i),w=+_(+a*a/+He(+w/+He(+u,+i),3)/(h*(2.59807621135*h)*.8)),o[s>>3]=w,v=~~w>>>0,x=+c(w)>=1?w>0?~~+b(+l(w/4294967296),4294967295)>>>0:~~+_((w-+(~~w>>>0))/4294967296)>>>0:0,2146435072==(2146435072&r[s+4>>2]))?e=1:(y=0==(0|v)&0==(0|x),r[(e=n)>>2]=y?1:v,r[e+4>>2]=y?0:x,e=0),R=p,0|(x=e))}function Q(t,e,n,i){t|=0,e|=0,n|=0,i|=0;var a,u,h,d,p=0,f=0,A=0;d=R,R=R+288|0,u=d+264|0,h=d+96|0,a=(p=f=d)+96|0;do{r[p>>2]=0,p=p+4|0}while((0|p)<(0|a));return 0|(n=0|Kt(n,f))?(R=d,0|(i=n)):(Zt(p=0|r[(n=f)>>2],n=0|r[n+4>>2],u),Xt(p,n,h),A=+te(u,h+8|0),A=+_(+ +te(t,e)/(2*A)),o[s>>3]=A,n=~~A>>>0,p=+c(A)>=1?A>0?~~+b(+l(A/4294967296),4294967295)>>>0:~~+_((A-+(~~A>>>0))/4294967296)>>>0:0,2146435072==(2146435072&r[s+4>>2])?(R=d,0|(i=1)):(f=0==(0|n)&0==(0|p),r[i>>2]=f?1:n,r[i+4>>2]=f?0:p,R=d,0|(i=0)))}function J(t,e,n,i){e|=0,n|=0,i|=0,r[(t|=0)>>2]=e,r[t+4>>2]=n,r[t+8>>2]=i}function Y(t,e){t|=0;var n,i,s,a,l=0,u=0,h=0,d=0,p=0,f=0,A=0;r[(a=(e|=0)+8|0)>>2]=0,i=+o[t>>3],d=+c(+i),s=+o[t+8>>3],d+=.5*(p=+c(+s)/.8660254037844386),d-=+(0|(l=~~d)),p-=+(0|(t=~~p));do{if(d<.5){if(d<.3333333333333333){if(r[e>>2]=l,p<.5*(d+1)){r[e+4>>2]=t;break}t=t+1|0,r[e+4>>2]=t;break}if(t=(1&!(p<(A=1-d)))+t|0,r[e+4>>2]=t,A<=p&p<2*d){l=l+1|0,r[e>>2]=l;break}r[e>>2]=l;break}if(!(d<.6666666666666666)){if(l=l+1|0,r[e>>2]=l,p<.5*d){r[e+4>>2]=t;break}t=t+1|0,r[e+4>>2]=t;break}if(p<1-d){if(r[e+4>>2]=t,2*d-1<p){r[e>>2]=l;break}}else t=t+1|0,r[e+4>>2]=t;l=l+1|0,r[e>>2]=l}while(0);do{if(i<0){if(1&t){l=~~(+(0|l)-(2*(+((f=0|Le(0|l,((0|l)<0)<<31>>31,0|(f=(t+1|0)/2|0),((0|f)<0)<<31>>31))>>>0)+4294967296*+(0|C()))+1)),r[e>>2]=l;break}l=~~(+(0|l)-2*(+((f=0|Le(0|l,((0|l)<0)<<31>>31,0|(f=(0|t)/2|0),((0|f)<0)<<31>>31))>>>0)+4294967296*+(0|C()))),r[e>>2]=l;break}}while(0);f=e+4|0,s<0&&(l=l-((1|t<<1)/2|0)|0,r[e>>2]=l,t=0-t|0,r[f>>2]=t),u=t-l|0,(0|l)<0?(h=0-l|0,r[f>>2]=u,r[a>>2]=h,r[e>>2]=0,t=u,l=0):h=0,(0|t)<0&&(l=l-t|0,r[e>>2]=l,h=h-t|0,r[a>>2]=h,r[f>>2]=0,t=0),n=l-h|0,u=t-h|0,(0|h)<0&&(r[e>>2]=n,r[f>>2]=u,r[a>>2]=0,t=u,l=n,h=0),(0|(u=(0|h)<(0|(u=(0|t)<(0|l)?t:l))?h:u))<=0||(r[e>>2]=l-u,r[f>>2]=t-u,r[a>>2]=h-u)}function $(t){var e,n=0,i=0,o=0,s=0,a=0;n=0|r[(t|=0)>>2],i=0|r[(e=t+4|0)>>2],(0|n)<0&&(i=i-n|0,r[e>>2]=i,r[(a=t+8|0)>>2]=(0|r[a>>2])-n,r[t>>2]=0,n=0),(0|i)<0?(n=n-i|0,r[t>>2]=n,s=(0|r[(a=t+8|0)>>2])-i|0,r[a>>2]=s,r[e>>2]=0,i=0):(a=s=t+8|0,s=0|r[s>>2]),(0|s)<0&&(n=n-s|0,r[t>>2]=n,i=i-s|0,r[e>>2]=i,r[a>>2]=0,s=0),(0|(o=(0|s)<(0|(o=(0|i)<(0|n)?i:n))?s:o))<=0||(r[t>>2]=n-o,r[e>>2]=i-o,r[a>>2]=s-o)}function tt(t,e){e|=0;var n,i;i=0|r[(t|=0)+8>>2],n=+((0|r[t+4>>2])-i|0),o[e>>3]=+((0|r[t>>2])-i|0)-.5*n,o[e+8>>3]=.8660254037844386*n}function et(t,e,n){t|=0,e|=0,r[(n|=0)>>2]=(0|r[e>>2])+(0|r[t>>2]),r[n+4>>2]=(0|r[e+4>>2])+(0|r[t+4>>2]),r[n+8>>2]=(0|r[e+8>>2])+(0|r[t+8>>2])}function nt(t,e,n){t|=0,e|=0,r[(n|=0)>>2]=(0|r[t>>2])-(0|r[e>>2]),r[n+4>>2]=(0|r[t+4>>2])-(0|r[e+4>>2]),r[n+8>>2]=(0|r[t+8>>2])-(0|r[e+8>>2])}function it(t,e){e|=0;var n,i=0;i=0|v(0|r[(t|=0)>>2],e),r[t>>2]=i,n=0|v(0|r[(i=t+4|0)>>2],e),r[i>>2]=n,e=0|v(0|r[(t=t+8|0)>>2],e),r[t>>2]=e}function rt(t){var e,n,i=0,o=0,s=0,a=0,l=0;l=(0|(n=0|r[(t|=0)>>2]))<0,t=(t=(o=(0|(a=((e=(0|(s=(0|r[t+4>>2])-(l?n:0)|0))<0)?0-s|0:0)+((0|r[t+8>>2])-(l?n:0))|0))<0)?0:a)-((s=(0|(o=(0|t)<(0|(o=(0|(i=(e?0:s)-(o?a:0)|0))<(0|(a=(l?0:n)-(e?s:0)-(o?a:0)|0))?i:a))?t:o))>0)?o:0)|0,i=i-(s?o:0)|0;t:do{switch(a-(s?o:0)|0){case 0:switch(0|i){case 0:return 0|(l=0==(0|t)?0:1==(0|t)?1:7);case 1:return 0|(l=0==(0|t)?2:1==(0|t)?3:7);default:break t}case 1:switch(0|i){case 0:return 0|(l=0==(0|t)?4:1==(0|t)?5:7);case 1:if(t)break t;return 0|(t=6);default:break t}}}while(0);return 0|(l=7)}function ot(t){var e,n=0,i=0,o=0,s=0,a=0,l=0;s=0|r[(e=(t|=0)+8|0)>>2],a=(0|r[t>>2])-s|0,s=(0|r[(l=t+4|0)>>2])-s|0;do{if(a>>>0>715827881|s>>>0>715827881){if(i=(0|a)>0){if((2147483647-a|0)<(0|a))return 0|(l=1);if((2147483647-(a<<1)|0)<(0|a))return 0|(l=1)}else{if((-2147483648-a|0)>(0|a))return 0|(l=1);if((-2147483648-(a<<1)|0)>(0|a))return 0|(l=1)}if(n=3*a|0,(0|s)>0){if((2147483647-s|0)<(0|s))return 0|(l=1)}else if((-2147483648-s|0)>(0|s))return 0|(l=1);if(o=s<<1,(0|a)>-1){if((-2147483648|n)>=(0|s))return 0|(l=1)}else if((-2147483648^n)<(0|s))return 0|(l=1);if(i){if(!((2147483647-a|0)<(0|o))){i=o;break}return 0|(n=1)}if(!((-2147483648-a|0)>(0|o))){i=o;break}return 0|(n=1)}i=s<<1,n=3*a|0}while(0);o=0|Pe(+(n-s|0)/7),r[t>>2]=o,s=0|Pe(+(i+a|0)/7),r[l>>2]=s,r[e>>2]=0,n=(i=(0|s)<(0|o))?o:s,i=i?s:o;do{if((0|i)<0){if((0|n)>0){if((-2147483648|n)<(0|i)&-2147483648!=(0|i)&(2147483647-n|0)>=(0|i))break;T(23313,22444,355,22455)}if(-2147483648==(0|i)|(-2147483648-n|0)>(0|i)&&T(23313,22444,355,22455),(0|n)>-1){if((-2147483648|n)<(0|i))break;T(23313,22444,355,22455)}else{if((-2147483648^n)>=(0|i))break;T(23313,22444,355,22455)}}}while(0);return n=s-o|0,(0|o)<0?(i=0-o|0,r[l>>2]=n,r[e>>2]=i,r[t>>2]=0,o=0):(n=s,i=0),(0|n)<0&&(o=o-n|0,r[t>>2]=o,i=i-n|0,r[e>>2]=i,r[l>>2]=0,n=0),a=o-i|0,s=n-i|0,(0|i)<0?(r[t>>2]=a,r[l>>2]=s,r[e>>2]=0,n=s,s=a,i=0):s=o,(0|(o=(0|i)<(0|(o=(0|n)<(0|s)?n:s))?i:o))<=0||(r[t>>2]=s-o,r[l>>2]=n-o,r[e>>2]=i-o),0|(l=0)}function st(t){var e,n=0,i=0,o=0,s=0,a=0,l=0;s=0|r[(e=(t|=0)+8|0)>>2],a=(0|r[t>>2])-s|0,s=(0|r[(l=t+4|0)>>2])-s|0;do{if(a>>>0>715827881|s>>>0>715827881){if(i=(0|a)>0){if((2147483647-a|0)<(0|a))return 0|(l=1)}else if((-2147483648-a|0)>(0|a))return 0|(l=1);if(n=a<<1,(0|s)>0){if((2147483647-s|0)<(0|s))return 0|(l=1);if((2147483647-(s<<1)|0)<(0|s))return 0|(l=1)}else{if((-2147483648-s|0)>(0|s))return 0|(l=1);if((-2147483648-(s<<1)|0)>(0|s))return 0|(l=1)}if(o=3*s|0,i){if((2147483647-n|0)<(0|s))return 0|(l=1)}else if((-2147483648-n|0)>(0|s))return 0|(l=1);if((0|s)>-1){if((-2147483648|o)<(0|a)){i=o;break}return 0|(n=1)}if(!((-2147483648^o)<(0|a))){i=o;break}return 0|(n=1)}i=3*s|0,n=a<<1}while(0);o=0|Pe(+(n+s|0)/7),r[t>>2]=o,s=0|Pe(+(i-a|0)/7),r[l>>2]=s,r[e>>2]=0,n=(i=(0|s)<(0|o))?o:s,i=i?s:o;do{if((0|i)<0){if((0|n)>0){if((-2147483648|n)<(0|i)&-2147483648!=(0|i)&(2147483647-n|0)>=(0|i))break;T(23313,22444,404,22469)}if(-2147483648==(0|i)|(-2147483648-n|0)>(0|i)&&T(23313,22444,404,22469),(0|n)>-1){if((-2147483648|n)<(0|i))break;T(23313,22444,404,22469)}else{if((-2147483648^n
vendor: 5,514 bytes, line 2
2)>=(0|i))break;T(23313,22444,404,22469)}}}while(0);return n=s-o|0,(0|o)<0?(i=0-o|0,r[l>>2]=n,r[e>>2]=i,r[t>>2]=0,o=0):(n=s,i=0),(0|n)<0&&(o=o-n|0,r[t>>2]=o,i=i-n|0,r[e>>2]=i,r[l>>2]=0,n=0),a=o-i|0,s=n-i|0,(0|i)<0?(r[t>>2]=a,r[l>>2]=s,r[e>>2]=0,n=s,s=a,i=0):s=o,(0|(o=(0|i)<(0|(o=(0|n)<(0|s)?n:s))?i:o))<=0||(r[t>>2]=s-o,r[l>>2]=n-o,r[e>>2]=i-o),0|(l=0)}function at(t){var e,n,i=0,o=0,s=0,a=0,l=0;o=0|r[(e=(t|=0)+8|0)>>2],s=0|Pe(+((3*(i=(0|r[t>>2])-o|0)|0)-(o=(0|r[(n=t+4|0)>>2])-o|0)|0)/7),r[t>>2]=s,i=0|Pe(+((o<<1)+i|0)/7),r[n>>2]=i,r[e>>2]=0,o=i-s|0,(0|s)<0?(l=0-s|0,r[n>>2]=o,r[e>>2]=l,r[t>>2]=0,i=o,s=0,o=l):o=0,(0|i)<0&&(s=s-i|0,r[t>>2]=s,o=o-i|0,r[e>>2]=o,r[n>>2]=0,i=0),l=s-o|0,a=i-o|0,(0|o)<0?(r[t>>2]=l,r[n>>2]=a,r[e>>2]=0,i=a,a=l,o=0):a=s,(0|(s=(0|o)<(0|(s=(0|i)<(0|a)?i:a))?o:s))<=0||(r[t>>2]=a-s,r[n>>2]=i-s,r[e>>2]=o-s)}function lt(t){var e,n,i=0,o=0,s=0,a=0,l=0;o=0|r[(e=(t|=0)+8|0)>>2],s=0|Pe(+(((i=(0|r[t>>2])-o|0)<<1)+(o=(0|r[(n=t+4|0)>>2])-o|0)|0)/7),r[t>>2]=s,i=0|Pe(+((3*o|0)-i|0)/7),r[n>>2]=i,r[e>>2]=0,o=i-s|0,(0|s)<0?(l=0-s|0,r[n>>2]=o,r[e>>2]=l,r[t>>2]=0,i=o,s=0,o=l):o=0,(0|i)<0&&(s=s-i|0,r[t>>2]=s,o=o-i|0,r[e>>2]=o,r[n>>2]=0,i=0),l=s-o|0,a=i-o|0,(0|o)<0?(r[t>>2]=l,r[n>>2]=a,r[e>>2]=0,i=a,a=l,o=0):a=s,(0|(s=(0|o)<(0|(s=(0|i)<(0|a)?i:a))?o:s))<=0||(r[t>>2]=a-s,r[n>>2]=i-s,r[e>>2]=o-s)}function ct(t){var e,n,i,o=0,s=0,a=0,l=0;o=0|r[(t|=0)>>2],s=0|r[(n=t+4|0)>>2],a=0|r[(i=t+8|0)>>2],l=s+(3*o|0)|0,r[t>>2]=l,s=a+(3*s|0)|0,r[n>>2]=s,o=(3*a|0)+o|0,r[i>>2]=o,a=s-l|0,(0|l)<0?(o=o-l|0,r[n>>2]=a,r[i>>2]=o,r[t>>2]=0,s=a,a=0):a=l,(0|s)<0&&(a=a-s|0,r[t>>2]=a,o=o-s|0,r[i>>2]=o,r[n>>2]=0,s=0),e=a-o|0,l=s-o|0,(0|o)<0?(r[t>>2]=e,r[n>>2]=l,r[i>>2]=0,a=e,o=0):l=s,(0|(s=(0|o)<(0|(s=(0|l)<(0|a)?l:a))?o:s))<=0||(r[t>>2]=a-s,r[n>>2]=l-s,r[i>>2]=o-s)}function ut(t){var e,n,i,o=0,s=0,a=0,l=0;l=0|r[(t|=0)>>2],a=(3*(o=0|r[(n=t+4|0)>>2])|0)+l|0,l=(s=0|r[(i=t+8|0)>>2])+(3*l|0)|0,r[t>>2]=l,r[n>>2]=a,o=(3*s|0)+o|0,r[i>>2]=o,s=a-l|0,(0|l)<0?(o=o-l|0,r[n>>2]=s,r[i>>2]=o,r[t>>2]=0,l=0):s=a,(0|s)<0&&(l=l-s|0,r[t>>2]=l,o=o-s|0,r[i>>2]=o,r[n>>2]=0,s=0),e=l-o|0,a=s-o|0,(0|o)<0?(r[t>>2]=e,r[n>>2]=a,r[i>>2]=0,l=e,o=0):a=s,(0|(s=(0|o)<(0|(s=(0|a)<(0|l)?a:l))?o:s))<=0||(r[t>>2]=l-s,r[n>>2]=a-s,r[i>>2]=o-s)}function ht(t,e){t|=0;var n,i,o,s=0,a=0,l=0;((e|=0)+-1|0)>>>0>=6||(l=(0|r[15440+(12*e|0)>>2])+(0|r[t>>2])|0,r[t>>2]=l,o=t+4|0,a=(0|r[15440+(12*e|0)+4>>2])+(0|r[o>>2])|0,r[o>>2]=a,i=t+8|0,e=(0|r[15440+(12*e|0)+8>>2])+(0|r[i>>2])|0,r[i>>2]=e,s=a-l|0,(0|l)<0?(e=e-l|0,r[o>>2]=s,r[i>>2]=e,r[t>>2]=0,a=0):(s=a,a=l),(0|s)<0&&(a=a-s|0,r[t>>2]=a,e=e-s|0,r[i>>2]=e,r[o>>2]=0,s=0),n=a-e|0,l=s-e|0,(0|e)<0?(r[t>>2]=n,r[o>>2]=l,r[i>>2]=0,a=n,e=0):l=s,(0|(s=(0|e)<(0|(s=(0|l)<(0|a)?l:a))?e:s))<=0||(r[t>>2]=a-s,r[o>>2]=l-s,r[i>>2]=e-s))}function dt(t){var e,n,i,o=0,s=0,a=0,l=0;l=0|r[(t|=0)>>2],a=(o=0|r[(n=t+4|0)>>2])+l|0,l=(s=0|r[(i=t+8|0)>>2])+l|0,r[t>>2]=l,r[n>>2]=a,o=s+o|0,r[i>>2]=o,s=a-l|0,(0|l)<0?(o=o-l|0,r[n>>2]=s,r[i>>2]=o,r[t>>2]=0,a=0):(s=a,a=l),(0|s)<0&&(a=a-s|0,r[t>>2]=a,o=o-s|0,r[i>>2]=o,r[n>>2]=0,s=0),e=a-o|0,l=s-o|0,(0|o)<0?(r[t>>2]=e,r[n>>2]=l,r[i>>2]=0,a=e,o=0):l=s,(0|(s=(0|o)<(0|(s=(0|l)<(0|a)?l:a))?o:s))<=0||(r[t>>2]=a-s,r[n>>2]=l-s,r[i>>2]=o-s)}function pt(t){var e,n,i,o=0,s=0,a=0,l=0;o=0|r[(t|=0)>>2],a=0|r[(n=t+4|0)>>2],s=0|r[(i=t+8|0)>>2],l=a+o|0,r[t>>2]=l,a=s+a|0,r[n>>2]=a,o=s+o|0,r[i>>2]=o,s=a-l|0,(0|l)<0?(o=o-l|0,r[n>>2]=s,r[i>>2]=o,r[t>>2]=0,a=0):(s=a,a=l),(0|s)<0&&(a=a-s|0,r[t>>2]=a,o=o-s|0,r[i>>2]=o,r[n>>2]=0,s=0),e=a-o|0,l=s-o|0,(0|o)<0?(r[t>>2]=e,r[n>>2]=l,r[i>>2]=0,a=e,o=0):l=s,(0|(s=(0|o)<(0|(s=(0|l)<(0|a)?l:a))?o:s))<=0||(r[t>>2]=a-s,r[n>>2]=l-s,r[i>>2]=o-s)}function ft(t){switch(0|(t|=0)){case 1:t=5;break;case 5:t=4;break;case 4:t=6;break;case 6:t=2;break;case 2:t=3;break;case 3:t=1}return 0|t}function At(t){switch(0|(t|=0)){case 1:t=3;break;case 3:t=2;break;case 2:t=6;break;case 6:t=4;break;case 4:t=5;break;case 5:t=1}return 0|t}function gt(t){var e,n,i,o=0,s=0,a=0,l=0;o=0|r[(t|=0)>>2],s=0|r[(n=t+4|0)>>2],a=0|r[(i=t+8|0)>>2],l=s+(o<<1)|0,r[t>>2]=l,s=a+(s<<1)|0,r[n>>2]=s,o=(a<<1)+o|0,r[i>>2]=o,a=s-l|0,(0|l)<0?(o=o-l|0,r[n>>2]=a,r[i>>2]=o,r[t>>2]=0,s=a,a=0):a=l,(0|s)<0&&(a=a-s|0,r[t>>2]=a,o=o-s|0,r[i>>2]=o,r[n>>2]=0,s=0),e=a-o|0,l=s-o|0,(0|o)<0?(r[t>>2]=e,r[n>>2]=l,r[i>>2]=0,a=e,o=0):l=s,(0|(s=(0|o)<(0|(s=(0|l)<(0|a)?l:a))?o:s))<=0||(r[t>>2]=a-s,r[n>>2]=l-s,r[i>>2]=o-s)}function mt(t){var e,n,i,o=0,s=0,a=0,l=0;l=0|r[(t|=0)>>2],a=((o=0|r[(n=t+4|0)>>2])<<1)+l|0,l=(s=0|r[(i=t+8|0)>>2])+(l<<1)|0,r[t>>2]=l,r[n>>2]=a,o=(s<<1)+o|0,r[i>>2]=o,s=a-l|0,(0|l)<0?(o=o-l|0,r[n>>2]=s,r[i>>2]=o,r[t>>2]=0,l=0):s=a,(0|s)<0&&(l=l-s|0,r[t>>2]=l,o=o-s|0,r[i>>2]=o,r[n>>2]=0,s=0),e=l-o|0,a=s-o|0,(0|o)<0?(r[t>>2]=e,r[n>>2]=a,r[i>>2]=0,l=e,o=0):a=s,(0|(s=(0|o)<(0|(s=(0|a)<(0|l)?a:l))?o:s))<=0||(r[t>>2]=l-s,r[n>>2]=a-s,r[i>>2]=o-s)}function yt(t,e){e|=0;var n,i,o,s=0,a=0,l=0;return o=(0|(i=(0|r[(t|=0)>>2])-(0|r[e>>2])|0))<0,n=(0|(a=(0|r[t+4>>2])-(0|r[e+4>>2])-(o?i:0)|0))<0,e=(e=(t=(0|(l=(o?0-i|0:0)+(0|r[t+8>>2])-(0|r[e+8>>2])+(n?0-a|0:0)|0))<0)?0:l)-((a=(0|(t=(0|e)<(0|(t=(0|(s=(n?0:a)-(t?l:0)|0))<(0|(l=(o?0:i)-(n?a:0)-(t?l:0)|0))?s:l))?e:t))>0)?t:0)|0,s=s-(a?t:0)|0,0|((0|(t=(0|(t=l-(a?t:0)|0))>-1?t:0-t|0))>(0|(e=(0|(s=(0|s)>-1?s:0-s|0))>(0|(e=(0|e)>-1?e:0-e|0))?s:e))?t:e)}function _t(t,e){e|=0;var n;n=0|r[(t|=0)+8>>2],r[e>>2]=(0|r[t>>2])-n,r[e+4>>2]=(0|r[t+4>>2])-n}function vt(t,e){e|=0;var n,i,o,s=0,a=0,l=0;a=0|r[(t|=0)>>2],r[e>>2]=a,l=0|r[t+4>>2],r[(i=e+4|0)>>2]=l,r[(o=e+8|0)>>2]=0,t=(s=(0|l)<(0|a))?a:l,s=s?l:a;do{if((0|s)<0){if((0|t)>0){if((-2147483648|t
vendor: 30,960 bytes, line 2
2)<(0|s)&-2147483648!=(0|s)&(2147483647-t|0)>=(0|s))break;return 0|(t=1)}if(-2147483648==(0|s)|(-2147483648-t|0)>(0|s))return 0|(e=1);if((0|t)>-1){if((-2147483648|t)<(0|s))break;return 0|(t=1)}if(!((-2147483648^t)<(0|s)))break;return 0|(t=1)}}while(0);return t=l-a|0,(0|a)<0?(s=0-a|0,r[i>>2]=t,r[o>>2]=s,r[e>>2]=0,a=0):(t=l,s=0),(0|t)<0&&(a=a-t|0,r[e>>2]=a,s=s-t|0,r[o>>2]=s,r[i>>2]=0,t=0),n=a-s|0,l=t-s|0,(0|s)<0?(r[e>>2]=n,r[i>>2]=l,r[o>>2]=0,t=l,l=n,s=0):l=a,(0|(a=(0|s)<(0|(a=(0|t)<(0|l)?t:l))?s:a))<=0||(r[e>>2]=l-a,r[i>>2]=t-a,r[o>>2]=s-a),0|(e=0)}function bt(t){var e,n,i,o;n=(o=0|r[(e=(t|=0)+8|0)>>2])-(0|r[t>>2])|0,r[t>>2]=n,t=(0|r[(i=t+4|0)>>2])-o|0,r[i>>2]=t,r[e>>2]=0-(t+n)}function xt(t){var e,n,i=0,o=0,s=0,a=0,l=0;i=0-(o=0|r[(t|=0)>>2])|0,r[t>>2]=i,r[(e=t+8|0)>>2]=0,a=(s=0|r[(n=t+4|0)>>2])+o|0,(0|o)>0?(r[n>>2]=a,r[e>>2]=o,r[t>>2]=0,i=0,s=a):o=0,(0|s)<0?(l=i-s|0,r[t>>2]=l,o=o-s|0,r[e>>2]=o,r[n>>2]=0,a=l-o|0,i=0-o|0,(0|o)<0?(r[t>>2]=a,r[n>>2]=i,r[e>>2]=0,s=i,o=0):(s=0,a=l)):a=i,(0|(i=(0|o)<(0|(i=(0|s)<(0|a)?s:a))?o:i))<=0||(r[t>>2]=a-i,r[n>>2]=s-i,r[e>>2]=o-i)}function wt(t,e,n){n|=0;var i,o,s=0,a=0;return o=R,R=R+16|0,i=o,a=-2130706433&(e|=0)|134217728,!0&268435456==(2013265920&e)?(s=0|Ge(0|(t|=0),0|e,56),C(),s=0|function(t,e,n){t|=0,e|=0,n|=0;var i=0,o=0,s=0;if(s=R,R=R+16|0,o=s,i=0|Ft(t,e),(n+-1|0)>>>0>5)return R=s,0|(o=-1);if(i=0!=(0|i),1==(0|n)&i)return R=s,0|(o=-1);do{if(!(0|_e(t,e,o))){if(i){i=(5+(0|r[21936+(n<<2)>>2])-(0|r[o>>2])|0)%5|0;break}i=(6+(0|r[21968+(n<<2)>>2])-(0|r[o>>2])|0)%6|0;break}i=-1}while(0);return o=i,R=s,0|o}(t,a,7&s),-1==(0|s)?(r[n>>2]=0,R=o,0|(a=6)):(0|qt(t,a,i)&&T(23313,22484,282,22499),e=0|Ge(0|t,0|e,52),C(),e&=15,0|Ft(t,a)?St(i,e,s,2,n):Bt(i,e,s,2,n),R=o,0|(a=0))):(R=o,0|(a=6))}function Et(t,e,n,i){e|=0,i|=0;var s,a=0,l=0,c=0,u=0;if(s=R,R=R+16|0,function(t,e,n){t|=0,e|=0,n|=0;var i=0,s=0,a=0;a=R,R=R+32|0,s=a,function(t,e){t|=0,e|=0;var n=0,i=0,r=0;n=+o[t>>3],i=+d(+n),n=+p(+n),o[e+16>>3]=n,n=+o[t+8>>3],r=i*+d(+n),o[e>>3]=r,n=i*+p(+n),o[e+8>>3]=n}(t,s),r[e>>2]=0,o[n>>3]=5,i=+ye(16400,s),i<+o[n>>3]&&(r[e>>2]=0,o[n>>3]=i);i=+ye(16424,s),i<+o[n>>3]&&(r[e>>2]=1,o[n>>3]=i);i=+ye(16448,s),i<+o[n>>3]&&(r[e>>2]=2,o[n>>3]=i);i=+ye(16472,s),i<+o[n>>3]&&(r[e>>2]=3,o[n>>3]=i);i=+ye(16496,s),i<+o[n>>3]&&(r[e>>2]=4,o[n>>3]=i);i=+ye(16520,s),i<+o[n>>3]&&(r[e>>2]=5,o[n>>3]=i);i=+ye(16544,s),i<+o[n>>3]&&(r[e>>2]=6,o[n>>3]=i);i=+ye(16568,s),i<+o[n>>3]&&(r[e>>2]=7,o[n>>3]=i);i=+ye(16592,s),i<+o[n>>3]&&(r[e>>2]=8,o[n>>3]=i);i=+ye(16616,s),i<+o[n>>3]&&(r[e>>2]=9,o[n>>3]=i);i=+ye(16640,s),i<+o[n>>3]&&(r[e>>2]=10,o[n>>3]=i);i=+ye(16664,s),i<+o[n>>3]&&(r[e>>2]=11,o[n>>3]=i);i=+ye(16688,s),i<+o[n>>3]&&(r[e>>2]=12,o[n>>3]=i);i=+ye(16712,s),i<+o[n>>3]&&(r[e>>2]=13,o[n>>3]=i);i=+ye(16736,s),i<+o[n>>3]&&(r[e>>2]=14,o[n>>3]=i);i=+ye(16760,s),i<+o[n>>3]&&(r[e>>2]=15,o[n>>3]=i);i=+ye(16784,s),i<+o[n>>3]&&(r[e>>2]=16,o[n>>3]=i);i=+ye(16808,s),i<+o[n>>3]&&(r[e>>2]=17,o[n>>3]=i);i=+ye(16832,s),i<+o[n>>3]&&(r[e>>2]=18,o[n>>3]=i);if(i=+ye(16856,s),!(i<+o[n>>3]))return void(R=a);r[e>>2]=19,o[n>>3]=i,R=a}(t|=0,n|=0,u=s),(l=+A(+(1-.5*+o[u>>3])))<1e-16)return r[i>>2]=0,r[i+4>>2]=0,r[i+8>>2]=0,r[i+12>>2]=0,void(R=s);if(u=0|r[n>>2],a=+Yt((a=+o[15920+(24*u|0)>>3])-+Yt(+function(t,e){t|=0,e|=0;var n=0,i=0,r=0,s=0,a=0;return s=+o[e>>3],i=+d(+s),r=+o[e+8>>3]-+o[t+8>>3],a=i*+p(+r),n=+o[t>>3],+ +y(+a,+(+p(+s)*+d(+n)-+d(+r)*(i*+p(+n))))}(15600+(u<<4)|0,t))),c=0|jt(e)?+Yt(a+-.3334731722518321):a,a=+f(+l)/.381966011250105,(0|e)>0){t=0;do{a*=2.6457513110645907,t=t+1|0}while((0|t)!=(0|e))}l=+d(+c)*a,o[i>>3]=l,c=+p(+c)*a,o[i+8>>3]=c,R=s}function Ct(t,e,n,i,s){e|=0,n|=0,i|=0,s|=0;var a=0,l=0;if(a=+function(t){t|=0;var e=0,n=0;return n=+o[t>>3],e=+o[t+8>>3],+ +u(+(n*n+e*e))}(t|=0),a<1e-16)return e=15600+(e<<4)|0,r[s>>2]=r[e>>2],r[s+4>>2]=r[e+4>>2],r[s+8>>2]=r[e+8>>2],void(r[s+12>>2]=r[e+12>>2]);if(l=+y(+ +o[t+8>>3],+ +o[t>>3]),(0|n)>0){t=0;do{a/=2.6457513110645907,t=t+1|0}while((0|t)!=(0|n))}i?(a/=3,n=0==(0|jt(n)),a=+m(.381966011250105*(n?a:a/2.6457513110645907))):(a=+m(.381966011250105*a),0|jt(n)&&(l=+Yt(l+.3334731722518321))),function(t,e,n,i){t|=0,e=+e,n=+n,i|=0;var s=0,a=0,l=0,u=0;if(n<1e-16)return r[i>>2]=r[t>>2],r[i+4>>2]=r[t+4>>2],r[i+8>>2]=r[t+8>>2],void(r[i+12>>2]=r[t+12>>2]);a=e<0?e+6.283185307179586:e,a=e>=6.283185307179586?a+-6.283185307179586:a;do{if(!(a<1e-16)){if(s=+c(+(a+-3.141592653589793))<1e-16,e=+o[t>>3],s){e-=n,o[i>>3]=e,s=i;break}if(l=+d(+n),n=+p(+n),e=l*+p(+e)+ +d(+a)*(n*+d(+e)),e=+g(+((e=e>1?1:e)<-1?-1:e)),o[i>>3]=e,+c(+(e+-1.5707963267948966))<1e-16)return o[i>>3]=1.5707963267948966,void(o[i+8>>3]=0);if(+c(+(e+1.5707963267948966))<1e-16)return o[i>>3]=-1.5707963267948966,void(o[i+8>>3]=0);if(u=+d(+e),a=n*+p(+a)/u,n=+o[t>>3],e=(l-+p(+e)*+p(+n))/+d(+n)/u,l=a>1?1:a,e=e>1?1:e,(e=+o[t+8>>3]+ +y(+(l<-1?-1:l),+(e<-1?-1:e)))>3.141592653589793)do{e+=-6.283185307179586}while(e>3.141592653589793);if(e<-3.141592653589793)do{e+=6.283185307179586}while(e<-3.141592653589793);return void(o[i+8>>3]=e)}e=+o[t>>3]+n,o[i>>3]=e,s=i}while(0);if(+c(+(e+-1.5707963267948966))<1e-16)return o[s>>3]=1.5707963267948966,void(o[i+8>>3]=0);if(+c(+(e+1.5707963267948966))<1e-16)return o[s>>3]=-1.5707963267948966,void(o[i+8>>3]=0);if(e=+o[t+8>>3],e>3.141592653589793)do{e+=-6.283185307179586}while(e>3.141592653589793);if(e<-3.141592653589793)do{e+=6.283185307179586}while(e<-3.141592653589793);o[i+8>>3]=e}(15600+(e<<4)|0,+Yt(+o[15920+(24*e|0)>>3]-l),a,s)}function Tt(t,e,n){e|=0,n|=0;var i,o;i=R,R=R+16|0,tt((t|=0)+4|0,o=i),Ct(o,0|r[t>>2],e,0,n),R=i}function St(t,e,n,i,s){t|=0,e|=0,n|=0,i|=0,s|=0;var a,l,c,u,h,d,p,f,A,g,m,y,_,v,b,x,w,E,C,S,P,M,I=0,B=0,L=0,O=0,D=0,k=0;if(M=R,R=R+272|0,O=M+240|0,C=M,S=M+224|0,P=M+208|0,m=M+176|0,y=M+160|0,_=M+192|0,v=M+144|0,b=M+128|0,x=M+112|0,w=M+96|0,E=M+80|0,r[(I=M+256|0)>>2]=e,r[O>>2]=r[t>>2],r[O+4>>2]=r[t+4>>2],r[O+8>>2]=r[t+8>>2],r[O+12>>2]=r[t+12>>2],Pt(O,I,C),r[s>>2]=0,(0|(O=i+n+(5==(0|i)&1)|0))<=(0|n))R=M;else{l=S+4|0,c=m+4|0,u=n+5|0,h=16880+((a=0|r[I>>2])<<2)|0,d=16960+(a<<2)|0,p=b+8|0,f=x+8|0,A=w+8|0,g=P+4|0,L=n;t:for(;;){B=C+((0|L)%5<<4)|0,r[P>>2]=r[B>>2],r[P+4>>2]=r[B+4>>2],r[P+8>>2]=r[B+8>>2],r[P+12>>2]=r[B+12>>2];do{}while(2==(0|Mt(P,a,0,1)));if((0|L)>(0|n)&0!=(0|jt(e))){if(r[m>>2]=r[P>>2],r[m+4>>2]=r[P+4>>2],r[m+8>>2]=r[P+8>>2],r[m+12>>2]=r[P+12>>2],tt(l,y),i=0|r[m>>2],I=0|r[17040+(80*i|0)+(r[S>>2]<<2)>>2],r[m>>2]=r[18640+(80*i|0)+(20*I|0)>>2],(0|(B=0|r[18640+(80*i|0)+(20*I|0)+16>>2]))>0){t=0;do{dt(c),t=t+1|0}while((0|t)<(0|B))}switch(B=18640+(80*i|0)+(20*I|0)+4|0,r[_>>2]=r[B>>2],r[_+4>>2]=r[B+4>>2],r[_+8>>2]=r[B+8>>2],it(_,3*(0|r[h>>2])|0),et(c,_,c),$(c),tt(c,v),D=+(0|r[d>>2]),o[b>>3]=3*D,o[p>>3]=0,k=-1.5*D,o[x>>3]=k,o[f>>3]=2.598076211353316*D,o[w>>3]=k,o[A>>3]=-2.598076211353316*D,0|r[17040+(80*(0|r[m>>2])|0)+(r[P>>2]<<2)>>2]){case 1:t=x,i=b;break;case 3:t=w,i=x;break;case 2:t=b,i=w;break;default:t=12;break t}ge(y,v,i,t,E),Ct(E,0|r[m>>2],a,1,s+8+(r[s>>2]<<4)|0),r[s>>2]=1+(0|r[s>>2])}if((0|L)<(0|u)&&(tt(g,m),Ct(m,0|r[P>>2],a,1,s+8+(r[s>>2]<<4)|0),r[s>>2]=1+(0|r[s>>2])),r[S>>2]=r[P>>2],r[S+4>>2]=r[P+4>>2],r[S+8>>2]=r[P+8>>2],r[S+12>>2]=r[P+12>>2],(0|(L=L+1|0))>=(0|O)){t=3;break}}3!=(0|t)?12==(0|t)&&T(22522,22569,571,22579):R=M}}function Pt(t,e,n){t|=0,e|=0,n|=0;var i,o=0,s=0,a=0,l=0,c=0;i=R,R=R+128|0,s=i,l=20240,c=(a=o=i+64|0)+60|0;do{r[a>>2]=r[l>>2],a=a+4|0,l=l+4|0}while((0|a)<(0|c));l=20304,c=(a=s)+60|0;do{r[a>>2]=r[l>>2],a=a+4|0,l=l+4|0}while((0|a)<(0|c));o=(c=0==(0|jt(0|r[e>>2])))?o:s,gt(s=t+4|0),mt(s),0|jt(0|r[e>>2])&&(ut(s),r[e>>2]=1+(0|r[e>>2])),r[n>>2]=r[t>>2],et(s,o,e=n+4|0),$(e),r[n+16>>2]=r[t>>2],et(s,o+12|0,e=n+20|0),$(e),r[n+32>>2]=r[t>>2],et(s,o+24|0,e=n+36|0),$(e),r[n+48>>2]=r[t>>2],et(s,o+36|0,e=n+52|0),$(e),r[n+64>>2]=r[t>>2],et(s,o+48|0,n=n+68|0),$(n),R=i}function Mt(t,e,n,i){n|=0,i|=0;var o,s,a,l,c,u,h=0,d=0,p=0,f=0,A=0;if(u=R,R=R+32|0,c=u+12|0,s=u,A=(t|=0)+4|0,f=0|r[16960+((e|=0)<<2)>>2],f=(l=0!=(0|i))?3*f|0:f,h=0|r[A>>2],o=0|r[(a=t+8|0)>>2],l){if((0|(h=o+h+(i=0|r[(d=t+12|0)>>2])|0))==(0|f))return R=u,0|(A=1);p=d}else h=o+h+(i=0|r[(p=t+12|0)>>2])|0;if((0|h)<=(0|f))return R=u,0|(A=0);do{if((0|i)>0){if(i=0|r[t>>2],(0|o)>0){d=18640+(80*i|0)+60|0,i=t;break}i=18640+(80*i|0)+40|0,n?(J(c,f,0,0),nt(A,c,s),pt(s),et(s,c,A),d=i,i=t):(d=i,i=t)}else d=18640+(80*(0|r[t>>2])|0)+20|0,i=t}while(0);if(r[i>>2]=r[d>>2],(0|r[(h=d+16|0)>>2])>0){i=0;do{dt(A),i=i+1|0}while((0|i)<(0|r[h>>2]))}return t=d+4|0,r[c>>2]=r[t>>2],r[c+4>>2]=r[t+4>>2],r[c+8>>2]=r[t+8>>2],e=0|r[16880+(e<<2)>>2],it(c,l?3*e|0:e),et(A,c,A),$(A),i=l&&((0|r[a>>2])+(0|r[A>>2])+(0|r[p>>2])|0)==(0|f)?1:2,R=u,0|(A=i)}function It(t,e){t|=0,e|=0;var n=0;do{n=0|Mt(t,e,0,1)}while(2==(0|n));return 0|n}function Bt(t,e,n,i,s){t|=0,e|=0,n|=0,i|=0,s|=0;var a,l,c,u,h,d,p,f,A,g,m,y,_,v,b,x,w,E,C=0,S=0,P=0,M=0,I=0;if(E=R,R=R+240|0,v=E+208|0,b=E,x=E+192|0,w=E+176|0,A=E+160|0,g=E+144|0,m=E+128|0,y=E+112|0,_=E+96|0,r[(C=E+224|0)>>2]=e,r[v>>2]=r[t>>2],r[v+4>>2]=r[t+4>>2],r[v+8>>2]=r[t+8>>2],r[v+12>>2]=r[t+12>>2],Rt(v,C,b),r[s>>2]=0,(0|(f=i+n+(6==(0|i)&1)|0))<=(0|n))R=E;else{l=n+6|0,c=16960+((a=0|r[C>>2])<<2)|0,u=g+8|0,h=m+8|0,d=y+8|0,p=x+4|0,S=0,P=n,i=-1;t:for(;;){if(t=b+((C=(0|P)%6|0)<<4)|0,r[x>>2]=r[t>>2],r[x+4>>2]=r[t+4>>2],r[x+8>>2]=r[t+8>>2],r[x+12>>2]=r[t+12>>2],t=S,S=0|Mt(x,a,0,1),(0|P)>(0|n)&0!=(0|jt(e))&&(1!=(0|t)&&(0|r[x>>2])!=(0|i))){switch(tt(b+((C+5|0)%6<<4)+4|0,w),tt(b+(C<<4)+4|0,A),M=+(0|r[c>>2]),o[g>>3]=3*M,o[u>>3]=0,I=-1.5*M,o[m>>3]=I,o[h>>3]=2.598076211353316*M,o[y>>3]=I,o[d>>3]=-2.598076211353316*M,C=0|r[v>>2],0|r[17040+(80*C|0)+(((0|i)==(0|C)?r[x>>2]:i)<<2)>>2]){case 1:t=m,i=g;break;case 3:t=y,i=m;break;case 2:t=g,i=y;break;default:t=8;break t}ge(w,A,i,t,_),0|me(w,_)||0|me(A,_)||(Ct(_,0|r[v>>2],a,1,s+8+(r[s>>2]<<4)|0),r[s>>2]=1+(0|r[s>>2]))}if((0|P)<(0|l)&&(tt(p,w),Ct(w,0|r[x>>2],a,1,s+8+(r[s>>2]<<4)|0),r[s>>2]=1+(0|r[s>>2])),(0|(P=P+1|0))>=(0|f)){t=3;break}i=0|r[x>>2]}3!=(0|t)?8==(0|t)&&T(22606,22569,736,22651):R=E}}function Rt(t,e,n){t|=0,e|=0,n|=0;var i,o=0,s=0,a=0,l=0,c=0;i=R,R=R+160|0,s=i,l=20368,c=(a=o=i+80|0)+72|0;do{r[a>>2]=r[l>>2],a=a+4|0,l=l+4|0}while((0|a)<(0|c));l=20448,c=(a=s)+72|0;do{r[a>>2]=r[l>>2],a=a+4|0,l=l+4|0}while((0|a)<(0|c));o=(c=0==(0|jt(0|r[e>>2])))?o:s,gt(s=t+4|0),mt(s),0|jt(0|r[e>>2])&&(ut(s),r[e>>2]=1+(0|r[e>>2])),r[n>>2]=r[t>>2],et(s,o,e=n+4|0),$(e),r[n+16>>2]=r[t>>2],et(s,o+12|0,e=n+20|0),$(e),r[n+32>>2]=r[t>>2],et(s,o+24|0,e=n+36|0),$(e),r[n+48>>2]=r[t>>2],et(s,o+36|0,e=n+52|0),$(e),r[n+64>>2]=r[t>>2],et(s,o+48|0,e=n+68|0),$(e),r[n+80>>2]=r[t>>2],et(s,o+60|0,n=n+84|0),$(n),R=i}function Lt(t,e){return e=0|Ge(0|(t|=0),0|(e|=0),45),C(),127&e}function Ot(t,e){var n=0,i=0,r=0,o=0,s=0,a=0;if(!(!0&134217728==(-16777216&(e|=0))))return 0|(e=0);if(s=0|Ge(0|(t|=0),0|e,45),C(),(s&=127)>>>0>121)return 0|(e=0);n=0|Ge(0|t,0|e,52),C(),n&=15;do{if(0|n){for(r=1,i=0;;){if(o=0|Ge(0|t,0|e,3*(15-r|0)|0),C(),0!=(0|(o&=7))&(1^i)){if(1==(0|o)&0!=(0|U(s))){a=0,i=13;break}i=1}if(7==(0|o)){a=0,i=13;break}if(!(r>>>0<n>>>0)){i=9;break}r=r+1|0}if(9==(0|i)){if(15!=(0|n))break;return 0|(a=1)}if(13==(0|i))return 0|a}}while(0);for(;;){if(a=0|Ge(0|t,0|e,3*(14-n|0)|0),C(),!(7==(7&a)&!0)){a=0,i=13;break}if(!(n>>>0<14)){a=1,i=13;break}n=n+1|0}return 13==(0|i)?0|a:0}function Dt(t,e,n,i){n|=0,i|=0;var o=0,s=0;if(s=0|Ge(0|(t|=0),0|(e|=0),52),C(),n>>>0>15)return 0|(i=4);if((0|(s&=15))<(0|n))return 0|(i=12);if((0|s)==(0|n))return r[i>>2]=t,r[i+4>>2]=e,0|(i=0);if(o=0|Ve(0|n,0,52),o|=t,t=C()|-15728641&e,(0|s)>(0|n))do{e=0|Ve(7,0,3*(14-n|0)|0),n=n+1|0,o|=e,t=C()|t}while((0|n)<(0|s));return r[i>>2]=o,r[i+4>>2]=t,0|(i=0)}function kt(t,e,n,i){n|=0,i|=0;var o=0,s=0,a=0;if(s=0|Ge(0|(t|=0),0|(e|=0),52),C(),!((0|n)<16&(0|(s&=15))<=(0|n)))return 0|(i=4);o=n-s|0,n=0|Ge(0|t,0|e,45),C();t:do{if(0|U(127&n)){e:do{if(0|s){for(n=1;0==((a=0|Ve(7,0,3*(15-n|0)|0))&t)&0==(C()&e);){if(!(n>>>0<s>>>0))break e;n=n+1|0}n=0|he(7,0,o,((0|o)<0)<<31>>31),o=0|C();break t}}while(0);n=0|Re(0|(n=0|Fe(0|(n=0|he(7,0,o,((0|o)<0)<<31>>31)),0|C(),5,0)),0|C(),-5,-1),n=0|Re(0|(n=0|ke(0|n,0|C(),6,0)),0|C(),1,0),o=0|C()}else n=0|he(7,0,o,((0|o)<0)<<31>>31),o=0|C()}while(0);return r[(a=i)>>2]=n,r[a+4>>2]=o,0|(a=0)}function Ft(t,e){var n=0,i=0,r=0;if(r=0|Ge(0|(t|=0),0|(e|=0),45),C(),!(0|U(127&r)))return 0|(r=0);r=0|Ge(0|t,0|e,52),C(),r&=15;t:do{if(r)for(i=1;;){if(n=0|Ge(0|t,0|e,3*(15-i|0)|0),C(),0|(n&=7))break t;if(!(i>>>0<r>>>0)){n=0;break}i=i+1|0}else n=0}while(0);return 0|(r=0==(0|n)&1)}function Nt(t,e){var n=0,i=0,r=0;if(r=0|Ge(0|(t|=0),0|(e|=0),52),C(),!(r&=15))return 0|(r=0);for(i=1;;){if(n=0|Ge(0|t,0|e,3*(15-i|0)|0),C(),0|(n&=7)){i=5;break}if(!(i>>>0<r>>>0)){n=0,i=5;break}i=i+1|0}return 5==(0|i)?0|n:0}function zt(t,e){var n=0,i=0,r=0,o=0,s=0,a=0,l=0;if(l=0|Ge(0|(t|=0),0|(e|=0),52),C(),!(l&=15))return l=t,E(0|(a=e)),0|l;for(a=1,n=0;;){i=0|Ve(7,0,0|(o=3*(15-a|0)|0)),r=0|C(),s=0|Ge(0|t,0|e,0|o),C(),t=(o=0|Ve(0|ft(7&s),0,0|o))|t&~i,e=(s=0|C())|e&~r;t:do{if(!n)if(0==(o&i)&0==(s&r))n=0;else if(i=0|Ge(0|t,0|e,52),C(),i&=15){n=1;e:for(;;){switch(s=0|Ge(0|t,0|e,3*(15-n|0)|0),C(),7&s){case 1:break e;case 0:break;default:n=1;break t}if(!(n>>>0<i>>>0)){n=1;break t}n=n+1|0}for(n=1;;){if(r=0|Ge(0|t,0|e,0|(s=3*(15-n|0)|0)),C(),o=0|Ve(7,0,0|s),e&=~C(),t=t&~o|(s=0|Ve(0|ft(7&r),0,0|s)),e|=C(),!(n>>>0<i>>>0)){n=1;break}n=n+1|0}}else n=1}while(0);if(!(a>>>0<l>>>0))break;a=a+1|0}return E(0|e),0|t}function Ut(t,e){var n=0,i=0,r=0,o=0,s=0;if(i=0|Ge(0|(t|=0),0|(e|=0),52),C(),!(i&=15))return i=t,E(0|(n=e)),0|i;for(n=1;s=0|Ge(0|t,0|e,0|(o=3*(15-n|0)|0)),C(),r=0|Ve(7,0,0|o),e&=~C(),t=(o=0|Ve(0|ft(7&s),0,0|o))|t&~r,e=C()|e,n>>>0<i>>>0;)n=n+1|0;return E(0|e),0|t}function Gt(t,e){var n=0,i=0,r=0,o=0,s=0,a=0,l=0;if(l=0|Ge(0|(t|=0),0|(e|=0),52),C(),!(l&=15))return l=t,E(0|(a=e)),0|l;for(a=1,n=0;;){i=0|Ve(7,0,0|(o=3*(15-a|0)|0)),r=0|C(),s=0|Ge(0|t,0|e,0|o),C(),t=(o=0|Ve(0|At(7&s),0,0|o))|t&~i,e=(s=0|C())|e&~r;t:do{if(!n)if(0==(o&i)&0==(s&r))n=0;else if(i=0|Ge(0|t,0|e,52),C(),i&=15){n=1;e:for(;;){switch(s=0|Ge(0|t,0|e,3*(15-n|0)|0),C(),7&s){case 1:break e;case 0:break;default:n=1;break t}if(!(n>>>0<i>>>0)){n=1;break t}n=n+1|0}for(n=1;;){if(o=0|Ve(7,0,0|(r=3*(15-n|0)|0)),s=e&~C(),e=0|Ge(0|t,0|e,0|r),C(),t=t&~o|(e=0|Ve(0|At(7&e),0,0|r)),e=s|C(),!(n>>>0<i>>>0)){n=1;break}n=n+1|0}}else n=1}while(0);if(!(a>>>0<l>>>0))break;a=a+1|0}return E(0|e),0|t}function Vt(t,e){var n=0,i=0,r=0,o=0,s=0;if(i=0|Ge(0|(t|=0),0|(e|=0),52),C(),!(i&=15))return i=t,E(0|(n=e)),0|i;for(n=1;o=0|Ve(7,0,0|(s=3*(15-n|0)|0)),r=e&~C(),e=0|Ge(0|t,0|e,0|s),C(),t=(e=0|Ve(0|At(7&e),0,0|s))|t&~o,e=C()|r,n>>>0<i>>>0;)n=n+1|0;return E(0|e),0|t}function jt(t){return(0|(t|=0))%2|0}function Ht(t,e,n){n|=0;var i,o=0;return i=R,R=R+16|0,o=i,(e|=0)>>>0>15?(R=i,0|(o=4)):2146435072==(2146435072&r[(t|=0)+4>>2])||2146435072==(2146435072&r[t+8+4>>2])?(R=i,0|(o=3)):(function(t,e,n){var i,r;i=R,R=R+16|0,Et(t|=0,e|=0,n|=0,r=i),Y(r,n+4|0),R=i}(t,e,o),e=0|function(t,e){t|=0;var n,i=0,o=0,s=0,a=0,l=0,c=0,u=0,h=0;if(n=R,R=R+64|0,c=n+40|0,o=n+24|0,s=n+12|0,a=n,Ve(0|(e|=0),0,52),i=134225919|C(),!e)return(0|r[t+4>>2])>2||(0|r[t+8>>2])>2||(0|r[t+12>>2])>2?(c=0,E(0|(l=0)),R=n,0|c):(Ve(0|V(t),0,45),l=C()|i,c=-1,E(0|l),R=n,0|c);if(r[c>>2]=r[t>>2],r[c+4>>2]=r[t+4>>2],r[c+8>>2]=r[t+8>>2],r[c+12>>2]=r[t+12>>2],l=c+4|0,(0|e)>0)for(t=-1;r[o>>2]=r[l>>2],r[o+4>>2]=r[l+4>>2],r[o+8>>2]=r[l+8>>2],1&e?(at(l),r[s>>2]=r[l>>2],r[s+4>>2]=r[l+4>>2],r[s+8>>2]=r[l+8>>2],ct(s)):(lt(l),r[s>>2]=r[l>>2],r[s+4>>2]=r[l+4>>2],r[s+8>>2]=r[l+8>>2],ut(s)),nt(o,s,a),$(a),u=0|Ve(7,0,0|(h=3*(15-e|0)|0)),i&=~C(),t=(h=0|Ve(0|rt(a),0,0|h))|t&~u,i=C()|i,(0|e)>1;)e=e+-1|0;else t=-1;t:do{if((0|r[l>>2])<=2&&(0|r[c+8>>2])<=2&&(0|r[c+12>>2])<=2){if(e=0|Ve(0|(o=0|V(c)),0,45),e|=t,t=C()|-1040385&i,a=0|j(c),!(0|U(o))){if((0|a)<=0)break;for(s=0;;){if(o=0|Ge(0|e,0|t,52),C(),o&=15)for(i=1;c=0|Ge(0|e,0|t,0|(h=3*(15-i|0)|0)),C(),u=0|Ve(7,0,0|h),t&=~C(),e=e&~u|(h=0|Ve(0|ft(7&c),0,0|h)),t|=C(),i>>>0<o>>>0;)i=i+1|0;if((0|(s=s+1|0))==(0|a))break t}}s=0|Ge(0|e,0|t,52),C(),s&=15;e:do{if(s){i=1;n:for(;;){switch(h=0|Ge(0|e,0|t,3*(15-i|0)|0),C(),7&h){case 1:break n;case 0:break;default:break e}if(!(i>>>0<s>>>0))break e;i=i+1|0}if(0|H(o,0|r[c>>2]))for(i=1;u=0|Ve(7,0,0|(c=3*(15-i|0)|0)),h=t&~C(),t=0|Ge(0|e,0|t,0|c),C(),e=e&~u|(t=0|Ve(0|At(7&t),0,0|c)),t=h|C(),i>>>0<s>>>0;)i=i+1|0;else for(i=1;c=0|Ge(0|e,0|t,0|(h=3*(15-i|0)|0)),C(),u=0|Ve(7,0,0|h),t&=~C(),e=e&~u|(h=0|Ve(0|ft(7&c),0,0|h)),t|=C(),i>>>0<s>>>0;)i=i+1|0}}while(0);if((0|a)>0){i=0;do{e=0|zt(e,t),t=0|C(),i=i+1|0}while((0|i)!=(0|a))}}else e=0,t=0}while(0);return h=e,E(0|(u=t)),R=n,0|h}(o,e),o=0|C(),r[n>>2]=e,r[n+4>>2]=o,0==(0|e)&0==(0|o)&&T(23313,22674,786,22697),R=i,0|(o=0))}function Wt(t,e,n){var i,o=0,s=0,a=0;if(i=(n|=0)+4|0,s=0|Ge(0|(t|=0),0|(e|=0),52),C(),s&=15,a=0|Ge(0|t,0|e,45),C(),o=0==(0|s),0|U(127&a)){if(o)return 0|(a=1);o=1}else{if(o)return 0|(a=0);o=0==(0|r[i>>2])&&0==(0|r[n+8>>2])?0!=(0|r[n+12>>2])&1:1}for(n=1;1&n?ct(i):ut(i),a=0|Ge(0|t,0|e,3*(15-n|0)|0),C(),ht(i,7&a),n>>>0<s>>>0;)n=n+1|0;return 0|o}function qt(t,e,n){n|=0;var i,o,s=0,a=0,l=0,c=0,u=0,h=0;if(o=R,R=R+16|0,i=o,h=0|Ge(0|(t|=0),0|(e|=0),45),C(),(h&=127)>>>0>121)return r[n>>2]=0,r[n+4>>2]=0,r[n+8>>2]=0,r[n+12>>2]=0,R=o,0|(h=5);t:do{if(0!=(0|U(h))&&(l=0|Ge(0|t,0|e,52),C(),0!=(0|(l&=15)))){s=1;e:for(;;){switch(u=0|Ge(0|t,0|e,3*(15-s|0)|0),C(),7&u){case 5:break e;case 0:break;default:s=e;break t}if(!(s>>>0<l>>>0)){s=e;break t}s=s+1|0}for(a=1,s=e;c=0|Ve(7,0,0|(e=3*(15-a|0)|0)),u=s&~C(),s=0|Ge(0|t,0|s,0|e),C(),t=t&~c|(s=0|Ve(0|At(7&s),0,0|e)),s=u|C(),a>>>0<l>>>0;)a=a+1|0}else s=e}while(0);if(u=7696+(28*h|0)|0,r[n>>2]=r[u>>2],r[n+4>>2]=r[u+4>>2],r[n+8>>2]=r[u+8>>2],r[n+12>>2]=r[u+12>>2],!(0|Wt(t,s,n)))return R=o,0|(h=0);if(c=n+4|0,r[i>>2]=r[c>>2],r[i+4>>2]=r[c+4>>2],r[i+8>>2]=r[c+8>>2],l=0|Ge(0|t,0|s,52),C(),u=15&l,1&l?(ut(c),l=u+1|0):l=u,0|U(h)){t:do{if(u)for(e=1;;){if(a=0|Ge(0|t,0|s,3*(15-e|0)|0),C(),0|(a&=7)){s=a;break t}if(!(e>>>0<u>>>0)){s=0;break}e=e+1|0}else s=0}while(0);s=4==(0|s)&1}else s=0;if(0|Mt(n,l,s,0)){if(0|U(h))do{}while(0!=(0|Mt(n,l,0,0)));(0|l)!=(0|u)&<(c)}else(0|l)!=(0|u)&&(r[c>>2]=r[i>>2],r[c+4>>2]=r[i+4>>2],r[c+8>>2]=r[i+8>>2]);return R=o,0|(h=0)}function Zt(t,e,n){n|=0;var i,r,o=0;return r=R,R=R+16|0,0|(o=0|qt(t|=0,e|=0,i=r))?(R=r,0|o):(o=0|Ge(0|t,0|e,52),C(),Tt(i,15&o,n),R=r,0|(o=0))}function Xt(t,e,n){n|=0;var i,r=0,o=0,s=0;if(i=R,R=R+16|0,0|(r=0|qt(t|=0,e|=0,s=i)))return R=i,0|(s=r);r=0|Ge(0|t,0|e,45),C(),r=0==(0|U(127&r)),o=0|Ge(0|t,0|e,52),C(),o&=15;t:do{if(!r){if(0|o)for(r=1;;){if(!(0==((0|Ve(7,0,3*(15-r|0)|0))&t)&0==(C()&e)))break t;if(!(r>>>0<o>>>0))break;r=r+1|0}return St(s,o,0,5,n),R=i,0|0}}while(0);return Bt(s,o,0,6,n),R=i,0|0}function Kt(t,e){e|=0;var n=0,i=0,o=0,s=0,a=0,l=0,c=0;if((t|=0)>>>0>15)return 0|(l=4);if(Ve(0|t,0,52),l=134225919|C(),!t){n=0,i=0;do{0|U(i)&&(Ve(0|i,0,45),a=l|C(),r[(t=e+(n<<3)|0)>>2]=-1,r[t+4>>2]=a,n=n+1|0),i=i+1|0}while(122!=(0|i));return 0|(n=0)}n=0,a=0;do{if(0|U(a)){for(Ve(0|a,0,45),i=1,o=-1,s=l|C();o&=~(c=0|Ve(7,0,3*(15-i|0)|0)),s&=~C(),(0|i)!=(0|t);)i=i+1|0;r[(c=e+(n<<3)|0)>>2]=o,r[c+4>>2]=s,n=n+1|0}a=a+1|0}while(122!=(0|a));return 0|(n=0)}function Qt(t,e,n,i){t|=0,i|=0;var o=0,s=0;o=0|Ge(0|(e|=0),0|(n|=0),52),C(),0==(0|e)&0==(0|n)|(0|i)>15|(0|(o&=15))>(0|i)?(i=-1,o=-1,e=0,n=0):(s=0|function(t,e,n,i){return t|=0,e|=0,(0|(i|=0))<(0|(n|=0))?(i=t,E(0|(n=e)),0|i):(n=0|Ve(-1,-1,3+(3*(i-n|0)|0)|0),i=0|Ve(0|~n,0|~C(),3*(15-i|0)|0),n=~C()&e,i=~i&t,E(0|n),0|i)}(e,n,o+1|0,i),n=-15728641&C(),e=0|Ve(0|i,0,52),i=(s=0==(0|Ft(e|=s,n|=C())))?-1:i),r[(s=t)>>2]=e,r[s+4>>2]=n,r[t+8>>2]=o,r[t+12>>2]=i}function Jt(t){var e,n=0,i=0,o=0,s=0,a=0,l=0,c=0,u=0;if(!(0==(0|(n=0|r[(i=t|=0)>>2]))&0==(0|(i=0|r[i+4>>2])))&&(o=0|Ge(0|n,0|i,52),C(),n=0|Re(0|(c=0|Ve(1,0,3*(15^(o&=15))|0)),0|C(),0|n,0|i),i=0|C(),r[(c=t)>>2]=n,r[c+4>>2]=i,!((0|o)<(0|(l=0|r[(c=t+8|0)>>2]))))){for(e=t+12|0,a=o;;){if((0|a)==(0|l)){o=5;break}if(u=(0|a)==(0|r[e>>2]),o=0|Ge(0|n,0|i,0|(s=3*(15-a|0)|0)),C(),u&1==(0|(o&=7))&!0){o=7;break}if(!(7==(0|o)&!0)){o=10;break}if(n=0|Re(0|n,0|i,0|(u=0|Ve(1,0,0|s)),0|C()),i=0|C(),r[(u=t)>>2]=n,r[u+4>>2]=i,!((0|a)>(0|l))){o=10;break}a=a+-1|0}if(5==(0|o))return r[(u=t)>>2]=0,r[u+4>>2]=0,r[c>>2]=-1,void(r[e>>2]=-1);if(7==(0|o))return l=0|Re(0|n,0|i,0|(l=0|Ve(1,0,0|s)),0|C()),c=0|C(),r[(u=t)>>2]=l,r[u+4>>2]=c,void(r[e>>2]=a+-1)}}function Yt(t){var e;return e=(t=+t)<0?t+6.283185307179586:t,+(t>=6.283185307179586?e+-6.283185307179586:e)}function $t(t,e){return e|=0,+c(+(+o[(t|=0)>>3]-+o[e>>3]))<17453292519943298e-27?0|(e=+c(+(+o[t+8>>3]-+o[e+8>>3]))<17453292519943298e-27):0|(e=0)}function te(t,e){t|=0;var n,i,r,s=0;return i=+o[(e|=0)>>3],n=+o[t>>3],s=(r=+p(.5*(i-n)))*r+(s=+p(.5*(+o[e+8>>3]-+o[t+8>>3])))*(+d(+i)*+d(+n)*s),2*+y(+ +u(+s),+ +u(+(1-s)))*6371.007180918475}function ee(t,e){e|=0;var n=0;return(t|=0)>>>0>15?0|(e=4):(n=0|Fe(0|(n=0|he(7,0,t,((0|t)<0)<<31>>31)),0|C(),120,0),t=0|C(),r[e>>2]=2|n,r[e+4>>2]=t,0|(e=0))}function ne(t,e,n){t|=0,n|=0;var i,r,s,a,l=0,c=0,h=0,A=0,g=0,_=0;return _=+o[(e|=0)>>3],s=+o[t>>3],g=+p(.5*(_-s)),h=+o[e+8>>3],r=+o[t+8>>3],A=+p(.5*(h-r)),i=+d(+s),a=+d(+_),A=2*+y(+ +u(+(A=g*g+A*(a*i*A))),+ +u(+(1-A))),g=+o[n>>3],_=+p(.5*(g-_)),l=+o[n+8>>3],h=+p(.5*(l-h)),c=+d(+g),h=2*+y(+ +u(+(h=_*_+h*(a*c*h))),+ +u(+(1-h))),g=+p(.5*(s-g)),l=+p(.5*(r-l)),l=2*+y(+ +u(+(l=g*g+l*(i*c*l))),+ +u(+(1-l))),4*+m(+ +u(+ +f(.5*(c=.5*(A+h+l)))*+f(.5*(c-A))*+f(.5*(c-h))*+f(.5*(c-l))))}function ie(t,e,n){n|=0;var i,s,a,l=0,c=0;if(a=R,R=R+192|0,s=a,0|(c=0|Zt(t|=0,e|=0,i=a+168|0)))return R=a,0|(n=c);if(0|Xt(t,e,s)&&T(23313,22742,386,22751),(0|(e=0|r[s>>2]))>0){if(l=+ne(s+8|0,s+8+((1!=(0|e)&1)<<4)|0,i)+0,1!=(0|e)){t=1;do{l+=+ne(s+8+((c=t)<<4)|0,s+8+((0|(t=t+1|0))%(0|e)<<4)|0,i)}while((0|t)<(0|e))}}else l=0;return o[n>>3]=l,R=a,0|(n=0)}function re(t){t|=0;var e,n,i=0;return(e=0|Be(1,12))||T(22832,22787,49,22845),0|(i=0|r[(n=t+4|0)>>2])?(r[(i=i+8|0)>>2]=e,r[n>>2]=e,0|e):(0|r[t>>2]&&T(22862,22787,61,22885),r[(i=t)>>2]=e,r[n>>2]=e,0|e)}function oe(t,e){t|=0,e|=0;var n,i;return(i=0|Me(24))||T(22899,22787,78,22913),r[i>>2]=r[e>>2],r[i+4>>2]=r[e+4>>2],r[i+8>>2]=r[e+8>>2],r[i+12>>2]=r[e+12>>2],r[i+16>>2]=0,0|(n=0|r[(e=t+4|0)>>2])?(r[n+16>>2]=i,r[e>>2]=i,0|i):(0|r[t>>2]&&T(22928,22787,82,22913),r[t>>2]=i,r[e>>2]=i,0|i)}function se(t){var e=0,n=0,i=0,o=0;if(t|=0)for(i=1;;){if(0|(e=0|r[t>>2]))do{if(0|(n=0|r[e>>2]))do{o=n,n=0|r[n+16>>2],Ie(o)}while(0!=(0|n));o=e,e=0|r[e+8>>2],Ie(o)}while(0!=(0|e));if(e=t,t=0|r[t+8>>2],i||Ie(e),!t)break;i=0}}function ae(t){var e,n,i=0,s=0,a=0,l=0,u=0,h=0,d=0,p=0,f=0,A=0,g=0,m=0,y=0,_=0,v=0,b=0,x=0,w=0,E=0,C=0,S=0,P=0,M=0,I=0,B=0,R=0,L=0,O=0,D=0,k=0;if(0|r[(l=(t|=0)+8|0)>>2])return 0|(k=1);if(!(a=0|r[t>>2]))return 0|(k=0);i=a,s=0;do{s=s+1|0,i=0|r[i+8>>2]}while(0!=(0|i));if(s>>>0<2)return 0|(k=0);(n=0|Me(s<<2))||T(22948,22787,317,22967),(e=0|Me(s<<5))||T(22989,22787,321,22967),r[t>>2]=0,r[(P=t+4|0)>>2]=0,r[l>>2]=0,s=0,O=0,S=0,g=0;t:for(;;){if(A=0|r[a>>2]){u=0,h=A;do{if(p=+o[h+8>>3],i=h,h=0|r[h+16>>2],d=+o[(l=(f=0==(0|h))?A:h)+8>>3],+c(+(p-d))>3.141592653589793){k=14;break}u+=(d-p)*(+o[i>>3]+ +o[l>>3])}while(!f);if(14==(0|k)){k=0,u=0,i=A;do{C=+o[i+8>>3],R=0|r[(L=i+16|0)>>2],E=+o[(R=0==(0|R)?A:R)+8>>3],u+=(+o[i>>3]+ +o[R>>3])*((E<0?E+6.283185307179586:E)-(C<0?C+6.283185307179586:C)),i=0|r[(0==(0|i)?a:L)>>2]}while(0!=(0|i))}u>0?(r[n+(O<<2)>>2]=a,O=O+1|0,l=S,i=g):k=19}else k=19;if(19==(0|k)){k=0;do{if(!s){if(g){l=P,h=g+8|0,i=a,s=t;break}if(0|r[t>>2]){k=27;break t}l=P,h=t,i=a,s=t;break}if(0|r[(i=s+8|0)>>2]){k=21;break t}if(!(s=0|Be(1,12))){k=23;break t}r[i>>2]=s,l=s+4|0,h=s,i=g}while(0);if(r[h>>2]=a,r[l>>2]=a,h=e+(S<<5)|0,f=0|r[a>>2]){for(o[(A=e+(S<<5)+8|0)>>3]=17976931348623157e292,o[(g=e+(S<<5)+24|0)>>3]=17976931348623157e292,o[h>>3]=-17976931348623157e292,o[(m=e+(S<<5)+16|0)>>3]=-17976931348623157e292,x=17976931348623157e292,w=-17976931348623157e292,l=0,y=f,p=17976931348623157e292,v=17976931348623157e292,b=-17976931348623157e292,d=-17976931348623157e292;u=+o[y>>3],C=+o[y+8>>3],y=0|r[y+16>>2],E=+o[((_=0==(0|y))?f:y)+8>>3],u<p&&(o[A>>3]=u,p=u),C<v&&(o[g>>3]=C,v=C),u>b?o[h>>3]=u:u=b,C>d&&(o[m>>3]=C,d=C),x=C>0&C<x?C:x,w=C<0&C>w?C:w,l|=+c(+(C-E))>3.141592653589793,!_;)b=u;l&&(o[m>>3]=w,o[g>>3]=x)}else r[h>>2]=0,r[h+4>>2]=0,r[h+8>>2]=0,r[h+12>>2]=0,r[h+16>>2]=0,r[h+20>>2]=0,r[h+24>>2]=0,r[h+28>>2]=0;l=S+1|0}if(a=0|r[(L=a+8|0)>>2],r[L>>2]=0,!a){k=45;break}S=l,g=i}if(21==(0|k))T(22765,22787,35,22799);else if(23==(0|k))T(22819,22787,37,22799);else if(27==(0|k))T(22862,22787,61,22885);else if(45==(0|k)){t:do{if((0|O)>0){for(L=0==(0|l),B=l<<2,R=0==(0|t),I=0,i=0;;){if(M=0|r[n+(I<<2)>>2],L)k=73;else{if(!(S=0|Me(B))){k=50;break}if(!(P=0|Me(B))){k=52;break}e:do{if(R)s=0;else{for(l=0,s=0,h=t;a=e+(l<<5)|0,0|le(0|r[h>>2],a,0|r[M>>2])?(r[S+(s<<2)>>2]=h,r[P+(s<<2)>>2]=a,_=s+1|0):_=s,h=0|r[h+8>>2];)l=l+1|0,s=_;if((0|_)>0)if(a=0|r[S>>2],1==(0|_))s=a;else for(m=0,y=-1,s=a,g=a;;){for(f=0|r[g>>2],a=0,h=0;A=(0|(l=0|r[r[S+(h<<2)>>2]>>2]))==(0|f)?a:a+(1&le(l,0|r[P+(h<<2)>>2],0|r[f>>2]))|0,(0|(h=h+1|0))!=(0|_);)a=A;if(s=(l=(0|A)>(0|y))?g:s,(0|(a=m+1|0))==(0|_))break e;m=a,y=l?A:y,g=0|r[S+(a<<2)>>2]}else s=0}}while(0);if(Ie(S),Ie(P),s){if(a=0|r[(l=s+4|0)>>2])s=a+8|0;else if(0|r[s>>2]){k=70;break}r[s>>2]=M,r[l>>2]=M}else k=73}if(73==(0|k)){if(k=0,0|(i=0|r[M>>2]))do{P=i,i=0|r[i+16>>2],Ie(P)}while(0!=(0|i));Ie(M),i=1}if((0|(I=I+1|0))>=(0|O)){D=i;break t}}50==(0|k)?T(23004,22787,249,23023):52==(0|k)?T(23042,22787,252,23023):70==(0|k)&&T(22862,22787,61,22885)}else D=0}while(0);return Ie(n),Ie(e),0|(k=D)}return 0}function le(t,e,n){t|=0;var i=0,s=0,a=0,l=0,c=0,u=0,h=0,d=0;if(!(0|X(e|=0,n|=0)))return 0|(t=0);if(e=0|Z(e),i=+o[n>>3],s=e&(s=+o[n+8>>3])<0?s+6.283185307179586:s,!(t=0|r[t>>2]))return 0|(t=0);if(e){e=0,h=s,n=t;t:for(;;){for(;l=+o[n>>3],s=+o[n+8>>3],d=0|r[(n=n+16|0)>>2],a=+o[(d=0==(0|d)?t:d)>>3],c=+o[d+8>>3],l>a?(u=l,l=c):(u=a,a=l,l=s,s=c),(i=i==a|i==u?i+2220446049250313e-31:i)<a|i>u;)if(!(n=0|r[n>>2])){n=22;break t}if(((u=(c=l<0?l+6.283185307179586:l)+(i-a)/(u-a)*((l=s<0?s+6.283185307179586:s)-c))<0?u+6.283185307179586:u)>(h=c==h|l==h?h+-2220446049250313e-31:h)&&(e^=1),!(n=0|r[n>>2])){n=22;break}}if(22==(0|n))return 0|e}else{e=0,h=s,n=t;t:for(;;){for(;l=+o[n>>3],s=+o[n+8>>3],d=0|r[(n=n+16|0)>>2],a=+o[(d=0==(0|d)?t:d)>>3],c=+o[d+8>>3],l>a?(u=l,l=c):(u=a,a=l,l=s,s=c),(i=i==a|i==u?i+2220446049250313e-31:i)<a|i>u;)if(!(n=0|r[n>>2])){n=22;break t}if(l+(i-a)/(u-a)*(s-l)>(h=l==h|s==h?h+-2220446049250313e-31:h)&&(e^=1),!(n=0|r[n>>2])){n=22;break}}if(22==(0|n))return 0|e}return 0}function ce(t,e,n,o,s){n|=0,o|=0,s|=0;var a,l,c,u,h=0,d=0,p=0,f=0,A=0,g=0,m=0,y=0,_=0,v=0;if(u=R,R=R+32|0,v=u+16|0,c=u,h=0|Ge(0|(t|=0),0|(e|=0),52),C(),h&=15,m=0|Ge(0|n,0|o,52),C(),(0|h)!=(15&m))return R=u,0|(v=12);if(A=0|Ge(0|t,0|e,45),C(),A&=127,g=0|Ge(0|n,0|o,45),C(),A>>>0>121|(g&=127)>>>0>121)return R=u,0|(v=5);if(m=(0|A)!=(0|g)){if(7==(0|(p=0|q(A,g))))return R=u,0|(v=1);7==(0|(f=0|q(g,A)))?T(23066,23090,161,23100):(y=p,d=f)}else y=0,d=0;a=0|U(A),l=0|U(g),r[v>>2]=0,r[v+4>>2]=0,r[v+8>>2]=0,r[v+12>>2]=0;do{if(y){if(p=(0|(g=0|r[4272+(28*A|0)+(y<<2)>>2]))>0,l)if(p){A=0,f=n,p=o;do{f=0|Gt(f,p),p=0|C(),1==(0|(d=0|At(d)))&&(d=0|At(1)),A=A+1|0}while((0|A)!=(0|g));g=d,A=f,f=p}else g=d,A=n,f=o;else if(p){A=0,f=n,p=o;do{f=0|Vt(f,p),p=0|C(),d=0|At(d),A=A+1|0}while((0|A)!=(0|g));g=d,A=f,f=p}else g=d,A=n,f=o;if(Wt(A,f,v),m||T(23115,23090,191,23100),(p=0!=(0|a))&(d=0!=(0|l))&&T(23142,23090,192,23100),p){if(7==(0|(d=0|Nt(t,e)))){h=5;break}if(0|i[21872+(7*d|0)+y|0]){h=1;break}A=f=0|r[21040+(28*d|0)+(y<<2)>>2]}else if(d){if(7==(0|(d=0|Nt(A,f)))){h=5;break}if(0|i[21872+(7*d|0)+g|0]){h=1;break}A=0,f=0|r[21040+(28*g|0)+(d<<2)>>2]}else A=0,f=0;if((A|f)<0)h=5;else{if((0|f)>0){p=v+4|0,d=0;do{pt(p),d=d+1|0}while((0|d)!=(0|f))}if(r[c>>2]=0,r[c+4>>2]=0,r[c+8>>2]=0,ht(c,y),0|h)for(;0|jt(h)?ct(c):ut(c),(0|h)>1;)h=h+-1|0;if((0|A)>0){h=0;do{pt(c),h=h+1|0}while((0|h)!=(0|A))}et(_=v+4|0,c,_),$(_),_=51}}else if(Wt(n,o,v),0!=(0|a)&0!=(0|l))if((0|g)!=(0|A)&&T(23173,23090,261,23100),7==(0|(d=0|Nt(t,e)))|7==(0|(h=0|Nt(n,o))))h=5;else if(0|i[21872+(7*d|0)+h|0])h=1;else if((0|(d=0|r[21040+(28*d|0)+(h<<2)>>2]))>0){p=v+4|0,h=0;do{pt(p),h=h+1|0}while((0|h)!=(0|d));_=51}else _=51;else _=51}while(0);return 51==(0|_)&&(h=v+4|0,r[s>>2]=r[h>>2],r[s+4>>2]=r[h+4>>2],r[s+8>>2]=r[h+8>>2],h=0),R=u,0|(v=h)}function ue(t,e,n,i){n|=0,i|=0;var o,s,a,l=0,c=0,u=0,h=0,d=0,p=0,f=0,A=0,g=0,m=0,y=0,_=0,v=0;if(a=R,R=R+48|0,o=a+36|0,u=a+24|0,h=a+12|0,d=a,l=0|Ge(0|(t|=0),0|(e|=0),52),C(),l&=15,f=0|Ge(0|t,0|e,45),C(),(f&=127)>>>0>121)return R=a,0|(i=5);if(s=0|U(f),Ve(0|l,0,52),m=134225919|C(),r[(c=i)>>2]=-1,r[c+4>>2]=m,!l)return 7==(0|(l=0|rt(n)))||127==(0|(l=0|W(f,l)))?(R=a,0|(m=1)):(A=0|Ve(0|l,0,45),g=0|C(),g=-1040385&r[(f=i)+4>>2]|g,r[(m=i)>>2]=r[f>>2]|A,r[m+4>>2]=g,R=a,0|(m=0));for(r[o>>2]=r[n>>2],r[o+4>>2]=r[n+4>>2],r[o+8>>2]=r[n+8>>2],n=l;;){if(c=n,n=n+-1|0,r[u>>2]=r[o>>2],r[u+4>>2]=r[o+4>>2],r[u+8>>2]=r[o+8>>2],0|jt(c)){if(0|(l=0|ot(o))){n=13;break}r[h>>2]=r[o>>2],r[h+4>>2]=r[o+4>>2],r[h+8>>2]=r[o+8>>2],ct(h)}else{if(0|(l=0|st(o))){n=13;break}r[h>>2]=r[o>>2],r[h+4>>2]=r[o+4>>2],r[h+8>>2]=r[o+8>>2],ut(h)}if(nt(u,h,d),$(d),_=0|r[(l=i)>>2],l=0|r[l+4>>2],y=0|Ve(7,0,0|(v=3*(15-c|0)|0)),l&=~C(),v=0|Ve(0|rt(d),0,0|v),l=C()|l,r[(m=i)>>2]=v|_&~y,r[m+4>>2]=l,(0|c)<=1){n=14;break}}t:do{if(13!=(0|n)&&14==(0|n))if((0|r[o>>2])<=1&&(0|r[o+4>>2])<=1&&(0|r[o+8>>2])<=1){d=127==(0|(l=0|W(f,n=0|rt(o))))?0:0|U(l);e:do{if(n){if(s){if(7==(0|(l=0|Nt(t,e)))){l=5;break t}if((0|(c=0|r[21248+(28*l|0)+(n<<2)>>2]))>0){l=n,n=0;do{l=0|ft(l),n=n+1|0}while((0|n)!=(0|c))}else l=n;if(1==(0|l)){l=9;break t}127==(0|(n=0|W(f,l)))&&T(23200,23090,411,23230),0|U(n)?T(23245,23090,412,23230):(g=n,A=c,p=l)}else g=l,A=0,p=n;if((0|(h=0|r[4272+(28*f|0)+(p<<2)>>2]))<=-1&&T(23276,23090,419,23230),!d){if((0|A)<0){l=5;break t}if(0|A){l=0,n=0|r[(c=i)>>2],c=0|r[c+4>>2];do{n=0|Ut(n,c),c=0|C(),r[(v=i)>>2]=n,r[v+4>>2]=c,l=l+1|0}while((0|l)<(0|A))}if((0|h)<=0){l=g,n=58;break}for(l=0,n=0|r[(c=i)>>2],c=0|r[c+4>>2];;)if(n=0|Ut(n,c),c=0|C(),r[(v=i)>>2]=n,r[v+4>>2]=c,(0|(l=l+1|0))==(0|h)){l=g,n=58;break e}}if(7==(0|(u=0|q(g,f)))&&T(23066,23090,428,23230),n=0|r[(l=i)>>2],l=0|r[l+4>>2],(0|h)>0){c=0;do{n=0|Ut(n,l),l=0|C(),r[(v=i)>>2]=n,r[v+4>>2]=l,c=c+1|0}while((0|c)!=(0|h))}if(7==(0|(l=0|Nt(n,l)))&&T(23313,23090,440,23230),n=0|G(g),(0|(n=0|r[(n?21664:21456)+(28*u|0)+(l<<2)>>2]))<0&&T(23313,23090,454,23230),n){l=0,c=0|r[(u=i)>>2],u=0|r[u+4>>2];do{c=0|zt(c,u),u=0|C(),r[(v=i)>>2]=c,r[v+4>>2]=u,l=l+1|0}while((0|l)<(0|n));l=g,n=58}else l=g,n=58}else if(0!=(0|s)&0!=(0|d)){if(7==(0|(n=0|Nt(t,e)))|7==(0|(c=0|Nt(0|r[(c=i)>>2],0|r[c+4>>2])))){l=5;break t}if((0|(c=0|r[21248+(28*n|0)+(c<<2)>>2]))<0){l=5;break t}if(c){n=0,u=0|r[(h=i)>>2],h=0|r[h+4>>2];do{u=0|Ut(u,h),h=0|C(),r[(v=i)>>2]=u,r[v+4>>2]=h,n=n+1|0}while((0|n)<(0|c));n=58}else n=59}else n=58}while(0);if(58==(0|n)&&d&&(n=59),59==(0|n)&&1==(0|Nt(0|r[(v=i)>>2],0|r[v+4>>2]))){l=9;break}y=0|r[(v=i)>>2],v=-1040385&r[v+4>>2],_=0|Ve(0|l,0,45),v|=C(),r[(l=i)>>2]=y|_,r[l+4>>2]=v,l=0}else l=1}while(0);return R=a,0|(v=l)}function he(t,e,n,i){t|=0,e|=0;var r=0,o=0,s=0;if(0==(0|(n|=0))&0==(0|(i|=0)))return o=1,E(0|(r=0)),0|o;o=t,r=e,t=1,e=0;do{t=0|Fe(0|((s=0==(1&n
vendor: 7,445 bytes, line 2
2)&!0)?1:o),0|(s?0:r),0|t,0|e),e=0|C(),n=0|Ue(0|n,0|i,1),i=0|C(),o=0|Fe(0|o,0|r,0|o,0|r),r=0|C()}while(!(0==(0|n)&0==(0|i)));return E(0|e),0|t}function de(t,e,n){t|=0;var i,s=0,a=0,l=0,c=0,u=0,h=0,d=0,p=0,f=0;if(!(0|X(e|=0,n|=0)))return 0|(f=0);if(e=0|Z(e),s=+o[n>>3],a=e&(a=+o[n+8>>3])<0?a+6.283185307179586:a,(0|(f=0|r[t>>2]))<=0)return 0|(f=0);if(i=0|r[t+4>>2],e){e=0,p=a,n=-1,t=0;t:for(;;){for(d=t;c=+o[i+(d<<4)>>3],a=+o[i+(d<<4)+8>>3],l=+o[i+((t=(n+2|0)%(0|f)|0)<<4)>>3],u=+o[i+(t<<4)+8>>3],c>l?(h=c,c=u):(h=l,l=c,c=a,a=u),(s=s==l|s==h?s+2220446049250313e-31:s)<l|s>h;){if((0|(n=d+1|0))>=(0|f)){n=22;break t}t=d,d=n,n=t}if(((h=(u=c<0?c+6.283185307179586:c)+(s-l)/(h-l)*((c=a<0?a+6.283185307179586:a)-u))<0?h+6.283185307179586:h)>(p=u==p|c==p?p+-2220446049250313e-31:p)&&(e^=1),(0|(t=d+1|0))>=(0|f)){n=22;break}n=d}if(22==(0|n))return 0|e}else{e=0,p=a,n=-1,t=0;t:for(;;){for(d=t;c=+o[i+(d<<4)>>3],a=+o[i+(d<<4)+8>>3],l=+o[i+((t=(n+2|0)%(0|f)|0)<<4)>>3],u=+o[i+(t<<4)+8>>3],c>l?(h=c,c=u):(h=l,l=c,c=a,a=u),(s=s==l|s==h?s+2220446049250313e-31:s)<l|s>h;){if((0|(n=d+1|0))>=(0|f)){n=22;break t}t=d,d=n,n=t}if(c+(s-l)/(h-l)*(a-c)>(p=c==p|a==p?p+-2220446049250313e-31:p)&&(e^=1),(0|(t=d+1|0))>=(0|f)){n=22;break}n=d}if(22==(0|n))return 0|e}return 0}function pe(t,e){e|=0;var n,i,s,a,l,u=0,h=0,d=0,p=0,f=0,A=0,g=0,m=0,y=0,_=0,v=0,b=0;if(!(i=0|r[(t|=0)>>2]))return r[e>>2]=0,r[e+4>>2]=0,r[e+8>>2]=0,r[e+12>>2]=0,r[e+16>>2]=0,r[e+20>>2]=0,r[e+24>>2]=0,void(r[e+28>>2]=0);if(o[(s=e+8|0)>>3]=17976931348623157e292,o[(a=e+24|0)>>3]=17976931348623157e292,o[e>>3]=-17976931348623157e292,o[(l=e+16|0)>>3]=-17976931348623157e292,!((0|i)<=0)){for(n=0|r[t+4>>2],m=17976931348623157e292,y=-17976931348623157e292,_=0,t=-1,p=17976931348623157e292,f=17976931348623157e292,g=-17976931348623157e292,h=-17976931348623157e292,v=0;u=+o[n+(v<<4)>>3],A=+o[n+(v<<4)+8>>3],d=+o[n+(((0|(t=t+2|0))==(0|i)?0:t)<<4)+8>>3],u<p&&(o[s>>3]=u,p=u),A<f&&(o[a>>3]=A,f=A),u>g?o[e>>3]=u:u=g,A>h&&(o[l>>3]=A,h=A),m=A>0&A<m?A:m,y=A<0&A>y?A:y,_|=+c(+(A-d))>3.141592653589793,(0|(t=v+1|0))!=(0|i);)b=v,g=u,v=t,t=b;_&&(o[l>>3]=y,o[a>>3]=m)}}function fe(t,e){e|=0;var n,i=0,s=0,a=0,l=0,u=0,h=0,d=0,p=0,f=0,A=0,g=0,m=0,y=0,_=0,v=0,b=0,x=0,w=0,E=0,C=0,T=0;if(y=0|r[(t|=0)>>2]){if(o[(_=e+8|0)>>3]=17976931348623157e292,o[(v=e+24|0)>>3]=17976931348623157e292,o[e>>3]=-17976931348623157e292,o[(b=e+16|0)>>3]=-17976931348623157e292,(0|y)>0){for(a=0|r[t+4>>2],g=17976931348623157e292,m=-17976931348623157e292,s=0,i=-1,d=17976931348623157e292,p=17976931348623157e292,A=-17976931348623157e292,u=-17976931348623157e292,x=0;l=+o[a+(x<<4)>>3],f=+o[a+(x<<4)+8>>3],h=+o[a+(((0|(C=i+2|0))==(0|y)?0:C)<<4)+8>>3],l<d&&(o[_>>3]=l,d=l),f<p&&(o[v>>3]=f,p=f),l>A?o[e>>3]=l:l=A,f>u&&(o[b>>3]=f,u=f),g=f>0&f<g?f:g,m=f<0&f>m?f:m,s|=+c(+(f-h))>3.141592653589793,(0|(i=x+1|0))!=(0|y);)C=x,A=l,x=i,i=C;s&&(o[b>>3]=m,o[v>>3]=g)}}else r[e>>2]=0,r[e+4>>2]=0,r[e+8>>2]=0,r[e+12>>2]=0,r[e+16>>2]=0,r[e+20>>2]=0,r[e+24>>2]=0,r[e+28>>2]=0;if(!((0|(i=0|r[(C=t+8|0)>>2]))<=0)){n=t+12|0,E=0;do{if(a=0|r[n>>2],s=E,v=e+((E=E+1|0)<<5)|0,b=0|r[a+(s<<3)>>2]){if(o[(x=e+(E<<5)+8|0)>>3]=17976931348623157e292,o[(t=e+(E<<5)+24|0)>>3]=17976931348623157e292,o[v>>3]=-17976931348623157e292,o[(w=e+(E<<5)+16|0)>>3]=-17976931348623157e292,(0|b)>0){for(y=0|r[a+(s<<3)+4>>2],g=17976931348623157e292,m=-17976931348623157e292,a=0,s=-1,_=0,d=17976931348623157e292,p=17976931348623157e292,f=-17976931348623157e292,u=-17976931348623157e292;l=+o[y+(_<<4)>>3],A=+o[y+(_<<4)+8>>3],h=+o[y+(((0|(s=s+2|0))==(0|b)?0:s)<<4)+8>>3],l<d&&(o[x>>3]=l,d=l),A<p&&(o[t>>3]=A,p=A),l>f?o[v>>3]=l:l=f,A>u&&(o[w>>3]=A,u=A),g=A>0&A<g?A:g,m=A<0&A>m?A:m,a|=+c(+(A-h))>3.141592653589793,(0|(s=_+1|0))!=(0|b);)T=_,_=s,f=l,s=T;a&&(o[w>>3]=m,o[t>>3]=g)}}else r[v>>2]=0,r[v+4>>2]=0,r[v+8>>2]=0,r[v+12>>2]=0,r[v+16>>2]=0,r[v+20>>2]=0,r[v+24>>2]=0,r[v+28>>2]=0,i=0|r[C>>2]}while((0|E)<(0|i))}}function Ae(t,e,n){var i=0,o=0,s=0;if(!(0|de(t|=0,e|=0,n|=0)))return 0|(o=0);if((0|r[(o=t+8|0)>>2])<=0)return 0|(o=1);for(i=t+12|0,t=0;;){if(s=t,t=t+1|0,0|de((0|r[i>>2])+(s<<3)|0,e+(t<<5)|0,n)){t=0,i=6;break}if((0|t)>=(0|r[o>>2])){t=1,i=6;break}}return 6==(0|i)?0|t:0}function ge(t,e,n,i,r){e|=0,n|=0,i|=0,r|=0;var s,a,l,c,u,h,d,p=0;c=+o[(t|=0)>>3],l=+o[e>>3]-c,a=+o[t+8>>3],s=+o[e+8>>3]-a,h=+o[n>>3],p=((p=+o[i>>3]-h)*(a-(d=+o[n+8>>3]))-(c-h)*(u=+o[i+8>>3]-d))/(l*u-s*p),o[r>>3]=c+l*p,o[r+8>>3]=a+s*p}function me(t,e){return e|=0,+c(+(+o[(t|=0)>>3]-+o[e>>3]))<1.1920928955078125e-7?0|(e=+c(+(+o[t+8>>3]-+o[e+8>>3]))<1.1920928955078125e-7):0|(e=0)}function ye(t,e){e|=0;var n,i,r;return+((r=+o[(t|=0)>>3]-+o[e>>3])*r+(i=+o[t+8>>3]-+o[e+8>>3])*i+(n=+o[t+16>>3]-+o[e+16>>3])*n)}function _e(t,e,n){n|=0;var i,o,s,a,l=0,c=0,u=0;if(a=R,R=R+32|0,u=a,0|(l=0|qt(t|=0,e|=0,o=a+16|0)))return R=a,0|(n=l);i=0|Lt(t,e),s=0|Nt(t,e),function(t,e){t=7696+(28*(t|=0)|0)|0,r[(e|=0)>>2]=r[t>>2],r[e+4>>2]=r[t+4>>2],r[e+8>>2]=r[t+8>>2],r[e+12>>2]=r[t+12>>2]}(i,u),l=0|function(t,e){t|=0;var n=0,i=0;if((e|=0)>>>0>20)return-1;do{if((0|r[11120+(216*e|0)>>2])!=(0|t))if((0|r[11120+(216*e|0)+8>>2])!=(0|t))if((0|r[11120+(216*e|0)+16>>2])!=(0|t))if((0|r[11120+(216*e|0)+24>>2])!=(0|t))if((0|r[11120+(216*e|0)+32>>2])!=(0|t))if((0|r[11120+(216*e|0)+40>>2])!=(0|t))if((0|r[11120+(216*e|0)+48>>2])!=(0|t))if((0|r[11120+(216*e|0)+56>>2])!=(0|t))if((0|r[11120+(216*e|0)+64>>2])!=(0|t))if((0|r[11120+(216*e|0)+72>>2])!=(0|t))if((0|r[11120+(216*e|0)+80>>2])!=(0|t))if((0|r[11120+(216*e|0)+88>>2])!=(0|t))if((0|r[11120+(216*e|0)+96>>2])!=(0|t))if((0|r[11120+(216*e|0)+104>>2])!=(0|t))if((0|r[11120+(216*e|0)+112>>2])!=(0|t))if((0|r[11120+(216*e|0)+120>>2])!=(0|t))if((0|r[11120+(216*e|0)+128>>2])!=(0|t)){if((0|r[11120+(216*e|0)+136>>2])!=(0|t)){if((0|r[11120+(216*e|0)+144>>2])==(0|t)){t=0,n=2,i=0;break}if((0|r[11120+(216*e|0)+152>>2])==(0|t)){t=0,n=2,i=1;break}if((0|r[11120+(216*e|0)+160>>2])==(0|t)){t=0,n=2,i=2;break}if((0|r[11120+(216*e|0)+168>>2])==(0|t)){t=1,n=2,i=0;break}if((0|r[11120+(216*e|0)+176>>2])==(0|t)){t=1,n=2,i=1;break}if((0|r[11120+(216*e|0)+184>>2])==(0|t)){t=1,n=2,i=2;break}if((0|r[11120+(216*e|0)+192>>2])==(0|t)){t=2,n=2,i=0;break}if((0|r[11120+(216*e|0)+200>>2])==(0|t)){t=2,n=2,i=1;break}if((0|r[11120+(216*e|0)+208>>2])==(0|t)){t=2,n=2,i=2;break}return-1}t=2,n=1,i=2}else t=2,n=1,i=1;else t=2,n=1,i=0;else t=1,n=1,i=2;else t=1,n=1,i=1;else t=1,n=1,i=0;else t=0,n=1,i=2;else t=0,n=1,i=1;else t=0,n=1,i=0;else t=2,n=0,i=2;else t=2,n=0,i=1;else t=2,n=0,i=0;else t=1,n=0,i=2;else t=1,n=0,i=1;else t=1,n=0,i=0;else t=0,n=0,i=2;else t=0,n=0,i=1;else t=0,n=0,i=0}while(0);return 0|r[11120+(216*e|0)+(72*n|0)+(24*t|0)+(i<<3)+4>>2]}(i,0|r[o>>2]);t:do{if(0|U(i)){switch(0|i){case 4:t=0;break;case 14:t=1;break;case 24:t=2;break;case 38:t=3;break;case 49:t=4;break;case 58:t=5;break;case 63:t=6;break;case 72:t=7;break;case 83:t=8;break;case 97:t=9;break;case 107:t=10;break;case 117:t=11;break;default:l=1;break t}if(c=0|r[22e3+(24*t|0)+8>>2],e=0|r[22e3+(24*t|0)+16>>2],(0|(t=0|r[o>>2]))!=(0|r[u>>2])&&(u=0|G(i))|(0|(t=0|r[o>>2]))==(0|e)&&(l=(l+1|0)%6|0),3==(0|s)&(0|t)==(0|e)){l=(l+5|0)%6|0,c=22;break}5==(0|s)&(0|t)==(0|c)?(l=(l+1|0)%6|0,c=22):c=22}else c=22}while(0);return 22==(0|c)&&(r[n>>2]=l,l=0),R=a,0|(n=l)}function ve(t,e,n,i){n|=0,i|=0;var o,s,a,l,c,u=0,h=0,d=0,p=0,f=0,A=0,g=0,m=0,y=0,_=0,v=0;if(c=R,R=R+32|0,v=c+24|0,l=c+20|0,a=c+8|0,s=c+16|0,o=c,f=(f=0==(0|Ft(t|=0,e|=0)))?6:5,g=0|Ge(0|t,0|e,52),C(),f>>>0<=n>>>0)return R=c,0|(i=2);!(m=0==(0|(g&=15)))&&0==((y=0|Ve(7,0,3*(15^g)|0))&t
vendor: 2,586 bytes, line 2
2)&0==(C()&e)?u=n:h=4;t:do{if(4==(0|h)){if((0|((u=0!=(0|Ft(t,e)))?4:5))<(0|n))return R=c,0|(i=1);if(0|_e(t,e,v))return R=c,0|(i=1);if(h=(0|r[v>>2])+n|0,7==(0|(y=0|r[(u=u?22288+((0|h)%5<<2)|0:22320+((0|h)%6<<2)|0)>>2])))return R=c,0|(i=1);r[l>>2]=0,u=0|F(t,e,y,l,a);do{if(!u){if(A=0|r[(p=a)>>2],h=(d=(p=0|r[p+4>>2])>>>0<e>>>0|(0|p)==(0|e)&A>>>0<t>>>0)?A:t,d=d?p:e,!m&&0==(A&(m=0|Ve(7,0,3*(15^g)|0)))&0==(p&C()))u=n;else{if(p=(n+-1+f|0)%(0|f)|0,u=0|Ft(t,e),(0|p)<0&&T(23313,23315,245,23324),(0|((f=0!=(0|u))?4:5))<(0|p)&&T(23313,23315,245,23324),0|_e(t,e,v)&&T(23313,23315,245,23324),u=(0|r[v>>2])+p|0,7==(0|(p=0|r[(u=f?22288+((0|u)%5<<2)|0:22320+((0|u)%6<<2)|0)>>2]))&&T(23313,23315,245,23324),r[s>>2]=0,0|(u=0|F(t,e,p,s,o)))break;f=0|r[(A=o)>>2],A=0|r[A+4>>2];do{if(A>>>0<d>>>0|(0|A)==(0|d)&f>>>0<h>>>0){if(h=0|Ft(f,A)?0|N(f,A,t,e):0|r[22384+(((0|r[s>>2])+(0|r[22352+(p<<2)>>2])|0)%6<<2)>>2],u=0|Ft(f,A),(h+-1|0)>>>0>5){u=-1,h=f,d=A;break}if(1==(0|h)&(u=0!=(0|u))){u=-1,h=f,d=A;break}do{if(!(0|_e(f,A,v))){if(u){u=(5+(0|r[21936+(h<<2)>>2])-(0|r[v>>2])|0)%5|0;break}u=(6+(0|r[21968+(h<<2)>>2])-(0|r[v>>2])|0)%6|0;break}u=-1}while(0);h=f,d=A}else u=n}while(0);A=0|r[(p=a)>>2],p=0|r[p+4>>2]}if((0|h)==(0|A)&(0|d)==(0|p)){if(t=(f=0!=(0|Ft(A,p)))?0|N(A,p,t,e):0|r[22384+(((0|r[l>>2])+(0|r[22352+(y<<2)>>2])|0)%6<<2)>>2],u=0|Ft(A,p),(t+-1|0)>>>0<=5&&!(1==(0|t)&(_=0!=(0|u))))do{if(!(0|_e(A,p,v))){if(_){u=(5+(0|r[21936+(t<<2)>>2])-(0|r[v>>2])|0)%5|0;break}u=(6+(0|r[21968+(t<<2)>>2])-(0|r[v>>2])|0)%6|0;break}u=-1}while(0);else u=-1;u=6==(0|(u=u+1|0))|f&5==(0|u)?0:u}e=d,t=h;break t}}while(0);return R=c,0|(i=u)}}while(0);return _=0|Ve(0|u,0,56),v=C()|-2130706433&e|536870912,r[i>>2]=_|t,r[i+4>>2]=v,R=c,0|(i=0)}function be(t,e,n){t|=0,n|=0;var i=0;(0|(e|=0))>0?(i=0|Be(e,4),r[t>>2]=i,i||T(23337,23360,40,23374)):r[t>>2]=0,r[t+4>>2]=e,r[t+8>>2]=0,r[t+12>>2]=n}function xe(t){var e,n,i,s=0,a=0,l=0,u=0;e=(t|=0)+4|0,n=t+12|0,i=t+8|0;t:for(;;){for(a=0|r[e>>2],s=0;;){if((0|s)>=(0|a))break t;if(l=0|r[t>>2],u=0|r[l+(s<<2)>>2])break;s=s+1|0}s=l+(~~(+c(+ +h(10,+ +(15-(0|r[n>>2])|0))*(+o[u>>3]+ +o[u+8>>3]))%+(0|a))>>>0<<2)|0,a=0|r[s>>2];e:do{if(0|a){if(l=u+32|0,(0|a)==(0|u))r[s>>2]=r[l>>2];else{if(!(s=0|r[(a=a+32|0)>>2]))break;for(;(0|s)!=(0|u);)if(!(s=0|r[(a=s+32|0)>>2]))break e;r[a>>2]=r[l>>2]}Ie(u),r[i>>2]=(0|r[i>>2])-1}}while(0)}Ie(0|r[t>>2])}function we(t){var e,n=0,i=0;for(e=0|r[(t|=0)+4>>2],i=0;;){if((0|i)>=(0|e)){n=0,i=4;break}if(n=0|r[(0|r[t>>2])+(i<<2)>>2]){i=4;break}i=i+1|0}return 4==(0|i)?0|n:0}function Ee(t,e){e|=0;var n=0,i=0,s=0,a=0;if(n=~~(+c(+ +h(10,+ +(15-(0|r[(t|=0)+12>>
vendor: 14,022 bytes, line 2
22])|0))*(+o[e>>3]+ +o[e+8>>3]))%+(0|r[t+4>>2]))>>>0,n=(0|r[t>>2])+(n<<2)|0,!(i=0|r[n>>2]))return 0|(a=1);a=e+32|0;do{if((0|i)!=(0|e)){if(!(n=0|r[i+32>>2]))return 0|(a=1);for(s=n;;){if((0|s)==(0|e)){s=8;break}if(!(n=0|r[s+32>>2])){n=1,s=10;break}i=s,s=n}if(8==(0|s)){r[i+32>>2]=r[a>>2];break}if(10==(0|s))return 0|n}else r[n>>2]=r[a>>2]}while(0);return Ie(e),r[(a=t+8|0)>>2]=(0|r[a>>2])-1,0|(a=0)}function Ce(t,e,n){t|=0,e|=0,n|=0;var i,s=0,a=0,l=0;(i=0|Me(40))||T(23390,23360,98,23403),r[i>>2]=r[e>>2],r[i+4>>2]=r[e+4>>2],r[i+8>>2]=r[e+8>>2],r[i+12>>2]=r[e+12>>2],r[(a=i+16|0)>>2]=r[n>>2],r[a+4>>2]=r[n+4>>2],r[a+8>>2]=r[n+8>>2],r[a+12>>2]=r[n+12>>2],r[i+32>>2]=0,a=~~(+c(+ +h(10,+ +(15-(0|r[t+12>>2])|0))*(+o[e>>3]+ +o[e+8>>3]))%+(0|r[t+4>>2]))>>>0,a=(0|r[t>>2])+(a<<2)|0,s=0|r[a>>2];do{if(s){for(;!(0|$t(s,e)&&0|$t(s+16|0,n));)if(a=0|r[s+32>>2],!(0|r[(s=0==(0|a)?s:a)+32>>2])){l=10;break}if(10==(0|l)){r[s+32>>2]=i;break}return Ie(i),0|(l=s)}r[a>>2]=i}while(0);return r[(l=t+8|0)>>2]=1+(0|r[l>>2]),0|(l=i)}function Te(t,e,n){e|=0,n|=0;var i=0,s=0;if(s=~~(+c(+ +h(10,+ +(15-(0|r[(t|=0)+12>>2])|0))*(+o[e>>3]+ +o[e+8>>3]))%+(0|r[t+4>>2]))>>>0,!(s=0|r[(0|r[t>>2])+(s<<2)>>2]))return 0|(n=0);if(!n){for(t=s;;){if(0|$t(t,e)){i=10;break}if(!(t=0|r[t+32>>2])){t=0,i=10;break}}if(10==(0|i))return 0|t}for(t=s;;){if(0|$t(t,e)&&0|$t(t+16|0,n)){i=10;break}if(!(t=0|r[t+32>>2])){t=0,i=10;break}}return 10==(0|i)?0|t:0}function Se(t,e){e|=0;var n=0;if(n=~~(+c(+ +h(10,+ +(15-(0|r[(t|=0)+12>>2])|0))*(+o[e>>3]+ +o[e+8>>3]))%+(0|r[t+4>>2]))>>>0,!(t=0|r[(0|r[t>>2])+(n<<2)>>2]))return 0|(n=0);for(;;){if(0|$t(t,e)){e=5;break}if(!(t=0|r[t+32>>2])){t=0,e=5;break}}return 5==(0|e)?0|t:0}function Pe(t){return 0|+function(t){return+ +Xe(+(t=+t))}(t=+t)}function Me(t){t|=0;var e,n=0,i=0,o=0,s=0,a=0,l=0,c=0,u=0,h=0,d=0,p=0,f=0,A=0,g=0,m=0,y=0,_=0,v=0,b=0,x=0;e=R,R=R+16|0,f=e;do{if(t>>>0<245){if(t=(h=t>>>0<11?16:t+11&-8)>>>3,3&(i=(p=0|r[5857])>>>t))return o=0|r[(i=(t=23468+((n=(1&i^1)+t|0)<<1<<2)|0)+8|0)>>2],(0|(a=0|r[(s=o+8|0)>>2]))==(0|t)?r[5857]=p&~(1<<n):(r[a+12>>2]=t,r[i>>2]=a),x=n<<3,r[o+4>>2]=3|x,r[(x=o+x+4|0)>>2]=1|r[x>>2],R=e,0|(x=s);if(h>>>0>(d=0|r[5859])>>>0){if(0|i)return n=((n=i<<t&((n=2<<t)|0-n))&0-n)-1|0,a=0|r[(t=(n=23468+((o=((i=(n>>>=c=n>>>12&16)>>>5&8)|c|(a=(n>>>=i)>>>2&4)|(t=(n>>>=a)>>>1&2)|(o=(n>>>=t)>>>1&1))+(n>>>o)|0)<<1<<2)|0)+8|0)>>2],(0|(i=0|r[(c=a+8|0)>>2]))==(0|n)?(t=p&~(1<<o),r[5857]=t):(r[i+12>>2]=n,r[t>>2]=i,t=p),l=(x=o<<3)-h|0,r[a+4>>2]=3|h,r[(s=a+h|0)+4>>2]=1|l,r[a+x>>2]=l,0|d&&(o=0|r[5862],i=23468+((n=d>>>3)<<1<<2)|0,t&(n=1<<n)?n=0|r[(t=i+8|0)>>2]:(r[5857]=t|n,n=i,t=i+8|0),r[t>>2]=o,r[n+12>>2]=o,r[o+8>>2]=n,r[o+12>>2]=i),r[5859]=l,r[5862]=s,R=e,0|(x=c);if(a=0|r[5858]){for(i=(a&0-a)-1|0,i=u=0|r[23732+(((o=(i>>>=s=i>>>12&16)>>>5&8)|s|(l=(i>>>=o)>>>2&4)|(c=(i>>>=l)>>>1&2)|(u=(i>>>=c)>>>1&1))+(i>>>u)<<2)>>2],c=u,u=(-8&r[u+4>>2])-h|0;(t=0|r[i+16>>2])||(t=0|r[i+20>>2]);)i=t,c=(s=(l=(-8&r[t+4>>2])-h|0)>>>0<u>>>0)?t:c,u=s?l:u;if((l=c+h|0)>>>0>c>>>0){s=0|r[c+24>>2],n=0|r[c+12>>2];do{if((0|n)==(0|c)){if(!(n=0|r[(t=c+20|0)>>2])&&!(n=0|r[(t=c+16|0)>>2])){i=0;break}for(;;)if(i=0|r[(o=n+20|0)>>2])n=i,t=o;else{if(!(i=0|r[(o=n+16|0)>>2]))break;n=i,t=o}r[t>>2]=0,i=n}else i=0|r[c+8>>2],r[i+12>>2]=n,r[n+8>>2]=i,i=n}while(0);do{if(0|s){if(n=0|r[c+28>>2],(0|c)==(0|r[(t=23732+(n<<2)|0)>>2])){if(r[t>>2]=i,!i){r[5858]=a&~(1<<n);break}}else if(r[((0|r[(x=s+16|0)>>2])==(0|c)?x:s+20)>>2]=i,!i)break;r[i+24>>2]=s,0|(n=0|r[c+16>>2])&&(r[i+16>>2]=n,r[n+24>>2]=i),0|(n=0|r[c+20>>2])&&(r[i+20>>2]=n,r[n+24>>2]=i)}}while(0);return u>>>0<16?(x=u+h|0,r[c+4>>2]=3|x,r[(x=c+x+4|0)>>2]=1|r[x>>2]):(r[c+4>>2]=3|h,r[l+4>>2]=1|u,r[l+u>>2]=u,0|d&&(o=0|r[5862],i=23468+((n=d>>>3)<<1<<2)|0,(n=1<<n)&p?n=0|r[(t=i+8|0)>>2]:(r[5857]=n|p,n=i,t=i+8|0),r[t>>2]=o,r[n+12>>2]=o,r[o+8>>2]=n,r[o+12>>2]=i),r[5859]=u,r[5862]=l),R=e,0|(x=c+8|0)}p=h}else p=h}else p=h}else if(t>>>0<=4294967231)if(h=-8&(t=t+11|0),o=0|r[5858]){s=0-h|0,u=(t>>>=8)?h>>>0>16777215?31:h>>>((u=14-((c=((m=t<<(p=(t+1048320|0)>>>16&8))+520192|0)>>>16&4)|p|(u=((m<<=c)+245760|0)>>>16&2))+(m<<u>>>15)|0)+7|0)&1|u<<1:0,i=0|r[23732+(u<<2)>>2];t:do{if(i)for(t=0,c=h<<(31==(0|u)?0:25-(u>>>1)),a=0;;){if((l=(-8&r[i+4>>2])-h|0)>>>0<s>>>0){if(!l){t=i,s=0,m=65;break t}t=i,s=l}if(a=0==(0|(m=0|r[i+20>>2]))|(0|m)==(0|(i=0|r[i+16+(c>>>31<<2)>>2]))?a:m,!i){i=a,m=61;break}c<<=1}else i=0,t=0,m=61}while(0);if(61==(0|m)){if(0==(0|i)&0==(0|t)){if(!(t=((t=2<<u)|0-t)&o)){p=h;break}p=(t&0-t)-1|0,t=0,i=0|r[23732+(((a=(p>>>=l=p>>>12&16)>>>5&8)|l|(c=(p>>>=a)>>>2&4)|(u=(p>>>=c)>>>1&2)|(i=(p>>>=u)>>>1&1))+(p>>>i)<<2)>>2]}i?m=65:(c=t,l=s)}if(65==(0|m))for(a=i;;){if(s=(i=(p=(-8&r[a+4>>2])-h|0)>>>0<s>>>0)?p:s,t=i?a:t,(i=0|r[a+16>>2])||(i=0|r[a+20>>2]),!i){c=t,l=s;break}a=i}if(0!=(0|c)&&l>>>0<((0|r[5859])-h|0)>>>0&&(d=c+h|0)>>>0>c>>>0){a=0|r[c+24>>2],n=0|r[c+12>>2];do{if((0|n)==(0|c)){if(!(n=0|r[(t=c+20|0)>>2])&&!(n=0|r[(t=c+16|0)>>2])){n=0;break}for(;;)if(i=0|r[(s=n+20|0)>>2])n=i,t=s;else{if(!(i=0|r[(s=n+16|0)>>2]))break;n=i,t=s}r[t>>2]=0}else x=0|r[c+8>>2],r[x+12>>2]=n,r[n+8>>2]=x}while(0);do{if(a){if(t=0|r[c+28>>2],(0|c)==(0|r[(i=23732+(t<<2)|0)>>2])){if(r[i>>2]=n,!n){o&=~(1<<t),r[5858]=o;break}}else if(r[((0|r[(x=a+16|0)>>2])==(0|c)?x:a+20)>>2]=n,!n)break;r[n+24>>2]=a,0|(t=0|r[c+16>>2])&&(r[n+16>>2]=t,r[t+24>>2]=n),(t=0|r[c+20>>2])&&(r[n+20>>2]=t,r[t+24>>2]=n)}}while(0);t:do{if(l>>>0<16)x=l+h|0,r[c+4>>2]=3|x,r[(x=c+x+4|0)>>2]=1|r[x>>2];else{if(r[c+4>>2]=3|h,r[d+4>>2]=1|l,r[d+l>>2]=l,n=l>>>3,l>>>0<256){i=23468+(n<<1<<2)|0,(t=0|r[5857])&(n=1<<n)?n=0|r[(t=i+8|0)>>2]:(r[5857]=t|n,n=i,t=i+8|0),r[t>>2]=d,r[n+12>>2]=d,r[d+8>>2]=n,r[d+12>>2]=i;break}if(n=23732+((i=(n=l>>>8)?l>>>0>16777215?31:l>>>((i=14-((v=((x=n<<(b=(n+1048320|0)>>>16&8))+520192|0)>>>16&4)|b|(i=((x<<=v)+245760|0)>>>16&2))+(x<<i>>>15)|0)+7|0)&1|i<<1:0)<<2)|0,r[d+28>>2]=i,r[(t=d+16|0)+4>>2]=0,r[t>>2]=0,!(o&(t=1<<i))){r[5858]=o|t,r[n>>2]=d,r[d+24>>2]=n,r[d+12>>2]=d,r[d+8>>2]=d;break}n=0|r[n>>2];e:do{if((-8&r[n+4>>2])!=(0|l)){for(o=l<<(31==(0|i)?0:25-(i>>>1));t=0|r[(i=n+16+(o>>>31<<2)|0)>>2];){if((-8&r[t+4>>2])==(0|l)){n=t;break e}o<<=1,n=t}r[i>>2]=d,r[d+24>>2]=n,r[d+12>>2]=d,r[d+8>>2]=d;break t}}while(0);x=0|r[(b=n+8|0)>>2],r[x+12>>2]=d,r[b>>2]=d,r[d+8>>2]=x,r[d+12>>2]=n,r[d+24>>2]=0}}while(0);return R=e,0|(x=c+8|0)}p=h}else p=h;else p=-1}while(0);if((i=0|r[5859])>>>0>=p>>>0)return n=i-p|0,t=0|r[5862],n>>>0>15?(x=t+p|0,r[5862]=x,r[5859]=n,r[x+4>>2]=1|n,r[t+i>>2]=n,r[t+4>>2]=3|p):(r[5859]=0,r[5862]=0,r[t+4>>2]=3|i,r[(x=t+i+4|0)>>2]=1|r[x>>2]),R=e,0|(x=t+8|0);if((l=0|r[5860])>>>0>p>>>0)return v=l-p|0,r[5860]=v,b=(x=0|r[5863])+p|0,r[5863]=b,r[b+4>>2]=1|v,r[x+4>>2]=3|p,R=e,0|(x=x+8|0);if(0|r[5975]?t=0|r[5977]:(r[5977]=4096,r[5976]=4096,r[5978]=-1,r[5979]=-1,r[5980]=0,r[5968]=0,r[5975]=-16&f^1431655768,t=4096),c=p+48|0,(h=(a=t+(u=p+47|0)|0)&(s=0-t|0))>>>0<=p>>>0)return R=e,0|(x=0);if(0|(t=0|r[5967])&&(f=(d=0|r[5965])+h|0)>>>0<=d>>>0|f>>>0>t>>>0)return R=e,0|(x=0);t:do{if(4&r[5968])n=0,m=143;else{i=0|r[5863];e:do{if(i){for(o=23876;!((f=0|r[o>>2])>>>0<=i>>>0&&(f+(0|r[o+4>>2])|0)>>>0>i>>>0);){if(!(t=0|r[o+8>>2])){m=128;break e}o=t}if((n=a-l&s)>>>0<2147483647)if((0|(t=0|Ke(0|n)))==((0|r[o>>2])+(0|r[o+4>>2])|0)){if(-1!=(0|t)){l=n,a=t,m=145;break t}}else o=t,m=136;else n=0}else m=128}while(0);do{if(128==(0|m))if(-1!=(0|(i=0|Ke(0)))&&(n=i,g=(n=(0==((g=(A=0|r[5976])+-1|0)&n)?0:(g+n&0-A)-n|0)+h|0)+(A=0|r[5965])|0,n>>>0>p>>>0&n>>>0<2147483647)){if(0|(f=0|r[5967])&&g>>>0<=A>>>0|g>>>0>f>>>0){n=0;break}if((0|(t=0|Ke(0|n)))==(0|i)){l=n,a=i,m=145;break t}o=t,m=136}else n=0}while(0);do{if(136==(0|m)){if(i=0-n|0,!(c>>>0>n>>>0&n>>>0<2147483647&-1!=(0|o))){if(-1==(0|o)){n=0;break}l=n,a=o,m=145;break t}if((t=u-n+(t=0|r[5977])&0-t)>>>0>=2147483647){l=n,a=o,m=145;break t}if(-1==(0|Ke(0|t))){Ke(0|i),n=0;break}l=t+n|0,a=o,m=145;break t}}while(0);r[5968]=4|r[5968],m=143}}while(0);if(143==(0|m)&&h>>>0<2147483647&&!(-1==(0|(v=0|Ke(0|h)))|1^(_=(y=(g=0|Ke(0))-v|0)>>>0>(p+40|0)>>>0)|v>>>0<g>>>0&-1!=(0|v)&-1!=(0|g)^1)&&(l=_?y:n,a=v,m=145),145==(0|m)){n=(0|r[5965])+l|0,r[5965]=n,n>>>0>(0|r[5966])>>>0&&(r[5966]=n),u=0|r[5863];t:do{if(u){for(n=23876;;){if((0|a)==((t=0|r[n>>2])+(i=0|r[n+4>>2])|0)){m=154;break}if(!(o=0|r[n+8>>2]))break;n=o}if(154==(0|m)&&(b=n+4|0,0==(8&r[n+12>>2]))&&a>>>0>u>>>0&t>>>0<=u>>>0){r[b>>2]=i+l,b=u+(v=0==(7&(v=u+8|0))?0:0-v&7)|0,v=(x=(0|r[5860])+l|0)-v|0,r[5863]=b,r[5860]=v,r[b+4>>2]=1|v,r[u+x+4>>2]=40,r[5864]=r[5979];break}for(a>>>0<(0|r[5861])>>>0&&(r[5861]=a),i=a+l|0,n=23876;;){if((0|r[n>>2])==(0|i)){m=162;break}if(!(t=0|r[n+8>>2]))break;n=t}if(162==(0|m)&&0==(8&r[n+12>>2])){r[n>>2]=a,r[(d=n+4|0)>>2]=(0|r[d>>2])+l,h=(d=a+(0==(7&(d=a+8|0))?0:0-d&7)|0)+p|0,c=(n=i+(0==(7&(n=i+8|0))?0:0-n&7)|0)-d-p|0,r[d+4>>2]=3|p;e:do{if((0|u)==(0|n))x=(0|r[5860])+c|0,r[5860]=x,r[5863]=h,r[h+4>>2]=1|x;else{if((0|r[5862])==(0|n)){x=(0|r[5859])+c|0,r[5859]=x,r[5862]=h,r[h+4>>2]=1|x,r[h+x>>2]=x;break}if(1==(3&(t=0|r[n+4>>2]))){l=-8&t,o=t>>>3;n:do{if(t>>>0<256){if(t=0|r[n+8>>2],(0|(i=0|r[n+12>>2]))==(0|t)){r[5857]=r[5857]&~(1<<o);break}r[t+12>>2]=i,r[i+8>>2]=t;break}a=0|r[n+24>>2],t=0|r[n+12>>2];do{if((0|t)==(0|n)){if(t=0|r[(o=(i=n+16|0)+4|0)>>2])i=o;else if(!(t=0|r[i>>2])){t=0;break}for(;;)if(o=0|r[(s=t+20|0)>>2])t=o,i=s;else{if(!(o=0|r[(s=t+16|0)>>2]))break;t=o,i=s}r[i>>2]=0}else x=0|r[n+8>>2],r[x+12>>2]=t,r[t+8>>2]=x}while(0);if(!a)break;o=23732+((i=0|r[n+28>>2])<<2)|0;do{if((0|r[o>>2])==(0|n)){if(r[o>>2]=t,0|t)break;r[5858]=r[5858]&~(1<<i);break n}if(r[((0|r[(x=a+16|0)>>2])==(0|n)?x:a+20)>>2]=t,!t)break n}while(0);if(r[t+24>>2]=a,0|(o=0|r[(i=n+16|0)>>2])&&(r[t+16>>2]=o,r[o+24>>2]=t),!(i=0|r[i+4>>2]))break;r[t+20>>2]=i,r[i+24>>2]=t}while(0);n=n+l|0,s=l+c|0}else s=c;if(r[(n=n+4|0)>>2]=-2&r[n>>2],r[h+4>>2]=1|s,r[h+s>>2]=s,n=s>>>3,s>>>0<256){i=23468+(n<<1<<2)|0,(t=0|r[5857])&(n=1<<n)?n=0|r[(t=i+8|0)>>2]:(r[5857]=t|n,n=i,t=i+8|0),r[t>>2]=h,r[n+12>>2]=h,r[h+8>>2]=n,r[h+12>>2]=i;break}n=s>>>8;do{if(n){if(s>>>0>16777215){o=31;break}o=s>>>((o=14-((v=((x=n<<(b=(n+1048320|0)>>>16&8))+520192|0)>>>16&4)|b|(o=((x<<=v)+245760|0)>>>16&2))+(x<<o>>>15)|0)+7|0)&1|o<<1}else o=0}while(0);if(n=23732+(o<<2)|0,r[h+28>>2]=o,r[(t=h+16|0)+4>>2]=0,r[t>>2]=0,!((t=0|r[5858])&(i=1<<o))){r[5858]=t|i,r[n>>2]=h,r[h+24>>2]=n,r[h+12>>2]=h,r[h+8>>2]=h;break}n=0|r[n>>2];n:do{if((-8&r[n+4>>2])!=(0|s)){for(o=s<<(31==(0|o)?0:25-(o>>>1));t=0|r[(i=n+16+(o>>>31<<2)|0)>>2];){if((-8&r[t+4>>2])==(0|s)){n=t;break n}o<<=1,n=t}r[i>>2]=h,r[h+24>>2]=n,r[h+12>>2]=h,r[h+8>>2]=h;break e}}while(0);x=0|r[(b=n+8|0)>>2],r[x+12>>2]=h,r[b>>2]=h,r[h+8>>2]=x,r[h+12>>2]=n,r[h+24>>2]=0}}while(0);return R=e,0|(x=d+8|0)}for(n=23876;!((t=0|r[n>>2])>>>0<=u>>>0&&(x=t+(0|r[n+4>>2])|0)>>>0>u>>>0);)n=0|r[n+8>>2];n=(t=(t=(s=x+-47|0)+(0==(7&(t=s+8|0))?0:0-t&7)|0)>>>0<(s=u+16|0)>>>0?u:t)+8|0,b=a+(v=0==(7&(v=a+8|0))?0:0-v&7)|0,v=(i=l+-40|0)-v|0,r[5863]=b,r[5860]=v,r[b+4>>2]=1|v,r[a+i+4>>2]=40,r[5864]=r[5979],r[(i=t+4|0)>>2]=27,r[n>>2]=r[5969],r[n+4>>2]=r[5970],r[n+8>>2]=r[5971],r[n+12>>2]=r[5972],r[5969]=a,r[5970]=l,r[5972]=0,r[5971]=n,n=t+24|0;do{b=n,r[(n=n+4|0)>>2]=7}while((b+8|0)>>>0<x>>>0);if((0|t)!=(0|u)){if(a=t-u|0,r[i>>2]=-2&r[i>>2],r[u+4>>2]=1|a,r[t>>2]=a,n=a>>>3,a>>>0<256){i=23468+(n<<1<<2)|0,(t=0|r[5857])&(n=1<<n)?n=0|r[(t=i+8|0)>>2]:(r[5857]=t|n,n=i,t=i+8|0),r[t>>2]=u,r[n+12>>2]=u,r[u+8>>2]=n,r[u+12>>2]=i;break}if(i=23732+((o=(n=a>>>8)?a>>>0>16777215?31:a>>>((o=14-((v=((x=n<<(b=(n+1048320|0)>>>16&8))+520192|0)>>>16&4)|b|(o=((x<<=v)+245760|0)>>>16&2))+(x<<o>>>15)|0)+7|0)&1|o<<1:0)<<2)|0,r[u+28>>2]=o,r[u+20>>2]=0,r[s>>2]=0,!((n=0|r[5858])&(t=1<<o))){r[5858]=n|t,r[i>>2]=u,r[u+24>>2]=i,r[u+12>>2]=u,r[u+8>>2]=u;break}n=0|r[i>>2];e:do{if((-8&r[n+4>>2])!=(0|a)){for(o=a<<(31==(0|o)?0:25-(o>>>1));t=0|r[(i=n+16+(o>>>31<<2)|0)>>2];){if((-8&r[t+4>>2])==(0|a)){n=t;break e}o<<=1,n=t}r[i>>2]=u,r[u+24>>2]=n,r[u+12>>2]=u,r[u+8>>2]=u;break t}}while(0);x=0|r[(b=n+8|0)>>2],r[x+12>>2]=u,r[b>>2]=u,r[u+8>>2]=x,r[u+12>>2]=n,r[u+24>>2]=0}}else 0==(0|(x=0|r[5861]))|a>>>0<x>>>0&&(r[5861]=a),r[5969]=a,r[5970]=l,r[5972]=0,r[5866]=r[5975],r[5865]=-1,r[5870]=23468,r[5869]=23468,r[5872]=23476,r[5871]=23476,r[5874]=23484,r[5873]=23484,r[5876]=23492,r[5875]=23492,r[5878]=23500,r[5877]=23500,r[5880]=23508,r[5879]=23508,r[5882]=23516,r[5881]=23516,r[5884]=23524,r[5883]=23524,r[5886]=23532,r[5885]=23532,r[5888]=23540,r[5887]=23540,r[5890]=23548,r[5889]=23548,r[5892]=23556,r[5891]=23556,r[5894]=23564,r[5893]=23564,r[5896]=23572,r[5895]=23572,r[5898]=23580,r[5897]=23580,r[5900]=23588,r[5899]=23588,r[5902]=23596,r[5901]=23596,r[5904]=23604,r[5903]=23604,r[5906]=23612,r[5905]=23612,r[5908]=23620,r[5907]=23620,r[5910]=23628,r[5909]=23628,r[5912]=23636,r[5911]=23636,r[5914]=23644,r[5913]=23644,r[5916]=23652,r[5915]=23652,r[5918]=23660,r[5917]=23660,r[5920]=23668,r[5919]=23668,r[5922]=23676,r[5921]=23676,r[5924]=23684,r[5923]=23684,r[5926]=23692,r[5925]=23692,r[5928]=23700,r[5927]=23700,r[5930]=23708,r[5929]=23708,r[5932]=23716,r[5931]=23716,b=a+(v=0==(7&(v=a+8|0))?0:0-v&7)|0,v=(x=l+-40|0)-v|0,r[5863]=b,r[5860]=v,r[b+4>>2]=1|v,r[a+x+4>>2]=40,r[5864]=r[5979]}while(0);if((n=0|r[5860])>>>0>p>>>0)return v=n-p|0,r[5860]=v,b=(x=0|r[5863])+p|0,r[5863]=b,r[b+4>>2]=1|v,r[x+4>>2]=3|p,R=e,0|(x=x+8|0)}return r[(x=23424)>>2]=12,R=e,0|(x=0)}function Ie(t){var e=0,n=0,i=0,o=0,s=0,a=0,l=0,c=0;if(t|=0){n=t+-8|0,o=0|r[5861],c=n+(e=-8&(t=0|r[t+-4>>2]))|0;do{if(1&t)l=n,a=n;else{if(i=0|r[n>>2],!(3&t))return;if(s=i+e|0,(a=n+(0-i)|0)>>>0<o>>>0)return;if((0|r[5862])==(0|a)){if(3!=(3&(e=0|r[(t=c+4|0)>>2]))){l=a,e=s;break}return r[5859]=s,r[t>>2]=-2&e,r[a+4>>2]=1|s,void(r[a+s>>2]=s)}if(n=i>>>3,i>>>0<256){if(t=0|r[a+8>>2],(0|(e=0|r[a+12>>2]))==(0|t)){r[5857]=r[5857]&~(1<<n),l=a,e=s;break}r[t+12>>2]=e,r[e+8>>2]=t,l=a,e=s;break}o=0|r[a+24>>2],t=0|r[a+12>>2];do{if((0|t)==(0|a)){if(t=0|r[(n=(e=a+16|0)+4|0)>>2])e=n;else if(!(t=0|r[e>>2])){t=0;break}for(;;)if(n=0|r[(i=t+20|0)>>2])t=n,e=i;else{if(!(n=0|r[(i=t+16|0)>>2]))break;t=n,e=i}r[e>>2]=0}else l=0|r[a+8>>2],r[l+12>>2]=t,r[t+8>>2]=l}while(0);if(o){if(e=0|r[a+28>>2],(0|r[(n=23732+(e<<2)|0)>>2])==(0|a)){if(r[n>>2]=t,!t){r[5858]=r[5858]&~(1<<e),l=a,e=s;break}}
vendor: 11,038 bytes, line 2
2else if(r[((0|r[(l=o+16|0)>>2])==(0|a)?l:o+20)>>2]=t,!t){l=a,e=s;break}r[t+24>>2]=o,0|(n=0|r[(e=a+16|0)>>2])&&(r[t+16>>2]=n,r[n+24>>2]=t),(e=0|r[e+4>>2])?(r[t+20>>2]=e,r[e+24>>2]=t,l=a,e=s):(l=a,e=s)}else l=a,e=s}}while(0);if(!(a>>>0>=c>>>0)&&1&(i=0|r[(t=c+4|0)>>2])){if(2&i)r[t>>2]=-2&i,r[l+4>>2]=1|e,r[a+e>>2]=e,o=e;else{if((0|r[5863])==(0|c)){if(c=(0|r[5860])+e|0,r[5860]=c,r[5863]=l,r[l+4>>2]=1|c,(0|l)!=(0|r[5862]))return;return r[5862]=0,void(r[5859]=0)}if((0|r[5862])==(0|c))return c=(0|r[5859])+e|0,r[5859]=c,r[5862]=a,r[l+4>>2]=1|c,void(r[a+c>>2]=c);o=(-8&i)+e|0,n=i>>>3;do{if(i>>>0<256){if(e=0|r[c+8>>2],(0|(t=0|r[c+12>>2]))==(0|e)){r[5857]=r[5857]&~(1<<n);break}r[e+12>>2]=t,r[t+8>>2]=e;break}s=0|r[c+24>>2],t=0|r[c+12>>2];do{if((0|t)==(0|c)){if(t=0|r[(n=(e=c+16|0)+4|0)>>2])e=n;else if(!(t=0|r[e>>2])){n=0;break}for(;;)if(n=0|r[(i=t+20|0)>>2])t=n,e=i;else{if(!(n=0|r[(i=t+16|0)>>2]))break;t=n,e=i}r[e>>2]=0,n=t}else n=0|r[c+8>>2],r[n+12>>2]=t,r[t+8>>2]=n,n=t}while(0);if(0|s){if(t=0|r[c+28>>2],(0|r[(e=23732+(t<<2)|0)>>2])==(0|c)){if(r[e>>2]=n,!n){r[5858]=r[5858]&~(1<<t);break}}else if(r[((0|r[(i=s+16|0)>>2])==(0|c)?i:s+20)>>2]=n,!n)break;r[n+24>>2]=s,0|(e=0|r[(t=c+16|0)>>2])&&(r[n+16>>2]=e,r[e+24>>2]=n),0|(t=0|r[t+4>>2])&&(r[n+20>>2]=t,r[t+24>>2]=n)}}while(0);if(r[l+4>>2]=1|o,r[a+o>>2]=o,(0|l)==(0|r[5862]))return void(r[5859]=o)}if(t=o>>>3,o>>>0<256)return n=23468+(t<<1<<2)|0,(e=0|r[5857])&(t=1<<t)?t=0|r[(e=n+8|0)>>2]:(r[5857]=e|t,t=n,e=n+8|0),r[e>>2]=l,r[t+12>>2]=l,r[l+8>>2]=t,void(r[l+12>>2]=n);t=23732+((i=(t=o>>>8)?o>>>0>16777215?31:o>>>((i=14-((s=((c=t<<(a=(t+1048320|0)>>>16&8))+520192|0)>>>16&4)|a|(i=((c<<=s)+245760|0)>>>16&2))+(c<<i>>>15)|0)+7|0)&1|i<<1:0)<<2)|0,r[l+28>>2]=i,r[l+20>>2]=0,r[l+16>>2]=0,e=0|r[5858],n=1<<i;t:do{if(e&n){t=0|r[t>>2];e:do{if((-8&r[t+4>>2])!=(0|o)){for(i=o<<(31==(0|i)?0:25-(i>>>1));e=0|r[(n=t+16+(i>>>31<<2)|0)>>2];){if((-8&r[e+4>>2])==(0|o)){t=e;break e}i<<=1,t=e}r[n>>2]=l,r[l+24>>2]=t,r[l+12>>2]=l,r[l+8>>2]=l;break t}}while(0);c=0|r[(a=t+8|0)>>2],r[c+12>>2]=l,r[a>>2]=l,r[l+8>>2]=c,r[l+12>>2]=t,r[l+24>>2]=0}else r[5858]=e|n,r[t>>2]=l,r[l+24>>2]=t,r[l+12>>2]=l,r[l+8>>2]=l}while(0);if(c=(0|r[5865])-1|0,r[5865]=c,!(0|c)){for(t=23884;t=0|r[t>>2];)t=t+8|0;r[5865]=-1}}}}function Be(t,e){e|=0;var n=0;return(t|=0)?(n=0|v(e,t),(e|t)>>>0>65535&&(n=((n>>>0)/(t>>>0)|0)==(0|e)?n:-1)):n=0,(t=0|Me(n))&&3&r[t+-4>>2]?(Ze(0|t,0,0|n),0|t):0|t}function Re(t,e,n,i){return 0|(E((e|=0)+(i|=0)+((n=(t|=0)+(n|=0)>>>0)>>>0<t>>>0|0)>>>0|0),n)}function Le(t,e,n,i){return 0|(E(0|(i=(e|=0)-(i|=0)-((n|=0)>>>0>(t|=0)>>>0|0)>>>0)),t-n>>>0)}function Oe(t){return 0|((t|=0)?31-(0|w(t^t-1)):32)}function De(t,e,n,i,o){o|=0;var s=0,a=0,l=0,c=0,u=0,h=0,d=0,p=0,f=0,A=0;if(h=t|=0,a=n|=0,l=p=i|=0,!(u=c=e|=0))return s=0!=(0|o),l?s?(r[o>>2]=0|t,r[o+4>>2]=0,o=0,0|(E(0|(p=0)),o)):(o=0,0|(E(0|(p=0)),o)):(s&&(r[o>>2]=(h>>>0)%(a>>>0),r[o+4>>2]=0),o=(h>>>0)/(a>>>0)>>>0,0|(E(0|(p=0)),o));s=0==(0|l);do{if(a){if(!s){if((s=(0|w(0|l))-(0|w(0|u))|0)>>>0<=31){a=d=s+1|0,t=h>>>(d>>>0)&(e=s-31>>31)|u<<(l=31-s|0),e&=u>>>(d>>>0),s=0,l=h<<l;break}return o?(r[o>>2]=0|t,r[o+4>>2]=0|c,o=0,0|(E(0|(p=0)),o)):(o=0,0|(E(0|(p=0)),o))}if((s=a-1|0)&a){a=l=33+(0|w(0|a))-(0|w(0|u))|0,t=(d=32-l|0)-1>>31&u>>>((f=l-32|0)>>>0)|(u<<d|h>>>(l>>>0))&(e=f>>31),e&=u>>>(l>>>0),s=h<<(A=64-l|0)&(c=d>>31),l=(u<<A|h>>>(f>>>0))&c|h<<d&l-33>>31;break}return 0|o&&(r[o>>2]=s&h,r[o+4>>2]=0),1==(0|a)?(A=0|t,0|(E(0|(f=0|c)),A)):(f=u>>>((A=0|Oe(0|a))>>>0)|0,A=u<<32-A|h>>>(A>>>0),0|(E(0|f),A))}if(s)return 0|o&&(r[o>>2]=(u>>>0)%(a>>>0),r[o+4>>2]=0),A=(u>>>0)/(a>>>0)>>>0,0|(E(0|(f=0)),A);if(!h)return 0|o&&(r[o>>2]=0,r[o+4>>2]=(u>>>0)%(l>>>0)),A=(u>>>0)/(l>>>0)>>>0,0|(E(0|(f=0)),A);if(!((s=l-1|0)&l))return 0|o&&(r[o>>2]=0|t,r[o+4>>2]=s&u),f=0,A=u>>>((0|Oe(0|l))>>>0),0|(E(0|f),A);if((s=(0|w(0|l))-(0|w(0|u))|0)>>>0<=30){a=e=s+1|0,t=u<<(l=31-s|0)|h>>>(e>>>0),e=u>>>(e>>>0),s=0,l=h<<l;break}return o?(r[o>>2]=0|t,r[o+4>>2]=0|c,A=0,0|(E(0|(f=0)),A)):(A=0,0|(E(0|(f=0)),A))}while(0);if(a){u=0|Re(0|(d=0|n),0|(h=0|p),-1,-1),n=0|C(),c=l,l=0;do{i=c,c=s>>>31|c<<1,s=l|s<<1,Le(0|u,0|n,0|(i=t<<1|i>>>31),0|(p=t>>>31|e<<1)),l=1&(f=(A=0|C())>>31|((0|A)<0?-1:0)<<1),t=0|Le(0|i,0|p,f&d,(((0|A)<0?-1:0)>>31|((0|A)<0?-1:0)<<1)&h),e=0|C(),a=a-1|0}while(0!=(0|a));u=c,c=0}else u=l,c=0,l=0;return a=0,0|o&&(r[o>>2]=t,r[o+4>>2]=e),A=s<<1&-2|l,0|(E(0|(f=(0|s)>>>31|(u|a)<<1|c)),A)}function ke(t,e,n,i){n|=0;var r,o,s,a,l;return o=(i|=0)>>31|((0|i)<0?-1:0)<<1,r=((0|i)<0?-1:0)>>31|((0|i)<0?-1:0)<<1,s=0|Le((l=(e|=0)>>31|((0|e)<0?-1:0)<<1)^(t|=0),(a=((0|e)<0?-1:0)>>31|((0|e)<0?-1:0)<<1)^e,0|l,0|a),t=o^l,e=r^a,0|Le(De(s,0|C(),0|Le(o^n,r^i,0|o,0|r),0|C(),0)^t,C()^e,0|t,0|e)}function Fe(t,e,n,i){e|=0,i|=0;var r,o;return n=0|function(t,e){var n,i,r,o=0;return t=((n=0|v(o=65535&(e|=0),r=65535&(t|=0)))>>>16)+(0|v(o,i=t>>>16))|0,e=0|v(o=e>>>16,r),0|(E((t>>>16)+(0|v(o,i))+(((65535&t)+e|0)>>>16)|0),t+e<<16|65535&n)}(r=t|=0,o=n|=0),t=0|C(),0|(E((0|v(e,o))+(0|v(i,r))+t|0),n)}function Ne(t,e,n,i){n|=0;var o,s,a,l,c,u;return o=R,R=R+16|0,l=0|o,u=(i|=0)>>31|((0|i)<0?-1:0)<<1,c=((0|i)<0?-1:0)>>31|((0|i)<0?-1:0)<<1,De(t=0|Le((a=(e|=0)>>31|((0|e)<0?-1:0)<<1)^(t|=0),(s=((0|e)<0?-1:0)>>31|((0|e)<0?-1:0)<<1)^e,0|a,0|s),e=0|C(),0|Le(u^n,c^i,0|u,0|c),0|C(),l),i=0|Le(r[l>>2]^a,r[l+4>>2]^s,0|a,0|s),n=0|C(),R=o,0|(E(0|n),i)}function ze(t,e,n,i){var o,s;return s=R,R=R+16|0,De(t|=0,e|=0,n|=0,i|=0,o=0|s),R=s,0|(E(0|r[o+4>>2]),r[o>>2])}function Ue(t,e,n){return t|=0,e|=0,(0|(n|=0))<32?(E(e>>n),t>>>n|(e&(1<<n)-1)<<32-n):(E(0|((0|e)<0?-1:0)),e>>n-32)}function Ge(t,e,n){return t|=0,e|=0,(0|(n|=0))<32?(E(e>>>n|0),t>>>n|(e&(1<<n)-1)<<32-n):(E(0),e>>>n-32|0)}function Ve(t,e,n){return t|=0,e|=0,(0|(n|=0))<32?(E(e<<n|(t&(1<<n)-1<<32-n)>>>32-n),t<<n):(E(t<<n-32),0)}function je(t,e){return e=+e,(t=+t)!=t?+e:e!=e?+t:+x(+t,+e)}function He(t,e){return e=+e,(t=+t)!=t?+e:e!=e?+t:+b(+t,+e)}function We(t){return(t=+t)>=0?+l(t+.5):+_(t-.5)}function qe(t,e,n){t|=0,e|=0;var o,s,a=0;if((0|(n|=0))>=8192)return M(0|t,0|e,0|n),0|t;if(s=0|t,o=t+n|0,(3&t)==(3&e)){for(;3&t;){if(!n)return 0|s;i[t|0]=0|i[e|0],t=t+1|0,e=e+1|0,n=n-1|0}for(a=(n=-4&o)-64|0;(0|t)<=(0|a);)r[t>>2]=r[e>>2],r[t+4>>2]=r[e+4>>2],r[t+8>>2]=r[e+8>>2],r[t+12>>2]=r[e+12>>2],r[t+16>>2]=r[e+16>>2],r[t+20>>2]=r[e+20>>2],r[t+24>>2]=r[e+24>>2],r[t+28>>2]=r[e+28>>2],r[t+32>>2]=r[e+32>>2],r[t+36>>2]=r[e+36>>2],r[t+40>>2]=r[e+40>>2],r[t+44>>2]=r[e+44>>2],r[t+48>>2]=r[e+48>>2],r[t+52>>2]=r[e+52>>2],r[t+56>>2]=r[e+56>>2],r[t+60>>2]=r[e+60>>2],t=t+64|0,e=e+64|0;for(;(0|t)<(0|n);)r[t>>2]=r[e>>2],t=t+4|0,e=e+4|0}else for(n=o-4|0;(0|t)<(0|n);)i[t|0]=0|i[e|0],i[t+1|0]=0|i[e+1|0],i[t+2|0]=0|i[e+2|0],i[t+3|0]=0|i[e+3|0],t=t+4|0,e=e+4|0;for(;(0|t)<(0|o);)i[t|0]=0|i[e|0],t=t+1|0,e=e+1|0;return 0|s}function Ze(t,e,n){e|=0;var o,s=0,a=0,l=0;if(o=(t|=0)+(n|=0)|0,e&=255,(0|n)>=67){for(;3&t;)i[t|0]=e,t=t+1|0;for(l=e|e<<8|e<<16|e<<24,a=(s=-4&o)-64|0;(0|t)<=(0|a);)r[t>>2]=l,r[t+4>>2]=l,r[t+8>>2]=l,r[t+12>>2]=l,r[t+16>>2]=l,r[t+20>>2]=l,r[t+24>>2]=l,r[t+28>>2]=l,r[t+32>>2]=l,r[t+36>>2]=l,r[t+40>>2]=l,r[t+44>>2]=l,r[t+48>>2]=l,r[t+52>>2]=l,r[t+56>>2]=l,r[t+60>>2]=l,t=t+64|0;for(;(0|t)<(0|s);)r[t>>2]=l,t=t+4|0}for(;(0|t)<(0|o);)i[t|0]=e,t=t+1|0;return o-n|0}function Xe(t){return(t=+t)>=0?+l(t+.5):+_(t-.5)}function Ke(t){t|=0;var e,n,i;return i=0|P(),(0|t)>0&(0|(e=(n=0|r[a>>2])+t|0))<(0|n)|(0|e)<0?(B(0|e),S(12),-1):(0|e)>(0|i)&&!(0|I(0|e))?(S(12),-1):(r[a>>2]=e,0|n)}return{___divdi3:ke,___muldi3:Fe,___remdi3:Ne,___uremdi3:ze,_areNeighborCells:function(t,e,n,i,o){o|=0;var s,a,l,c=0,u=0,h=0,d=0;if(l=R,R=R+64|0,a=l,s=l+56|0,!(!0&134217728==(2013265920&(e|=0))&!0&134217728==(2013265920&(i|=0))))return R=l,0|(o=5);if((0|(t|=0))==(0|(n|=0))&(0|e)==(0|i))return r[o>>2]=0,R=l,0|(o=0);if(u=0|Ge(0|t,0|e,52),C(),u&=15,d=0|Ge(0|n,0|i,52),C(),(0|u)!=(15&d))return R=l,0|(o=12);if(c=u+-1|0,u>>>0>1){Dt(t,e,c,a),Dt(n,i,c,s),h=0|r[(d=a)>>2],d=0|r[d+4>>2];t:do{if((0|h)==(0|r[s>>2])&&(0|d)==(0|r[s+4>>2])){c=0|Ge(0|t,0|e,0|(u=3*(15^u)|0)),C(),c&=7,u=0|Ge(0|n,0|i,0|u),C(),u&=7;do{if(0==(0|c)|0==(0|u))r[o>>2]=1,c=0;else if(7==(0|c))c=5;else{if(1==(0|c)|1==(0|u)&&0|Ft(h,d)){c=5;break}if((0|r[15536+(c<<2)>>2])!=(0|u)&&(0|r[15568+(c<<2)>>2])!=(0|u))break t;r[o>>2]=1,c=0}}while(0);return R=l,0|(o=c)}}while(0)}u=(c=a)+56|0;do{r[c>>2]=0,c=c+4|0}while((0|c)<(0|u));return L(t,e,1,a),c=(0|r[(e=a)>>2])==(0|n)&&(0|r[e+4>>2])==(0|i)||(0|r[(e=a+8|0)>>2])==(0|n)&&(0|r[e+4>>2])==(0|i)||(0|r[(e=a+16|0)>>2])==(0|n)&&(0|r[e+4>>2])==(0|i)||(0|r[(e=a+24|0)>>2])==(0|n)&&(0|r[e+4>>2])==(0|i)||(0|r[(e=a+32|0)>>2])==(0|n)&&(0|r[e+4>>2])==(0|i)||(0|r[(e=a+40|0)>>2])==(0|n)&&(0|r[e+4>>2])==(0|i)?1:1&((0|r[(c=a+48|0)>>2])==(0|n)?(0|r[c+4>>2])==(0|i):0),r[o>>2]=c,R=l,0|(o=0)},_bitshift64Ashr:Ue,_bitshift64Lshr:Ge,_bitshift64Shl:Ve,_calloc:Be,_cellAreaKm2:function(t,e,n){return 0|(t=0|ie(t|=0,e|=0,n|=0))||(o[n>>3]=6371.007180918475*+o[n>>3]*6371.007180918475),0|t},_cellAreaM2:function(t,e,n){return 0|(t=0|ie(t|=0,e|=0,n|=0))||(o[n>>3]=6371.007180918475*+o[n>>3]*6371.007180918475*1e3*1e3),0|t},_cellAreaRads2:ie,_cellToBoundary:Xt,_cellToCenterChild:function(t,e,n,i){n|=0,i|=0;var o=0;return o=0|Ge(0|(t|=0),0|(e|=0),52),C(),(0|n)<16&(0|(o&=15))<=(0|n)?((0|o)<(0|n)&&(o=0|Ve(-1,-1,3+(3*(n+-1-o|0)|0)|0),o=0|Ve(0|~o,0|~C(),3*(15-n|0)|0),e=~C()&e,t&=~o),o=0|Ve(0|n,0,52),n=-15728641&e|C(),r[i>>2]=t|o,r[i+4>>2]=n,0|(i=0)):0|(i=4)},_cellToChildPos:function(t,e,n,i){n|=0,i|=0;var o,s=0,a=0,l=0,c=0,u=0,h=0,d=0,p=0,f=0,A=0,g=0,m=0,y=0,_=0;if(o=R,R=R+16|0,y=o,_=0|Ge(0|(t|=0),0|(e|=0),52),C(),_&=15,n>>>0>15)return R=o,0|(_=4);if((0|_)<(0|n))return R=o,0|(_=12);if((0|_)!=(0|n))if(a=0|Ve(0|n,0,52),a|=t,c=C()|-15728641&e,(0|_)>(0|n)){u=n;do{m=0|Ve(7,0,3*(14-u|0)|0),u=u+1|0,a|=m,c=C()|c}while((0|u)<(0|_));m=a}else m=a;else m=t,c=e;g=0|Ge(0|m,0|c,45),C();t:do{if(0|U(127&g)){if(u=0|Ge(0|m,0|c,52),C(),0|(u&=15))for(a=1;;){if(!(0==((g=0|Ve(7,0,3*(15-a|0)|0))&m)&0==(C()&c))){h=33;break t}if(!(a>>>0<u>>>0))break;a=a+1|0}if(r[(g=i)>>2]=0,r[g+4>>2]=0,(0|_)>(0|n)){for(g=-15728641&e,A=_;;){if(f=A,(A=A+-1|0)>>>0>15|(0|_)<(0|A)){h=19;break}if((0|_)!=(0|A))if(a=0|Ve(0|A,0,52),a|=t,u=C()|g,(0|_)<(0|f))p=a;else{h=A;do{p=0|Ve(7,0,3*(14-h|0)|0),h=h+1|0,a|=p,u=C()|u}while((0|h)<(0|_));p=a}else p=t,u=e;if(d=0|Ge(0|p,0|u,45),C(),0|U(127&d)){d=0|Ge(0|p,0|u,52),C(),d&=15;e:do{if(d)for(h=1;;){if(a=0|Ge(0|p,0|u,3*(15-h|0)|0),C(),0|(a&=7))break e;if(!(h>>>0<d>>>0)){a=0;break}h=h+1|0}else a=0}while(0);a=0==(0|a)&1}else a=0;if(u=0|Ge(0|t,0|e,3*(15-f|0)|0),C(),7==(0|(u&=7))){s=5,h=42;break}if(1==(0|u)&(a=0!=(0|a))){s=5,h=42;break}if(0|(p=u+((0!=(0|u)&a)<<31>>31)|0)&&(h=0|he(7,0,h=_-f|0,((0|h)<0)<<31>>31),d=0|C(),a?(a=0|Re(0|(a=0|Fe(0|h,0|d,5,0)),0|C(),-5,-1),a=0|Re(0|(a=0|ke(0|a,0|C(),6,0)),0|C(),1,0),u=0|C()):(a=h,u=d),f=0|Re(0|a,0|u,0|(f=0|Fe(0|h,0|d,0|(f=p+-1|0),((0|f)<0)<<31>>31)),0|C()),d=0|Re(0|f,0|(p=0|C()),0|r[(d=i)>>2],0|r[d+4>>2]),p=0|C(),r[(f=i)>>2]=d,r[f+4>>2]=p),(0|A)<=(0|n)){h=37;break}}if(19==(0|h))T(23313,22674,1099,22710);else{if(37==(0|h)){s=0|r[(l=i)+4>>2],l=0|r[l>>2];break}if(42==(0|h))return R=o,0|s}}else s=0,l=0}else h=33}while(0);
vendor: 1,637 bytes, line 2
2t:do{if(33==(0|h)){if(r[(g=i)>>2]=0,r[g+4>>2]=0,(0|_)>(0|n)){for(a=_;;){if(s=0|Ge(0|t,0|e,3*(15-a|0)|0),C(),7==(0|(s&=7))){s=5;break}if(s=0|Fe(0|(l=0|he(7,0,l=_-a|0,((0|l)<0)<<31>>31)),0|C(),0|s,0),l=0|C(),l=0|Re(0|r[(g=i)>>2],0|r[g+4>>2],0|s,0|l),s=0|C(),r[(g=i)>>2]=l,r[g+4>>2]=s,(0|(a=a+-1|0))<=(0|n))break t}return R=o,0|s}s=0,l=0}}while(0);return 0|kt(m,c,_,y)&&T(23313,22674,1063,22725),((0|s)>-1|-1==(0|s)&l>>>0>4294967295)&((0|(y=0|r[(_=y)+4>>2]))>(0|s)|((0|y)==(0|s)?(0|r[_>>2])>>>0>l>>>0:0))?(R=o,0|(_=0)):(T(23313,22674,1139,22710),0)},_cellToChildren:function(t,e,n,i){i|=0;var o,s,a=0,l=0;if(s=R,R=R+16|0,Qt(o=s,t|=0,e|=0,n|=0),0==(0|(t=0|r[(e=o)>>2]))&0==(0|(e=0|r[e+4>>2])))return R=s,0;a=0,n=0;do{r[(l=i+(a<<3)|0)>>2]=t,r[l+4>>2]=e,a=0|Re(0|a,0|n,1,0),n=0|C(),Jt(o),t=0|r[(l=o)>>2],e=0|r[l+4>>2]}while(!(0==(0|t)&0==(0|e)));return R=s,0},_cellToChildrenSize:kt,_cellToLatLng:Zt,_cellToLocalIj:function(t,e,n,i,r,o){var s,a;return t|=0,e|=0,n|=0,i|=0,o|=0,a=R,R=R+16|0,s=a,(r|=0)?t=15:(t=0|ce(t,e,n,i,s))||(_t(s,o),t=0),R=a,0|t},_cellToParent:Dt,_cellToVertex:ve,_cellToVertexes:function(t,e,n){n|=0;var i,o=0,s=0;return s=0==(0|Ft(t|=0,e|=0)),i=0==(0|(o=0|ve(t,e,0,n))),s?i?0|(o=0|ve(t,e,1,n+8|0))||0|(o=0|ve(t,e,2,n+16|0))||0|(o=0|ve(t,e,3,n+24|0))||(o=0|ve(t,e,4,n+32|0))?0|(s=o):0|ve(t,e,5,n+40|0):0|(s=o):i?0|(o=0|ve(t,e,1,n+8|0))||0|(o=0|ve(t,e,2,n+16|0))||0|(o=0|ve(t,e,3,n+24|0))||0|(o=0|ve(t,e,4,n+32|0))?0|(s=o):(r[(s=n+40|0)>>2]=0,r[s+4>>2]=0,0|(s=0)):0|(s=o)},_cellsToDirectedEdge:function(t,e,n,i,o){return o|=0,7==(0|(n=0|N(t|=0,e|=0,n|=0,i|=0)))?0|(o=11):(i=0|Ve(0|n,0,56),e=-2130706433&e|C()|268435456,r[o>
vendor: 2,716 bytes, line 2
2>2]=t|i,r[o+4>>2]=e,0|(o=0))},_cellsToLinkedMultiPolygon:function(t,e,n){n|=0;var i,o,s,a=0;if(s=R,R=R+32|0,i=s,t=0|function(t,e,n){t|=0,n|=0;var i,o,s=0,a=0,l=0,c=0,u=0,h=0;if(o=R,R=R+176|0,i=o,(0|(e|=0))<1)return be(n,0,0),R=o,0;for(u=0|Ge(0|r[(u=t)>>2],0|r[u+4>>2],52),C(),be(n,(0|e)>6?e:6,15&u),u=0;!(0|(s=0|Xt(0|r[(s=t+(u<<3)|0)>>2],0|r[s+4>>2],i)));){if((0|(s=0|r[i>>2]))>0){c=0;do{l=i+8+(c<<4)|0,(a=0|Te(n,s=i+8+((0|(c=c+1|0))%(0|s)<<4)|0,l))?Ee(n,a):Ce(n,l,s),s=0|r[i>>2]}while((0|c)<(0|s))}if((0|(u=u+1|0))>=(0|e)){s=0,h=13;break}}return 13==(0|h)?(R=o,0|s):(xe(n),R=o,0|(h=s))}(t|=0,e|=0,o=s+16|0),0|t)return R=s,0|(n=t);if(r[n>>2]=0,r[n+4>>2]=0,r[n+8>>2]=0,0|(t=0|we(o)))do{e=0|re(n);do{oe(e,t),a=t+16|0,r[i>>2]=r[a>>2],r[i+4>>2]=r[a+4>>2],r[i+8>>2]=r[a+8>>2],r[i+12>>2]=r[a+12>>2],Ee(o,t),t=0|Se(o,i)}while(0!=(0|t));t=0|we(o)}while(0!=(0|t));return xe(o),(t=0|ae(n))?(se(n),R=s,0|(a=t)):(R=s,0|(a=0))},_childPosToCell:function(t,e,n,i,o,s){t|=0,e|=0,s|=0;var a,l=0,c=0,u=0,h=0,d=0,p=0,f=0,A=0,g=0;if(a=R,R=R+16|0,l=a,(o|=0)>>>0>15)return R=a,0|(s=4);if(c=0|Ge(0|(n|=0),0|(i|=0),52),C(),(0|(c&=15))>(0|o))return R=a,0|(s=12);if(0|kt(n,i,o,l)&&T(23313,22674,1063,22725),!(((0|e)>-1|-1==(0|e)&t>>>0>4294967295)&((0|(h=0|r[(d=l)+4>>2]))>(0|e)|((0|h)==(0|e)?(0|r[d>>2])>>>0>t>>>0:0))))return R=a,0|(s=2);d=o-c|0,o=0|Ve(0|o,0,52),u=C()|-15728641&i,r[(h=s)>>2]=o|n,r[h+4>>2]=u,h=0|Ge(0|n,0|i,45),C();t:do{if(0|U(127&h)){if(0|c)for(l=1;;){if(!(0==((h=0|Ve(7,0,3*(15-l|0)|0))&n)&0==(C()&i)))break t;if(!(l>>>0<c>>>0))break;l=l+1|0}if((0|d)<1)return R=a,0|(s=0);for(h=15^c,i=-1,u=1,l=1;;){c=0|he(7,0,c=d-u|0,((0|c)<0)<<31>>31),n=0|C();do{if(l){if(l=0|ke(0|(l=0|Re(0|(l=0|Fe(0|c,0|n,5,0)),0|C(),-5,-1)),0|C(),6,0),(0|e)>(0|(o=0|C()))|(0|e)==(0|o)&t>>>0>l>>>0){e=0|Le(0|(e=0|Re(0|t,0|e,-1,-1)),0|C(),0|l,0|o),l=0|C(),A=0|r[(p=s)>>2],p=0|r[p+4>>2],f=0|Ve(7,0,0|(g=3*(h+i|0)|0)),p&=~C(),g=0|Ve(0|(o=0|Re(0|(i=0|ke(0|e,0|l,0|c,0|n)),0|(t=0|C()),2,0)),0|C(),0|g),p=C()|p,r[(o=s)>>2]=g|A&~f,r[o+4>>2]=p,t=0|Le(0|e,0|l,0|(t=0|Fe(0|i,0|t,0|c,0|n)),0|C()),l=0,e=0|C();break}f=0|r[(g=s)>>2],g=0|r[g+4>>2],A=0|Ve(7,0,3*(h+i|0)|0),g&=~C(),r[(l=s)>>2]=f&~A,r[l+4>>2]=g,l=1;break}o=0|r[(f=s)>>2],f=0|r[f+4>>2],p=0|Ve(7,0,0|(i=3*(h+i|0)|0)),f&=~C(),i=0|Ve(0|(g=0|ke(0|t,0|e,0|c,0|n)),0|(l=0|C()),0|i),f=C()|f,r[(A=s)>>2]=i|o&~p,r[A+4>>2]=f,t=0|Le(0|t,0|e,0|(l=0|Fe(0|g,0|l,0|c,0|n)),0|C()),l=0,e=0|C()}while(0);if(!((0|d)>(0|u))){e=0;break}i=~u,u=u+1|0}return R=a,0|e}}while(0);if((0|d)<1)return R=a,0|(g=0);for(o=15^c,l=1;;){if(A=0|he(7,0,A=d-l|0,((0|A)<0)<<31>>31),g=0|C(),n=0|r[(u=s)>>2],u=0|r[u+4>>2],i=0|Ve(7,0,0|(c=3*(o-l|0)|0)),u&=~C(),c=0|Ve(0|(p=0|ke(0|t,0|e,0|A,0|g)),0|(f=0|C()),0|c),u=C()|u,r[(h=s)>>2]=c|n&~i,r[h+4>>
vendor: 33,874 bytes, line 2
22]=u,t=0|Le(0|t,0|e,0|(g=0|Fe(0|p,0|f,0|A,0|g)),0|C()),e=0|C(),(0|d)<=(0|l)){e=0;break}l=l+1|0}return R=a,0|e},_compactCells:function(t,e,n,i){e|=0;var o,s=0,a=0,l=0,c=0,u=0,h=0,d=0,p=0,f=0,A=0,g=0,m=0,y=0,_=0,v=0,b=0,x=0,w=0,E=0,S=0;if(0==(0|(n|=0))&0==(0|(i|=0)))return 0|(E=0);if(a=0|r[(s=t|=0)>>2],!0&0==(15728640&(s=0|r[s+4>>2]))){if(!((0|i)>0|0==(0|i)&n>>>0>0))return 0|(E=0);if(r[(E=e)>>2]=a,r[E+4>>2]=s,1==(0|n)&0==(0|i))return 0|(E=0);s=1;do{w=0|r[(x=t+(s<<3)|0)+4>>2],r[(E=e+(s<<3)|0)>>2]=r[x>>2],r[E+4>>2]=w,s=s+1|0}while(0<(0|i)|0==(0|i)&s>>>0<n>>>0);return 0|(s=0)}if(!(w=0|Me(o=n<<3)))return 0|(E=13);if(qe(0|w,0|t,0|o),!(x=0|Be(n,8)))return Ie(w),0|(E=13);t:do{if(0|n){e:for(;;){v=0|Ge(0|(_=0|r[(s=w)>>2]),0|(s=0|r[s+4>>2]),52),C(),b=(v&=15)+-1|0,y=(0|n)>0;n:do{if(0!=(0|v)&y){if(A=((0|n)<0)<<31>>31,g=0|Ve(0|b,0,52),m=0|C(),b>>>0>15){if(!(0==(0|_)&0==(0|s))){E=17;break e}for(a=0;;){if((0|(a=a+1|0))>=(0|n))break n;if(!(0==(0|(m=0|r[(i=w+(a<<3)|0)>>2]))&0==(0|(i=0|r[i+4>>2])))){s=i,E=17;break e}}}for(a=0,t=_,i=s;;){if(!(0==(0|t)&0==(0|i))){if(!(!0&0==(117440512&i))){E=22;break e}if(c=0|Ge(0|t,0|i,52),C(),(0|(c&=15))<(0|b)){s=12,E=28;break e}if((0|c)!=(0|b)&&(t|=g,i=-15728641&i|m,c>>>0>=v>>>0)){l=b;do{f=0|Ve(7,0,3*(14-l|0)|0),l=l+1|0,t|=f,i=C()|i}while(l>>>0<c>>>0)}if(l=0|ze(0|t,0|i,0|n,0|A),C(),0==(0|(u=0|r[(c=h=x+(l<<3)|0)>>2]))&0==(0|(c=0|r[c+4>>2])))l=h;else for(f=0;;){if((0|f)>(0|n)){E=32;break e}if((0|u)==(0|t)&(-117440513&c)==(0|i)){d=0|Ge(0|u,0|c,56),C(),p=(d&=7)+1|0,S=0|Ge(0|u,0|c,45),C();i:do{if(0|U(127&S)){if(u=0|Ge(0|u,0|c,52),C(),!(u&=15)){c=6;break}for(c=1;;){if(!(0==((S=0|Ve(7,0,3*(15-c|0)|0))&t)&0==(C()&i))){c=7;break i}if(!(c>>>0<u>>>0)){c=6;break}c=c+1|0}}else c=7}while(0);if((d+2|0)>>>0>c>>>0){E=42;break e}S=0|Ve(0|p,0,56),i=C()|-117440513&i,r[(p=h)>>2]=0,r[p+4>>2]=0,t|=S}else l=(l+1|0)%(0|n)|0;if(0==(0|(u=0|r[(c=h=x+(l<<3)|0)>>2]))&0==(0|(c=0|r[c+4>>2]))){l=h;break}f=f+1|0}r[(S=l)>>2]=t,r[S+4>>2]=i}if((0|(a=a+1|0))>=(0|n))break n;t=0|r[(i=w+(a<<3)|0)>>2],i=0|r[i+4>>2]}}}while(0);if((n+5|0)>>>0<11){E=85;break}if(!(m=0|Be((0|n)/6|0,8))){E=49;break}n:do{if(y){f=0,p=0;do{if(!(0==(0|(a=0|r[(i=c=x+(f<<3)|0)>>2]))&0==(0|(i=0|r[i+4>>2])))){u=0|Ge(0|a,0|i,56),C(),t=(u&=7)+1|0,h=-117440513&i,S=0|Ge(0|a,0|i,45),C();i:do{if(0|U(127&S)){if(d=0|Ge(0|a,0|i,52),C(),0|(d&=15))for(l=1;;){if(!(0==(a&(S=0|Ve(7,0,3*(15-l|0)|0)))&0==(h&C())))break i;if(!(l>>>0<d>>>0))break;l=l+1|0}a|=i=0|Ve(0|t,0,56),i=C()|h,r[(t=c)>>2]=a,r[t+4>>2]=i,t=u+2|0}}while(0);7==(0|t)&&(r[(S=m+(p<<3)|0)>>2]=a,r[S+4>>2]=-117440513&i,p=p+1|0)}f=f+1|0}while((0|f)!=(0|n));if(y){if(f=((0|n)<0)<<31>>31,A=0|Ve(0|b,0,52),g=0|C(),b>>>0>15){if(!(0==(0|_)&0==(0|s))){s=4,E=84;break e}for(s=0;;){if((0|(s=s+1|0))>=(0|n)){a=0,s=p;break n}if(!(0==(0|r[(S=w+(s<<3)|0)>>2])&0==(0|r[S+4>>2]))){s=4,E=84;break e}}}for(d=0,a=0,h=_;;){do{if(!(0==(0|h)&0==(0|s))){if(c=0|Ge(0|h,0|s,52),C(),(0|(c&=15))<(0|b)){s=12,E=84;break e}do{if((0|c)==(0|b))i=h,c=s;else{if(i=h|A,t=-15728641&s|g,c>>>0<v>>>0){c=t;break}l=b;do{S=0|Ve(7,0,3*(14-l|0)|0),l=l+1|0,i|=S,t=C()|t}while(l>>>0<c>>>0);c=t}}while(0);for(l=0|ze(0|i,0|c,0|n,0|f),C(),t=0;;){if((0|t)>(0|n)){E=77;break e}if((-117440513&(u=0|r[(S=x+(l<<3)|0)+4>>2]))==(0|c)&&(0|r[S>>2])==(0|i)){E=79;break}if((0|r[(S=x+((l=(l+1|0)%(0|n)|0)<<3)|0)>>2])==(0|i)&&(0|r[S+4>>2])==(0|c))break;t=t+1|0}if(79==(0|E)&&(E=0,!0&100663296==(117440512&u)))break;r[(S=e+(a<<3)|0)>>2]=h,r[S+4>>2]=s,a=a+1|0}}while(0);if((0|(s=d+1|0))>=(0|n)){s=p;break n}d=s,h=0|r[(S=w+(s<<3)|0)>>2],s=0|r[S+4>>2]}}else a=0,s=p}else a=0,s=0}while(0);if(Ze(0|x,0,0|o),qe(0|w,0|m,s<<3),Ie(m),!s)break t;e=e+(a<<3)|0,n=s}if(17==(0|E))!0&0==(117440512&s)?(s=4,E=28):E=22;else if(32==(0|E))T(23313,22674,362,22684);else{if(42==(0|E))return Ie(w),Ie(x),0|(S=10);if(49==(0|E))return Ie(w),Ie(x),0|(S=13);if(77==(0|E))T(23313,22674,462,22684);else{if(84==(0|E))return Ie(m),Ie(w),Ie(x),0|(S=s);if(85==(0|E)){qe(0|e,0|w,n<<3);break}}}if(22==(0|E))return Ie(w),Ie(x),0|(S=5);if(28==(0|E))return Ie(w),Ie(x),0|(S=s)}}while(0);return Ie(w),Ie(x),0|(S=0)},_destroyLinkedMultiPolygon:se,_directedEdgeToBoundary:wt,_directedEdgeToCells:function(t,e,n){t|=0;var i,o,s,a=0;return i=R,R=R+16|0,a=i,!0&268435456==(2013265920&(e|=0))?(o=-2130706433&e|134217728,r[(s=n|=0)>>2]=t,r[s+4>>2]=o,r[a>>2]=0,e=0|Ge(0|t,0|e,56),C(),a=0|F(t,o,7&e,a,n+8|0),R=i,0|a):(R=i,0|(a=6))},_edgeLengthKm:function(t,e,n){n|=0;var i,s=0,a=0,l=0,c=0,h=0,f=0,A=0;if(i=R,R=R+176|0,0|(t=0|wt(t|=0,e|=0,c=i)))return c=t,l=+o[n>>3],l*=6371.007180918475,o[n>>3]=l,R=i,0|c;if(o[n>>3]=0,(0|(t=0|r[c>>2]))<=1)return c=0,l=0,l*=6371.007180918475,o[n>>3]=l,R=i,0|c;e=t+-1|0,t=0,s=+o[c+8>>3],a=+o[c+16>>3],l=0;do{f=s,s=+o[c+8+((t=t+1|0)<<4)>>3],A=+p(.5*(s-f)),h=a,a=+o[c+8+(t<<4)+8>>3],h=A*A+(h=+p(.5*(a-h)))*(+d(+f)*+d(+s)*h),l+=2*+y(+ +u(+h),+ +u(+(1-h)))}while((0|t)!=(0|e));return o[n>>3]=l,c=0,A=l,A*=6371.007180918475,o[n>>3]=A,R=i,0|c},_edgeLengthM:function(t,e,n){n|=0;var i,s=0,a=0,l=0,c=0,h=0,f=0,A=0;if(i=R,R=R+176|0,0|(t=0|wt(t|=0,e|=0,c=i)))return c=t,l=+o[n>>3],l*=6371.007180918475,l*=1e3,o[n>>3]=l,R=i,0|c;if(o[n>>3]=0,(0|(t=0|r[c>>2]))<=1)return c=0,l=0,l*=6371.007180918475,l*=1e3,o[n>>3]=l,R=i,0|c;e=t+-1|0,t=0,s=+o[c+8>>3],a=+o[c+16>>3],l=0;do{f=s,s=+o[c+8+((t=t+1|0)<<4)>>3],A=+p(.5*(s-f)),h=a,a=+o[c+8+(t<<4)+8>>3],h=A*A+(h=+p(.5*(a-h)))*(+d(+f)*+d(+s)*h),l+=2*+y(+ +u(+h),+ +u(+(1-h)))}while((0|t)!=(0|e));return o[n>>3]=l,c=0,A=l,A*=6371.007180918475,A*=1e3,o[n>>3]=A,R=i,0|c},_edgeLengthRads:function(t,e,n){n|=0;var i,s=0,a=0,l=0,c=0,h=0,f=0,A=0;if(i=R,R=R+176|0,0|(t=0|wt(t|=0,e|=0,c=i)))return R=i,0|(c=t);if(o[n>>3]=0,(0|(t=0|r[c>>2]))<=1)return R=i,0|(c=0);e=t+-1|0,t=0,s=+o[c+8>>3],a=+o[c+16>>3],l=0;do{f=s,s=+o[c+8+((t=t+1|0)<<4)>>3],A=+p(.5*(s-f)),h=a,a=+o[c+8+(t<<4)+8>>3],h=A*A+(h=+p(.5*(a-h)))*(+d(+s)*+d(+f)*h),l+=2*+y(+ +u(+h),+ +u(+(1-h)))}while((0|t)<(0|e));return o[n>>3]=l,R=i,0|(c=0)},_emscripten_replace_memory:function(t){return i=new Int8Array(t),new Uint8Array(t),r=new Int32Array(t),new Float32Array(t),o=new Float64Array(t),n=t,!0},_free:Ie,_getBaseCellNumber:Lt,_getDirectedEdgeDestination:function(t,e,n){t|=0,e|=0,n|=0;var i,o,s=0;return i=R,R=R+16|0,r[(s=i)>>2]=0,!0&268435456==(2013265920&e)?(o=0|Ge(0|t,0|e,56),C(),s=0|F(t,-2130706433&e|134217728,7&o,s,n),R=i,0|s):(R=i,0|(s=6))},_getDirectedEdgeOrigin:function(t,e,n){return t|=0,n|=0,!0&268435456==(2013265920&(e|=0))?(r[n>>2]=t,r[n+4>>2]=-2130706433&e|134217728,0|(n=0)):0|(n=6)},_getHexagonAreaAvgKm2:function(t,e){return e|=0,(t|=0)>>>0>15?0|(e=4):(o[e>>3]=+o[20528+(t<<3)>>3],0|(e=0))},_getHexagonAreaAvgM2:function(t,e){return e|=0,(t|=0)>>>0>15?0|(e=4):(o[e>>3]=+o[20656+(t<<3)>>3],0|(e=0))},_getHexagonEdgeLengthAvgKm:function(t,e){return e|=0,(t|=0)>>>0>15?0|(e=4):(o[e>>3]=+o[20784+(t<<3)>>3],0|(e=0))},_getHexagonEdgeLengthAvgM:function(t,e){return e|=0,(t|=0)>>>0>15?0|(e=4):(o[e>>3]=+o[20912+(t<<3)>>3],0|(e=0))},_getIcosahedronFaces:function t(e,n,i){i|=0;var o,s=0,a=0,l=0,c=0,u=0,h=0,d=0,p=0;o=R,R=R+128|0,d=o+112|0,l=o+96|0,p=o,a=0|Ge(0|(e|=0),0|(n|=0),52),C(),u=15&a,r[d>>2]=u,c=0|Ge(0|e,0|n,45),C(),c&=127;t:do{if(0|U(c)){if(0|u)for(s=1;;){if(!(0==((h=0|Ve(7,0,3*(15-s|0)|0))&e)&0==(C()&n))){a=0;break t}if(!(s>>>0<u>>>0))break;s=s+1|0}if(!(1&a))return h=0|Ve(u+1|0,0,52),p=C()|-15728641&n,p=0|t((h|e)&~(d=0|Ve(7,0,3*(14-u|0)|0)),p&~C(),i),R=o,0|p;a=1}else a=0}while(0);if(!(s=0|qt(e,n,l))){a?(Pt(l,d,p),h=5):(Rt(l,d,p),h=6);t:do{if(0|U(c))if(u)for(s=1;;){if(!(0==((c=0|Ve(7,0,3*(15-s|0)|0))&e)&0==(C()&n))){e=2;break t}if(!(s>>>0<u>>>0)){e=5;break}s=s+1|0}else e=5;else e=2}while(0);Ze(0|i,-1,e<<2);t:do{if(a)for(l=0;;){if(It(c=p+(l<<4)|0,0|r[d>>2]),c=0|r[c>>2],-1==(0|(u=0|r[i>>2]))|(0|u)==(0|c))s=i;else{a=0;do{if((a=a+1|0)>>>0>=e>>>0){s=1;break t}u=0|r[(s=i+(a<<2)|0)>>2]}while(!(-1==(0|u)|(0|u)==(0|c)))}if(r[s>>2]=c,(l=l+1|0)>>>0>=h>>>0){s=0;break}}else for(l=0;;){if(Mt(c=p+(l<<4)|0,0|r[d>>2],0,1),c=0|r[c>>2],-1==(0|(u=0|r[i>>2]))|(0|u)==(0|c))s=i;else{a=0;do{if((a=a+1|0)>>>0>=e>>>0){s=1;break t}u=0|r[(s=i+(a<<2)|0)>>2]}while(!(-1==(0|u)|(0|u)==(0|c)))}if(r[s>>2]=c,(l=l+1|0)>>>0>=h>>>0){s=0;break}}}while(0)}return R=o,0|(p=s)},_getNumCells:ee,_getPentagons:Kt,_getRes0Cells:function(t){t|=0;var e=0,n=0,i=0;e=0;do{Ve(0|e,0,45),i=134225919|C(),r[(n=t+(e<<3)|0)>>2]=-1,r[n+4>>2]=i,e=e+1|0}while(122!=(0|e));return 0},_getResolution:function(t,e){return e=0|Ge(0|(t|=0),0|(e|=0),52),C(),15&e},_greatCircleDistanceKm:te,_greatCircleDistanceM:function(t,e){t|=0;var n,i,r,s=0;return i=+o[(e|=0)>>3],n=+o[t>>3],s=(r=+p(.5*(i-n)))*r+(s=+p(.5*(+o[e+8>>3]-+o[t+8>>3])))*(+d(+i)*+d(+n)*s),2*+y(+ +u(+s),+ +u(+(1-s)))*6371.007180918475*1e3},_greatCircleDistanceRads:function(t,e){t|=0;var n,i,r,s=0;return i=+o[(e|=0)>>3],n=+o[t>>3],s=(r=+p(.5*(i-n)))*r+(s=+p(.5*(+o[e+8>>3]-+o[t+8>>3])))*(+d(+i)*+d(+n)*s),2*+y(+ +u(+s),+ +u(+(1-s)))},_gridDisk:L,_gridDiskDistances:O,_gridDistance:function(t,e,n,i,o){n|=0,i|=0,o|=0;var s,a,l=0,c=0;return a=R,R=R+32|0,c=a,0|(s=0|ce(t|=0,e|=0,t,e,l=a+12|0))?(R=a,0|(c=s)):0|(t=0|ce(t,e,n,i,c))?(R=a,0|(c=t)):(l=0|yt(l,c),r[(c=o)>>2]=l,r[c+4>>2]=((0|l)<0)<<31>>31,R=a,0|(c=0))},_gridPathCells:function(t,e,n,i,o){n|=0,i|=0,o|=0;var s,a=0,l=0,u=0,h=0,d=0,p=0,f=0,A=0,g=0,m=0,y=0,_=0,v=0,b=0,x=0,w=0,E=0,S=0,P=0;if(s=R,R=R+48|0,u=s+12|0,S=s,!(a=0|ce(t|=0,e|=0,t,e,l=s+24|0))&&!(a=0|ce(t,e,n,i,u))){E=((0|(w=0|yt(l,u)))<0)<<31>>31,r[l>>2]=0,r[l+4>>2]=0,r[l+8>>2]=0,r[u>>2]=0,r[u+4>>2]=0,r[u+8>>2]=0,0|ce(t,e,t,e,l)&&T(23313,23090,691,23299),0|ce(t,e,n,i,u)&&T(23313,23090,696,23299),bt(l),bt(u),w?(m=+(0|w),x=l,i=f=0|r[l>>2],a=A=0|r[(v=l+4|0)>>2],n=g=0|r[(b=l+8|0)>>2],y=+((0|r[u>>2])-f|0)/m,_=+((0|r[u+4>>2])-A|0)/m,m=+((0|r[u+8>>2])-g|0)/m):(v=a=l+4|0,b=n=l+8|0,x=l,i=0|r[l>>2],a=0|r[a>>2],n=0|r[n>>2],y=0,_=0,m=0),r[S>>2]=i,r[(g=S+4|0)>>2]=a,r[(A=S+8|0)>>2]=n;t:do{if((0|w)<0)a=0;else for(p=0,f=0,a=i;;){P=y*(d=+(f>>>0)+4294967296*+(0|p))+ +(0|a),h=_*d+ +(0|r[v>>2]),d=m*d+ +(0|r[b>>2]),n=~~+We(+P),l=~~+We(+h),a=~~+We(+d),P=+c(+(+(0|n)-P)),h=+c(+(+(0|l)-h)),d=+c(+(+(0|a)-d));do{if(!(P>h&P>d)){if(u=0-n|0,h>d){i=u-a|0;break}i=l,a=u-l|0;break}n=0-(l+a)|0,i=l}while(0);if(r[S>>2]=n,r[g>>2]=i,r[A>>2]=a,xt(S),0|(a=0|ue(t,e,S,o+(f<<3)|0)))break t;if(!((0|p)<(0|E)|(0|p)==(0|E)&f>>>0<w>>>0)){a=0;break t}a=0|Re(0|f,0|p,1,0),p=u=0|C(),f=a,a=0|r[x>>2]}}while(0);return R=s,0|(S=a)}return R=s,0|(S=a)},_gridPathCellsSize:function(t,e,n,i,o){n|=0,i|=0,o|=0;var s,a=0,l=0,c=0;return s=R,R=R+32|0,c=s,(a=0|ce(t|=0,e|=0,t,e,l=s+12|0))||(a=0|ce(t,e,n,i,c))?(R=s,0|(c=a)):(i=0|Re(0|(i=0|yt(l,c)),((0|i)<0)<<31>>31,1,0),l=0|C(),r[(c=o)>>2]=i,r[c+4>>2]=l,R=s,0|(c=0))},_gridRingUnsafe:function(t,e,n,i){t|=0,e|=0,n|=0,i|=0;var o,s,a=0,l=0,c=0,u=0,h=0,d=0,p=0,f=0,A=0;if(s=R,R=R+16|0,A=s+8|0,r[(f=o=s)>>2]=t,r[f+4>>2]=e,!n)return r[(A=i)>>2]=t,r[A+4>>2]=e,R=s,0|(A=0);r[A>>2]=0;t:do{if(0|Ft(t,e))t=9;else{if(l=(0|n)>0){a=0,f=t;do{if(0|(t=0|F(f,e,4,A,o)))break t;if(a=a+1|0,0|Ft(f=0|r[(e=o)>>2],e=0|r[e+4>>2])){t=9;break t}}while((0|a)<(0|n));if(r[(p=i)>>2]=f,r[p+4>>2]=e,p=n+-1|0,l){d=0,t=1;do{if(a=22384+(d<<2)|0,5==(0|d))for(c=0|r[a>>2],l=0,a=t;;){if(0|(t=0|F(0|r[(t=o)>>2],0|r[t+4>>2],c,A,o)))break t;if((0|l)!=(0|p)){if(u=0|r[(h=o)>>2],h=0|r[h+4>>2],r[(t=i+(a<<3)|0)>>2]=u,r[t+4>>2]=h,0|Ft(u,h)){t=9;break t}t=a+1|0}else t=a;if((0|(l=l+1|0))>=(0|n))break;a=t}else for(c=o,h=0|r[a>>2],u=0,a=t,l=0|r[c>>2],c=0|r[c+4>>2];;){if(0|(t=0|F(l,c,h,A,o)))break t;if(l=0|r[(c=o)>>2],c=0|r[c+4>>2],r[(t=i+(a<<3)|0)>>2]=l,r[t+4>>2]=c,t=a+1|0,0|Ft(l,c)){t=9;break t}if((0|(u=u+1|0))>=(0|n))break;a=t}d=d+1|0}while(d>>>0<6);c=f,a=0|r[(t=o)>>2],l=e,t=0|r[t+4>>2]}else c=f,a=f,l=e,t=e}else r[(c=i)>>2]=t,r[c+4>>2]=e,c=t,a=t,l=e,t=e;t=(0|c)==(0|a)&(0|l)==(0|t)?0:9}}while(0);return R=s,0|(A=t)},_i64Add:Re,_i64Subtract:Le,_isPentagon:Ft,_isResClassIII:function(t,e){return e=0|Ge(0|(t|=0),0|(e|=0),52),C(),1&e},_isValidCell:Ot,_isValidDirectedEdge:function(t,e){var n=0;switch(n=0|Ge(0|(t|=0),0|(e|=0),56),C(),7&n){case 0:case 7:return 0|(n=0)}return n=-2130706433&e|134217728,!0&268435456==(2013265920&e)?!0&16777216==(117440512&e)&0!=(0|Ft(t,n))?0|(n=0):0|(n=0|Ot(t,n)):0|(n=0)},_isValidVertex:function(t,e){t|=0;var n,i,o=0,s=0;return i=R,R=R+16|0,n=i,!0&536870912==(2013265920&(e|=0))&&0|Ot(t,o=-2130706433&e|134217728)?(s=0|Ge(0|t,0|e,56),C(),o=(s=0==(0|ve(t,o,7&s,n)))&((0|r[(o=n)>>2])==(0|t)?(0|r[o+4>>2])==(0|e):0)&1,R=i,0|o):(R=i,0|(o=0))},_latLngToCell:Ht,_llvm_maxnum_f64:je,_llvm_minnum_f64:He,_llvm_round_f64:We,_localIjToCell:function(t,e,n,i,r){var o,s;return t|=0,e|=0,n|=0,r|=0,s=R,R=R+16|0,o=s,(i|=0)?n=15:(n=0|vt(n,o))||(n=0|ue(t,e,o,r)),R=s,0|n},_malloc:Me,_maxFaceCount:function(t,e,n){n|=0;var i=0,o=0;if(o=0|Ge(0|(t|=0),0|(e|=0),45),C(),!(0|U(127&o)))return o=2,r[n>>2]=o,0;if(o=0|Ge(0|t,0|e,52),C(),!(o&=15))return o=5,r[n>>2]=o,0;for(i=1;;){if(!(0==((0|Ve(7,0,3*(15-i|0)|0))&t)&0==(C()&e))){i=2,t=6;break}if(!(i>>>0<o>>>0)){i=5,t=6;break}i=i+1|0}return 6==(0|t)?(r[n>>2]=i,0):0},_maxGridDiskSize:function(t,e){e|=0;var n=0,i=0,o=0;return(0|(t|=0))<0?0|(e=2):(0|t)>13780509?0|(e=0|ee(15,e)):(o=0|Fe(0|t,0|(n=((0|t)<0)<<31>>31),3,0),i=0|C(),n=0|Re(0|t,0|n,1,0),n=0|Re(0|(n=0|Fe(0|o,0|i,0|n,0|C())),0|C(),1,0),t=0|C(),r[e>>2]=n,r[e+4>>2]=t,0|(e=0))},_maxPolygonToCellsSize:function(t,e,n,i){e|=0,i|=0;var o,s=0,a=0,l=0,c=0,u=0;if(o=R,R=R+48|0,s=o+16|0,a=o+8|0,l=o,0|(n|=0))return R=o,0|(l=15);if(c=0|r[(u=t|=0)+4>>2],r[(n=a)>>2]=r[u>>2],r[n+4>>2]=c,pe(a,s),!(e=0|K(s,e,l))){if(n=0|r[a>>2],(0|(a=0|r[t+8>>2]))>0){s=0|r[t+12>>2],e=0;do{n=(0|r[s+(e<<3)>>2])+n|0,e=e+1|0}while((0|e)<(0|a))}s=0|r[(e=l)>>2],(0|(e=0|r[e+4>>2]))<(0|(a=((0|n)<0)<<31>>31))|(0|e)==(0|a)&s>>>0<n>>>0?(r[(e=l)>>2]=n,r[e+4>>2]=a,e=a):n=s,c=0|Re(0|n,0|e,12,0),u=0|C(),r[(e=l)>>2]=c,r[e+4>>2]=u,r[(e=i)>>2]=c,r[e+4>>2]=u,e=0}return R=o,0|(u=e)},_memcpy:qe,_memset:Ze,_originToDirectedEdges:function(t,e,n){n|=0;var i,o=0;return i=0==(0|Ft(t|=0,e|=0)),e&=-2130706433,r[(o=n)>>2]=i?t:0,r[o+4>>2]=i?285212672|e:0,r[(o=n+8|0)>>2]=t,r[o+4>>2]=301989888|e,r[(o=n+16|0)>>2]=t,r[o+4>>2]=318767104|e,r[(o=n+24|0)>>2]=t,r[o+4>>2]=335544320|e,r[(o=n+32|0)>>2]=t,r[o+4>>2]=352321536|e,r[(n=n+40|0)>>2]=t,r[n+4>>2]=369098752|e,0},_pentagonCount:function(){return 12},_polygonToCells:function(t,e,n,i){e|=0,i|=0;var o,s,a,l,c=0,u=0,h=0,d=0,p=0,f=0,A=0,g=0,m=0,y=0,_=0,v=0,b=0,x=0,w=0,E=0,T=0,S=0,P=0,M=0,I=0,B=0,L=0,O=0,F=0,N=0,U=0;if(l=R,R=R+112|0,o=l+80|0,p=l+72|0,s=l,a=l+56|0,0|(n|=0))return R=l,0|(U=15);if(!(U=0|Me(32+(r[(f=(t|=0)+8|0)>>2]<<5)|0)))return R=l,0|(U=13);if(fe(t,U),N=0|r[(F=t)+4>>2],r[(n=p)>>2]=r[F>>2],r[n+4>>2]=N,pe(p,o),n=0|K(o,e,s))F=0,N=0;else{if(n=0|r[p>>2],(0|(u=0|r[f>>2]))>0){h=0|r[t+12>>2],c=0;do{n=(0|r[h+(c<<3)>>2])+n|0,c=c+1|0}while((0|c)!=(0|u));c=n}else c=n;u=0|r[(n=s)>>2],(0|(n=0|r[n+4>>2]))<(0|(h=((0|c)<0)<<31>>31))|(0|n)==(0|h)&u>>>0<c>>>0?(r[(n=s)>>2]=c,r[n+4>>2]=h,n=h):c=u,F=0|Re(0|c,0|n,12,0),N=0|C(),r[(n=s)>>2]=F,r[n+4>>2]=N,n=0}if(0|n)return Ie(U),R=l,0|(U=n);if(!(c=0|Be(F,8)))return Ie(U),R=l,0|(U=13);if(!(d=0|Be(F,8)))return Ie(U),Ie(c),R=l,0|(U=13);r[(L=o)>>2]=0,r[L+4>>2]=0,O=0|r[(L=t)+4>>2],r[(n=p)>>2]=r[L>>2],r[n+4>>2]=O,n=0|z(p,F,N,e,o,c,d);t:do{if(n)Ie(c),Ie(d),Ie(U);else{e:do{if((0|r[f>>2])>0){for(h=t+12|0,u=0;n=0|z((0|r[h>>2])+(u<<3)|0,F,N,e,o,c,d),u=u+1|0,!(0|n);)if((0|u)>=(0|r[f>>2]))break e;Ie(c),Ie(d),Ie(U);break t}}while(0);(0|N)>0|0==(0|N)&F>>>0>0&&Ze(0|d,0,F<<3),L=0|r[(O=o)+4>>2];e:do{if((0|L)>0|0==(0|L)&(0|r[O>>2])>>>0>0){M=c,I=d,B=c,L=d,O=c,n=c,T=c,S=d,P=d,c=d;n:for(;;){for(b=0,x=0,w=0,E=0,u=0,h=0;;){p=(d=s)+56|0;do{r[d>>2]=0,d=d+4|0}while((0|d)<(0|p));if(0|D(f=0|r[(e=M+(b<<3)|0)>>2],e=0|r[e+4>>2],1,s,0)){p=(d=s)+56|0;do{r[d>>2]=0,d=d+4|0}while((0|d)<(0|p));0|(d=0|Be(7,4))&&(k(f,e,1,s,d,7,0,0),Ie(d))}for(v=0;;){y=0|r[(_=s+(v<<3)|0)>>2],_=0|r[_+4>>2];i:do{if(0==(0|y)&0==(0|_))d=u,p=h;else{if(A=0|ze(0|y,0|_,0|F,0|N),f=0|C(),!(0==(0|(p=0|r[(e=d=i+(A<<3)|0)>>2]))&0==(0|(e=0|r[e+4>>2])))){g=0,m=0;do{if((0|g)>(0|N)|(0|g)==(0|N)&m>>>0>F>>>0)break n;if((0|p)==(0|y)&(0|e)==(0|_)){d=u,p=h;break i}A=0|Ne(0|(d=0|Re(0|A,0|f,1,0)),0|C(),0|F,0|N),f=0|C(),m=0|Re(0|m,0|g,1,0),g=0|C(),p=0|r[(e=d=i+(A<<3)|0)>>2],e=0|r[e+4>>2]}while(!(0==(0|p)&0==(0|e)))}0==(0|y)&0==(0|_)?(d=u,p=h):(Zt(y,_,a),0|Ae(t,U,a)&&(m=0|Re(0|u,0|h,1,0),h=0|C(),r[(g=d)>>2]=y,r[g+4>>2]=_,r[(u=I+(u<<3)|0)>>2]=y,r[u+4>>2]=_,u=m),d=u,p=h)}}while(0);if((v=v+1|0)>>>0>=7)break;u=d,h=p}if(b=0|Re(0|b,0|x,1,0),x=0|C(),w=0|Re(0|w,0|E,1,0),E=0|C(),u=0|r[(h=o)>>2],!((0|E)<(0|(h=0|r[h+4>>2]))|(0|E)==(0|h)&w>>>0<u>>>0))break;u=d,h=p}if((0|h)>0|0==(0|h)&u>>>0>0){u=0,h=0;do{r[(E=M+(u<<3)|0)>>2]=0,r[E+4>>2]=0,u=0|Re(0|u,0|h,1,0),h=0|C(),w=0|r[(E=o)+4>>2]}while((0|h)<(0|w)|((0|h)==(0|w)?u>>>0<(0|r[E>>2])>>>0:0))}if(r[(E=o)>>2]=d,r[E+4>>2]=p,!((0|p)>0|0==(0|p)&d>>>0>0))break e;v=c,b=P,x=O,w=S,E=I,c=T,P=n,S=B,T=v,n=b,O=L,L=x,B=w,I=M,M=E}Ie(B),Ie(L),Ie(U),n=1;break t}n=d}while(0);Ie(U),Ie(c),Ie(n),n=0}}while(0);return R=l,0|(U=n)},_readInt64AsDoubleFromPointer:function(t){return+(+((0|r[(t|=0)>>2])>>>0)+4294967296*+(0|r[t+4>>2]))},_res0CellCount:function(){return 122},_round:Xe,_sbrk:Ke,_sizeOfCellBoundary:function(){return 168},_sizeOfCoordIJ:function(){return 8},_sizeOfGeoLoop:function(){return 8},_sizeOfGeoPolygon:function(){return 16},_sizeOfH3Index:function(){return 8},_sizeOfLatLng:function(){return 16},_sizeOfLinkedGeoPolygon:function(){return 12},_uncompactCells:function(t,e,n,i,o,s,a){t|=0,i|=0,o|=0,s|=0;var l,c=0,u=0,h=0,d=0,p=0,f=0,A=0,g=0;if(l=R,R=R+16|0,g=l,!((0|(n|=0))>0|0==(0|n)&(e|=0)>>>0>0))return R=l,0|(g=0);if((0|(a|=0))>=16)return R=l,0|(g=12);f=0,A=0,p=0,c=0;t:for(;;){if(d=0|Ge(0|(u=0|r[(h=t+(f<<3)|0)>>2]),0|(h=0|r[h+4>>2]),52),C(),(15&d)>(0|a)){c=12,u=11;break}if(Qt(g,u,h,a),0==(0|(h=0|r[(d=g)>>2]))&0==(0|(d=0|r[d+4>>2])))u=p;else{u=p;do{if(!((0|c)<(0|s)|(0|c)==(0|s)&u>>>0<o>>>0)){u=10;break t}r[(p=i+(u<<3)|0)>>2]=h,r[p+4>>2]=d,u=0|Re(0|u,0|c,1,0),c=0|C(),Jt(g),h=0|r[(p=g)>>2],d=0|r[p+4>>2]}while(!(0==(0|h)&0==(0|d)))}if(f=0|Re(0|f,0|A,1,0),!((0|(A=0|C()))<(0|n)|(0|A)==(0|n)&f>>>0<e>>>0)){c=0,u=11;break}p=u}return 10==(0|u)?(R=l,0|(g=14)):11==(0|u)?(R=l,0|c):0},_uncompactCellsSize:function(t,e,n,i,o){t|=0,e|=0,n|=0,i|=0,o|=0;var s,a,l=0,c=0,u=0,h=0,d=0,p=0;a=R,R=R+16|0,s=a;t:do{if((0|n)>0|0==(0|n)&e>>>0>0){for(d=0,c=0,l=0,p=0;;){if(!(0==(0|(u=0|r[(h=t+(d<<3)|0)>>2]))&0==(0|(h=0|r[h+4>>2])))&&(h=0==(0|kt(u,h,i,s)),c=0|Re(0|r[(u=s)>>2],0|r[u+4>>2],0|c,0|l),l=0|C(),!h)){l=12;break}if(d=0|Re(0|d,0|p,1,0),!((0|(p=0|C()))<(0|n)|(0|p)==(0|n)&d>>>0<e>>>0))break t}return R=a,0|l}c=0,l=0}while(0);return r[o>>2]=c,r[o+4>>2]=l,R=a,0|(o=0)},_vertexToLatLng:function(t,e,n){n|=0;var i,o,s,a,l=0,c=0;return a=R,R=R+192|0,o=a,s=a+168|0,l=0|Ge(0|(t|=0),0|(e|=0),56),C(),l&=7,0|(i=0|qt(t,c=-2130706433&e|134217728,s))?(R=a,0|(c=i)):(e=0|Ge(0|t,0|e,52),C(),e&=15,0|Ft(t,c)?St(s,e,l,1,o):Bt(s,e,l,1,o),c=o+8|0,r[n>>2]=r[c>>2],r[n+4>>2]=r[c+4>>2],r[n+8>>2]=r[c+8>>2],r[n+12>>2]=r[c+12>>2],R=a,0|(c=0))},establishStackSpace:function(t,e){R=t|=0},stackAlloc:function(t){var e;return e=R,R=(R=R+(t|=0)|0)+15&-16,0|e},stackRestore:function(t){R=t|=0},stackSave:function(){return 0|R}}}({Math:Math,Int8Array:Int8Array,Int32Array:Int32Array,Uint8Array:Uint8Array,Float32Array:Float32Array,Float64Array:Float64Array},{a:at,b:function(t){c=t},c:function(){return c},d:function(t,e,n,i){at("Assertion failed: "+f(t)+", at: "+[e?f(e):"unknown filename",n,i?f(i):"unknown function"])},e:function(t){return n.___errno_location&&(_[n.___errno_location()>>2]=t),t},f:W,g:function(t,e,n){m.set(m.subarray(e,e+n),t)},h:function(t){var e=W(),n=16777216,i=2130706432;if(t>i)return!1;for(var r=Math.max(e,16777216);r<t;)r=r<=536870912?x(2*r,n):Math.min(x((3*r+2147483648)/4,n),i);return!!q(r)},i:function(t){at("OOM")},j:V,k:j,l:q,m:H,n:function(){var t=H();return n.extraStackTrace&&(t+="\n"+n.extraStackTrace()),j(t)},o:24144,p:24128},A),Y=(n.___divdi3=J.___divdi3,n.___muldi3=J.___muldi3,n.___remdi3=J.___remdi3,n.___uremdi3=J.___uremdi3,n._areNeighborCells=J._areNeighborCells,n._bitshift64Ashr=J._bitshift64Ashr,n._bitshift64Lshr=J._bitshift64Lshr,n._bitshift64Shl=J._bitshift64Shl,n._calloc=J._calloc,n._cellAreaKm2=J._cellAreaKm2,n._cellAreaM2=J._cellAreaM2,n._cellAreaRads2=J._cellAreaRads2,n._cellToBoundary=J._cellToBoundary,n._cellToCenterChild=J._cellToCenterChild,n._cellToChildPos=J._cellToChildPos,n._cellToChildren=J._cellToChildren,n._cellToChildrenSize=J._cellToChildrenSize,n._cellToLatLng=J._cellToLatLng,n._cellToLocalIj=J._cellToLocalIj,n._cellToParent=J._cellToParent,n._cellToVertex=J._cellToVertex,n._cellToVertexes=J._cellToVertexes,n._cellsToDirectedEdge=J._cellsToDirectedEdge,n._cellsToLinkedMultiPolygon=J._cellsToLinkedMultiPolygon,n._childPosToCell=J._childPosToCell,n._compactCells=J._compactCells,n._destroyLinkedMultiPolygon=J._destroyLinkedMultiPolygon,n._directedEdgeToBoundary=J._directedEdgeToBoundary,n._directedEdgeToCells=J._directedEdgeToCells,n._edgeLengthKm=J._edgeLengthKm,n._edgeLengthM=J._edgeLengthM,n._edgeLengthRads=J._edgeLengthRads,n._emscripten_replace_memory=J._emscripten_replace_memory),$=(n._free=J._free,n._getBaseCellNumber=J._getBaseCellNumber,n._getDirectedEdgeDestination=J._getDirectedEdgeDestination,n._getDirectedEdgeOrigin=J._getDirectedEdgeOrigin,n._getHexagonAreaAvgKm2=J._getHexagonAreaAvgKm2,n._getHexagonAreaAvgM2=J._getHexagonAreaAvgM2,n._getHexagonEdgeLengthAvgKm=J._getHexagonEdgeLengthAvgKm,n._getHexagonEdgeLengthAvgM=J._getHexagonEdgeLengthAvgM,n._getIcosahedronFaces=J._getIcosahedronFaces,n._getNumCells=J._getNumCells,n._getPentagons=J._getPentagons,n._getRes0Cells=J._getRes0Cells,n._getResolution=J._getResolution,n._greatCircleDistanceKm=J._greatCircleDistanceKm,n._greatCircleDistanceM=J._greatCircleDistanceM,n._greatCircleDistanceRads=J._greatCircleDistanceRads,n._gridDisk=J._gridDisk,n._gridDiskDistances=J._gridDiskDistances,n._gridDistance=J._gridDistance,n._gridPathCells=J._gridPathCells,n._gridPathCellsSize=J._gridPathCellsSize,n._gridRingUnsafe=J._gridRingUnsafe,n._i64Add=J._i64Add,n._i64Subtract=J._i64Subtract,n._isPentagon=J._isPentagon,n._isResClassIII=J._isResClassIII,n._isValidCell=J._isValidCell,n._isValidDirectedEdge=J._isValidDirectedEdge,n._isValidVertex=J._isValidVertex,n._latLngToCell=J._latLngToCell,n._llvm_maxnum_f64=J._llvm_maxnum_f64,n._llvm_minnum_f64=J._llvm_minnum_f64,n._llvm_round_f64=J._llvm_round_f64,n._localIjToCell=J._localIjToCell,n._malloc=J._malloc,n._maxFaceCount=J._maxFaceCount,n._maxGridDiskSize=J._maxGridDiskSize,n._maxPolygonToCellsSize=J._maxPolygonToCellsSize,n._memcpy=J._memcpy,n._memset=J._memset,n._originToDirectedEdges=J._originToDirectedEdges,n._pentagonCount=J._pentagonCount,n._polygonToCells=J._polygonToCells,n._readInt64AsDoubleFromPointer=J._readInt64AsDoubleFromPointer,n._res0CellCount=J._res0CellCount,n._round=J._round,n._sbrk=J._sbrk,n._sizeOfCellBoundary=J._sizeOfCellBoundary,n._sizeOfCoordIJ=J._sizeOfCoordIJ,n._sizeOfGeoLoop=J._sizeOfGeoLoop,n._sizeOfGeoPolygon=J._sizeOfGeoPolygon,n._sizeOfH3Index=J._sizeOfH3Index,n._sizeOfLatLng=J._sizeOfLatLng,n._sizeOfLinkedGeoPolygon=J._sizeOfLinkedGeoPolygon,n._uncompactCells=J._uncompactCells,n._uncompactCellsSize=J._uncompactCellsSize,n._vertexToLatLng=J._vertexToLatLng,n.establishStackSpace=J.establishStackSpace,n.stackAlloc=J.stackAlloc),tt=n.stackRestore=J.stackRestore,et=n.stackSave=J.stackSave;if(n.asm=J,n.cwrap=function(t,e,n,i){var r=(n=n||[]).every((function(t){return"number"===t}));return"string"!==e&&r&&!i?h(t):function(){return d(t,e,n,arguments)}},n.setValue=function(t,e,n,i){switch("*"===(n=n||"i8").charAt(n.length-1)&&(n="i32"),n){case"i1":case"i8":g[t|0]=e;break;case"i16":y[t>>1]=e;break;case"i32":_[t>>2]=e;break;case"i64":N=[e>>>0,(F=e,+I(F)>=1?F>0?(0|L(+R(F/4294967296),4294967295))>>>0:~~+B((F-+(~~F>>>0))/4294967296)>>>0:0)],_[t>>2]=N[0],_[t+4>>2]=N[1];break;case"float":v[t>>2]=e;break;case"double":b[t>>3]=e;break;default:at("invalid type for setValue: "+n)}},n.getValue=function(t,e,n){switch("*"===(e=e||"i8").charAt(e.length-1)&&(e="i32"),e){case"i1":case"i8":return g[t|0];case"i16":return y[t>>1];case"i32":case"i64":return _[t>>2];case"float":return v[t>>2];case"double":return b[t>>3];default:at("invalid type for getValue: "+e)}return null},z){G(z)||(K=z,z=n.locateFile?n.locateFile(K,s):s+K),O++,n.monitorRunDependencies&&n.monitorRunDependencies(O);var nt=function(t){t.byteLength&&(t=new Uint8Array(t)),m.set(t,8),n.memoryInitializerRequest&&delete n.memoryInitializerRequest.response,function(){if(O--,n.monitorRunDependencies&&n.monitorRunDependencies(O),0==O&&(null!==D&&(clearInterval(D),D=null),k)){var t=k;k=null,t()}}()},it=function(){r(z,nt,(function(){throw"could not load memory initializer "+z}))},rt=X(z);if(rt)nt(rt.buffer);else if(n.memoryInitializerRequest){var ot=function(){var t=n.memoryInitializerRequest,e=t.response;if(200!==t.status&&0!==t.status){var i=X(n.memoryInitializerRequestURL);if(!i)return console.warn("a problem seems to have happened with Module.memoryInitializerRequest, status: "+t.status+", retrying "+z),void it();e=i.buffer}nt(e)};n.memoryInitializerRequest.response?setTimeout(ot,0):n.memoryInitializerRequest.addEventListener("load",ot)}else it()}function st(t){function e(){Q||(Q=!0,u||(C(S),C(P),n.onRuntimeInitialized&&n.onRuntimeInitialized(),function(){if(n.postRun)for("function"==typeof n.postRun&&(n.postRun=[n.postRun]);n.postRun.length;)t=n.postRun.shift(),M.unshift(t);var t;C(M)}()))}t=t||o,O>0||(!function(){if(n.preRun)for("function"==typeof n.preRun&&(n.preRun=[n.preRun]);n.preRun.length;)t=n.preRun.shift(),T.unshift(t);var t;C(T)}(),O>0||(n.setStatus?(n.setStatus("Running..."),setTimeout((function(){setTimeout((function(){n.setStatus("")}),1),e()}),1)):e()))}function at(t){throw n.onAbort&&n.onAbort(t),a(t+=""),l(t),u=!0,"abort("+t+"). Build with -s ASSERTIONS=1 for more info."}if(k=function t(){Q||st(),Q||(k=t)},n.run=st,n.abort=at,n.preInit)for("function"==typeof n.preInit&&(n.preInit=[n.preInit]);n.preInit.length>0;)n.preInit.pop()();return st(),t}("object"===typeof i?i:{}),r="number",o=[["sizeOfH3Index",r],["sizeOfLatLng",r],["sizeOfCellBoundary",r],["sizeOfGeoLoop",r],["sizeOfGeoPolygon",r],["sizeOfLinkedGeoPolygon",r],["sizeOfCoordIJ",r],["readInt64AsDoubleFromPointer",r],["isValidCell",r,[r,r]],["latLngToCell",r,[r,r,r,r]],["cellToLatLng",r,[r,r,r]],["cellToBoundary",r,[r,r,r]],["maxGridDiskSize",r,[r,r]],["gridDisk",r,[r,r,r,r]],["gridDiskDistances",r,[r,r,r,r,r]],["gridRingUnsafe",r,[r,r,r,r]],["maxPolygonToCellsSize",r,[r,r,r,r]],["polygonToCells",r,[r,r,r,r]],["cellsToLinkedMultiPolygon",r,[r,r,r]],["destroyLinkedMultiPolygon",null,[r]],["compactCells",r,[r,r,r,r]],["uncompactCells",r,[r,r,r,r,r,r]],["uncompactCellsSize",r,[r,r,r,r,r]],["isPentagon",r,[r,r]],["isResClassIII",r,[r,r]],["getBaseCellNumber",r,[r,r]],["getResolution",r,[r,r]],["maxFaceCount",r,[r,r,r]],["getIcosahedronFaces",r,[r,r,r]],["cellToParent",r,[r,r,r,r]],["cellToChildren",r,[r,r,r,r]],["cellToCenterChild",r,[r,r,r,r]],["cellToChildrenSize",r,[r,r,r,r]],["cellToChildPos",r,[r,r,r,r]],["childPosToCell",r,[r,r,r,r,r,r]],["areNeighborCells",r,[r,r,r,r,r]],["cellsToDirectedEdge",r,[r,r,r,r,r]],["getDirectedEdgeOrigin",r,[r,r,r]],["getDirectedEdgeDestination",r,[r,r,r]],["isValidDirectedEdge",r,[r,r]],["directedEdgeToCells",r,[r,r,r]],["originToDirectedEdges",r,[r,r,r]],["directedEdgeToBoundary",r,[r,r,r]],["gridDistance",r,[r,r,r,r,r]],["gridPathCells",r,[r,r,r,r,r]],["gridPathCellsSize",r,[r,r,r,r,r]],["cellToLocalIj",r,[r,r,r,r,r,r]],["localIjToCell",r,[r,r,r,r,r]],["getHexagonAreaAvgM2",r,[r,r]],["getHexagonAreaAvgKm2",r,[r,r]],["getHexagonEdgeLengthAvgM",r,[r,r]],["getHexagonEdgeLengthAvgKm",r,[r,r]],["greatCircleDistanceM",r,[r,r]],["greatCircleDistanceKm",r,[r,r]],["greatCircleDistanceRads",r,[r,r]],["cellAreaM2",r,[r,r,r]],["cellAreaKm2",r,[r,r,r]],["cellAreaRads2",r,[r,r,r]],["edgeLengthM",r,[r,r,r]],["edgeLengthKm",r,[r,r,r]],["edgeLengthRads",r,[r,r,r]],["getNumCells",r,[r,r]],["getRes0Cells",r,[r]],["res0CellCount",r],["getPentagons",r,[r,r]],["pentagonCount",r],["cellToVertex",r,[r,r,r,r]],["cellToVertexes",r,[r,r,r]],["vertexToLatLng",r,[r,r,r]],["isValidVertex",r,[r,r]]],s=4,a=5,l={0:"Success",1:"The operation failed but a more specific error is not available",2:"Argument was outside of acceptable range",3:"Latitude or longitude arguments were outside of acceptable range"};l[s]="Resolution argument was outside of acceptable range",l[a]="Cell argument was not valid",l[6]="Directed edge argument was not valid",l[7]="Undirected edge argument was not valid",l[8]="Vertex argument was not valid",l[9]="Pentagon distortion was encountered",l[10]="Duplicate input",l[11]="Cell arguments were not neighbors",l[12]="Cell arguments had incompatible resolutions",l[13]="Memory allocation failed",l[14]="Bounds of provided memory were insufficient",l[15]="Mode or flags argument was not valid";var c=1e3,u=1001,h=1002,d={};d[c]="Unknown unit",d[u]="Array length out of bounds",d[h]="Got unexpected null value for H3 index";var p="Unknown error";function f(t,e,n){var i=n&&"value"in n,r=new Error((t[e]||p)+" (code: "+e+(i?", value: "+n.value:"")+")");return r.code=e,r}function A(t,e){return f(l,t,2===arguments.length?{value:e}:{})}function g(t,e){return f(d,t,2===arguments.length?{value:e}:{})}function m(t){if(0!==t)throw A(t)}var y={};o.forEach((function(t){y[t[0]]=i.cwrap.apply(i,t)}));var _=16,v=4,b=4,x=8,w=8,E=y.sizeOfH3Index(),C=y.sizeOfLatLng(),T=y.sizeOfCellBoundary(),S=y.sizeOfGeoPolygon(),P=y.sizeOfGeoLoop(),M=y.sizeOfLinkedGeoPolygon(),I=(y.sizeOfCoordIJ(),{m:"m",m2:"m2",km:"km",km2:"km2",rads:"rads",rads2:"rads2"});function B(t){if("number"!==typeof t||t<0||t>15||Math.floor(t)!==t)throw A(s,t);return t}function R(t){if(!t)throw g(h);return t}var L=Math.pow(2,32)-1;function O(t){if(t>L)throw g(u,t);return t}var D=/[^0-9a-fA-F]/;function k(t){if(Array.isArray(t)&&2===t.length&&Number.isInteger(t[0])&&Number.isInteger(t[1]))return t;if("string"!==typeof t||D.test(t))return[0,0];var e=parseInt(t.substring(0,t.length-8),_);return[parseInt(t.substring(t.length-8),_),e]}function F(t){if(t>=0)return t.toString(_);var e=N(8,(t&=2147483647).toString(_));return e=(parseInt(e[0],_)+8).toString(_)+e.substring(1)}function N(t,e){for(var n=t-e.length,i="",r=0;r<n;r++)i+="0";return i+=e}Math.pow(2,32);function z(t,e,n){for(var r=t.length,o=i._calloc(r,C),s=n?1:0,a=n?0:1,l=0;l<2*r;l+=2)i.HEAPF64.set([t[l/2][s],t[l/2][a]].map(ct),o/x+l);return i.HEAPU32.set([r,o],e/v),e}function U(t,e){void 0===e&&(e=0);var n=i.getValue(t+E*e,"i32"),r=i.getValue(t+E*e+v,"i32");return r?function(t,e){return F(e)+N(8,F(t))}(n,r):null}function G(t,e){return void 0===e&&(e=0),i.getValue(t+x*e,"double")}function V(t){return y.readInt64AsDoubleFromPointer(t)}function j(t,e,n){i.HEAPU32.set(k(t),e/v+2*n)}function H(t,e){for(var n=[],i=0;i<e;i++){var r=U(t,i);null!==r&&n.push(r)}return n}function W(t,e){for(var n=e.length,i=0;i<n;i++)j(e[i],t,i)}function q(t){return 180*i.getValue(t,"double")/Math.PI}function Z(t){return[q(t),q(t+x)]}function X(t){return[q(t+x),q(t)]}function K(t,e,n){for(var r=i.getValue(t,"i32"),o=t+x,s=[],a=e?X:Z,l=0;l<2*r;l+=2)s.push(a(o+x*l));return n&&s.push(s[0]),s}function Q(t){var e=k(t),n=e[0],i=e[1];return Boolean(y.isPentagon(n,i))}function J(t){var e=k(t),n=e[0],i=e[1];return y.isValidCell(n,i)?y.getResolution(n,i):-1}function Y(t,e,n){var r=i._malloc(C);i.HEAPF64.set([t,e].map(ct),r/x);var o=i._malloc(E);try{return m(y.latLngToCell(r,n,o)),R(U(o))}finally{i._free(o),i._free(r)}}function $(t){var e=i._malloc(C),n=k(t),r=n[0],o=n[1];try{return m(y.cellToLatLng(r,o,e)),Z(e)}finally{i._free(e)}}function tt(t,e){var n=i._malloc(T),r=k(t),o=r[0],s=r[1];try{return m(y.cellToBoundary(o,s,n)),K(n,e,e)}finally{i._free(n)}}function et(t,e){var n=k(t),r=n[0],o=n[1],s=i._malloc(E);try{return m(y.cellToParent(r,o,e,s)),R(U(s))}finally{i._free(s)}}function nt(t,e){var n=k(t),r=n[0],o=n[1],s=i._malloc(w);try{m(y.maxGridDiskSize(e,s));var a=O(V(s)),l=i._calloc(a,E);try{return m(y.gridDisk(r,o,e,l)),H(l,a)}finally{i._free(l)}}finally{i._free(s)}}function it(t,e,n){if(B(e),n=Boolean(n),0===t.length||0===t[0].length)return[];var r=function(t,e){var n,r=t.length-1,o=i._calloc(S),s=0+P,a=s+v;if(z(t[0],o+0,e),r>0){n=i._calloc(r,P);for(var l=0;l<r;l++)z(t[l+1],n+P*l,e)}return i.setValue(o+s,r,"i32"),i.setValue(o+a,n,"i32"),o}("number"===typeof t[0][0]?[t]:t,n),o=i._malloc(w);try{m(y.maxPolygonToCellsSize(r,e,0,o));var s=O(V(o)),a=i._calloc(s,E);try{return m(y.polygonToCells(r,e,0,a)),H(a,s)}finally{i._free(a)}}finally{i._free(o),function(t){var e=0+P,n=e+v,r=v;i._free(i.getValue(t+0+r,"i8*"));var o=i.getValue(t+e,"i32");if(o>0){for(var s=i.getValue(t+n,"i32"),a=0;a<o;a++)i._free(i.getValue(s+P*a+r,"i8*"));i._free(s)}i._free(t)}(r)}}function rt(t,e){if(!t||!t.length)return[];var n=t.length,r=i._calloc(n,E);W(r,t);var o=i._calloc(M);try{return m(y.cellsToLinkedMultiPolygon(r,n,o)),function(t,e){for(var n,r,o,s,a=[],l=e?X:Z;t;){for(a.push(n=[]),r=i.getValue(t,"i8*");r;){for(n.push(o=[]),s=i.getValue(r,"i8*");s;)o.push(l(s)),s=i.getValue(s+2*x,"i8*");e&&o.push(o[0]),r=i.getValue(r+2*b,"i8*")}t=i.getValue(t+2*b,"i8*")}return a}(o,e)}finally{y.destroyLinkedMultiPolygon(o),i._free(o),i._free(r)}}function ot(t){var e=k(t),n=e[0],r=e[1],o=i._calloc(6,E);try{return m(y.originToDirectedEdges(n,r,o)),H(o,6)}finally{i._free(o)}}function st(t,e){var n=k(t),r=n[0],o=n[1],s=k(e),a=s[0],l=s[1],c=i._malloc(w);try{return m(y.gridDistance(r,o,a,l,c)),V(c)}finally{i._free(c)}}function at(t,e){var n=k(t),r=n[0],o=n[1],s=i._malloc(x);try{switch(e){case I.m:m(y.edgeLengthM(r,o,s));break;case I.km:m(y.edgeLengthKm(r,o,s));break;case I.rads:m(y.edgeLengthRads(r,o,s));break;default:throw g(c,e)}return G(s)}finally{i._free(s)}}function lt(t,e){B(t);var n=i._malloc(x);try{switch(e){case I.m:m(y.getHexagonEdgeLengthAvgM(t,n));break;case I.km:m(y.getHexagonEdgeLengthAvgKm(t,n));break;default:throw g(c,e)}return G(n)}finally{i._free(n)}}function ct(t){return t*Math.PI/180}},92494
vendor: 20,222 bytes, line 2
2:(t,e,n)=>{var i;!function(r,o,s,a){"use strict";var l,c=["","webkit","Moz","MS","ms","o"],u=o.createElement("div"),h="function",d=Math.round,p=Math.abs,f=Date.now;function A(t,e,n){return setTimeout(x(t,n),e)}function g(t,e,n){return!!Array.isArray(t)&&(m(t,n[e],n),!0)}function m(t,e,n){var i;if(t)if(t.forEach)t.forEach(e,n);else if(t.length!==a)for(i=0;i<t.length;)e.call(n,t[i],i,t),i++;else for(i in t)t.hasOwnProperty(i)&&e.call(n,t[i],i,t)}function y(t,e,n){var i="DEPRECATED METHOD: "+e+"\n"+n+" AT \n";return function(){var e=new Error("get-stack-trace"),n=e&&e.stack?e.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",o=r.console&&(r.console.warn||r.console.log);return o&&o.call(r.console,i,n),t.apply(this,arguments)}}l="function"!==typeof Object.assign?function(t){if(t===a||null===t)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(t),n=1;n<arguments.length;n++){var i=arguments[n];if(i!==a&&null!==i)for(var r in i)i.hasOwnProperty(r)&&(e[r]=i[r])}return e}:Object.assign;var _=y((function(t,e,n){for(var i=Object.keys(e),r=0;r<i.length;)(!n||n&&t[i[r]]===a)&&(t[i[r]]=e[i[r]]),r++;return t}),"extend","Use `assign`."),v=y((function(t,e){return _(t,e,!0)}),"merge","Use `assign`.");function b(t,e,n){var i,r=e.prototype;(i=t.prototype=Object.create(r)).constructor=t,i._super=r,n&&l(i,n)}function x(t,e){return function(){return t.apply(e,arguments)}}function w(t,e){return typeof t==h?t.apply(e&&e[0]||a,e):t}function E(t,e){return t===a?e:t}function C(t,e,n){m(M(e),(function(e){t.addEventListener(e,n,!1)}))}function T(t,e,n){m(M(e),(function(e){t.removeEventListener(e,n,!1)}))}function S(t,e){for(;t;){if(t==e)return!0;t=t.parentNode}return!1}function P(t,e){return t.indexOf(e)>-1}function M(t){return t.trim().split(/\s+/g)}function I(t,e,n){if(t.indexOf&&!n)return t.indexOf(e);for(var i=0;i<t.length;){if(n&&t[i][n]==e||!n&&t[i]===e)return i;i++}return-1}function B(t){return Array.prototype.slice.call(t,0)}function R(t,e,n){for(var i=[],r=[],o=0;o<t.length;){var s=e?t[o][e]:t[o];I(r,s)<0&&i.push(t[o]),r[o]=s,o++}return n&&(i=e?i.sort((function(t,n){return t[e]>n[e]})):i.sort()),i}function L(t,e){for(var n,i,r=e[0].toUpperCase()+e.slice(1),o=0;o<c.length;){if((i=(n=c[o])?n+r:e)in t)return i;o++}return a}var O=1;function D(t){var e=t.ownerDocument||t;return e.defaultView||e.parentWindow||r}var k="ontouchstart"in r,F=L(r,"PointerEvent")!==a,N=k&&/mobile|tablet|ip(ad|hone|od)|android/i.test(navigator.userAgent),z="touch",U="mouse",G=25,V=1,j=4,H=8,W=1,q=2,Z=4,X=8,K=16,Q=q|Z,J=X|K,Y=Q|J,$=["x","y"],tt=["clientX","clientY"];function et(t,e){var n=this;this.manager=t,this.callback=e,this.element=t.element,this.target=t.options.inputTarget,this.domHandler=function(e){w(t.options.enable,[t])&&n.handler(e)},this.init()}function nt(t,e,n){var i=n.pointers.length,r=n.changedPointers.length,o=e&V&&i-r===0,s=e&(j|H)&&i-r===0;n.isFirst=!!o,n.isFinal=!!s,o&&(t.session={}),n.eventType=e,function(t,e){var n=t.session,i=e.pointers,r=i.length;n.firstInput||(n.firstInput=it(e));r>1&&!n.firstMultiple?n.firstMultiple=it(e):1===r&&(n.firstMultiple=!1);var o=n.firstInput,s=n.firstMultiple,l=s?s.center:o.center,c=e.center=rt(i);e.timeStamp=f(),e.deltaTime=e.timeStamp-o.timeStamp,e.angle=lt(l,c),e.distance=at(l,c),function(t,e){var n=e.center,i=t.offsetDelta||{},r=t.prevDelta||{},o=t.prevInput||{};e.eventType!==V&&o.eventType!==j||(r=t.prevDelta={x:o.deltaX||0,y:o.deltaY||0},i=t.offsetDelta={x:n.x,y:n.y});e.deltaX=r.x+(n.x-i.x),e.deltaY=r.y+(n.y-i.y)}(n,e),e.offsetDirection=st(e.deltaX,e.deltaY);var u=ot(e.deltaTime,e.deltaX,e.deltaY);e.overallVelocityX=u.x,e.overallVelocityY=u.y,e.overallVelocity=p(u.x)>p(u.y)?u.x:u.y,e.scale=s?(h=s.pointers,d=i,at(d[0],d[1],tt)/at(h[0],h[1],tt)):1,e.rotation=s?function(t,e){return lt(e[1],e[0],tt)+lt(t[1],t[0],tt)}(s.pointers,i):0,e.maxPointers=n.prevInput?e.pointers.length>n.prevInput.maxPointers?e.pointers.length:n.prevInput.maxPointers:e.pointers.length,function(t,e){var n,i,r,o,s=t.lastInterval||e,l=e.timeStamp-s.timeStamp;if(e.eventType!=H&&(l>G||s.velocity===a)){var c=e.deltaX-s.deltaX,u=e.deltaY-s.deltaY,h=ot(l,c,u);i=h.x,r=h.y,n=p(h.x)>p(h.y)?h.x:h.y,o=st(c,u),t.lastInterval=e}else n=s.velocity,i=s.velocityX,r=s.velocityY,o=s.direction;e.velocity=n,e.velocityX=i,e.velocityY=r,e.direction=o}(n,e);var h,d;var A=t.element;S(e.srcEvent.target,A)&&(A=e.srcEvent.target);e.target=A}(t,n),t.emit("hammer.input",n),t.recognize(n),t.session.prevInput=n}function it(t){for(var e=[],n=0;n<t.pointers.length;)e[n]={clientX:d(t.pointers[n].clientX),clientY:d(t.pointers[n].clientY)},n++;return{timeStamp:f(),pointers:e,center:rt(e),deltaX:t.deltaX,deltaY:t.deltaY}}function rt(t){var e=t.length;if(1===e)return{x:d(t[0].clientX),y:d(t[0].clientY)};for(var n=0,i=0,r=0;r<e;)n+=t[r].clientX,i+=t[r].clientY,r++;return{x:d(n/e),y:d(i/e)}}function ot(t,e,n){return{x:e/t||0,y:n/t||0}}function st(t,e){return t===e?W:p(t)>=p(e)?t<0?q:Z:e<0?X:K}function at(t,e,n){n||(n=$);var i=e[n[0]]-t[n[0]],r=e[n[1]]-t[n[1]];return Math.sqrt(i*i+r*r)}function lt(t,e,n){n||(n=$);var i=e[n[0]]-t[n[0]],r=e[n[1]]-t[n[1]];return 180*Math.atan2(r,i)/Math.PI}et.prototype={handler:function(){},init:function(){this.evEl&&C(this.element,this.evEl,this.domHandler),this.evTarget&&C(this.target,this.evTarget,this.domHandler),this.evWin&&C(D(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&T(this.element,this.evEl,this.domHandler),this.evTarget&&T(this.target,this.evTarget,this.domHandler),this.evWin&&T(D(this.element),this.evWin,this.domHandler)}};var ct={mousedown:V,mousemove:2,mouseup:j},ut="mousedown",ht="mousemove mouseup";function dt(){this.evEl=ut,this.evWin=ht,this.pressed=!1,et.apply(this,arguments)}b(dt,et,{handler:function(t){var e=ct[t.type];e&V&&0===t.button&&(this.pressed=!0),2&e&&1!==t.which&&(e=j),this.pressed&&(e&j&&(this.pressed=!1),this.callback(this.manager,e,{pointers:[t],changedPointers:[t],pointerType:U,srcEvent:t}))}});var pt={pointerdown:V,pointermove:2,pointerup:j,pointercancel:H,pointerout:H},ft={2:z,3:"pen",4:U,5:"kinect"},At="pointerdown",gt="pointermove pointerup pointercancel";function mt(){this.evEl=At,this.evWin=gt,et.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}r.MSPointerEvent&&!r.PointerEvent&&(At="MSPointerDown",gt="MSPointerMove MSPointerUp MSPointerCancel"),b(mt,et,{handler:function(t){var e=this.store,n=!1,i=t.type.toLowerCase().replace("ms",""),r=pt[i],o=ft[t.pointerType]||t.pointerType,s=o==z,a=I(e,t.pointerId,"pointerId");r&V&&(0===t.button||s)?a<0&&(e.push(t),a=e.length-1):r&(j|H)&&(n=!0),a<0||(e[a]=t,this.callback(this.manager,r,{pointers:e,changedPointers:[t],pointerType:o,srcEvent:t}),n&&e.splice(a,1))}});var yt={touchstart:V,touchmove:2,touchend:j,touchcancel:H};function _t(){this.evTarget="touchstart",this.evWin="touchstart touchmove touchend touchcancel",this.started=!1,et.apply(this,arguments)}function vt(t,e){var n=B(t.touches),i=B(t.changedTouches);return e&(j|H)&&(n=R(n.concat(i),"identifier",!0)),[n,i]}b(_t,et,{handler:function(t){var e=yt[t.type];if(e===V&&(this.started=!0),this.started){var n=vt.call(this,t,e);e&(j|H)&&n[0].length-n[1].length===0&&(this.started=!1),this.callback(this.manager,e,{pointers:n[0],changedPointers:n[1],pointerType:z,srcEvent:t})}}});var bt={touchstart:V,touchmove:2,touchend:j,touchcancel:H},xt="touchstart touchmove touchend touchcancel";function wt(){this.evTarget=xt,this.targetIds={},et.apply(this,arguments)}function Et(t,e){var n=B(t.touches),i=this.targetIds;if(e&(2|V)&&1===n.length)return i[n[0].identifier]=!0,[n,n];var r,o,s=B(t.changedTouches),a=[],l=this.target;if(o=n.filter((function(t){return S(t.target,l)})),e===V)for(r=0;r<o.length;)i[o[r].identifier]=!0,r++;for(r=0;r<s.length;)i[s[r].identifier]&&a.push(s[r]),e&(j|H)&&delete i[s[r].identifier],r++;return a.length?[R(o.concat(a),"identifier",!0),a]:void 0}b(wt,et,{handler:function(t){var e=bt[t.type],n=Et.call(this,t,e);n&&this.callback(this.manager,e,{pointers:n[0],changedPointers:n[1],pointerType:z,srcEvent:t})}});var Ct=2500;function Tt(){et.apply(this,arguments);var t=x(this.handler,this);this.touch=new wt(this.manager,t),this.mouse=new dt(this.manager,t),this.primaryTouch=null,this.lastTouches=[]}function St(t,e){t&V?(this.primaryTouch=e.changedPointers[0].identifier,Pt.call(this,e)):t&(j|H)&&Pt.call(this,e)}function Pt(t){var e=t.changedPointers[0];if(e.identifier===this.primaryTouch){var n={x:e.clientX,y:e.clientY};this.lastTouches.push(n);var i=this.lastTouches;setTimeout((function(){var t=i.indexOf(n);t>-1&&i.splice(t,1)}),Ct)}}function Mt(t){for(var e=t.srcEvent.clientX,n=t.srcEvent.clientY,i=0;i<this.lastTouches.length;i++){var r=this.lastTouches[i],o=Math.abs(e-r.x),s=Math.abs(n-r.y);if(o<=25&&s<=25)return!0}return!1}b(Tt,et,{handler:function(t,e,n){var i=n.pointerType==z,r=n.pointerType==U;if(!(r&&n.sourceCapabilities&&n.sourceCapabilities.firesTouchEvents)){if(i)St.call(this,e,n);else if(r&&Mt.call(this,n))return;this.callback(t,e,n)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var It=L(u.style,"touchAction"),Bt=It!==a,Rt="compute",Lt="auto",Ot="manipulation",Dt="none",kt="pan-x",Ft="pan-y",Nt=function(){if(!Bt)return!1;var t={},e=r.CSS&&r.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach((function(n){t[n]=!e||r.CSS.supports("touch-action",n)})),t}();function zt(t,e){this.manager=t,this.set(e)}zt.prototype={set:function(t){t==Rt&&(t=this.compute()),Bt&&this.manager.element.style&&Nt[t]&&(this.manager.element.style[It]=t),this.actions=t.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var t=[];return m(this.manager.recognizers,(function(e){w(e.options.enable,[e])&&(t=t.concat(e.getTouchAction()))})),function(t){if(P(t,Dt))return Dt;var e=P(t,kt),n=P(t,Ft);if(e&&n)return Dt;if(e||n)return e?kt:Ft;if(P(t,Ot))return Ot;return Lt}(t.join(" "))},preventDefaults:function(t){var e=t.srcEvent,n=t.offsetDirection;if(this.manager.session.prevented)e.preventDefault();else{var i=this.actions,r=P(i,Dt)&&!Nt[Dt],o=P(i,Ft)&&!Nt[Ft],s=P(i,kt)&&!Nt[kt];if(r){var a=1===t.pointers.length,l=t.distance<2,c=t.deltaTime<250;if(a&&l&&c)return}if(!s||!o)return r||o&&n&Q||s&&n&J?this.preventSrc(e):void 0}},preventSrc:function(t){this.manager.session.prevented=!0,t.preventDefault()}};var Ut=1,Gt=32;function Vt(t){this.options=l({},this.defaults,t||{}),this.id=O++,this.manager=null,this.options.enable=E(this.options.enable,!0),this.state=Ut,this.simultaneous={},this.requireFail=[]}function jt(t){return 16&t?"cancel":8&t?"end":4&t?"move":2&t?"start":""}function Ht(t){return t==K?"down":t==X?"up":t==q?"left":t==Z?"right":""}function Wt(t,e){var n=e.manager;return n?n.get(t):t}function qt(){Vt.apply(this,arguments)}function Zt(){qt.apply(this,arguments),this.pX=null,this.pY=null}function Xt(){qt.apply(this,arguments)}function Kt(){Vt.apply(this,arguments),this._timer=null,this._input=null}function Qt(){qt.apply(this,arguments)}function Jt(){qt.apply(this,arguments)}function Yt(){Vt.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function $t(t,e){return(e=e||{}).recognizers=E(e.recognizers,$t.defaults.preset),new te(t,e)}Vt.prototype={defaults:{},set:function(t){return l(this.options,t),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(t){if(g(t,"recognizeWith",this))return this;var e=this.simultaneous;return e[(t=Wt(t,this)).id]||(e[t.id]=t,t.recognizeWith(this)),this},dropRecognizeWith:function(t){return g(t,"dropRecognizeWith",this)||(t=Wt(t,this),delete this.simultaneous[t.id]),this},requireFailure:function(t){if(g(t,"requireFailure",this))return this;var e=this.requireFail;return-1===I(e,t=Wt(t,this))&&(e.push(t),t.requireFailure(this)),this},dropRequireFailure:function(t){if(g(t,"dropRequireFailure",this))return this;t=Wt(t,this);var e=I(this.requireFail,t);return e>-1&&this.requireFail.splice(e,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(t){return!!this.simultaneous[t.id]},emit:function(t){var e=this,n=this.state;function i(n){e.manager.emit(n,t)}n<8&&i(e.options.event+jt(n)),i(e.options.event),t.additionalEvent&&i(t.additionalEvent),n>=8&&i(e.options.event+jt(n))},tryEmit:function(t){if(this.canEmit())return this.emit(t);this.state=Gt},canEmit:function(){for(var t=0;t<this.requireFail.length;){if(!(this.requireFail[t].state&(Gt|Ut)))return!1;t++}return!0},recognize:function(t){var e=l({},t);if(!w(this.options.enable,[this,e]))return this.reset(),void(this.state=Gt);56&this.state&&(this.state=Ut),this.state=this.process(e),30&this.state&&this.tryEmit(e)},process:function(t){},getTouchAction:function(){},reset:function(){}},b(qt,Vt,{defaults:{pointers:1},attrTest:function(t){var e=this.options.pointers;return 0===e||t.pointers.length===e},process:function(t){var e=this.state,n=t.eventType,i=6&e,r=this.attrTest(t);return i&&(n&H||!r)?16|e:i||r?n&j?8|e:2&e?4|e:2:Gt}}),b(Zt,qt,{defaults:{event:"pan",threshold:10,pointers:1,direction:Y},getTouchAction:function(){var t=this.options.direction,e=[];return t&Q&&e.push(Ft),t&J&&e.push(kt),e},directionTest:function(t){var e=this.options,n=!0,i=t.distance,r=t.direction,o=t.deltaX,s=t.deltaY;return r&e.direction||(e.direction&Q?(r=0===o?W:o<0?q:Z,n=o!=this.pX,i=Math.abs(t.deltaX)):(r=0===s?W:s<0?X:K,n=s!=this.pY,i=Math.abs(t.deltaY))),t.direction=r,n&&i>e.threshold&&r&e.direction},attrTest:function(t){return qt.prototype.attrTest.call(this,t)&&(2&this.state||!(2&this.state)&&this.directionTest(t))},emit:function(t){this.pX=t.deltaX,this.pY=t.deltaY;var e=Ht(t.direction);e&&(t.additionalEvent=this.options.event+e),this._super.emit.call(this,t)}}),b(Xt,qt,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[Dt]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.scale-1)>this.options.threshold||2&this.state)},emit:function(t){if(1!==t.scale){var e=t.scale<1?"in":"out";t.additionalEvent=this.options.event+e}this._super.emit.call(this,t)}}),b(Kt,Vt,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[Lt]},process:function(t){var e=this.options,n=t.pointers.length===e.pointers,i=t.distance<e.threshold,r=t.deltaTime>e.time;if(this._input=t,!i||!n||t.eventType&(j|H)&&!r)this.reset();else if(t.eventType&V)this.reset(),this._timer=A((function(){this.state=8,this.tryEmit()}),e.time,this);else if(t.eventType&j)return 8;return Gt},reset:function(){clearTimeout(this._timer)},emit:function(t){8===this.state&&(t&&t.eventType&j?this.manager.emit(this.options.event+"up",t):(this._input.timeStamp=f(),this.manager.emit(this.options.event,this._input)))}}),b(Qt,qt,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Dt]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.rotation)>this.options.threshold||2&this.state)}}),b(Jt,qt,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:Q|J,pointers:1},getTouchAction:function(){return Zt.prototype.getTouchAction.call(this)},attrTest:function(t){var e,n=this.options.direction;return n&(Q|J)?e=t.overallVelocity:n&Q?e=t.overallVelocityX:n&J&&(e=t.overallVelocityY),this._super.attrTest.call(this,t)&&n&t.offsetDirection&&t.distance>this.options.threshold&&t.maxPointers==this.options.pointers&&p(e)>this.options.velocity&&t.eventType&j},emit:function(t){var e=Ht(t.offsetDirection);e&&this.manager.emit(this.options.event+e,t),this.manager.emit(this.options.event,t)}}),b(Yt,Vt,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Ot]},process:function(t){var e=this.options,n=t.pointers.length===e.pointers,i=t.distance<e.threshold,r=t.deltaTime<e.time;if(this.reset(),t.eventType&V&&0===this.count)return this.failTimeout();if(i&&r&&n){if(t.eventType!=j)return this.failTimeout();var o=!this.pTime||t.timeStamp-this.pTime<e.interval,s=!this.pCenter||at(this.pCenter,t.center)<e.posThreshold;if(this.pTime=t.timeStamp,this.pCenter=t.center,s&&o?this.count+=1:this.count=1,this._input=t,0===this.count%e.taps)return this.hasRequireFailures()?(this._timer=A((function(){this.state=8,this.tryEmit()}),e.interval,this),2):8}return Gt},failTimeout:function(){return this._timer=A((function(){this.state=Gt}),this.options.interval,this),Gt},reset:function(){clearTimeout(this._timer)},emit:function(){8==this.state&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),$t.VERSION="2.0.7",$t.defaults={domEvents:!1,touchAction:Rt,enable:!0,inputTarget:null,inputClass:null,preset:[[Qt,{enable:!1}],[Xt,{enable:!1},["rotate"]],[Jt,{direction:Q}],[Zt,{direction:Q},["swipe"]],[Yt],[Yt,{event:"doubletap",taps:2},["tap"]],[Kt]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};function te(t,e){var n;this.options=l({},$t.defaults,e||{}),this.options.inputTarget=this.options.inputTarget||t,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=t,this.input=new((n=this).options.inputClass||(F?mt:N?wt:k?Tt:dt))(n,nt),this.touchAction=new zt(this,this.options.touchAction),ee(this,!0),m(this.options.recognizers,(function(t){var e=this.add(new t[0](t[1]));t[2]&&e.recognizeWith(t[2]),t[3]&&e.requireFailure(t[3])}),this)}function ee(t,e){var n,i=t.element;i.style&&(m(t.options.cssProps,(function(r,o){n=L(i.style,o),e?(t.oldCssProps[n]=i.style[n],i.style[n]=r):i.style[n]=t.oldCssProps[n]||""})),e||(t.oldCssProps={}))}te.prototype={set:function(t){return l(this.options,t),t.touchAction&&this.touchAction.update(),t.inputTarget&&(this.input.destroy(),this.input.target=t.inputTarget,this.input.init()),this},stop:function(t){this.session.stopped=t?2:1},recognize:function(t){var e=this.session;if(!e.stopped){var n;this.touchAction.preventDefaults(t);var i=this.recognizers,r=e.curRecognizer;(!r||r&&8&r.state)&&(r=e.curRecognizer=null);for(var o=0;o<i.length;)n=i[o],2===e.stopped||r&&n!=r&&!n.canRecognizeWith(r)?n.reset():n.recognize(t),!r&&14&n.state&&(r=e.curRecognizer=n),o++}},get:function(t){if(t instanceof Vt)return t;for(var e=this.recognizers,n=0;n<e.length;n++)if(e[n].options.event==t)return e[n];return null},add:function(t){if(g(t,"add",this))return this;var e=this.get(t.options.event);return e&&this.remove(e),this.recognizers.push(t),t.manager=this,this.touchAction.update(),t},remove:function(t){if(g(t,"remove",this))return this;if(t=this.get(t)){var e=this.recognizers,n=I(e,t);-1!==n&&(e.splice(n,1),this.touchAction.update())}return this},on:function(t,e){if(t!==a&&e!==a){var n=this.handlers;return m(M(t),(function(t){n[t]=n[t]||[],n[t].push(e)})),this}},off:function(t,e){if(t!==a){var n=this.handlers;return m(M(t),(function(t){e?n[t]&&n[t].splice(I(n[t],e),1):delete n[t]})),this}},emit:function(t,e){this.options.domEvents&&function(t,e){var n=o.createEvent("Event");n.initEvent(t,!0,!0),n.gesture=e,e.target.dispatchEvent(n)}(t,e);var n=this.handlers[t]&&this.handlers[t].slice();if(n&&n.length){e.type=t,e.preventDefault=function(){e.srcEvent.preventDefault()};for(var i=0;i<n.length;)n[i](e),i++}},destroy:function(){this.element&&ee(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},l($t,{INPUT_START:V,INPUT_MOVE:2,INPUT_END:j,INPUT_CANCEL:H,STATE_POSSIBLE:Ut,STATE_BEGAN:2,STATE_CHANGED:4,STATE_ENDED:8,STATE_RECOGNIZED:8,STATE_CANCELLED:16,STATE_FAILED:Gt,DIRECTION_NONE:W,DIRECTION_LEFT:q,DIRECTION_RIGHT:Z,DIRECTION_UP:X,DIRECTION_DOWN:K,DIRECTION_HORIZONTAL:Q,DIRECTION_VERTICAL:J,DIRECTION_ALL:Y,Manager:te,Input:et,TouchAction:zt,TouchInput:wt,MouseInput:dt,PointerEventInput:mt,TouchMouseInput:Tt,SingleTouchInput:_t,Recognizer:Vt,AttrRecognizer:qt,Tap:Yt,Pan:Zt,Swipe:Jt,Pinch:Xt,Rotate:Qt,Press:Kt,on:C,off:T,each:m,merge:v,extend:_,assign:l,inherit:b,bindFn:x,prefixed:L}),("undefined"!==typeof r?r:"undefined"!==typeof self?self:{}).Hammer=$t,(i=function(){return $t}.call(e,n,e,t))===a||(t.exports=i)}(window,document)},
vendor: 5,767 bytes, line 2
27121:(t,e)=>{e.read=function(t,e,n,i,r){var o,s,a=8*r-i-1,l=(1<<a)-1,c=l>>1,u=-7,h=n?r-1:0,d=n?-1:1,p=t[e+h];for(h+=d,o=p&(1<<-u)-1,p>>=-u,u+=a;u>0;o=256*o+t[e+h],h+=d,u-=8);for(s=o&(1<<-u)-1,o>>=-u,u+=i;u>0;s=256*s+t[e+h],h+=d,u-=8);if(0===o)o=1-c;else{if(o===l)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,i),o-=c}return(p?-1:1)*s*Math.pow(2,o-i)},e.write=function(t,e,n,i,r,o){var s,a,l,c=8*o-r-1,u=(1<<c)-1,h=u>>1,d=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,p=i?0:o-1,f=i?1:-1,A=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=u):(s=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-s))<1&&(s--,l*=2),(e+=s+h>=1?d/l:d*Math.pow(2,1-h))*l>=2&&(s++,l/=2),s+h>=u?(a=0,s=u):s+h>=1?(a=(e*l-1)*Math.pow(2,r),s+=h):(a=e*Math.pow(2,h-1)*Math.pow(2,r),s=0));r>=8;t[n+p]=255&a,p+=f,a/=256,r-=8);for(s=s<<r|a,c+=r;c>0;t[n+p]=255&s,p+=f,s/=256,c-=8);t[n+p-f]|=128*A}},1386:function(t,e){!function(){"use strict";var n="Compound",i="MemberExpression",r="Literal",o=function(t,e){var n=new Error(t+" at character "+e);throw n.index=e,n.description=t,n},s=!0,a={"-":s,"!":s,"~":s,"+":s},l={"||":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10},c=function(t){var e,n=0;for(var i in t)(e=i.length)>n&&t.hasOwnProperty(i)&&(n=e);return n},u=c(a),h=c(l),d={true:!0,false:!1,null:null},p=function(t){return l[t]||0},f=function(t,e,n){return{type:"||"===t||"&&"===t?"LogicalExpression":"BinaryExpression",operator:t,left:e,right:n}},A=function(t){return t>=48&&t<=57},g=function(t){return 36===t||95===t||t>=65&&t<=90||t>=97&&t<=122||t>=128&&!l[String.fromCharCode(t)]},m=function(t){return 36===t||95===t||t>=65&&t<=90||t>=97&&t<=122||t>=48&&t<=57||t>=128&&!l[String.fromCharCode(t)]},y=function(t){for(var e,s,c=0,y=t.charAt,_=t.charCodeAt,v=function(e){return y.call(t,e)},b=function(e){return _.call(t,e)},x=t.length,w=function(){for(var t=b(c);32===t||9===t||10===t||13===t;)t=b(++c)},E=function(){var t,e,n=T();return w(),63!==b(c)?n:(c++,(t=E())||o("Expected expression",c),w(),58===b(c)?(c++,(e=E())||o("Expected expression",c),{type:"ConditionalExpression",test:n,consequent:t,alternate:e}):void o("Expected :",c))},C=function(){w();for(var e=t.substr(c,h),n=e.length;n>0;){if(l.hasOwnProperty(e)&&(!g(b(c))||c+e.length<t.length&&!m(b(c+e.length))))return c+=n,e;e=e.substr(0,--n)}return!1},T=function(){var t,e,n,i,r,s,a,l,u;if(s=S(),!(e=C()))return s;for(r={value:e,prec:p(e)},(a=S())||o("Expected expression after "+e,c),i=[s,r,a];(e=C())&&0!==(n=p(e));){for(r={value:e,prec:n},u=e;i.length>2&&n<=i[i.length-2].prec;)a=i.pop(),e=i.pop().value,s=i.pop(),t=f(e,s,a),i.push(t);(t=S())||o("Expected expression after "+u,c),i.push(r,t)}for(t=i[l=i.length-1];l>1;)t=f(i[l-1].value,i[l-2],t),l-=2;return t},S=function(){var e,n,i;if(w(),e=b(c),A(e)||46===e)return P();if(39===e||34===e)return M();if(91===e)return O();for(i=(n=t.substr(c,u)).length;i>0;){if(a.hasOwnProperty(n)&&(!g(b(c))||c+n.length<t.length&&!m(b(c+n.length))))return c+=i,{type:"UnaryExpression",operator:n,argument:S(),prefix:!0};n=n.substr(0,--i)}return!(!g(e)&&40!==e)&&R()},P=function(){for(var t,e,n="";A(b(c));)n+=v(c++);if(46===b(c))for(n+=v(c++);A(b(c));)n+=v(c++);if("e"===(t=v(c))||"E"===t){for(n+=v(c++),"+"!==(t=v(c))&&"-"!==t||(n+=v(c++));A(b(c));)n+=v(c++);A(b(c-1))||o("Expected exponent ("+n+v(c)+")",c)}return e=b(c),g(e)?o("Variable names cannot start with a number ("+n+v(c)+")",c):46===e&&o("Unexpected period",c),{type:r,value:parseFloat(n),raw:n}},M=function(){for(var t,e="",n=v(c++),i=!1;c<x;){if((t=v(c++))===n){i=!0;break}if("\\"===t)switch(t=v(c++)){case"n":e+="\n";break;case"r":e+="\r";break;case"t":e+="\t";break;case"b":e+="\b";break;case"f":e+="\f";break;case"v":e+="\v";break;default:e+=t}else e+=t}return i||o('Unclosed quote after "'+e+'"',c),{type:r,value:e,raw:n+e+n}},I=function(){var e,n=b(c),i=c;for(g(n)?c++:o("Unexpected "+v(c),c);c<x&&(n=b(c),m(n));)c++;return e=t.slice(i,c),d.hasOwnProperty(e)?{type:r,value:d[e],raw:e}:"this"===e?{type:"ThisExpression"}:{type:"Identifier",name:e}},B=function(t){for(var e,i,r=[],s=!1,a=0;c<x;){if(w(),(e=b(c))===t){s=!0,c++,41===t&&a&&a>=r.length&&o("Unexpected token "+String.fromCharCode(t),c);break}if(44===e){if(c++,++a!==r.length)if(41===t)o("Unexpected token ,",c);else if(93===t)for(var l=r.length;l<a;l++)r.push(null)}else(i=E())&&i.type!==n||o("Expected comma",c),r.push(i)}return s||o("Expected "+String.fromCharCode(t),c),r},R=function(){var t,e;for(e=40===(t=b(c))?L():I(),w(),t=b(c);46===t||91===t||40===t;)c++,46===t?(w(),e={type:i,computed:!1,object:e,property:I()}):91===t?(e={type:i,computed:!0,object:e,property:E()},w(),93!==(t=b(c))&&o("Unclosed [",c),c++):40===t&&(e={type:"CallExpression",arguments:B(41),callee:e}),w(),t=b(c);return e},L=function(){c++;var t=E();if(w(),41===b(c))return c++,t;o("Unclosed (",c)},O=function(){return c++,{type:"ArrayExpression",elements:B(93)}},D=[];c<x;)59===(e=b(c))||44===e?c++:(s=E())?D.push(s):c<x&&o('Unexpected "'+v(c)+'"',c);return 1===D.length?D[0]:{type:n,body:D}};y.version="0.3.5",y.toString=function(){return"JavaScript Expression Parser (JSEP) v"+y.version},y.addUnaryOp=function(t){return u=Math.max(t.length,u),a[t]=s,this},y.addBinaryOp=function(t,e){return h=Math.max(t.length,h),l[t]=e,this},y.addLiteral=function(t,e){return d[t]=e,this},y.removeUnaryOp=function(t){return delete a[t],t.length===u&&(u=c(a)),this},y.removeAllUnaryOps=function(){return a={},u=0,this},y.removeBinaryOp=function(t){return delete l[t],t.length===h&&(h=c(l)),this},y.removeAllBinaryOps=function(){return l={},h=0,this},y.removeLiteral=function(t){return delete d[t],this},y.removeAllLiterals=function(){return d={},this},t.exports?e=t.exports=y:e.parse=y}()},23524
vendor: 12,513 bytes, line 2
2:function(t){t.exports=function(){"use strict";var t,e,n;function i(i,r){if(t)if(e){var o="var sharedChunk = {}; ("+t+")(sharedChunk); ("+e+")(sharedChunk);",s={};t(s),n=r(s),"undefined"!==typeof window&&(n.workerUrl=window.URL.createObjectURL(new Blob([o],{type:"text/javascript"})))}else e=r;else t=r}return i(["exports"],(function(t){function e(t,e){return t(e={exports:{}},e.exports),e.exports}var n=i;function i(t,e,n,i){this.cx=3*t,this.bx=3*(n-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(i-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=i,this.p2x=n,this.p2y=i}i.prototype.sampleCurveX=function(t){return((this.ax*t+this.bx)*t+this.cx)*t},i.prototype.sampleCurveY=function(t){return((this.ay*t+this.by)*t+this.cy)*t},i.prototype.sampleCurveDerivativeX=function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},i.prototype.solveCurveX=function(t,e){var n,i,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)<(n=0))return n;if(r>(i=1))return i;for(;n<i;){if(o=this.sampleCurveX(r),Math.abs(o-t)<e)return r;t>o?n=r:i=r,r=.5*(i-n)+n}return r},i.prototype.solve=function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))};var r=o;function o(t,e){this.x=t,this.y=e}o.prototype={clone:function(){return new o(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},multByPoint:function(t){return this.clone()._multByPoint(t)},divByPoint:function(t){return this.clone()._divByPoint(t)},mult:function(t){return this.clone()._mult(t)},div:function(t){return this.clone()._div(t)},rotate:function(t){return this.clone()._rotate(t)},rotateAround:function(t,e){return this.clone()._rotateAround(t,e)},matMult:function(t){return this.clone()._matMult(t)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(t){return this.x===t.x&&this.y===t.y},dist:function(t){return Math.sqrt(this.distSqr(t))},distSqr:function(t){var e=t.x-this.x,n=t.y-this.y;return e*e+n*n},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith:function(t){return this.angleWithSep(t.x,t.y)},angleWithSep:function(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},_matMult:function(t){var e=t[2]*this.x+t[3]*this.y;return this.x=t[0]*this.x+t[1]*this.y,this.y=e,this},_add:function(t){return this.x+=t.x,this.y+=t.y,this},_sub:function(t){return this.x-=t.x,this.y-=t.y,this},_mult:function(t){return this.x*=t,this.y*=t,this},_div:function(t){return this.x/=t,this.y/=t,this},_multByPoint:function(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint:function(t){return this.x/=t.x,this.y/=t.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var t=this.y;return this.y=this.x,this.x=-t,this},_rotate:function(t){var e=Math.cos(t),n=Math.sin(t),i=n*this.x+e*this.y;return this.x=e*this.x-n*this.y,this.y=i,this},_rotateAround:function(t,e){var n=Math.cos(t),i=Math.sin(t),r=e.y+i*(this.x-e.x)+n*(this.y-e.y);return this.x=e.x+n*(this.x-e.x)-i*(this.y-e.y),this.y=r,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},o.convert=function(t){return t instanceof o?t:Array.isArray(t)?new o(t[0],t[1]):t};var s="undefined"!=typeof self?self:{},a=Math.pow(2,53)-1;function l(t,e,i,r){var o=new n(t,e,i,r);return function(t){return o.solve(t)}}var c=l(.25,.1,.25,1);function u(t,e,n){return Math.min(n,Math.max(e,t))}function h(t,e,n){var i=n-e,r=((t-e)%i+i)%i+e;return r===e?n:r}function d(t){for(var e=[],n=arguments.length-1;n-- >0;)e[n]=arguments[n+1];for(var i=0,r=e;i<r.length;i+=1){var o=r[i];for(var s in o)t[s]=o[s]}return t}var p=1;function f(){return p++}function A(){return function t(e){return e?(e^16*Math.random()>>e/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,t)}()}function g(t){return!!t&&/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(t)}function m(t,e){t.forEach((function(t){e[t]&&(e[t]=e[t].bind(e))}))}function y(t,e){return-1!==t.indexOf(e,t.length-e.length)}function _(t,e,n){var i={};for(var r in t)i[r]=e.call(n||this,t[r],r,t);return i}function v(t,e,n){var i={};for(var r in t)e.call(n||this,t[r],r,t)&&(i[r]=t[r]);return i}function b(t){return Array.isArray(t)?t.map(b):"object"==typeof t&&t?_(t,b):t}var x={};function w(t){x[t]||("undefined"!=typeof console&&console.warn(t),x[t]=!0)}function E(t,e,n){return(n.y-t.y)*(e.x-t.x)>(e.y-t.y)*(n.x-t.x)}function C(t){for(var e=0,n=0,i=t.length,r=i-1,o=void 0,s=void 0;n<i;r=n++)e+=((s=t[r]).x-(o=t[n]).x)*(o.y+s.y);return e}function T(){return"undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof self&&self instanceof WorkerGlobalScope}function S(t){var e={};if(t.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(function(t,n,i,r){var o=i||r;return e[n]=!o||o.toLowerCase(),""})),e["max-age"]){var n=parseInt(e["max-age"],10);isNaN(n)?delete e["max-age"]:e["max-age"]=n}return e}var P=null;function M(t){if(null==P){var e=t.navigator?t.navigator.userAgent:null;P=!!t.safari||!(!e||!(/\b(iPad|iPhone|iPod)\b/.test(e)||e.match("Safari")&&!e.match("Chrome")))}return P}function I(t){try{var e=s[t];return e.setItem("_mapbox_test_",1),e.removeItem("_mapbox_test_"),!0}catch(t){return!1}}var B,R,L,O,D=s.performance&&s.performance.now?s.performance.now.bind(s.performance):Date.now.bind(Date),k=s.requestAnimationFrame||s.mozRequestAnimationFrame||s.webkitRequestAnimationFrame||s.msRequestAnimationFrame,F=s.cancelAnimationFrame||s.mozCancelAnimationFrame||s.webkitCancelAnimationFrame||s.msCancelAnimationFrame,N={now:D,frame:function(t){var e=k(t);return{cancel:function(){return F(e)}}},getImageData:function(t,e){void 0===e&&(e=0);var n=s.document.createElement("canvas"),i=n.getContext("2d");if(!i)throw new Error("failed to create canvas 2d context");return n.width=t.width,n.height=t.height,i.drawImage(t,0,0,t.width,t.height),i.getImageData(-e,-e,t.width+2*e,t.height+2*e)},resolveURL:function(t){return B||(B=s.document.createElement("a")),B.href=t,B.href},hardwareConcurrency:s.navigator&&s.navigator.hardwareConcurrency||4,get devicePixelRatio(){return s.devicePixelRatio},get prefersReducedMotion(){return!!s.matchMedia&&(null==R&&(R=s.matchMedia("(prefers-reduced-motion: reduce)")),R.matches)}},z={API_URL:"https://api.mapbox.com",get EVENTS_URL(){return this.API_URL?0===this.API_URL.indexOf("https://api.mapbox.cn")?"https://events.mapbox.cn/events/v2":0===this.API_URL.indexOf("https://api.mapbox.com")?"https://events.mapbox.com/events/v2":null:null},FEEDBACK_URL:"https://apps.mapbox.com/feedback",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,MAX_PARALLEL_IMAGE_REQUESTS:16},U={supported:!1,testSupport:function(t){!G&&O&&(V?j(t):L=t)}},G=!1,V=!1;function j(t){var e=t.createTexture();t.bindTexture(t.TEXTURE_2D,e);try{if(t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,O),t.isContextLost())return;U.supported=!0}catch(t){}t.deleteTexture(e),G=!0}s.document&&((O=s.document.createElement("img")).onload=function(){L&&j(L),L=null,V=!0},O.onerror=function(){G=!0,L=null},O.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");var H="01",W=function(t,e){this._transformRequestFn=t,this._customAccessToken=e,this._createSkuToken()};function q(t){return 0===t.indexOf("mapbox:")}W.prototype._createSkuToken=function(){var t=function(){for(var t="",e=0;e<10;e++)t+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[Math.floor(62*Math.random())];return{token:["1",H,t].join(""),tokenExpiresAt:Date.now()+432e5}}();this._skuToken=t.token,this._skuTokenExpiresAt=t.tokenExpiresAt},W.prototype._isSkuTokenExpired=function(){return Date.now()>this._skuTokenExpiresAt},W.prototype.transformRequest=function(t,e){return this._transformRequestFn&&this._transformRequestFn(t,e)||{url:t}},W.prototype.normalizeStyleURL=function(t,e){if(!q(t))return t;var n=Q(t);return n.path="/styles/v1"+n.path,this._makeAPIURL(n,this._customAccessToken||e)},W.prototype.normalizeGlyphsURL=function(t,e){if(!q(t))return t;var n=Q(t);return n.path="/fonts/v1"+n.path,this._makeAPIURL(n,this._customAccessToken||e)},W.prototype.normalizeSourceURL=function(t,e){if(!q(t))return t;var n=Q(t);return n.path="/v4/"+n.authority+".json",n.params.push("secure"),this._makeAPIURL(n,this._customAccessToken||e)},W.prototype.normalizeSpriteURL=function(t,e,n,i){var r=Q(t);return q(t)?(r.path="/styles/v1"+r.path+"/sprite"+e+n,this._makeAPIURL(r,this._customAccessToken||i)):(r.path+=""+e+n,J(r))},W.prototype.normalizeTileURL=function(t,e){if(this._isSkuTokenExpired()&&this._createSkuToken(),t&&!q(t))return t;var n=Q(t);n.path=n.path.replace(/(\.(png|jpg)\d*)(?=$)/,(N.devicePixelRatio>=2||512===e?"@2x":"")+(U.supported?".webp":"$1")),n.path=n.path.replace(/^.+\/v4\//,"/"),n.path="/v4"+n.path;var i=this._customAccessToken||function(t){for(var e=0,n=t;e<n.length;e+=1){var i=n[e].match(/^access_token=(.*)$/);if(i)return i[1]}return null}(n.params)||z.ACCESS_TOKEN;return z.REQUIRE_ACCESS_TOKEN&&i&&this._skuToken&&n.params.push("sku="+this._skuToken),this._makeAPIURL(n,i)},W.prototype.canonicalizeTileURL=function(t,e){var n=Q(t);if(!n.path.match(/(^\/v4\/)/)||!n.path.match(/\.[\w]+$/))return t;var i="mapbox://tiles/";i+=n.path.replace("/v4/","");var r=n.params;return e&&(r=r.filter((function(t){return!t.match(/^access_token=/)}))),r.length&&(i+="?"+r.join("&")),i},W.prototype.canonicalizeTileset=function(t,e){for(var n=!!e&&q(e),i=[],r=0,o=t.tiles||[];r<o.length;r+=1){var s=o[r];X(s)?i.push(this.canonicalizeTileURL(s,n)):i.push(s)}return i},W.prototype._makeAPIURL=function(t,e){var n="See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes",i=Q(z.API_URL);if(t.protocol=i.protocol,t.authority=i.authority,"http"===t.protocol){var r=t.params.indexOf("secure");r>=0&&t.params.splice(r,1)}if("/"!==i.path&&(t.path=""+i.path+t.path),!z.REQUIRE_ACCESS_TOKEN)return J(t);if(!(e=e||z.ACCESS_TOKEN))throw new Error("An API access token is required to use Mapbox GL. "+n);if("s"===e[0])throw new Error("Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). "+n);return t.params=t.params.filter((function(t){return-1===t.indexOf("access_token")})),t.params.push("access_token="+e),J(t)};var Z=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;function X(t){return Z.test(t)}var K=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function Q(t){var e=t.match(K);if(!e)throw new Error("Unable to parse URL object");return{protocol:e[1],authority:e[2],path:e[3]||"/",params:e[4]?e[4].split("&"):[]}}function J(t){var e=t.params.length?"?"+t.params.join("&"):"";return t.protocol+"://"+t.authority+t.path+e}function Y(t){if(!t)return null;var e=t.split(".");if(!e||3!==e.length)return null;try{return JSON.parse(decodeURIComponent(s.atob(e[1]).split("").map((function(t){return"%"+("00"+t.charCodeAt(0).toString(16)).slice(-2)})).join("")))}catch(t){return null}}var $=function(t){this.type=t,this.anonId=null,this.eventData={},this.queue=[],this.pendingRequest=null};$.prototype.getStorageKey=function(t){var e,n=Y(z.ACCESS_TOKEN);return e=n&&n.u?s.btoa(encodeURIComponent(n.u).replace(/%([0-9A-F]{2})/g,(function(t,e){return String.fromCharCode(Number("0x"+e))}))):z.ACCESS_TOKEN||"",t?"mapbox.eventData."+t+":"+e:"mapbox.eventData:"+e},$.prototype.fetchEventData=function(){var t=I("localStorage"),e=this.getStorageKey(),n=this.getStorageKey("uuid");if(t)try{var i=s.localStorage.getItem(e);i&&(this.eventData=JSON.parse(i));var r=s.localStorage.getItem(n);r&&(this.anonId=r)}catch(t){w("Unable to read from LocalStorage")}},$.prototype.saveEventData=function(){var t=I("localStorage"),e=this.getStorageKey(),n=this.getStorageKey("uuid");if(t)try{s.localStorage.setItem(n,this.anonId),Object.keys(this.eventData).length>=1&&s.localStorage.setItem(e,JSON.stringify(this.eventData))}catch(t){w("Unable to write to LocalStorage")}},$.prototype.processRequests=function(t){},$.prototype.postEvent=function(t,e,n,i){var r=this;if(z.EVENTS_URL){var o=Q(z.EVENTS_URL);o.params.push("access_token="+(i||z.ACCESS_TOKEN||""));var s={event:this.type,created:new Date(t).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:"1.13.
22",skuId:H,userId:this.anonId},a=e?d(s,e):s,l={url:J(o),headers:{"Content-Type":"text/plain"},body:JSON.stringify([a])};this.pendingRequest=bt(l,(function(t){r.pendingRequest=null,n(t),r.saveEventData(),r.processRequests(i)}))}},$.prototype.queueRequest=function(t,e){this.queue.push(t),this.processRequests(e)};var tt,et,nt=function(t){function e(){t.call(this,"map.load"),this.success={},this.skuToken=""}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.postMapLoadEvent=function(t,e,n,i){this.skuToken=n,(z.EVENTS_URL&&i||z.ACCESS_TOKEN&&Array.isArray(t)&&t.some((function(t){return q(t)||X(t)})))
vendor: 27,695 bytes, line 2
2&&this.queueRequest({id:e,timestamp:Date.now()},i)},e.prototype.processRequests=function(t){var e=this;if(!this.pendingRequest&&0!==this.queue.length){var n=this.queue.shift(),i=n.id,r=n.timestamp;i&&this.success[i]||(this.anonId||this.fetchEventData(),g(this.anonId)||(this.anonId=A()),this.postEvent(r,{skuToken:this.skuToken},(function(t){t||i&&(e.success[i]=!0)}),t))}},e}($),it=new(function(t){function e(e){t.call(this,"appUserTurnstile"),this._customAccessToken=e}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.postTurnstileEvent=function(t,e){z.EVENTS_URL&&z.ACCESS_TOKEN&&Array.isArray(t)&&t.some((function(t){return q(t)||X(t)}))&&this.queueRequest(Date.now(),e)},e.prototype.processRequests=function(t){var e=this;if(!this.pendingRequest&&0!==this.queue.length){this.anonId&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();var n=Y(z.ACCESS_TOKEN),i=n?n.u:z.ACCESS_TOKEN,r=i!==this.eventData.tokenU;g(this.anonId)||(this.anonId=A(),r=!0);var o=this.queue.shift();if(this.eventData.lastSuccess){var s=new Date(this.eventData.lastSuccess),a=new Date(o),l=(o-this.eventData.lastSuccess)/864e5;r=r||l>=1||l<-1||s.getDate()!==a.getDate()}else r=!0;if(!r)return this.processRequests();this.postEvent(o,{"enabled.telemetry":!1},(function(t){t||(e.eventData.lastSuccess=o,e.eventData.tokenU=i)}),t)}},e}($)),rt=it.postTurnstileEvent.bind(it),ot=new nt,st=ot.postMapLoadEvent.bind(ot),at=500,lt=50;function ct(){s.caches&&!tt&&(tt=s.caches.open("mapbox-tiles"))}function ut(t){var e=t.indexOf("?");return e<0?t:t.slice(0,e)}var ht,dt=1/0;function pt(){return null==ht&&(ht=s.OffscreenCanvas&&new s.OffscreenCanvas(1,1).getContext("2d")&&"function"==typeof s.createImageBitmap),ht}var ft={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};"function"==typeof Object.freeze&&Object.freeze(ft);var At,gt,mt=function(t){function e(e,n,i){401===n&&X(i)&&(e+=": you may have provided an invalid Mapbox access token. See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes"),t.call(this,e),this.status=n,this.url=i,this.name=this.constructor.name,this.message=e}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.toString=function(){return this.name+": "+this.message+" ("+this.status+"): "+this.url},e}(Error),yt=T()?function(){return self.worker&&self.worker.referrer}:function(){return("blob:"===s.location.protocol?s.parent:s).location.href},_t=function(t,e){if(!(/^file:/.test(n=t.url)||/^file:/.test(yt())&&!/^\w+:/.test(n))){if(s.fetch&&s.Request&&s.AbortController&&s.Request.prototype.hasOwnProperty("signal"))return function(t,e){var n,i=new s.AbortController,r=new s.Request(t.url,{method:t.method||"GET",body:t.body,credentials:t.credentials,headers:t.headers,referrer:yt(),signal:i.signal}),o=!1,a=!1,l=(n=r.url).indexOf("sku=")>0&&X(n);"json"===t.type&&r.headers.set("Accept","application/json");var c=function(n,i,o){if(!a){if(n&&"SecurityError"!==n.message&&w(n),i&&o)return u(i);var c=Date.now();s.fetch(r).then((function(n){if(n.ok){var i=l?n.clone():null;return u(n,i,c)}return e(new mt(n.statusText,n.status,t.url))})).catch((function(t){20!==t.code&&e(new Error(t.message))}))}},u=function(n,i,l){("arrayBuffer"===t.type?n.arrayBuffer():"json"===t.type?n.json():n.text()).then((function(t){a||(i&&l&&function(t,e,n){if(ct(),tt){var i={status:e.status,statusText:e.statusText,headers:new s.Headers};e.headers.forEach((function(t,e){return i.headers.set(e,t)}));var r=S(e.headers.get("Cache-Control")||"");r["no-store"]||(r["max-age"]&&i.headers.set("Expires",new Date(n+1e3*r["max-age"]).toUTCString()),new Date(i.headers.get("Expires")).getTime()-n<42e4||function(t,e){if(void 0===et)try{new Response(new ReadableStream),et=!0}catch(t){et=!1}et?e(t.body):t.blob().then(e)}(e,(function(e){var n=new s.Response(e,i);ct(),tt&&tt.then((function(e){return e.put(ut(t.url),n)})).catch((function(t){return w(t.message)}))})))}}(r,i,l),o=!0,e(null,t,n.headers.get("Cache-Control"),n.headers.get("Expires")))})).catch((function(t){a||e(new Error(t.message))}))};return l?function(t,e){if(ct(),!tt)return e(null);var n=ut(t.url);tt.then((function(t){t.match(n).then((function(i){var r=function(t){if(!t)return!1;var e=new Date(t.headers.get("Expires")||0),n=S(t.headers.get("Cache-Control")||"");return e>Date.now()&&!n["no-cache"]}(i);t.delete(n),r&&t.put(n,i.clone()),e(null,i,r)})).catch(e)})).catch(e)}(r,c):c(null,null),{cancel:function(){a=!0,o||i.abort()}}}(t,e);if(T()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",t,e,void 0,!0)}var n;return function(t,e){var n=new s.XMLHttpRequest;for(var i in n.open(t.method||"GET",t.url,!0),"arrayBuffer"===t.type&&(n.responseType="arraybuffer"),t.headers)n.setRequestHeader(i,t.headers[i]);return"json"===t.type&&(n.responseType="text",n.setRequestHeader("Accept","application/json")),n.withCredentials="include"===t.credentials,n.onerror=function(){e(new Error(n.statusText))},n.onload=function(){if((n.status>=200&&n.status<300||0===n.status)&&null!==n.response){var i=n.response;if("json"===t.type)try{i=JSON.parse(n.response)}catch(t){return e(t)}e(null,i,n.getResponseHeader("Cache-Control"),n.getResponseHeader("Expires"))}else e(new mt(n.statusText,n.status,t.url))},n.send(t.body),{cancel:function(){return n.abort()}}}(t,e)},vt=function(t,e){return _t(d(t,{type:"arrayBuffer"}),e)},bt=function(t,e){return _t(d(t,{method:"POST"}),e)},xt="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";At=[],gt=0;var wt=function(t,e){if(U.supported&&(t.headers||(t.headers={}),t.headers.accept="image/webp,*/*"),gt>=z.MAX_PARALLEL_IMAGE_REQUESTS){var n={requestParameters:t,callback:e,cancelled:!1,cancel:function(){this.cancelled=!0}};return At.push(n),n}gt++;var i=!1,r=function(){if(!i)for(i=!0,gt--;At.length&><z.MAX_PARALLEL_IMAGE_REQUESTS;){var t=At.shift();t.cancelled||(t.cancel=wt(t.requestParameters,t.callback).cancel)}},o=vt(t,(function(t,n,i,o){r(),t?e(t):n&&(pt()?function(t,e){var n=new s.Blob([new Uint8Array(t)],{type:"image/png"});s.createImageBitmap(n).then((function(t){e(null,t)})).catch((function(t){e(new Error("Could not load image because of "+t.message+". Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))}))}(n,e):function(t,e,n,i){var r=new s.Image,o=s.URL;r.onload=function(){e(null,r),o.revokeObjectURL(r.src),r.onload=null,s.requestAnimationFrame((function(){r.src=xt}))},r.onerror=function(){return e(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))};var a=new s.Blob([new Uint8Array(t)],{type:"image/png"});r.cacheControl=n,r.expires=i,r.src=t.byteLength?o.createObjectURL(a):xt}(n,e,i,o))}));return{cancel:function(){o.cancel(),r()}}};function Et(t,e,n){n[t]&&-1!==n[t].indexOf(e)||(n[t]=n[t]||[],n[t].push(e))}function Ct(t,e,n){if(n&&n[t]){var i=n[t].indexOf(e);-1!==i&&n[t].splice(i,1)}}var Tt=function(t,e){void 0===e&&(e={}),d(this,e),this.type=t},St=function(t){function e(e,n){void 0===n&&(n={}),t.call(this,"error",d({error:e},n))}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(Tt),Pt=function(){};Pt.prototype.on=function(t,e){return this._listeners=this._listeners||{},Et(t,e,this._listeners),this},Pt.prototype.off=function(t,e){return Ct(t,e,this._listeners),Ct(t,e,this._oneTimeListeners),this},Pt.prototype.once=function(t,e){return this._oneTimeListeners=this._oneTimeListeners||{},Et(t,e,this._oneTimeListeners),this},Pt.prototype.fire=function(t,e){"string"==typeof t&&(t=new Tt(t,e||{}));var n=t.type;if(this.listens(n)){t.target=this;for(var i=0,r=this._listeners&&this._listeners[n]?this._listeners[n].slice():[];i<r.length;i+=1)r[i].call(this,t);for(var o=0,s=this._oneTimeListeners&&this._oneTimeListeners[n]?this._oneTimeListeners[n].slice():[];o<s.length;o+=1){var a=s[o];Ct(n,a,this._oneTimeListeners),a.call(this,t)}var l=this._eventedParent;l&&(d(t,"function"==typeof this._eventedParentData?this._eventedParentData():this._eventedParentData),l.fire(t))}else t instanceof St&&console.error(t.error);return this},Pt.prototype.listens=function(t){return this._listeners&&this._listeners[t]&&this._listeners[t].length>0||this._oneTimeListeners&&this._oneTimeListeners[t]&&this._oneTimeListeners[t].length>0||this._eventedParent&&this._eventedParent.listens(t)},Pt.prototype.setEventedParent=function(t,e){return this._eventedParent=t,this._eventedParentData=e,this};var Mt={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},sources:{required:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},default:"mapbox"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}
vendor: 6,734 bytes, line 2
2,"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}
vendor: 187,337 bytes, line 2
2,"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}},It=function(t,e,n,i){this.message=(t?t+": ":"")+n,i&&(this.identifier=i),null!=e&&e.__line__&&(this.line=e.__line__)};function Bt(t){var e=t.value;return e?[new It(t.key,e,"constants have been deprecated as of v8")]:[]}function Rt(t){for(var e=[],n=arguments.length-1;n-- >0;)e[n]=arguments[n+1];for(var i=0,r=e;i<r.length;i+=1){var o=r[i];for(var s in o)t[s]=o[s]}return t}function Lt(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}function Ot(t){if(Array.isArray(t))return t.map(Ot);if(t instanceof Object&&!(t instanceof Number||t instanceof String||t instanceof Boolean)){var e={};for(var n in t)e[n]=Ot(t[n]);return e}return Lt(t)}var Dt=function(t){function e(e,n){t.call(this,n),this.message=n,this.key=e}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(Error),kt=function(t,e){void 0===e&&(e=[]),this.parent=t,this.bindings={};for(var n=0,i=e;n<i.length;n+=1){var r=i[n];this.bindings[r[0]]=r[1]}};kt.prototype.concat=function(t){return new kt(this,t)},kt.prototype.get=function(t){if(this.bindings[t])return this.bindings[t];if(this.parent)return this.parent.get(t);throw new Error(t+" not found in scope.")},kt.prototype.has=function(t){return!!this.bindings[t]||!!this.parent&&this.parent.has(t)};var Ft={kind:"null"},Nt={kind:"number"},zt={kind:"string"},Ut={kind:"boolean"},Gt={kind:"color"},Vt={kind:"object"},jt={kind:"value"},Ht={kind:"collator"},Wt={kind:"formatted"},qt={kind:"resolvedImage"};function Zt(t,e){return{kind:"array",itemType:t,N:e}}function Xt(t){if("array"===t.kind){var e=Xt(t.itemType);return"number"==typeof t.N?"array<"+e+", "+t.N+">":"value"===t.itemType.kind?"array":"array<"+e+">"}return t.kind}var Kt=[Ft,Nt,zt,Ut,Gt,Wt,Vt,Zt(jt),qt];function Qt(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!Qt(t.itemType,e.itemType))&&("number"!=typeof t.N||t.N===e.N))return null}else{if(t.kind===e.kind)return null;if("value"===t.kind)for(var n=0,i=Kt;n<i.length;n+=1)if(!Qt(i[n],e))return null}return"Expected "+Xt(t)+" but found "+Xt(e)+" instead."}function Jt(t,e){return e.some((function(e){return e.kind===t.kind}))}function Yt(t,e){return e.some((function(e){return"null"===e?null===t:"array"===e?Array.isArray(t):"object"===e?t&&!Array.isArray(t)&&"object"==typeof t:e===typeof t}))}var $t=e((function(t,e){var n={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function i(t){return(t=Math.round(t))<0?0:t>255?255:t}function r(t){return i("%"===t[t.length-1]?parseFloat(t)/100*255:parseInt(t))}function o(t){return(e="%"===t[t.length-1]?parseFloat(t)/100:parseFloat(t))<0?0:e>1?1:e;var e}function s(t,e,n){return n<0?n+=1:n>1&&(n-=1),6*n<1?t+(e-t)*n*6:2*n<1?e:3*n<2?t+(e-t)*(2/3-n)*6:t}try{e.parseCSSColor=function(t){var e,a=t.replace(/ /g,"").toLowerCase();if(a in n)return n[a].slice();if("#"===a[0])return 4===a.length?(e=parseInt(a.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===a.length&&(e=parseInt(a.substr(1),16))>=0&&e<=16777215?[(16711680&e)>>16,(65280&e)>>8,255&e,1]:null;var l=a.indexOf("("),c=a.indexOf(")");if(-1!==l&&c+1===a.length){var u=a.substr(0,l),h=a.substr(l+1,c-(l+1)).split(","),d=1;switch(u){case"rgba":if(4!==h.length)return null;d=o(h.pop());case"rgb":return 3!==h.length?null:[r(h[0]),r(h[1]),r(h[2]),d];case"hsla":if(4!==h.length)return null;d=o(h.pop());case"hsl":if(3!==h.length)return null;var p=(parseFloat(h[0])%360+360)%360/360,f=o(h[1]),A=o(h[2]),g=A<=.5?A*(f+1):A+f-A*f,m=2*A-g;return[i(255*s(m,g,p+1/3)),i(255*s(m,g,p)),i(255*s(m,g,p-1/3)),d];default:return null}}return null}}catch(t){}})).parseCSSColor,te=function(t,e,n,i){void 0===i&&(i=1),this.r=t,this.g=e,this.b=n,this.a=i};te.parse=function(t){if(t){if(t instanceof te)return t;if("string"==typeof t){var e=$t(t);if(e)return new te(e[0]/255*e[3],e[1]/255*e[3],e[2]/255*e[3],e[3])}}},te.prototype.toString=function(){var t=this.toArray(),e=t[1],n=t[2],i=t[3];return"rgba("+Math.round(t[0])+","+Math.round(e)+","+Math.round(n)+","+i+")"},te.prototype.toArray=function(){var t=this.a;return 0===t?[0,0,0,0]:[255*this.r/t,255*this.g/t,255*this.b/t,t]},te.black=new te(0,0,0,1),te.white=new te(1,1,1,1),te.transparent=new te(0,0,0,0),te.red=new te(1,0,0,1);var ee=function(t,e,n){this.sensitivity=t?e?"variant":"case":e?"accent":"base",this.locale=n,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})};ee.prototype.compare=function(t,e){return this.collator.compare(t,e)},ee.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var ne=function(t,e,n,i,r){this.text=t,this.image=e,this.scale=n,this.fontStack=i,this.textColor=r},ie=function(t){this.sections=t};ie.fromString=function(t){return new ie([new ne(t,null,null,null,null)])},ie.prototype.isEmpty=function(){return 0===this.sections.length||!this.sections.some((function(t){return 0!==t.text.length||t.image&&0!==t.image.name.length}))},ie.factory=function(t){return t instanceof ie?t:ie.fromString(t)},ie.prototype.toString=function(){return 0===this.sections.length?"":this.sections.map((function(t){return t.text})).join("")},ie.prototype.serialize=function(){for(var t=["format"],e=0,n=this.sections;e<n.length;e+=1){var i=n[e];if(i.image)t.push(["image",i.image.name]);else{t.push(i.text);var r={};i.fontStack&&(r["text-font"]=["literal",i.fontStack.split(",")]),i.scale&&(r["font-scale"]=i.scale),i.textColor&&(r["text-color"]=["rgba"].concat(i.textColor.toArray())),t.push(r)}}return t};var re=function(t){this.name=t.name,this.available=t.available};function oe(t,e,n,i){return"number"==typeof t&&t>=0&&t<=255&&"number"==typeof e&&e>=0&&e<=255&&"number"==typeof n&&n>=0&&n<=255?void 0===i||"number"==typeof i&&i>=0&&i<=1?null:"Invalid rgba value ["+[t,e,n,i].join(", ")+"]: 'a' must be between 0 and 1.":"Invalid rgba value ["+("number"==typeof i?[t,e,n,i]:[t,e,n]).join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}function se(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 te)return!0;if(t instanceof ee)return!0;if(t instanceof ie)return!0;if(t instanceof re)return!0;if(Array.isArray(t)){for(var e=0,n=t;e<n.length;e+=1)if(!se(n[e]))return!1;return!0}if("object"==typeof t){for(var i in t)if(!se(t[i]))return!1;return!0}return!1}function ae(t){if(null===t)return Ft;if("string"==typeof t)return zt;if("boolean"==typeof t)return Ut;if("number"==typeof t)return Nt;if(t instanceof te)return Gt;if(t instanceof ee)return Ht;if(t instanceof ie)return Wt;if(t instanceof re)return qt;if(Array.isArray(t)){for(var e,n=t.length,i=0,r=t;i<r.length;i+=1){var o=ae(r[i]);if(e){if(e===o)continue;e=jt;break}e=o}return Zt(e||jt,n)}return Vt}function le(t){var e=typeof t;return null===t?"":"string"===e||"number"===e||"boolean"===e?String(t):t instanceof te||t instanceof ie||t instanceof re?t.toString():JSON.stringify(t)}re.prototype.toString=function(){return this.name},re.fromString=function(t){return t?new re({name:t,available:!1}):null},re.prototype.serialize=function(){return["image",this.name]};var ce=function(t,e){this.type=t,this.value=e};ce.parse=function(t,e){if(2!==t.length)return e.error("'literal' expression requires exactly one argument, but found "+(t.length-1)+" instead.");if(!se(t[1]))return e.error("invalid value");var n=t[1],i=ae(n),r=e.expectedType;return"array"!==i.kind||0!==i.N||!r||"array"!==r.kind||"number"==typeof r.N&&0!==r.N||(i=r),new ce(i,n)},ce.prototype.evaluate=function(){return this.value},ce.prototype.eachChild=function(){},ce.prototype.outputDefined=function(){return!0},ce.prototype.serialize=function(){return"array"===this.type.kind||"object"===this.type.kind?["literal",this.value]:this.value instanceof te?["rgba"].concat(this.value.toArray()):this.value instanceof ie?this.value.serialize():this.value};var ue=function(t){this.name="ExpressionEvaluationError",this.message=t};ue.prototype.toJSON=function(){return this.message};var he={string:zt,number:Nt,boolean:Ut,object:Vt},de=function(t,e){this.type=t,this.args=e};de.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var n,i=1,r=t[0];if("array"===r){var o,s;if(t.length>2){var a=t[1];if("string"!=typeof a||!(a in he)||"object"===a)return e.error('The item type argument of "array" must be one of string, number, boolean',1);o=he[a],i++}else o=jt;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);s=t[2],i++}n=Zt(o,s)}else n=he[r];for(var l=[];i<t.length;i++){var c=e.parse(t[i],i,jt);if(!c)return null;l.push(c)}return new de(n,l)},de.prototype.evaluate=function(t){for(var e=0;e<this.args.length;e++){var n=this.args[e].evaluate(t);if(!Qt(this.type,ae(n)))return n;if(e===this.args.length-1)throw new ue("Expected value to be of type "+Xt(this.type)+", but found "+Xt(ae(n))+" instead.")}return null},de.prototype.eachChild=function(t){this.args.forEach(t)},de.prototype.outputDefined=function(){return this.args.every((function(t){return t.outputDefined()}))},de.prototype.serialize=function(){var t=this.type,e=[t.kind];if("array"===t.kind){var n=t.itemType;if("string"===n.kind||"number"===n.kind||"boolean"===n.kind){e.push(n.kind);var i=t.N;("number"==typeof i||this.args.length>1)&&e.push(i)}}return e.concat(this.args.map((function(t){return t.serialize()})))};var pe=function(t){this.type=Wt,this.sections=t};pe.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var n=t[1];if(!Array.isArray(n)&&"object"==typeof n)return e.error("First argument must be an image or text section.");for(var i=[],r=!1,o=1;o<=t.length-1;++o){var s=t[o];if(r&&"object"==typeof s&&!Array.isArray(s)){r=!1;var a=null;if(s["font-scale"]&&!(a=e.parse(s["font-scale"],1,Nt)))return null;var l=null;if(s["text-font"]&&!(l=e.parse(s["text-font"],1,Zt(zt))))return null;var c=null;if(s["text-color"]&&!(c=e.parse(s["text-color"],1,Gt)))return null;var u=i[i.length-1];u.scale=a,u.font=l,u.textColor=c}else{var h=e.parse(t[o],1,jt);if(!h)return null;var d=h.type.kind;if("string"!==d&&"value"!==d&&"null"!==d&&"resolvedImage"!==d)return e.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");r=!0,i.push({content:h,scale:null,font:null,textColor:null})}}return new pe(i)},pe.prototype.evaluate=function(t){return new ie(this.sections.map((function(e){var n=e.content.evaluate(t);return ae(n)===qt?new ne("",n,null,null,null):new ne(le(n),null,e.scale?e.scale.evaluate(t):null,e.font?e.font.evaluate(t).join(","):null,e.textColor?e.textColor.evaluate(t):null)})))},pe.prototype.eachChild=function(t){for(var e=0,n=this.sections;e<n.length;e+=1){var i=n[e];t(i.content),i.scale&&t(i.scale),i.font&&t(i.font),i.textColor&&t(i.textColor)}},pe.prototype.outputDefined=function(){return!1},pe.prototype.serialize=function(){for(var t=["format"],e=0,n=this.sections;e<n.length;e+=1){var i=n[e];t.push(i.content.serialize());var r={};i.scale&&(r["font-scale"]=i.scale.serialize()),i.font&&(r["text-font"]=i.font.serialize()),i.textColor&&(r["text-color"]=i.textColor.serialize()),t.push(r)}return t};var fe=function(t){this.type=qt,this.input=t};fe.parse=function(t,e){if(2!==t.length)return e.error("Expected two arguments.");var n=e.parse(t[1],1,zt);return n?new fe(n):e.error("No image name provided.")},fe.prototype.evaluate=function(t){var e=this.input.evaluate(t),n=re.fromString(e);return n&&t.availableImages&&(n.available=t.availableImages.indexOf(e)>-1),n},fe.prototype.eachChild=function(t){t(this.input)},fe.prototype.outputDefined=function(){return!1},fe.prototype.serialize=function(){return["image",this.input.serialize()]};var Ae={"to-boolean":Ut,"to-color":Gt,"to-number":Nt,"to-string":zt},ge=function(t,e){this.type=t,this.args=e};ge.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var n=t[0];if(("to-boolean"===n||"to-string"===n)&&2!==t.length)return e.error("Expected one argument.");for(var i=Ae[n],r=[],o=1;o<t.length;o++){var s=e.parse(t[o],o,jt);if(!s)return null;r.push(s)}return new ge(i,r)},ge.prototype.evaluate=function(t){if("boolean"===this.type.kind)return Boolean(this.args[0].evaluate(t));if("color"===this.type.kind){for(var e,n,i=0,r=this.args;i<r.length;i+=1){if(n=null,(e=r[i].evaluate(t))instanceof te)return e;if("string"==typeof e){var o=t.parseColor(e);if(o)return o}else if(Array.isArray(e)&&!(n=e.length<3||e.length>4?"Invalid rbga value "+JSON.stringify(e)+": expected an array containing either three or four numeric values.":oe(e[0],e[1],e[2],e[3])))return new te(e[0]/255,e[1]/255,e[2]/255,e[3])}throw new ue(n||"Could not parse color from value '"+("string"==typeof e?e:String(JSON.stringify(e)))+"'")}if("number"===this.type.kind){for(var s=null,a=0,l=this.args;a<l.length;a+=1){if(null===(s=l[a].evaluate(t)))return 0;var c=Number(s);if(!isNaN(c))return c}throw new ue("Could not convert "+JSON.stringify(s)+" to number.")}return"formatted"===this.type.kind?ie.fromString(le(this.args[0].evaluate(t))):"resolvedImage"===this.type.kind?re.fromString(le(this.args[0].evaluate(t))):le(this.args[0].evaluate(t))},ge.prototype.eachChild=function(t){this.args.forEach(t)},ge.prototype.outputDefined=function(){return this.args.every((function(t){return t.outputDefined()}))},ge.prototype.serialize=function(){if("formatted"===this.type.kind)return new pe([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if("resolvedImage"===this.type.kind)return new fe(this.args[0]).serialize();var t=["to-"+this.type.kind];return this.eachChild((function(e){t.push(e.serialize())})),t};var me=["Unknown","Point","LineString","Polygon"],ye=function(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null};ye.prototype.id=function(){return this.feature&&"id"in this.feature?this.feature.id:null},ye.prototype.geometryType=function(){return this.feature?"number"==typeof this.feature.type?me[this.feature.type]:this.feature.type:null},ye.prototype.geometry=function(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null},ye.prototype.canonicalID=function(){return this.canonical},ye.prototype.properties=function(){return this.feature&&this.feature.properties||{}},ye.prototype.parseColor=function(t){var e=this._parseColorCache[t];return e||(e=this._parseColorCache[t]=te.parse(t)),e};var _e=function(t,e,n,i){this.name=t,this.type=e,this._evaluate=n,this.args=i};_e.prototype.evaluate=function(t){return this._evaluate(t,this.args)},_e.prototype.eachChild=function(t){this.args.forEach(t)},_e.prototype.outputDefined=function(){return!1},_e.prototype.serialize=function(){return[this.name].concat(this.args.map((function(t){return t.serialize()})))},_e.parse=function(t,e){var n,i=t[0],r=_e.definitions[i];if(!r)return e.error('Unknown expression "'+i+'". If you wanted a literal array, use ["literal", [...]].',0);for(var o=Array.isArray(r)?r[0]:r.type,s=Array.isArray(r)?[[r[1],r[2]]]:r.overloads,a=s.filter((function(e){var n=e[0];return!Array.isArray(n)||n.length===t.length-1})),l=null,c=0,u=a;c<u.length;c+=1){var h=u[c],d=h[0],p=h[1];l=new Ge(e.registry,e.path,null,e.scope);for(var f=[],A=!1,g=1;g<t.length;g++){var m=t[g],y=Array.isArray(d)?d[g-1]:d.type,_=l.parse(m,1+f.length,y);if(!_){A=!0;break}f.push(_)}if(!A)if(Array.isArray(d)&&d.length!==f.length)l.error("Expected "+d.length+" arguments, but found "+f.length+" instead.");else{for(var v=0;v<f.length;v++){var b=Array.isArray(d)?d[v]:d.type,x=f[v];l.concat(v+1).checkSubtype(b,x.type)}if(0===l.errors.length)return new _e(i,o,p,f)}}if(1===a.length)(n=e.errors).push.apply(n,l.errors);else{for(var w=(a.length?a:s).map((function(t){var e;return e=t[0],Array.isArray(e)?"("+e.map(Xt).join(", ")+")":"("+Xt(e.type)+"...)"})).join(" | "),E=[],C=1;C<t.length;C++){var T=e.parse(t[C],1+E.length);if(!T)return null;E.push(Xt(T.type))}e.error("Expected arguments of type "+w+", but found ("+E.join(", ")+") instead.")}return null},_e.register=function(t,e){for(var n in _e.definitions=e,e)t[n]=_e};var ve=function(t,e,n){this.type=Ht,this.locale=n,this.caseSensitive=t,this.diacriticSensitive=e};function be(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 xe(t,e){return!(t[0]<=e[0]||t[2]>=e[2]||t[1]<=e[1]||t[3]>=e[3])}function we(t,e){var n=(180+t[0])/360,i=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t[1]*Math.PI/360)))/360,r=Math.pow(2,e.z);return[Math.round(n*r*8192),Math.round(i*r*8192)]}function Ee(t,e,n){return e[1]>t[1]!=n[1]>t[1]&&t[0]<(n[0]-e[0])*(t[1]-e[1])/(n[1]-e[1])+e[0]}function Ce(t,e){for(var n,i,r,o,s,a,l,c=!1,u=0,h=e.length;u<h;u++)for(var d=e[u],p=0,f=d.length;p<f-1;p++){if((o=(n=t)[0]-(i=d[p])[0])*(l=n[1]-(r=d[p+1])[1])-(a=n[0]-r[0])*(s=n[1]-i[1])==0&&o*a<=0&&s*l<=0)return!1;Ee(t,d[p],d[p+1])&&(c=!c)}return c}function Te(t,e){for(var n=0;n<e.length;n++)if(Ce(t,e[n]))return!0;return!1}function Se(t,e,n,i){var r=i[0]-n[0],o=i[1]-n[1],s=(t[0]-n[0])*o-r*(t[1]-n[1]),a=(e[0]-n[0])*o-r*(e[1]-n[1]);return s>0&&a<0||s<0&&a>0}function Pe(t,e,n){for(var i=0,r=n;i<r.length;i+=1)for(var o=r[i],s=0;s<o.length-1;++s)if(0!=(h=[(u=o[s+1])[0]-(c=o[s])[0],u[1]-c[1]])[0]*(d=[(l=e)[0]-(a=t)[0],l[1]-a[1]])[1]-h[1]*d[0]&&Se(a,l,c,u)&&Se(c,u,a,l))return!0;var a,l,c,u,h,d;return!1}function Me(t,e){for(var n=0;n<t.length;++n)if(!Ce(t[n],e))return!1;for(var i=0;i<t.length-1;++i)if(Pe(t[i],t[i+1],e))return!1;return!0}function Ie(t,e){for(var n=0;n<e.length;n++)if(Me(t,e[n]))return!0;return!1}function Be(t,e,n){for(var i=[],r=0;r<t.length;r++){for(var o=[],s=0;s<t[r].length;s++){var a=we(t[r][s],n);be(e,a),o.push(a)}i.push(o)}return i}function Re(t,e,n){for(var i=[],r=0;r<t.length;r++){var o=Be(t[r],e,n);i.push(o)}return i}function Le(t,e,n,i){if(t[0]<n[0]||t[0]>n[2]){var r=.5*i,o=t[0]-n[0]>r?-i:n[0]-t[0]>r?i:0;0===o&&(o=t[0]-n[2]>r?-i:n[2]-t[0]>r?i:0),t[0]+=o}be(e,t)}function Oe(t,e,n,i){for(var r=8192*Math.pow(2,i.z),o=[8192*i.x,8192*i.y],s=[],a=0,l=t;a<l.length;a+=1)for(var c=0,u=l[a];c<u.length;c+=1){var h=u[c],d=[h.x+o[0],h.y+o[1]];Le(d,e,n,r),s.push(d)}return s}function De(t,e,n,i){for(var r,o=8192*Math.pow(2,i.z),s=[8192*i.x,8192*i.y],a=[],l=0,c=t;l<c.length;l+=1){for(var u=[],h=0,d=c[l];h<d.length;h+=1){var p=d[h],f=[p.x+s[0],p.y+s[1]];be(e,f),u.push(f)}a.push(u)}if(e[2]-e[0]<=o/2){(r=e)[0]=r[1]=1/0,r[2]=r[3]=-1/0;for(var A=0,g=a;A<g.length;A+=1)for(var m=0,y=g[A];m<y.length;m+=1)Le(y[m],e,n,o)}return a}ve.parse=function(t,e){if(2!==t.length)return e.error("Expected one argument.");var n=t[1];if("object"!=typeof n||Array.isArray(n))return e.error("Collator options argument must be an object.");var i=e.parse(void 0!==n["case-sensitive"]&&n["case-sensitive"],1,Ut);if(!i)return null;var r=e.parse(void 0!==n["diacritic-sensitive"]&&n["diacritic-sensitive"],1,Ut);if(!r)return null;var o=null;return n.locale&&!(o=e.parse(n.locale,1,zt))?null:new ve(i,r,o)},ve.prototype.evaluate=function(t){return new ee(this.caseSensitive.evaluate(t),this.diacriticSensitive.evaluate(t),this.locale?this.locale.evaluate(t):null)},ve.prototype.eachChild=function(t){t(this.caseSensitive),t(this.diacriticSensitive),this.locale&&t(this.locale)},ve.prototype.outputDefined=function(){return!1},ve.prototype.serialize=function(){var t={};return t["case-sensitive"]=this.caseSensitive.serialize(),t["diacritic-sensitive"]=this.diacriticSensitive.serialize(),this.locale&&(t.locale=this.locale.serialize()),["collator",t]};var ke=function(t,e){this.type=Ut,this.geojson=t,this.geometries=e};function Fe(t){if(t instanceof _e){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 ke)return!1;var e=!0;return t.eachChild((function(t){e&&!Fe(t)&&(e=!1)})),e}function Ne(t){if(t instanceof _e&&"feature-state"===t.name)return!1;var e=!0;return t.eachChild((function(t){e&&!Ne(t)&&(e=!1)})),e}function ze(t,e){if(t instanceof _e&&e.indexOf(t.name)>=0)return!1;var n=!0;return t.eachChild((function(t){n&&!ze(t,e)&&(n=!1)})),n}ke.parse=function(t,e){if(2!==t.length)return e.error("'within' expression requires exactly one argument, but found "+(t.length-1)+" instead.");if(se(t[1])){var n=t[1];if("FeatureCollection"===n.type)for(var i=0;i<n.features.length;++i){var r=n.features[i].geometry.type;if("Polygon"===r||"MultiPolygon"===r)return new ke(n,n.features[i].geometry)}else if("Feature"===n.type){var o=n.geometry.type;if("Polygon"===o||"MultiPolygon"===o)return new ke(n,n.geometry)}else if("Polygon"===n.type||"MultiPolygon"===n.type)return new ke(n,n)}return e.error("'within' expression requires valid geojson object that contains polygon geometry type.")},ke.prototype.evaluate=function(t){if(null!=t.geometry()&&null!=t.canonicalID()){if("Point"===t.geometryType())return function(t,e){var n=[1/0,1/0,-1/0,-1/0],i=[1/0,1/0,-1/0,-1/0],r=t.canonicalID();if("Polygon"===e.type){var o=Be(e.coordinates,i,r),s=Oe(t.geometry(),n,i,r);if(!xe(n,i))return!1;for(var a=0,l=s;a<l.length;a+=1)if(!Ce(l[a],o))return!1}if("MultiPolygon"===e.type){var c=Re(e.coordinates,i,r),u=Oe(t.geometry(),n,i,r);if(!xe(n,i))return!1;for(var h=0,d=u;h<d.length;h+=1)if(!Te(d[h],c))return!1}return!0}(t,this.geometries);if("LineString"===t.geometryType())return function(t,e){var n=[1/0,1/0,-1/0,-1/0],i=[1/0,1/0,-1/0,-1/0],r=t.canonicalID();if("Polygon"===e.type){var o=Be(e.coordinates,i,r),s=De(t.geometry(),n,i,r);if(!xe(n,i))return!1;for(var a=0,l=s;a<l.length;a+=1)if(!Me(l[a],o))return!1}if("MultiPolygon"===e.type){var c=Re(e.coordinates,i,r),u=De(t.geometry(),n,i,r);if(!xe(n,i))return!1;for(var h=0,d=u;h<d.length;h+=1)if(!Ie(d[h],c))return!1}return!0}(t,this.geometries)}return!1},ke.prototype.eachChild=function(){},ke.prototype.outputDefined=function(){return!0},ke.prototype.serialize=function(){return["within",this.geojson]};var Ue=function(t,e){this.type=e.type,this.name=t,this.boundExpression=e};Ue.parse=function(t,e){if(2!==t.length||"string"!=typeof t[1])return e.error("'var' expression requires exactly one string literal argument.");var n=t[1];return e.scope.has(n)?new Ue(n,e.scope.get(n)):e.error('Unknown variable "'+n+'". Make sure "'+n+'" has been bound in an enclosing "let" expression before using it.',1)},Ue.prototype.evaluate=function(t){return this.boundExpression.evaluate(t)},Ue.prototype.eachChild=function(){},Ue.prototype.outputDefined=function(){return!1},Ue.prototype.serialize=function(){return["var",this.name]};var Ge=function(t,e,n,i,r){void 0===e&&(e=[]),void 0===i&&(i=new kt),void 0===r&&(r=[]),this.registry=t,this.path=e,this.key=e.map((function(t){return"["+t+"]"})).join(""),this.scope=i,this.errors=r,this.expectedType=n};function Ve(t,e){for(var n,i=t.length-1,r=0,o=i,s=0;r<=o;)if((n=t[s=Math.floor((r+o)/2)])<=e){if(s===i||e<t[s+1])return s;r=s+1}else{if(!(n>e))throw new ue("Input is not a number.");o=s-1}return 0}Ge.prototype.parse=function(t,e,n,i,r){return void 0===r&&(r={}),e?this.concat(e,n,i)._parse(t,r):this._parse(t,r)},Ge.prototype._parse=function(t,e){function n(t,e,n){return"assert"===n?new de(e,[t]):"coerce"===n?new ge(e,[t]):t}if(null!==t&&"string"!=typeof t&&"boolean"!=typeof t&&"number"!=typeof t||(t=["literal",t]),Array.isArray(t)){if(0===t.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var i=t[0];if("string"!=typeof i)return this.error("Expression name must be a string, but found "+typeof i+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var r=this.registry[i];if(r){var o=r.parse(t,this);if(!o)return null;if(this.expectedType){var s=this.expectedType,a=o.type;if("string"!==s.kind&&"number"!==s.kind&&"boolean"!==s.kind&&"object"!==s.kind&&"array"!==s.kind||"value"!==a.kind)if("color"!==s.kind&&"formatted"!==s.kind&&"resolvedImage"!==s.kind||"value"!==a.kind&&"string"!==a.kind){if(this.checkSubtype(s,a))return null}else o=n(o,s,e.typeAnnotation||"coerce");else o=n(o,s,e.typeAnnotation||"assert")}if(!(o instanceof ce)&&"resolvedImage"!==o.type.kind&&function t(e){if(e instanceof Ue)return t(e.boundExpression);if(e instanceof _e&&"error"===e.name)return!1;if(e instanceof ve)return!1;if(e instanceof ke)return!1;var n=e instanceof ge||e instanceof de,i=!0;return e.eachChild((function(e){i=n?i&&t(e):i&&e instanceof ce})),!!i&&Fe(e)&&ze(e,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}(o)){var l=new ye;try{o=new ce(o.type,o.evaluate(l))}catch(t){return this.error(t.message),null}}return o}return this.error('Unknown expression "'+i+'". If you wanted a literal array, use ["literal", [...]].',0)}return this.error(void 0===t?"'undefined' value invalid. Use null instead.":"object"==typeof t?'Bare objects invalid. Use ["literal", {...}] instead.':"Expected an array, but found "+typeof t+" instead.")},Ge.prototype.concat=function(t,e,n){var i="number"==typeof t?this.path.concat(t):this.path,r=n?this.scope.concat(n):this.scope;return new Ge(this.registry,i,e||null,r,this.errors)},Ge.prototype.error=function(t){for(var e=[],n=arguments.length-1;n-- >0;)e[n]=arguments[n+1];var i=""+this.key+e.map((function(t){return"["+t+"]"})).join("");this.errors.push(new Dt(i,t))},Ge.prototype.checkSubtype=function(t,e){var n=Qt(t,e);return n&&this.error(n),n};var je=function(t,e,n){this.type=t,this.input=e,this.labels=[],this.outputs=[];for(var i=0,r=n;i<r.length;i+=1){var o=r[i],s=o[1];this.labels.push(o[0]),this.outputs.push(s)}};function He(t,e,n){return t*(1-n)+e*n}je.parse=function(t,e){if(t.length-1<4)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");var n=e.parse(t[1],1,Nt);if(!n)return null;var i=[],r=null;e.expectedType&&"value"!==e.expectedType.kind&&(r=e.expectedType);for(var o=1;o<t.length;o+=2){var s=1===o?-1/0:t[o],a=t[o+1],l=o,c=o+1;if("number"!=typeof s)return e.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',l);if(i.length&&i[i.length-1][0]>=s)return e.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',l);var u=e.parse(a,c,r);if(!u)return null;r=r||u.type,i.push([s,u])}return new je(r,n,i)},je.prototype.evaluate=function(t){var e=this.labels,n=this.outputs;if(1===e.length)return n[0].evaluate(t);var i=this.input.evaluate(t);if(i<=e[0])return n[0].evaluate(t);var r=e.length;return i>=e[r-1]?n[r-1].evaluate(t):n[Ve(e,i)].evaluate(t)},je.prototype.eachChild=function(t){t(this.input);for(var e=0,n=this.outputs;e<n.length;e+=1)t(n[e])},je.prototype.outputDefined=function(){return this.outputs.every((function(t){return t.outputDefined()}))},je.prototype.serialize=function(){for(var t=["step",this.input.serialize()],e=0;e<this.labels.length;e++)e>0&&t.push(this.labels[e]),t.push(this.outputs[e].serialize());return t};var We=Object.freeze({__proto__:null,number:He,color:function(t,e,n){return new te(He(t.r,e.r,n),He(t.g,e.g,n),He(t.b,e.b,n),He(t.a,e.a,n))},array:function(t,e,n){return t.map((function(t,i){return He(t,e[i],n)}))}}),qe=6/29*3*(6/29),Ze=Math.PI/180,Xe=180/Math.PI;function Ke(t){return t>.008856451679035631?Math.pow(t,1/3):t/qe+4/29}function Qe(t){return t>6/29?t*t*t:qe*(t-4/29)}function Je(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Ye(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function $e(t){var e=Ye(t.r),n=Ye(t.g),i=Ye(t.b),r=Ke((.4124564*e+.3575761*n+.1804375*i)/.95047),o=Ke((.2126729*e+.7151522*n+.072175*i)/1);return{l:116*o-16,a:500*(r-o),b:200*(o-Ke((.0193339*e+.119192*n+.9503041*i)/1.08883)),alpha:t.a}}function tn(t){var e=(t.l+16)/116,n=isNaN(t.a)?e:e+t.a/500,i=isNaN(t.b)?e:e-t.b/200;return e=1*Qe(e),n=.95047*Qe(n),i=1.08883*Qe(i),new te(Je(3.2404542*n-1.5371385*e-.4985314*i),Je(-.969266*n+1.8760108*e+.041556*i),Je(.0556434*n-.2040259*e+1.0572252*i),t.alpha)}function en(t,e,n){var i=e-t;return t+n*(i>180||i<-180?i-360*Math.round(i/360):i)}var nn={forward:$e,reverse:tn,interpolate:function(t,e,n){return{l:He(t.l,e.l,n),a:He(t.a,e.a,n),b:He(t.b,e.b,n),alpha:He(t.alpha,e.alpha,n)}}},rn={forward:function(t){var e=$e(t),n=e.l,i=e.a,r=e.b,o=Math.atan2(r,i)*Xe;return{h:o<0?o+360:o,c:Math.sqrt(i*i+r*r),l:n,alpha:t.a}},reverse:function(t){var e=t.h*Ze,n=t.c;return tn({l:t.l,a:Math.cos(e)*n,b:Math.sin(e)*n,alpha:t.alpha})},interpolate:function(t,e,n){return{h:en(t.h,e.h,n),c:He(t.c,e.c,n),l:He(t.l,e.l,n),alpha:He(t.alpha,e.alpha,n)}}},on=Object.freeze({__proto__:null,lab:nn,hcl:rn}),sn=function(t,e,n,i,r){this.type=t,this.operator=e,this.interpolation=n,this.input=i,this.labels=[],this.outputs=[];for(var o=0,s=r;o<s.length;o+=1){var a=s[o],l=a[1];this.labels.push(a[0]),this.outputs.push(l)}};function an(t,e,n,i){var r=i-n,o=t-n;return 0===r?0:1===e?o/r:(Math.pow(e,o)-1)/(Math.pow(e,r)-1)}sn.interpolationFactor=function(t,e,i,r){var o=0;if("exponential"===t.name)o=an(e,t.base,i,r);else if("linear"===t.name)o=an(e,1,i,r);else if("cubic-bezier"===t.name){var s=t.controlPoints;o=new n(s[0],s[1],s[2],s[3]).solve(an(e,1,i,r))}return o},sn.parse=function(t,e){var n=t[0],i=t[1],r=t[2],o=t.slice(3);if(!Array.isArray(i)||0===i.length)return e.error("Expected an interpolation type expression.",1);if("linear"===i[0])i={name:"linear"};else if("exponential"===i[0]){var s=i[1];if("number"!=typeof s)return e.error("Exponential interpolation requires a numeric base.",1,1);i={name:"exponential",base:s}}else{if("cubic-bezier"!==i[0])return e.error("Unknown interpolation type "+String(i[0]),1,0);var a=i.slice(1);if(4!==a.length||a.some((function(t){return"number"!=typeof t||t<0||t>1})))return e.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);i={name:"cubic-bezier",controlPoints:a}}if(t.length-1<4)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");if(!(r=e.parse(r,2,Nt)))return null;var l=[],c=null;"interpolate-hcl"===n||"interpolate-lab"===n?c=Gt:e.expectedType&&"value"!==e.expectedType.kind&&(c=e.expectedType);for(var u=0;u<o.length;u+=2){var h=o[u],d=o[u+1],p=u+3,f=u+4;if("number"!=typeof h)return e.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',p);if(l.length&&l[l.length-1][0]>=h)return e.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',p);var A=e.parse(d,f,c);if(!A)return null;c=c||A.type,l.push([h,A])}return"number"===c.kind||"color"===c.kind||"array"===c.kind&&"number"===c.itemType.kind&&"number"==typeof c.N?new sn(c,n,i,r,l):e.error("Type "+Xt(c)+" is not interpolatable.")},sn.prototype.evaluate=function(t){var e=this.labels,n=this.outputs;if(1===e.length)return n[0].evaluate(t);var i=this.input.evaluate(t);if(i<=e[0])return n[0].evaluate(t);var r=e.length;if(i>=e[r-1])return n[r-1].evaluate(t);var o=Ve(e,i),s=sn.interpolationFactor(this.interpolation,i,e[o],e[o+1]),a=n[o].evaluate(t),l=n[o+1].evaluate(t);return"interpolate"===this.operator?We[this.type.kind.toLowerCase()](a,l,s):"interpolate-hcl"===this.operator?rn.reverse(rn.interpolate(rn.forward(a),rn.forward(l),s)):nn.reverse(nn.interpolate(nn.forward(a),nn.forward(l),s))},sn.prototype.eachChild=function(t){t(this.input);for(var e=0,n=this.outputs;e<n.length;e+=1)t(n[e])},sn.prototype.outputDefined=function(){return this.outputs.every((function(t){return t.outputDefined()}))},sn.prototype.serialize=function(){var t;t="linear"===this.interpolation.name?["linear"]:"exponential"===this.interpolation.name?1===this.interpolation.base?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier"].concat(this.interpolation.controlPoints);for(var e=[this.operator,t,this.input.serialize()],n=0;n<this.labels.length;n++)e.push(this.labels[n],this.outputs[n].serialize());return e};var ln=function(t,e){this.type=t,this.args=e};ln.parse=function(t,e){if(t.length<2)return e.error("Expectected at least one argument.");var n=null,i=e.expectedType;i&&"value"!==i.kind&&(n=i);for(var r=[],o=0,s=t.slice(1);o<s.length;o+=1){var a=e.parse(s[o],1+r.length,n,void 0,{typeAnnotation:"omit"});if(!a)return null;n=n||a.type,r.push(a)}var l=i&&r.some((function(t){return Qt(i,t.type)}));return new ln(l?jt:n,r)},ln.prototype.evaluate=function(t){for(var e,n=null,i=0,r=0,o=this.args;r<o.length&&(i++,(n=o[r].evaluate(t))&&n instanceof re&&!n.available&&(e||(e=n.name),n=null,i===this.args.length&&(n=e)),null===n);r+=1);return n},ln.prototype.eachChild=function(t){this.args.forEach(t)},ln.prototype.outputDefined=function(){return this.args.every((function(t){return t.outputDefined()}))},ln.prototype.serialize=function(){var t=["coalesce"];return this.eachChild((function(e){t.push(e.serialize())})),t};var cn=function(t,e){this.type=e.type,this.bindings=[].concat(t),this.result=e};cn.prototype.evaluate=function(t){return this.result.evaluate(t)},cn.prototype.eachChild=function(t){for(var e=0,n=this.bindings;e<n.length;e+=1)t(n[e][1]);t(this.result)},cn.parse=function(t,e){if(t.length<4)return e.error("Expected at least 3 arguments, but found "+(t.length-1)+" instead.");for(var n=[],i=1;i<t.length-1;i+=2){var r=t[i];if("string"!=typeof r)return e.error("Expected string, but found "+typeof r+" instead.",i);if(/[^a-zA-Z0-9_]/.test(r))return e.error("Variable names must contain only alphanumeric characters or '_'.",i);var o=e.parse(t[i+1],i+1);if(!o)return null;n.push([r,o])}var s=e.parse(t[t.length-1],t.length-1,e.expectedType,n);return s?new cn(n,s):null},cn.prototype.outputDefined=function(){return this.result.outputDefined()},cn.prototype.serialize=function(){for(var t=["let"],e=0,n=this.bindings;e<n.length;e+=1){var i=n[e];t.push(i[0],i[1].serialize())}return t.push(this.result.serialize()),t};var un=function(t,e,n){this.type=t,this.index=e,this.input=n};un.parse=function(t,e){if(3!==t.length)return e.error("Expected 2 arguments, but found "+(t.length-1)+" instead.");var n=e.parse(t[1],1,Nt),i=e.parse(t[2],2,Zt(e.expectedType||jt));return n&&i?new un(i.type.itemType,n,i):null},un.prototype.evaluate=function(t){var e=this.index.evaluate(t),n=this.input.evaluate(t);if(e<0)throw new ue("Array index out of bounds: "+e+" < 0.");if(e>=n.length)throw new ue("Array index out of bounds: "+e+" > "+(n.length-1)+".");if(e!==Math.floor(e))throw new ue("Array index must be an integer, but found "+e+" instead.");return n[e]},un.prototype.eachChild=function(t){t(this.index),t(this.input)},un.prototype.outputDefined=function(){return!1},un.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var hn=function(t,e){this.type=Ut,this.needle=t,this.haystack=e};hn.parse=function(t,e){if(3!==t.length)return e.error("Expected 2 arguments, but found "+(t.length-1)+" instead.");var n=e.parse(t[1],1,jt),i=e.parse(t[2],2,jt);return n&&i?Jt(n.type,[Ut,zt,Nt,Ft,jt])?new hn(n,i):e.error("Expected first argument to be of type boolean, string, number or null, but found "+Xt(n.type)+" instead"):null},hn.prototype.evaluate=function(t){var e=this.needle.evaluate(t),n=this.haystack.evaluate(t);if(!n)return!1;if(!Yt(e,["boolean","string","number","null"]))throw new ue("Expected first argument to be of type boolean, string, number or null, but found "+Xt(ae(e))+" instead.");if(!Yt(n,["string","array"]))throw new ue("Expected second argument to be of type array or string, but found "+Xt(ae(n))+" instead.");return n.indexOf(e)>=0},hn.prototype.eachChild=function(t){t(this.needle),t(this.haystack)},hn.prototype.outputDefined=function(){return!0},hn.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var dn=function(t,e,n){this.type=Nt,this.needle=t,this.haystack=e,this.fromIndex=n};dn.parse=function(t,e){if(t.length<=2||t.length>=5)return e.error("Expected 3 or 4 arguments, but found "+(t.length-1)+" instead.");var n=e.parse(t[1],1,jt),i=e.parse(t[2],2,jt);if(!n||!i)return null;if(!Jt(n.type,[Ut,zt,Nt,Ft,jt]))return e.error("Expected first argument to be of type boolean, string, number or null, but found "+Xt(n.type)+" instead");if(4===t.length){var r=e.parse(t[3],3,Nt);return r?new dn(n,i,r):null}return new dn(n,i)},dn.prototype.evaluate=function(t){var e=this.needle.evaluate(t),n=this.haystack.evaluate(t);if(!Yt(e,["boolean","string","number","null"]))throw new ue("Expected first argument to be of type boolean, string, number or null, but found "+Xt(ae(e))+" instead.");if(!Yt(n,["string","array"]))throw new ue("Expected second argument to be of type array or string, but found "+Xt(ae(n))+" instead.");if(this.fromIndex){var i=this.fromIndex.evaluate(t);return n.indexOf(e,i)}return n.indexOf(e)},dn.prototype.eachChild=function(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)},dn.prototype.outputDefined=function(){return!1},dn.prototype.serialize=function(){if(null!=this.fromIndex&&void 0!==this.fromIndex){var t=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),t]}return["index-of",this.needle.serialize(),this.haystack.serialize()]};var pn=function(t,e,n,i,r,o){this.inputType=t,this.type=e,this.input=n,this.cases=i,this.outputs=r,this.otherwise=o};pn.parse=function(t,e){if(t.length<5)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if(t.length%2!=1)return e.error("Expected an even number of arguments.");var n,i;e.expectedType&&"value"!==e.expectedType.kind&&(i=e.expectedType);for(var r={},o=[],s=2;s<t.length-1;s+=2){var a=t[s],l=t[s+1];Array.isArray(a)||(a=[a]);var c=e.concat(s);if(0===a.length)return c.error("Expected at least one branch label.");for(var u=0,h=a;u<h.length;u+=1){var d=h[u];if("number"!=typeof d&&"string"!=typeof d)return c.error("Branch labels must be numbers or strings.");if("number"==typeof d&&Math.abs(d)>Number.MAX_SAFE_INTEGER)return c.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if("number"==typeof d&&Math.floor(d)!==d)return c.error("Numeric branch labels must be integer values.");if(n){if(c.checkSubtype(n,ae(d)))return null}else n=ae(d);if(void 0!==r[String(d)])return c.error("Branch labels must be unique.");r[String(d)]=o.length}var p=e.parse(l,s,i);if(!p)return null;i=i||p.type,o.push(p)}var f=e.parse(t[1],1,jt);if(!f)return null;var A=e.parse(t[t.length-1],t.length-1,i);return A?"value"!==f.type.kind&&e.concat(1).checkSubtype(n,f.type)?null:new pn(n,i,f,r,o,A):null},pn.prototype.evaluate=function(t){var e=this.input.evaluate(t);return(ae(e)===this.inputType&&this.outputs[this.cases[e]]||this.otherwise).evaluate(t)},pn.prototype.eachChild=function(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)},pn.prototype.outputDefined=function(){return this.outputs.every((function(t){return t.outputDefined()}))&&this.otherwise.outputDefined()},pn.prototype.serialize=function(){for(var t=this,e=["match",this.input.serialize()],n=[],i={},r=0,o=Object.keys(this.cases).sort();r<o.length;r+=1){var s=o[r];void 0===(h=i[this.cases[s]])?(i[this.cases[s]]=n.length,n.push([this.cases[s],[s]])):n[h][1].push(s)}for(var a=function(e){return"number"===t.inputType.kind?Number(e):e},l=0,c=n;l<c.length;l+=1){var u=c[l],h=u[0],d=u[1];e.push(1===d.length?a(d[0]):d.map(a)),e.push(this.outputs[outputIndex$1].serialize())}return e.push(this.otherwise.serialize()),e};var fn=function(t,e,n){this.type=t,this.branches=e,this.otherwise=n};fn.parse=function(t,e){if(t.length<4)return e.error("Expected at least 3 arguments, but found only "+(t.length-1)+".");if(t.length%2!=0)return e.error("Expected an odd number of arguments.");var n;e.expectedType&&"value"!==e.expectedType.kind&&(n=e.expectedType);for(var i=[],r=1;r<t.length-1;r+=2){var o=e.parse(t[r],r,Ut);if(!o)return null;var s=e.parse(t[r+1],r+1,n);if(!s)return null;i.push([o,s]),n=n||s.type}var a=e.parse(t[t.length-1],t.length-1,n);return a?new fn(n,i,a):null},fn.prototype.evaluate=function(t){for(var e=0,n=this.branches;e<n.length;e+=1){var i=n[e],r=i[1];if(i[0].evaluate(t))return r.evaluate(t)}return this.otherwise.evaluate(t)},fn.prototype.eachChild=function(t){for(var e=0,n=this.branches;e<n.length;e+=1){var i=n[e],r=i[1];t(i[0]),t(r)}t(this.otherwise)},fn.prototype.outputDefined=function(){return this.branches.every((function(t){return t[1].outputDefined()}))&&this.otherwise.outputDefined()},fn.prototype.serialize=function(){var t=["case"];return this.eachChild((function(e){t.push(e.serialize())})),t};var An=function(t,e,n,i){this.type=t,this.input=e,this.beginIndex=n,this.endIndex=i};function gn(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 mn(t,e,n,i){return 0===i.compare(e,n)}function yn(t,e,n){var i="=="!==t&&"!="!==t;return function(){function r(t,e,n){this.type=Ut,this.lhs=t,this.rhs=e,this.collator=n,this.hasUntypedArgument="value"===t.type.kind||"value"===e.type.kind}return r.parse=function(t,e){if(3!==t.length&&4!==t.length)return e.error("Expected two or three arguments.");var n=t[0],o=e.parse(t[1],1,jt);if(!o)return null;if(!gn(n,o.type))return e.concat(1).error('"'+n+"\" comparisons are not supported for type '"+Xt(o.type)+"'.");var s=e.parse(t[2],2,jt);if(!s)return null;if(!gn(n,s.type))return e.concat(2).error('"'+n+"\" comparisons are not supported for type '"+Xt(s.type)+"'.");if(o.type.kind!==s.type.kind&&"value"!==o.type.kind&&"value"!==s.type.kind)return e.error("Cannot compare types '"+Xt(o.type)+"' and '"+Xt(s.type)+"'.");i&&("value"===o.type.kind&&"value"!==s.type.kind?o=new de(s.type,[o]):"value"!==o.type.kind&&"value"===s.type.kind&&(s=new de(o.type,[s])));var a=null;if(4===t.length){if("string"!==o.type.kind&&"string"!==s.type.kind&&"value"!==o.type.kind&&"value"!==s.type.kind)return e.error("Cannot use collator to compare non-string types.");if(!(a=e.parse(t[3],3,Ht)))return null}return new r(o,s,a)},r.prototype.evaluate=function(r){var o=this.lhs.evaluate(r),s=this.rhs.evaluate(r);if(i&&this.hasUntypedArgument){var a=ae(o),l=ae(s);if(a.kind!==l.kind||"string"!==a.kind&&"number"!==a.kind)throw new ue('Expected arguments for "'+t+'" to be (string, string) or (number, number), but found ('+a.kind+", "+l.kind+") instead.")}if(this.collator&&!i&&this.hasUntypedArgument){var c=ae(o),u=ae(s);if("string"!==c.kind||"string"!==u.kind)return e(r,o,s)}return this.collator?n(r,o,s,this.collator.evaluate(r)):e(r,o,s)},r.prototype.eachChild=function(t){t(this.lhs),t(this.rhs),this.collator&&t(this.collator)},r.prototype.outputDefined=function(){return!0},r.prototype.serialize=function(){var e=[t];return this.eachChild((function(t){e.push(t.serialize())})),e},r}()}An.parse=function(t,e){if(t.length<=2||t.length>=5)return e.error("Expected 3 or 4 arguments, but found "+(t.length-1)+" instead.");var n=e.parse(t[1],1,jt),i=e.parse(t[2],2,Nt);if(!n||!i)return null;if(!Jt(n.type,[Zt(jt),zt,jt]))return e.error("Expected first argument to be of type array or string, but found "+Xt(n.type)+" instead");if(4===t.length){var r=e.parse(t[3],3,Nt);return r?new An(n.type,n,i,r):null}return new An(n.type,n,i)},An.prototype.evaluate=function(t){var e=this.input.evaluate(t),n=this.beginIndex.evaluate(t);if(!Yt(e,["string","array"]))throw new ue("Expected first argument to be of type array or string, but found "+Xt(ae(e))+" instead.");if(this.endIndex){var i=this.endIndex.evaluate(t);return e.slice(n,i)}return e.slice(n)},An.prototype.eachChild=function(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)},An.prototype.outputDefined=function(){return!1},An.prototype.serialize=function(){if(null!=this.endIndex&&void 0!==this.endIndex){var t=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),t]}return["slice",this.input.serialize(),this.beginIndex.serialize()]};var _n=yn("==",(function(t,e,n){return e===n}),mn),vn=yn("!=",(function(t,e,n){return e!==n}),(function(t,e,n,i){return!mn(0,e,n,i)})),bn=yn("<",(function(t,e,n){return e<n}),(function(t,e,n,i){return i.compare(e,n)<0})),xn=yn(">",(function(t,e,n){return e>n}),(function(t,e,n,i){return i.compare(e,n)>0})),wn=yn("<=",(function(t,e,n){return e<=n}),(function(t,e,n,i){return i.compare(e,n)<=0})),En=yn(">=",(function(t,e,n){return e>=n}),(function(t,e,n,i){return i.compare(e,n)>=0})),Cn=function(t,e,n,i,r){this.type=zt,this.number=t,this.locale=e,this.currency=n,this.minFractionDigits=i,this.maxFractionDigits=r};Cn.parse=function(t,e){if(3!==t.length)return e.error("Expected two arguments.");var n=e.parse(t[1],1,Nt);if(!n)return null;var i=t[2];if("object"!=typeof i||Array.isArray(i))return e.error("NumberFormat options argument must be an object.");var r=null;if(i.locale&&!(r=e.parse(i.locale,1,zt)))return null;var o=null;if(i.currency&&!(o=e.parse(i.currency,1,zt)))return null;var s=null;if(i["min-fraction-digits"]&&!(s=e.parse(i["min-fraction-digits"],1,Nt)))return null;var a=null;return i["max-fraction-digits"]&&!(a=e.parse(i["max-fraction-digits"],1,Nt))?null:new Cn(n,r,o,s,a)},Cn.prototype.evaluate=function(t){return new Intl.NumberFormat(this.locale?this.locale.evaluate(t):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(t):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(t):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(t):void 0}).format(this.number.evaluate(t))},Cn.prototype.eachChild=function(t){t(this.number),this.locale&&t(this.locale),this.currency&&t(this.currency),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits)},Cn.prototype.outputDefined=function(){return!1},Cn.prototype.serialize=function(){var t={};return this.locale&&(t.locale=this.locale.serialize()),this.currency&&(t.currency=this.currency.serialize()),this.minFractionDigits&&(t["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(t["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),t]};var Tn=function(t){this.type=Nt,this.input=t};Tn.parse=function(t,e){if(2!==t.length)return e.error("Expected 1 argument, but found "+(t.length-1)+" instead.");var n=e.parse(t[1],1);return n?"array"!==n.type.kind&&"string"!==n.type.kind&&"value"!==n.type.kind?e.error("Expected argument of type string or array, but found "+Xt(n.type)+" instead."):new Tn(n):null},Tn.prototype.evaluate=function(t){var e=this.input.evaluate(t);if("string"==typeof e)return e.length;if(Array.isArray(e))return e.length;throw new ue("Expected value to be of type string or array, but found "+Xt(ae(e))+" instead.")},Tn.prototype.eachChild=function(t){t(this.input)},Tn.prototype.outputDefined=function(){return!1},Tn.prototype.serialize=function(){var t=["length"];return this.eachChild((function(e){t.push(e.serialize())})),t};var Sn={"==":_n,"!=":vn,">":xn,"<":bn,">=":En,"<=":wn,array:de,at:un,boolean:de,case:fn,coalesce:ln,collator:ve,format:pe,image:fe,in:hn,"index-of":dn,interpolate:sn,"interpolate-hcl":sn,"interpolate-lab":sn,length:Tn,let:cn,literal:ce,match:pn,number:de,"number-format":Cn,object:de,slice:An,step:je,string:de,"to-boolean":ge,"to-color":ge,"to-number":ge,"to-string":ge,var:Ue,within:ke};function Pn(t,e){var n=e[0],i=e[1],r=e[2],o=e[3];n=n.evaluate(t),i=i.evaluate(t),r=r.evaluate(t);var s=o?o.evaluate(t):1,a=oe(n,i,r,s);if(a)throw new ue(a);return new te(n/255*s,i/255*s,r/255*s,s)}function Mn(t,e){return t in e}function In(t,e){var n=e[t];return void 0===n?null:n}function Bn(t){return{type:t}}function Rn(t){return{result:"success",value:t}}function Ln(t){return{result:"error",value:t}}function On(t){return"data-driven"===t["property-type"]||"cross-faded-data-driven"===t["property-type"]}function Dn(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}function kn(t){return!!t.expression&&t.expression.interpolated}function Fn(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":typeof t}function Nn(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}function zn(t){return t}function Un(t,e,n){return void 0!==t?t:void 0!==e?e:void 0!==n?n:void 0}function Gn(t,e,n,i,r){return Un(typeof n===r?i[n]:void 0,t.default,e.default)}function Vn(t,e,n){if("number"!==Fn(n))return Un(t.default,e.default);var i=t.stops.length;if(1===i)return t.stops[0][1];if(n<=t.stops[0][0])return t.stops[0][1];if(n>=t.stops[i-1][0])return t.stops[i-1][1];var r=Ve(t.stops.map((function(t){return t[0]})),n);return t.stops[r][1]}function jn(t,e,n){var i=void 0!==t.base?t.base:1;if("number"!==Fn(n))return Un(t.default,e.default);var r=t.stops.length;if(1===r)return t.stops[0][1];if(n<=t.stops[0][0])return t.stops[0][1];if(n>=t.stops[r-1][0])return t.stops[r-1][1];var o=Ve(t.stops.map((function(t){return t[0]})),n),s=function(t,e,n,i){var r=i-n,o=t-n;return 0===r?0:1===e?o/r:(Math.pow(e,o)-1)/(Math.pow(e,r)-1)}(n,i,t.stops[o][0],t.stops[o+1][0]),a=t.stops[o][1],l=t.stops[o+1][1],c=We[e.type]||zn;if(t.colorSpace&&"rgb"!==t.colorSpace){var u=on[t.colorSpace];c=function(t,e){return u.reverse(u.interpolate(u.forward(t),u.forward(e),s))}}return"function"==typeof a.evaluate?{evaluate:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];var n=a.evaluate.apply(void 0,t),i=l.evaluate.apply(void 0,t);if(void 0!==n&&void 0!==i)return c(n,i,s)}}:c(a,l,s)}function Hn(t,e,n){return"color"===e.type?n=te.parse(n):"formatted"===e.type?n=ie.fromString(n.toString()):"resolvedImage"===e.type?n=re.fromString(n.toString()):Fn(n)===e.type||"enum"===e.type&&e.values[n]||(n=void 0),Un(n,t.default,e.default)}_e.register(Sn,{error:[{kind:"error"},[zt],function(t,e){throw new ue(e[0].evaluate(t))}],typeof:[zt,[jt],function(t,e){return Xt(ae(e[0].evaluate(t)))}],"to-rgba":[Zt(Nt,4),[Gt],function(t,e){return e[0].evaluate(t).toArray()}],rgb:[Gt,[Nt,Nt,Nt],Pn],rgba:[Gt,[Nt,Nt,Nt,Nt],Pn],has:{type:Ut,overloads:[[[zt],function(t,e){return Mn(e[0].evaluate(t),t.properties())}],[[zt,Vt],function(t,e){var n=e[1];return Mn(e[0].evaluate(t),n.evaluate(t))}]]},get:{type:jt,overloads:[[[zt],function(t,e){return In(e[0].evaluate(t),t.properties())}],[[zt,Vt],function(t,e){var n=e[1];return In(e[0].evaluate(t),n.evaluate(t))}]]},"feature-state":[jt,[zt],function(t,e){return In(e[0].evaluate(t),t.featureState||{})}],properties:[Vt,[],function(t){return t.properties()}],"geometry-type":[zt,[],function(t){return t.geometryType()}],id:[jt,[],function(t){return t.id()}],zoom:[Nt,[],function(t){return t.globals.zoom}],"heatmap-density":[Nt,[],function(t){return t.globals.heatmapDensity||0}],"line-progress":[Nt,[],function(t){return t.globals.lineProgress||0}],accumulated:[jt,[],function(t){return void 0===t.globals.accumulated?null:t.globals.accumulated}],"+":[Nt,Bn(Nt),function(t,e){for(var n=0,i=0,r=e;i<r.length;i+=1)n+=r[i].evaluate(t);return n}],"*":[Nt,Bn(Nt),function(t,e){for(var n=1,i=0,r=e;i<r.length;i+=1)n*=r[i].evaluate(t);return n}],"-":{type:Nt,overloads:[[[Nt,Nt],function(t,e){var n=e[1];return e[0].evaluate(t)-n.evaluate(t)}],[[Nt],function(t,e){return-e[0].evaluate(t)}]]},"/":[Nt,[Nt,Nt],function(t,e){var n=e[1];return e[0].evaluate(t)/n.evaluate(t)}],"%":[Nt,[Nt,Nt],function(t,e){var n=e[1];return e[0].evaluate(t)%n.evaluate(t)}],ln2:[Nt,[],function(){return Math.LN2}],pi:[Nt,[],function(){return Math.PI}],e:[Nt,[],function(){return Math.E}],"^":[Nt,[Nt,Nt],function(t,e){var n=e[1];return Math.pow(e[0].evaluate(t),n.evaluate(t))}],sqrt:[Nt,[Nt],function(t,e){return Math.sqrt(e[0].evaluate(t))}],log10:[Nt,[Nt],function(t,e){return Math.log(e[0].evaluate(t))/Math.LN10}],ln:[Nt,[Nt],function(t,e){return Math.log(e[0].evaluate(t))}],log2:[Nt,[Nt],function(t,e){return Math.log(e[0].evaluate(t))/Math.LN2}],sin:[Nt,[Nt],function(t,e){return Math.sin(e[0].evaluate(t))}],cos:[Nt,[Nt],function(t,e){return Math.cos(e[0].evaluate(t))}],tan:[Nt,[Nt],function(t,e){return Math.tan(e[0].evaluate(t))}],asin:[Nt,[Nt],function(t,e){return Math.asin(e[0].evaluate(t))}],acos:[Nt,[Nt],function(t,e){return Math.acos(e[0].evaluate(t))}],atan:[Nt,[Nt],function(t,e){return Math.atan(e[0].evaluate(t))}],min:[Nt,Bn(Nt),function(t,e){return Math.min.apply(Math,e.map((function(e){return e.evaluate(t)})))}],max:[Nt,Bn(Nt),function(t,e){return Math.max.apply(Math,e.map((function(e){return e.evaluate(t)})))}],abs:[Nt,[Nt],function(t,e){return Math.abs(e[0].evaluate(t))}],round:[Nt,[Nt],function(t,e){var n=e[0].evaluate(t);return n<0?-Math.round(-n):Math.round(n)}],floor:[Nt,[Nt],function(t,e){return Math.floor(e[0].evaluate(t))}],ceil:[Nt,[Nt],function(t,e){return Math.ceil(e[0].evaluate(t))}],"filter-==":[Ut,[zt,jt],function(t,e){var n=e[0],i=e[1];return t.properties()[n.value]===i.value}],"filter-id-==":[Ut,[jt],function(t,e){var n=e[0];return t.id()===n.value}],"filter-type-==":[Ut,[zt],function(t,e){var n=e[0];return t.geometryType()===n.value}],"filter-<":[Ut,[zt,jt],function(t,e){var n=e[0],i=e[1],r=t.properties()[n.value],o=i.value;return typeof r==typeof o&&r<o}],"filter-id-<":[Ut,[jt],function(t,e){var n=e[0],i=t.id(),r=n.value;return typeof i==typeof r&&i<r}],"filter->":[Ut,[zt,jt],function(t,e){var n=e[0],i=e[1],r=t.properties()[n.value],o=i.value;return typeof r==typeof o&&r>o}],"filter-id->":[Ut,[jt],function(t,e){var n=e[0],i=t.id(),r=n.value;return typeof i==typeof r&&i>r}],"filter-<=":[Ut,[zt,jt],function(t,e){var n=e[0],i=e[1],r=t.properties()[n.value],o=i.value;return typeof r==typeof o&&r<=o}],"filter-id-<=":[Ut,[jt],function(t,e){var n=e[0],i=t.id(),r=n.value;return typeof i==typeof r&&i<=r}],"filter->=":[Ut,[zt,jt],function(t,e){var n=e[0],i=e[1],r=t.properties()[n.value],o=i.value;return typeof r==typeof o&&r>=o}],"filter-id->=":[Ut,[jt],function(t,e){var n=e[0],i=t.id(),r=n.value;return typeof i==typeof r&&i>=r}],"filter-has":[Ut,[jt],function(t,e){return e[0].value in t.properties()}],"filter-has-id":[Ut,[],function(t){return null!==t.id()&&void 0!==t.id()}],"filter-type-in":[Ut,[Zt(zt)],function(t,e){return e[0].value.indexOf(t.geometryType())>=0}],"filter-id-in":[Ut,[Zt(jt)],function(t,e){return e[0].value.indexOf(t.id())>=0}],"filter-in-small":[Ut,[zt,Zt(jt)],function(t,e){var n=e[0];return e[1].value.indexOf(t.properties()[n.value])>=0}],"filter-in-large":[Ut,[zt,Zt(jt)],function(t,e){var n=e[0],i=e[1];return function(t,e,n,i){for(;n<=i;){var r=n+i>>1;if(e[r]===t)return!0;e[r]>t?i=r-1:n=r+1}return!1}(t.properties()[n.value],i.value,0,i.value.length-1)}],all:{type:Ut,overloads:[[[Ut,Ut],function(t,e){var n=e[1];return e[0].evaluate(t)&&n.evaluate(t)}],[Bn(Ut),function(t,e){for(var n=0,i=e;n<i.length;n+=1)if(!i[n].evaluate(t))return!1;return!0}]]},any:{type:Ut,overloads:[[[Ut,Ut],function(t,e){var n=e[1];return e[0].evaluate(t)||n.evaluate(t)}],[Bn(Ut),function(t,e){for(var n=0,i=e;n<i.length;n+=1)if(i[n].evaluate(t))return!0;return!1}]]},"!":[Ut,[Ut],function(t,e){return!e[0].evaluate(t)}],"is-supported-script":[Ut,[zt],function(t,e){var n=t.globals&&t.globals.isSupportedScript;return!n||n(e[0].evaluate(t))}],upcase:[zt,[zt],function(t,e){return e[0].evaluate(t).toUpperCase()}],downcase:[zt,[zt],function(t,e){return e[0].evaluate(t).toLowerCase()}],concat:[zt,Bn(jt),function(t,e){return e.map((function(e){return le(e.evaluate(t))})).join("")}],"resolved-locale":[zt,[Ht],function(t,e){return e[0].evaluate(t).resolvedLocale()}]});var Wn=function(t,e){this.expression=t,this._warningHistory={},this._evaluator=new ye,this._defaultValue=e?function(t){return"color"===t.type&&Nn(t.default)?new te(0,0,0,0):"color"===t.type?te.parse(t.default)||null:void 0===t.default?null:t.default}(e):null,this._enumValues=e&&"enum"===e.type?e.values:null};function qn(t){return Array.isArray(t)&&t.length>0&&"string"==typeof t[0]&&t[0]in Sn}function Zn(t,e){var n=new Ge(Sn,[],e?function(t){var e={color:Gt,string:zt,number:Nt,enum:zt,boolean:Ut,formatted:Wt,resolvedImage:qt};return"array"===t.type?Zt(e[t.value]||jt,t.length):e[t.type]}(e):void 0),i=n.parse(t,void 0,void 0,void 0,e&&"string"===e.type?{typeAnnotation:"coerce"}:void 0);return i?Rn(new Wn(i,e)):Ln(n.errors)}Wn.prototype.evaluateWithoutErrorHandling=function(t,e,n,i,r,o){return this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=n,this._evaluator.canonical=i,this._evaluator.availableImages=r||null,this._evaluator.formattedSection=o,this.expression.evaluate(this._evaluator)},Wn.prototype.evaluate=function(t,e,n,i,r,o){this._evaluator.globals=t,this._evaluator.feature=e||null,this._evaluator.featureState=n||null,this._evaluator.canonical=i,this._evaluator.availableImages=r||null,this._evaluator.formattedSection=o||null;try{var s=this.expression.evaluate(this._evaluator);if(null==s||"number"==typeof s&&s!=s)return this._defaultValue;if(this._enumValues&&!(s in this._enumValues))throw new ue("Expected value to be one of "+Object.keys(this._enumValues).map((function(t){return JSON.stringify(t)})).join(", ")+", but found "+JSON.stringify(s)+" instead.");return s}catch(t){return this._warningHistory[t.message]||(this._warningHistory[t.message]=!0,"undefined"!=typeof console&&console.warn(t.message)),this._defaultValue}};var Xn=function(t,e){this.kind=t,this._styleExpression=e,this.isStateDependent="constant"!==t&&!Ne(e.expression)};Xn.prototype.evaluateWithoutErrorHandling=function(t,e,n,i,r,o){return this._styleExpression.evaluateWithoutErrorHandling(t,e,n,i,r,o)},Xn.prototype.evaluate=function(t,e,n,i,r,o){return this._styleExpression.evaluate(t,e,n,i,r,o)};var Kn=function(t,e,n,i){this.kind=t,this.zoomStops=n,this._styleExpression=e,this.isStateDependent="camera"!==t&&!Ne(e.expression),this.interpolationType=i};function Qn(t,e){if("error"===(t=Zn(t,e)).result)return t;var n=t.value.expression,i=Fe(n);if(!i&&!On(e))return Ln([new Dt("","data expressions not supported")]);var r=ze(n,["zoom"]);if(!r&&!Dn(e))return Ln([new Dt("","zoom expressions not supported")]);var o=function t(e){var n=null;if(e instanceof cn)n=t(e.result);else if(e instanceof ln)for(var i=0,r=e.args;i<r.length&&!(n=t(r[i]));i+=1);else(e instanceof je||e instanceof sn)&&e.input instanceof _e&&"zoom"===e.input.name&&(n=e);return n instanceof Dt||e.eachChild((function(e){var i=t(e);i instanceof Dt?n=i:!n&&i?n=new Dt("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):n&&i&&n!==i&&(n=new Dt("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))})),n}(n);return o||r?o instanceof Dt?Ln([o]):o instanceof sn&&!kn(e)?Ln([new Dt("",'"interpolate" expressions cannot be used with this property')]):Rn(o?new Kn(i?"camera":"composite",t.value,o.labels,o instanceof sn?o.interpolation:void 0):new Xn(i?"constant":"source",t.value)):Ln([new Dt("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}Kn.prototype.evaluateWithoutErrorHandling=function(t,e,n,i,r,o){return this._styleExpression.evaluateWithoutErrorHandling(t,e,n,i,r,o)},Kn.prototype.evaluate=function(t,e,n,i,r,o){return this._styleExpression.evaluate(t,e,n,i,r,o)},Kn.prototype.interpolationFactor=function(t,e,n){return this.interpolationType?sn.interpolationFactor(this.interpolationType,t,e,n):0};var Jn=function(t,e){this._parameters=t,this._specification=e,Rt(this,function t(e,n){var i,r,o,s="color"===n.type,a=e.stops&&"object"==typeof e.stops[0][0],l=a||!(a||void 0!==e.property),c=e.type||(kn(n)?"exponential":"interval");if(s&&((e=Rt({},e)).stops&&(e.stops=e.stops.map((function(t){return[t[0],te.parse(t[1])]}))),e.default=te.parse(e.default?e.default:n.default)),e.colorSpace&&"rgb"!==e.colorSpace&&!on[e.colorSpace])throw new Error("Unknown color space: "+e.colorSpace);if("exponential"===c)i=jn;else if("interval"===c)i=Vn;else if("categorical"===c){i=Gn,r=Object.create(null);for(var u=0,h=e.stops;u<h.length;u+=1){var d=h[u];r[d[0]]=d[1]}o=typeof e.stops[0][0]}else{if("identity"!==c)throw new Error('Unknown function type "'+c+'"');i=Hn}if(a){for(var p={},f=[],A=0;A<e.stops.length;A++){var g=e.stops[A],m=g[0].zoom;void 0===p[m]&&(p[m]={zoom:m,type:e.type,property:e.property,default:e.default,stops:[]},f.push(m)),p[m].stops.push([g[0].value,g[1]])}for(var y=[],_=0,v=f;_<v.length;_+=1){var b=v[_];y.push([p[b].zoom,t(p[b],n)])}var x={name:"linear"};return{kind:"composite",interpolationType:x,interpolationFactor:sn.interpolationFactor.bind(void 0,x),zoomStops:y.map((function(t){return t[0]})),evaluate:function(t,i){var r=t.zoom;return jn({stops:y,base:e.base},n,r).evaluate(r,i)}}}if(l){var w="exponential"===c?{name:"exponential",base:void 0!==e.base?e.base:1}:null;return{kind:"camera",interpolationType:w,interpolationFactor:sn.interpolationFactor.bind(void 0,w),zoomStops:e.stops.map((function(t){return t[0]})),evaluate:function(t){return i(e,n,t.zoom,r,o)}}}return{kind:"source",evaluate:function(t,s){var a=s&&s.properties?s.properties[e.property]:void 0;return void 0===a?Un(e.default,n.default):i(e,n,a,r,o)}}}(this._parameters,this._specification))};function Yn(t){var e=t.key,n=t.value,i=t.valueSpec||{},r=t.objectElementValidators||{},o=t.style,s=t.styleSpec,a=[],l=Fn(n);if("object"!==l)return[new It(e,n,"object expected, "+l+" found")];for(var c in n){var u=c.split(".")[0],h=i[u]||i["*"],d=void 0;if(r[u])d=r[u];else if(i[u])d=wi;else if(r["*"])d=r["*"];else{if(!i["*"]){a.push(new It(e,n[c],'unknown property "'+c+'"'));continue}d=wi}a=a.concat(d({key:(e?e+".":e)+c,value:n[c],valueSpec:h,style:o,styleSpec:s,object:n,objectKey:c},n))}for(var p in i)r[p]||i[p].required&&void 0===i[p].default&&void 0===n[p]&&a.push(new It(e,n,'missing required property "'+p+'"'));return a}function $n(t){var e=t.value,n=t.valueSpec,i=t.style,r=t.styleSpec,o=t.key,s=t.arrayElementValidator||wi;if("array"!==Fn(e))return[new It(o,e,"array expected, "+Fn(e)+" found")];if(n.length&&e.length!==n.length)return[new It(o,e,"array length "+n.length+" expected, length "+e.length+" found")];if(n["min-length"]&&e.length<n["min-length"])return[new It(o,e,"array length at least "+n["min-length"]+" expected, length "+e.length+" found")];var a={type:n.value,values:n.values};r.$version<7&&(a.function=n.function),"object"===Fn(n.value)&&(a=n.value);for(var l=[],c=0;c<e.length;c++)l=l.concat(s({array:e,arrayIndex:c,value:e[c],valueSpec:a,style:i,styleSpec:r,key:o+"["+c+"]"}));return l}function ti(t){var e=t.key,n=t.value,i=t.valueSpec,r=Fn(n);return"number"===r&&n!=n&&(r="NaN"),"number"!==r?[new It(e,n,"number expected, "+r+" found")]:"minimum"in i&&n<i.minimum?[new It(e,n,n+" is less than the minimum value "+i.minimum)]:"maximum"in i&&n>i.maximum?[new It(e,n,n+" is greater than the maximum value "+i.maximum)]:[]}function ei(t){var e,n,i,r=t.valueSpec,o=Lt(t.value.type),s={},a="categorical"!==o&&void 0===t.value.property,l=!a,c="array"===Fn(t.value.stops)&&"array"===Fn(t.value.stops[0])&&"object"===Fn(t.value.stops[0][0]),u=Yn({key:t.key,value:t.value,valueSpec:t.styleSpec.function,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:function(t){if("identity"===o)return[new It(t.key,t.value,'identity function may not have a "stops" property')];var e=[],n=t.value;return e=e.concat($n({key:t.key,value:n,valueSpec:t.valueSpec,style:t.style,styleSpec:t.styleSpec,arrayElementValidator:h})),"array"===Fn(n)&&0===n.length&&e.push(new It(t.key,n,"array must have at least one stop")),e},default:function(t){return wi({key:t.key,value:t.value,valueSpec:r,style:t.style,styleSpec:t.styleSpec})}}});return"identity"===o&&a&&u.push(new It(t.key,t.value,'missing required property "property"')),"identity"===o||t.value.stops||u.push(new It(t.key,t.value,'missing required property "stops"')),"exponential"===o&&t.valueSpec.expression&&!kn(t.valueSpec)&&u.push(new It(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(l&&!On(t.valueSpec)?u.push(new It(t.key,t.value,"property functions not supported")):a&&!Dn(t.valueSpec)&&u.push(new It(t.key,t.value,"zoom functions not supported"))),"categorical"!==o&&!c||void 0!==t.value.property||u.push(new It(t.key,t.value,'"property" property is required')),u;function h(t){var e=[],o=t.value,a=t.key;if("array"!==Fn(o))return[new It(a,o,"array expected, "+Fn(o)+" found")];if(2!==o.length)return[new It(a,o,"array length 2 expected, length "+o.length+" found")];if(c){if("object"!==Fn(o[0]))return[new It(a,o,"object expected, "+Fn(o[0])+" found")];if(void 0===o[0].zoom)return[new It(a,o,"object stop key must have zoom")];if(void 0===o[0].value)return[new It(a,o,"object stop key must have value")];if(i&&i>Lt(o[0].zoom))return[new It(a,o[0].zoom,"stop zoom values must appear in ascending order")];Lt(o[0].zoom)!==i&&(i=Lt(o[0].zoom),n=void 0,s={}),e=e.concat(Yn({key:a+"[0]",value:o[0],valueSpec:{zoom:{}},style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:ti,value:d}}))}else e=e.concat(d({key:a+"[0]",value:o[0],valueSpec:{},style:t.style,styleSpec:t.styleSpec},o));return qn(Ot(o[1]))?e.concat([new It(a+"[1]",o[1],"expressions are not allowed in function stops.")]):e.concat(wi({key:a+"[1]",value:o[1],valueSpec:r,style:t.style,styleSpec:t.styleSpec}))}function d(t,i){var a=Fn(t.value),l=Lt(t.value),c=null!==t.value?t.value:i;if(e){if(a!==e)return[new It(t.key,c,a+" stop domain type must match previous stop domain type "+e)]}else e=a;if("number"!==a&&"string"!==a&&"boolean"!==a)return[new It(t.key,c,"stop domain value must be a number, string, or boolean")];if("number"!==a&&"categorical"!==o){var u="number expected, "+a+" found";return On(r)&&void 0===o&&(u+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new It(t.key,c,u)]}return"categorical"!==o||"number"!==a||isFinite(l)&&Math.floor(l)===l?"categorical"!==o&&"number"===a&&void 0!==n&&l<n?[new It(t.key,c,"stop domain values must appear in ascending order")]:(n=l,"categorical"===o&&l in s?[new It(t.key,c,"stop domain values must be unique")]:(s[l]=!0,[])):[new It(t.key,c,"integer expected, found "+l)]}}function ni(t){var e=("property"===t.expressionContext?Qn:Zn)(Ot(t.value),t.valueSpec);if("error"===e.result)return e.value.map((function(e){return new It(""+t.key+e.key,t.value,e.message)}));var n=e.value.expression||e.value._styleExpression.expression;if("property"===t.expressionContext&&"text-font"===t.propertyKey&&!n.outputDefined())return[new It(t.key,t.value,'Invalid data expression for "'+t.propertyKey+'". Output values must be contained as literals within the expression.')];if("property"===t.expressionContext&&"layout"===t.propertyType&&!Ne(n))return[new It(t.key,t.value,'"feature-state" data expressions are not supported with layout properties.')];if("filter"===t.expressionContext&&!Ne(n))return[new It(t.key,t.value,'"feature-state" data expressions are not supported with filters.')];if(t.expressionContext&&0===t.expressionContext.indexOf("cluster")){if(!ze(n,["zoom","feature-state"]))return[new It(t.key,t.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if("cluster-initial"===t.expressionContext&&!Fe(n))return[new It(t.key,t.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function ii(t){var e=t.key,n=t.value,i=t.valueSpec,r=[];return Array.isArray(i.values)?-1===i.values.indexOf(Lt(n))&&r.push(new It(e,n,"expected one of ["+i.values.join(", ")+"], "+JSON.stringify(n)+" found")):-1===Object.keys(i.values).indexOf(Lt(n))&&r.push(new It(e,n,"expected one of ["+Object.keys(i.values).join(", ")+"], "+JSON.stringify(n)+" found")),r}function ri(t){if(!0===t||!1===t)return!0;if(!Array.isArray(t)||0===t.length)return!1;switch(t[0]){case"has":return t.length>=2&&"$id"!==t[1]&&"$type"!==t[1];case"in":return t.length>=3&&("string"!=typeof t[1]||Array.isArray(t[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==t.length||Array.isArray(t[1])||Array.isArray(t[2]);case"any":case"all":for(var e=0,n=t.slice(1);e<n.length;e+=1){var i=n[e];if(!ri(i)&&"boolean"!=typeof i)return!1}return!0;default:return!0}}Jn.deserialize=function(t){return new Jn(t._parameters,t._specification)},Jn.serialize=function(t){return{_parameters:t._parameters,_specification:t._specification}};var oi={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function si(t){if(null==t)return{filter:function(){return!0},needGeometry:!1};ri(t)||(t=li(t));var e=Zn(t,oi);if("error"===e.result)throw new Error(e.value.map((function(t){return t.key+": "+t.message})).join(", "));return{filter:function(t,n,i){return e.value.evaluate(t,n,{},i)},needGeometry:function t(e){if(!Array.isArray(e))return!1;if("within"===e[0])return!0;for(var n=1;n<e.length;n++)if(t(e[n]))return!0;return!1}(t)}}function ai(t,e){return t<e?-1:t>e?1:0}function li(t){if(!t)return!0;var e,n=t[0];return t.length<=1?"any"!==n:"=="===n?ci(t[1],t[2],"=="):"!="===n?di(ci(t[1],t[2],"==")):"<"===n||">"===n||"<="===n||">="===n?ci(t[1],t[2],n):"any"===n?(e=t.slice(1),["any"].concat(e.map(li))):"all"===n?["all"].concat(t.slice(1).map(li)):"none"===n?["all"].concat(t.slice(1).map(li).map(di)):"in"===n?ui(t[1],t.slice(2)):"!in"===n?di(ui(t[1],t.slice(2))):"has"===n?hi(t[1]):"!has"===n?di(hi(t[1])):"within"!==n||t}function ci(t,e,n){switch(t){case"$type":return["filter-type-"+n,e];case"$id":return["filter-id-"+n,e];default:return["filter-"+n,t,e]}}function ui(t,e){if(0===e.length)return!1;switch(t){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some((function(t){return typeof t!=typeof e[0]}))?["filter-in-large",t,["literal",e.sort(ai)]]:["filter-in-small",t,["literal",e]]}}function hi(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function di(t){return["!",t]}function pi(t){return ri(Ot(t.value))?ni(Rt({},t,{expressionContext:"filter",valueSpec:{value:"boolean"}})):function t(e){var n=e.value,i=e.key;if("array"!==Fn(n))return[new It(i,n,"array expected, "+Fn(n)+" found")];var r,o=e.styleSpec,s=[];if(n.length<1)return[new It(i,n,"filter array must have at least 1 element")];switch(s=s.concat(ii({key:i+"[0]",value:n[0],valueSpec:o.filter_operator,style:e.style,styleSpec:e.styleSpec})),Lt(n[0])){case"<":case"<=":case">":case">=":n.length>=2&&"$type"===Lt(n[1])&&s.push(new It(i,n,'"$type" cannot be use with operator "'+n[0]+'"'));case"==":case"!=":3!==n.length&&s.push(new It(i,n,'filter array for operator "'+n[0]+'" must have 3 elements'));case"in":case"!in":n.length>=2&&"string"!==(r=Fn(n[1]))&&s.push(new It(i+"[1]",n[1],"string expected, "+r+" found"));for(var a=2;a<n.length;a++)r=Fn(n[a]),"$type"===Lt(n[1])?s=s.concat(ii({key:i+"["+a+"]",value:n[a],valueSpec:o.geometry_type,style:e.style,styleSpec:e.styleSpec})):"string"!==r&&"number"!==r&&"boolean"!==r&&s.push(new It(i+"["+a+"]",n[a],"string, number, or boolean expected, "+r+" found"));break;case"any":case"all":case"none":for(var l=1;l<n.length;l++)s=s.concat(t({key:i+"["+l+"]",value:n[l],style:e.style,styleSpec:e.styleSpec}));break;case"has":case"!has":r=Fn(n[1]),2!==n.length?s.push(new It(i,n,'filter array for "'+n[0]+'" operator must have 2 elements')):"string"!==r&&s.push(new It(i+"[1]",n[1],"string expected, "+r+" found"));break;case"within":r=Fn(n[1]),2!==n.length?s.push(new It(i,n,'filter array for "'+n[0]+'" operator must have 2 elements')):"object"!==r&&s.push(new It(i+"[1]",n[1],"object expected, "+r+" found"))}return s}(t)}function fi(t,e){var n=t.key,i=t.style,r=t.styleSpec,o=t.value,s=t.objectKey,a=r[e+"_"+t.layerType];if(!a)return[];var l=s.match(/^(.*)-transition$/);if("paint"===e&&l&&a[l[1]]&&a[l[1]].transition)return wi({key:n,value:o,valueSpec:r.transition,style:i,styleSpec:r});var c,u=t.valueSpec||a[s];if(!u)return[new It(n,o,'unknown property "'+s+'"')];if("string"===Fn(o)&&On(u)&&!u.tokens&&(c=/^{([^}]+)}$/.exec(o)))return[new It(n,o,'"'+s+'" does not support interpolation syntax\nUse an identity property function instead: `{ "type": "identity", "property": '+JSON.stringify(c[1])+" }`.")];var h=[];return"symbol"===t.layerType&&("text-field"===s&&i&&!i.glyphs&&h.push(new It(n,o,'use of "text-field" requires a style "glyphs" property')),"text-font"===s&&Nn(Ot(o))&&"identity"===Lt(o.type)&&h.push(new It(n,o,'"text-font" does not support identity functions'))),h.concat(wi({key:t.key,value:o,valueSpec:u,style:i,styleSpec:r,expressionContext:"property",propertyType:e,propertyKey:s}))}function Ai(t){return fi(t,"paint")}function gi(t){return fi(t,"layout")}function mi(t){var e=[],n=t.value,i=t.key,r=t.style,o=t.styleSpec;n.type||n.ref||e.push(new It(i,n,'either "type" or "ref" is required'));var s,a=Lt(n.type),l=Lt(n.ref);if(n.id)for(var c=Lt(n.id),u=0;u<t.arrayIndex;u++){var h=r.layers[u];Lt(h.id)===c&&e.push(new It(i,n.id,'duplicate layer id "'+n.id+'", previously used at line '+h.id.__line__))}if("ref"in n)["type","source","source-layer","filter","layout"].forEach((function(t){t in n&&e.push(new It(i,n[t],'"'+t+'" is prohibited for ref layers'))})),r.layers.forEach((function(t){Lt(t.id)===l&&(s=t)})),s?s.ref?e.push(new It(i,n.ref,"ref cannot reference another ref layer")):a=Lt(s.type):e.push(new It(i,n.ref,'ref layer "'+l+'" not found'));else if("background"!==a)if(n.source){var d=r.sources&&r.sources[n.source],p=d&&Lt(d.type);d?"vector"===p&&"raster"===a?e.push(new It(i,n.source,'layer "'+n.id+'" requires a raster source')):"raster"===p&&"raster"!==a?e.push(new It(i,n.source,'layer "'+n.id+'" requires a vector source')):"vector"!==p||n["source-layer"]?"raster-dem"===p&&"hillshade"!==a?e.push(new It(i,n.source,"raster-dem source can only be used with layer type 'hillshade'.")):"line"!==a||!n.paint||!n.paint["line-gradient"]||"geojson"===p&&d.lineMetrics||e.push(new It(i,n,'layer "'+n.id+'" specifies a line-gradient, which requires a GeoJSON source with `lineMetrics` enabled.')):e.push(new It(i,n,'layer "'+n.id+'" must specify a "source-layer"')):e.push(new It(i,n.source,'source "'+n.source+'" not found'))}else e.push(new It(i,n,'missing required property "source"'));return e=e.concat(Yn({key:i,value:n,valueSpec:o.layer,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(){return[]},type:function(){return wi({key:i+".type",value:n.type,valueSpec:o.layer.type,style:t.style,styleSpec:t.styleSpec,object:n,objectKey:"type"})},filter:pi,layout:function(t){return Yn({layer:n,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(t){return gi(Rt({layerType:a},t))}}})},paint:function(t){return Yn({layer:n,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(t){return Ai(Rt({layerType:a},t))}}})}}}))}function yi(t){var e=t.value,n=t.key,i=Fn(e);return"string"!==i?[new It(n,e,"string expected, "+i+" found")]:[]}var _i={promoteId:function(t){var e=t.key,n=t.value;if("string"===Fn(n))return yi({key:e,value:n});var i=[];for(var r in n)i.push.apply(i,yi({key:e+"."+r,value:n[r]}));return i}};function vi(t){var e=t.value,n=t.key,i=t.styleSpec,r=t.style;if(!e.type)return[new It(n,e,'"type" is required')];var o,s=Lt(e.type);switch(s){case"vector":case"raster":case"raster-dem":return Yn({key:n,value:e,valueSpec:i["source_"+s.replace("-","_")],style:t.style,styleSpec:i,objectElementValidators:_i});case"geojson":if(o=Yn({key:n,value:e,valueSpec:i.source_geojson,style:r,styleSpec:i,objectElementValidators:_i}),e.cluster)for(var a in e.clusterProperties){var l=e.clusterProperties[a],c=l[0],u="string"==typeof c?[c,["accumulated"],["get",a]]:c;o.push.apply(o,ni({key:n+"."+a+".map",value:l[1],expressionContext:"cluster-map"})),o.push.apply(o,ni({key:n+"."+a+".reduce",value:u,expressionContext:"cluster-reduce"}))}return o;case"video":return Yn({key:n,value:e,valueSpec:i.source_video,style:r,styleSpec:i});case"image":return Yn({key:n,value:e,valueSpec:i.source_image,style:r,styleSpec:i});case"canvas":return[new It(n,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return ii({key:n+".type",value:e.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:r,styleSpec:i})}}function bi(t){var e=t.value,n=t.styleSpec,i=n.light,r=t.style,o=[],s=Fn(e);if(void 0===e)return o;if("object"!==s)return o.concat([new It("light",e,"object expected, "+s+" found")]);for(var a in e){var l=a.match(/^(.*)-transition$/);o=o.concat(l&&i[l[1]]&&i[l[1]].transition?wi({key:a,value:e[a],valueSpec:n.transition,style:r,styleSpec:n}):i[a]?wi({key:a,value:e[a],valueSpec:i[a],style:r,styleSpec:n}):[new It(a,e[a],'unknown property "'+a+'"')])}return o}var xi={"*":function(){return[]},array:$n,boolean:function(t){var e=t.value,n=t.key,i=Fn(e);return"boolean"!==i?[new It(n,e,"boolean expected, "+i+" found")]:[]},number:ti,color:function(t){var e=t.key,n=t.value,i=Fn(n);return"string"!==i?[new It(e,n,"color expected, "+i+" found")]:null===$t(n)?[new It(e,n,'color expected, "'+n+'" found')]:[]},constants:Bt,enum:ii,filter:pi,function:ei,layer:mi,object:Yn,source:vi,light:bi,string:yi,formatted:function(t){return 0===yi(t).length?[]:ni(t)},resolvedImage:function(t){return 0===yi(t).length?[]:ni(t)}};function wi(t){var e=t.value,n=t.valueSpec,i=t.styleSpec;return n.expression&&Nn(Lt(e))?ei(t):n.expression&&qn(Ot(e))?ni(t):n.type&&xi[n.type]?xi[n.type](t):Yn(Rt({},t,{valueSpec:n.type?i[n.type]:n}))}function Ei(t){var e=t.value,n=t.key,i=yi(t);return i.length||(-1===e.indexOf("{fontstack}")&&i.push(new It(n,e,'"glyphs" url must include a "{fontstack}" token')),-1===e.indexOf("{range}")&&i.push(new It(n,e,'"glyphs" url must include a "{range}" token'))),i}function Ci(t,e){void 0===e&&(e=Mt);var n=[];return n=n.concat(wi({key:"",value:t,valueSpec:e.$root,styleSpec:e,style:t,objectElementValidators:{glyphs:Ei,"*":function(){return[]}}})),t.constants&&(n=n.concat(Bt({key:"constants",value:t.constants,style:t,styleSpec:e}))),Ti(n)}function Ti(t){return[].concat(t).sort((function(t,e){return t.line-e.line}))}function Si(t){return function(){for(var e=[],n=arguments.length;n--;)e[n]=arguments[n];return Ti(t.apply(this,e))}}Ci.source=Si(vi),Ci.light=Si(bi),Ci.layer=Si(mi),Ci.filter=Si(pi),Ci.paintProperty=Si(Ai),Ci.layoutProperty=Si(gi);var Pi=Ci,Mi=Pi.light,Ii=Pi.paintProperty,Bi=Pi.layoutProperty;function Ri(t,e){var n=!1;if(e&&e.length)for(var i=0,r=e;i<r.length;i+=1)t.fire(new St(new Error(r[i].message))),n=!0;return n}var Li=Oi;function Oi(t,e,n){var i=this.cells=[];if(t instanceof ArrayBuffer){this.arrayBuffer=t;var r=new Int32Array(this.arrayBuffer);t=r[0],this.d=(e=r[1])+2*(n=r[2]);for(var o=0;o<this.d*this.d;o++){var s=r[3+o],a=r[3+o+1];i.push(s===a?null:r.subarray(s,a))}var l=r[3+i.length+1];this.keys=r.subarray(r[3+i.length],l),this.bboxes=r.subarray(l),this.insert=this._insertReadonly}else{this.d=e+2*n;for(var c=0;c<this.d*this.d;c++)i.push([]);this.keys=[],this.bboxes=[]}this.n=e,this.extent=t,this.padding=n,this.scale=e/t,this.uid=0;var u=n/e*t;this.min=-u,this.max=t+u}Oi.prototype.insert=function(t,e,n,i,r){this._forEachCell(e,n,i,r,this._insertCell,this.uid++),this.keys.push(t),this.bboxes.push(e),this.bboxes.push(n),this.bboxes.push(i),this.bboxes.push(r)},Oi.prototype._insertReadonly=function(){throw"Cannot insert into a GridIndex created from an ArrayBuffer."},Oi.prototype._insertCell=function(t,e,n,i,r,o){this.cells[r].push(o)},Oi.prototype.query=function(t,e,n,i,r){var o=this.min,s=this.max;if(t<=o&&e<=o&&s<=n&&s<=i&&!r)return Array.prototype.slice.call(this.keys);var a=[];return this._forEachCell(t,e,n,i,this._queryCell,a,{},r),a},Oi.prototype._queryCell=function(t,e,n,i,r,o,s,a){var l=this.cells[r];if(null!==l)for(var c=this.keys,u=this.bboxes,h=0;h<l.length;h++){var d=l[h];if(void 0===s[d]){var p=4*d;(a?a(u[p+0],u[p+1],u[p+2],u[p+3]):t<=u[p+2]&&e<=u[p+3]&&n>=u[p+0]&&i>=u[p+1])?(s[d]=!0,o.push(c[d])):s[d]=!1}}},Oi.prototype._forEachCell=function(t,e,n,i,r,o,s,a){for(var l=this._convertToCellCoord(t),c=this._convertToCellCoord(e),u=this._convertToCellCoord(n),h=this._convertToCellCoord(i),d=l;d<=u;d++)for(var p=c;p<=h;p++){var f=this.d*p+d;if((!a||a(this._convertFromCellCoord(d),this._convertFromCellCoord(p),this._convertFromCellCoord(d+1),this._convertFromCellCoord(p+1)))&&r.call(this,t,e,n,i,f,o,s,a))return}},Oi.prototype._convertFromCellCoord=function(t){return(t-this.padding)/this.scale},Oi.prototype._convertToCellCoord=function(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))},Oi.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var t=this.cells,e=3+this.cells.length+1+1,n=0,i=0;i<this.cells.length;i++)n+=this.cells[i].length;var r=new Int32Array(e+n+this.keys.length+this.bboxes.length);r[0]=this.extent,r[1]=this.n,r[2]=this.padding;for(var o=e,s=0;s<t.length;s++){var a=t[s];r[3+s]=o,r.set(a,o),o+=a.length}return r[3+t.length]=o,r.set(this.keys,o),r[3+t.length+1]=o+=this.keys.length,r.set(this.bboxes,o),o+=this.bboxes.length,r.buffer};var Di=s.ImageData,ki=s.ImageBitmap,Fi={};function Ni(t,e,n){void 0===n&&(n={}),Object.defineProperty(e,"_classRegistryKey",{value:t,writeable:!1}),Fi[t]={klass:e,omit:n.omit||[],shallow:n.shallow||[]}}for(var zi in Ni("Object",Object),Li.serialize=function(t,e){var n=t.toArrayBuffer();return e&&e.push(n),{buffer:n}},Li.deserialize=function(t){return new Li(t.buffer)},Ni("Grid",Li),Ni("Color",te),Ni("Error",Error),Ni("ResolvedImage",re),Ni("StylePropertyFunction",Jn),Ni("StyleExpression",Wn,{omit:["_evaluator"]}),Ni("ZoomDependentExpression",Kn),Ni("ZoomConstantExpression",Xn),Ni("CompoundExpression",_e,{omit:["_evaluate"]}),Sn)Sn[zi]._classRegistryKey||Ni("Expression_"+zi,Sn[zi]);function Ui(t){return t&&"undefined"!=typeof ArrayBuffer&&(t instanceof ArrayBuffer||t.constructor&&"ArrayBuffer"===t.constructor.name)}function Gi(t){return ki&&t instanceof ki}function Vi(t,e){if(null==t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp)return t;if(Ui(t)||Gi(t))return e&&e.push(t),t;if(ArrayBuffer.isView(t)){var n=t;return e&&e.push(n.buffer),n}if(t instanceof Di)return e&&e.push(t.data.buffer),t;if(Array.isArray(t)){for(var i=[],r=0,o=t;r<o.length;r+=1)i.push(Vi(o[r],e));return i}if("object"==typeof t){var s=t.constructor,a=s._classRegistryKey;if(!a)throw new Error("can't serialize object of unregistered class");var l=s.serialize?s.serialize(t,e):{};if(!s.serialize){for(var c in t)if(t.hasOwnProperty(c)&&!(Fi[a].omit.indexOf(c)>=0)){var u=t[c];l[c]=Fi[a].shallow.indexOf(c)>=0?u:Vi(u,e)}t instanceof Error&&(l.message=t.message)}if(l.$name)throw new Error("$name property is reserved for worker serialization logic.");return"Object"!==a&&(l.$name=a),l}throw new Error("can't serialize object of type "+typeof t)}function ji(t){if(null==t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp||Ui(t)||Gi(t)||ArrayBuffer.isView(t)||t instanceof Di)return t;if(Array.isArray(t))return t.map(ji);if("object"==typeof t){var e=t.$name||"Object",n=Fi[e].klass;if(!n)throw new Error("can't deserialize unregistered class "+e);if(n.deserialize)return n.deserialize(t);for(var i=Object.create(n.prototype),r=0,o=Object.keys(t);r<o.length;r+=1){var s=o[r];if("$name"!==s){var a=t[s];i[s]=Fi[e].shallow.indexOf(s)>=0?a:ji(a)}}return i}throw new Error("can't deserialize object of type "+typeof t)}var Hi=function(){this.first=!0};Hi.prototype.update=function(t,e){var n=Math.floor(t);return this.first?(this.first=!1,this.lastIntegerZoom=n,this.lastIntegerZoomTime=0,this.lastZoom=t,this.lastFloorZoom=n,!0):(this.lastFloorZoom>n?(this.lastIntegerZoom=n+1,this.lastIntegerZoomTime=e):this.lastFloorZoom<n&&(this.lastIntegerZoom=n,this.lastIntegerZoomTime=e),t!==this.lastZoom&&(this.lastZoom=t,this.lastFloorZoom=n,!0))};var Wi={"Latin-1 Supplement":function(t){return t>=128&&t<=255},Arabic:function(t){return t>=1536&&t<=1791},"Arabic Supplement":function(t){return t>=1872&&t<=1919},"Arabic Extended-A":function(t){return t>=2208&&t<=2303},"Hangul Jamo":function(t){return t>=4352&&t<=4607},"Unified Canadian Aboriginal Syllabics":function(t){return t>=5120&&t<=5759},Khmer:function(t){return t>=6016&&t<=6143},"Unified Canadian Aboriginal Syllabics Extended":function(t){return t>=6320&&t<=6399},"General Punctuation":function(t){return t>=8192&&t<=8303},"Letterlike Symbols":function(t){return t>=8448&&t<=8527},"Number Forms":function(t){return t>=8528&&t<=8591},"Miscellaneous Technical":function(t){return t>=8960&&t<=9215},"Control Pictures":function(t){return t>=9216&&t<=9279},"Optical Character Recognition":function(t){return t>=9280&&t<=9311},"Enclosed Alphanumerics":function(t){return t>=9312&&t<=9471},"Geometric Shapes":function(t){return t>=9632&&t<=9727},"Miscellaneous Symbols":function(t){return t>=9728&&t<=9983},"Miscellaneous Symbols and Arrows":function(t){return t>=11008&&t<=11263},"CJK Radicals Supplement":function(t){return t>=11904&&t<=12031},"Kangxi Radicals":function(t){return t>=12032&&t<=12255},"Ideographic Description Characters":function(t){return t>=12272&&t<=12287},"CJK Symbols and Punctuation":function(t){return t>=12288&&t<=12351},Hiragana:function(t){return t>=12352&&t<=12447},Katakana:function(t){return t>=12448&&t<=12543},Bopomofo:function(t){return t>=12544&&t<=12591},"Hangul Compatibility Jamo":function(t){return t>=12592&&t<=12687},Kanbun:function(t){return t>=12688&&t<=12703},"Bopomofo Extended":function(t){return t>=12704&&t<=12735},"CJK Strokes":function(t){return t>=12736&&t<=12783},"Katakana Phonetic Extensions":function(t){return t>=12784&&t<=12799},"Enclosed CJK Letters and Months":function(t){return t>=12800&&t<=13055},"CJK Compatibility":function(t){return t>=13056&&t<=13311},"CJK Unified Ideographs Extension A":function(t){return t>=13312&&t<=19903},"Yijing Hexagram Symbols":function(t){return t>=19904&&t<=19967},"CJK Unified Ideographs":function(t){return t>=19968&&t<=40959},"Yi Syllables":function(t){return t>=40960&&t<=42127},"Yi Radicals":function(t){return t>=42128&&t<=42191},"Hangul Jamo Extended-A":function(t){return t>=43360&&t<=43391},"Hangul Syllables":function(t){return t>=44032&&t<=55215},"Hangul Jamo Extended-B":function(t){return t>=55216&&t<=55295},"Private Use Area":function(t){return t>=57344&&t<=63743},"CJK Compatibility Ideographs":function(t){return t>=63744&&t<=64255},"Arabic Presentation Forms-A":function(t){return t>=64336&&t<=65023},"Vertical Forms":function(t){return t>=65040&&t<=65055},"CJK Compatibility Forms":function(t){return t>=65072&&t<=65103},"Small Form Variants":function(t){return t>=65104&&t<=65135},"Arabic Presentation Forms-B":function(t){return t>=65136&&t<=65279},"Halfwidth and Fullwidth Forms":function(t){return t>=65280&&t<=65519}};function qi(t){for(var e=0,n=t;e<n.length;e+=1)if(Zi(n[e].charCodeAt(0)))return!0;return!1}function Zi(t){return!(746!==t&&747!==t&&(t<4352||!(Wi["Bopomofo Extended"](t)||Wi.Bopomofo(t)||Wi["CJK Compatibility Forms"](t)&&!(t>=65097&&t<=65103)||Wi["CJK Compatibility Ideographs"](t)||Wi["CJK Compatibility"](t)||Wi["CJK Radicals Supplement"](t)||Wi["CJK Strokes"](t)||!(!Wi["CJK Symbols and Punctuation"](t)||t>=12296&&t<=12305||t>=12308&&t<=12319||12336===t)||Wi["CJK Unified Ideographs Extension A"](t)||Wi["CJK Unified Ideographs"](t)||Wi["Enclosed CJK Letters and Months"](t)||Wi["Hangul Compatibility Jamo"](t)||Wi["Hangul Jamo Extended-A"](t)||Wi["Hangul Jamo Extended-B"](t)||Wi["Hangul Jamo"](t)||Wi["Hangul Syllables"](t)||Wi.Hiragana(t)||Wi["Ideographic Description Characters"](t)||Wi.Kanbun(t)||Wi["Kangxi Radicals"](t)||Wi["Katakana Phonetic Extensions"](t)||Wi.Katakana(t)&&12540!==t||!(!Wi["Halfwidth and Fullwidth Forms"](t)||65288===t||65289===t||65293===t||t>=65306&&t<=65310||65339===t||65341===t||65343===t||t>=65371&&t<=65503||65507===t||t>=65512&&t<=65519)||!(!Wi["Small Form Variants"](t)||t>=65112&&t<=65118||t>=65123&&t<=65126)||Wi["Unified Canadian Aboriginal Syllabics"](t)||Wi["Unified Canadian Aboriginal Syllabics Extended"](t)||Wi["Vertical Forms"](t)||Wi["Yijing Hexagram Symbols"](t)||Wi["Yi Syllables"](t)||Wi["Yi Radicals"](t))))}function Xi(t){return!(Zi(t)||function(t){return!!(Wi["Latin-1 Supplement"](t)&&(167===t||169===t||174===t||177===t||188===t||189===t||190===t||215===t||247===t)||Wi["General Punctuation"](t)&&(8214===t||8224===t||8225===t||8240===t||8241===t||8251===t||8252===t||8258===t||8263===t||8264===t||8265===t||8273===t)||Wi["Letterlike Symbols"](t)||Wi["Number Forms"](t)||Wi["Miscellaneous Technical"](t)&&(t>=8960&&t<=8967||t>=8972&&t<=8991||t>=8996&&t<=9e3||9003===t||t>=9085&&t<=9114||t>=9150&&t<=9165||9167===t||t>=9169&&t<=9179||t>=9186&&t<=9215)||Wi["Control Pictures"](t)&&9251!==t||Wi["Optical Character Recognition"](t)||Wi["Enclosed Alphanumerics"](t)||Wi["Geometric Shapes"](t)||Wi["Miscellaneous Symbols"](t)&&!(t>=9754&&t<=9759)||Wi["Miscellaneous Symbols and Arrows"](t)&&(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243)||Wi["CJK Symbols and Punctuation"](t)||Wi.Katakana(t)||Wi["Private Use Area"](t)||Wi["CJK Compatibility Forms"](t)||Wi["Small Form Variants"](t)||Wi["Halfwidth and Fullwidth Forms"](t)||8734===t||8756===t||8757===t||t>=9984&&t<=10087||t>=10102&&t<=10131||65532===t||65533===t)}(t))}function Ki(t){return t>=1424&&t<=2303||Wi["Arabic Presentation Forms-A"](t)||Wi["Arabic Presentation Forms-B"](t)}function Qi(t,e){return!(!e&&Ki(t)||t>=2304&&t<=3583||t>=3840&&t<=4255||Wi.Khmer(t))}function Ji(t){for(var e=0,n=t;e<n.length;e+=1)if(Ki(n[e].charCodeAt(0)))return!0;return!1}var Yi=null,$i="unavailable",tr=null,er=function(t){t&&"string"==typeof t&&t.indexOf("NetworkError")>-1&&($i="error"),Yi&&Yi(t)};function nr(){ir.fire(new Tt("pluginStateChange",{pluginStatus:$i,pluginURL:tr}))}var ir=new Pt,rr=function(){return $i},or=function(){if("deferred"!==$i||!tr)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");$i="loading",nr(),tr&&vt({url:tr},(function(t){t?er(t):($i="loaded",nr())}))},sr={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return"loaded"===$i||null!=sr.applyArabicShaping},isLoading:function(){return"loading"===$i},setState:function(t){$i=t.pluginStatus,tr=t.pluginURL},isParsed:function(){return null!=sr.applyArabicShaping&&null!=sr.processBidirectionalText&&null!=sr.processStyledBidirectionalText},getPluginURL:function(){return tr}},ar=function(t,e){this.zoom=t,e?(this.now=e.now,this.fadeDuration=e.fadeDuration,this.zoomHistory=e.zoomHistory,this.transition=e.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new Hi,this.transition={})};ar.prototype.isSupportedScript=function(t){return function(t,e){for(var n=0,i=t;n<i.length;n+=1)if(!Qi(i[n].charCodeAt(0),e))return!1;return!0}(t,sr.isLoaded())},ar.prototype.crossFadingFactor=function(){return 0===this.fadeDuration?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)},ar.prototype.getCrossfadeParameters=function(){var t=this.zoom,e=t-Math.floor(t),n=this.crossFadingFactor();return t>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:e+(1-e)*n}:{fromScale:.5,toScale:1,t:1-(1-n)*e}};var lr=function(t,e){this.property=t,this.value=e,this.expression=function(t,e){if(Nn(t))return new Jn(t,e);if(qn(t)){var n=Qn(t,e);if("error"===n.result)throw new Error(n.value.map((function(t){return t.key+": "+t.message})).join(", "));return n.value}var i=t;return"string"==typeof t&&"color"===e.type&&(i=te.parse(t)),{kind:"constant",evaluate:function(){return i}}}(void 0===e?t.specification.default:e,t.specification)};lr.prototype.isDataDriven=function(){return"source"===this.expression.kind||"composite"===this.expression.kind},lr.prototype.possiblyEvaluate=function(t,e,n){return this.property.possiblyEvaluate(this,t,e,n)};var cr=function(t){this.property=t,this.value=new lr(t,void 0)};cr.prototype.transitioned=function(t,e){return new hr(this.property,this.value,e,d({},t.transition,this.transition),t.now)},cr.prototype.untransitioned=function(){return new hr(this.property,this.value,null,{},0)};var ur=function(t){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues)};ur.prototype.getValue=function(t){return b(this._values[t].value.value)},ur.prototype.setValue=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new cr(this._values[t].property)),this._values[t].value=new lr(this._values[t].property,null===e?void 0:b(e))},ur.prototype.getTransition=function(t){return b(this._values[t].transition)},ur.prototype.setTransition=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new cr(this._values[t].property)),this._values[t].transition=b(e)||void 0},ur.prototype.serialize=function(){for(var t={},e=0,n=Object.keys(this._values);e<n.length;e+=1){var i=n[e],r=this.getValue(i);void 0!==r&&(t[i]=r);var o=this.getTransition(i);void 0!==o&&(t[i+"-transition"]=o)}return t},ur.prototype.transitioned=function(t,e){for(var n=new dr(this._properties),i=0,r=Object.keys(this._values);i<r.length;i+=1){var o=r[i];n._values[o]=this._values[o].transitioned(t,e._values[o])}return n},ur.prototype.untransitioned=function(){for(var t=new dr(this._properties),e=0,n=Object.keys(this._values);e<n.length;e+=1){var i=n[e];t._values[i]=this._values[i].untransitioned()}return t};var hr=function(t,e,n,i,r){this.property=t,this.value=e,this.begin=r+i.delay||0,this.end=this.begin+i.duration||0,t.specification.transition&&(i.delay||i.duration)&&(this.prior=n)};hr.prototype.possiblyEvaluate=function(t,e,n){var i=t.now||0,r=this.value.possiblyEvaluate(t,e,n),o=this.prior;if(o){if(i>this.end)return this.prior=null,r;if(this.value.isDataDriven())return this.prior=null,r;if(i<this.begin)return o.possiblyEvaluate(t,e,n);var s=(i-this.begin)/(this.end-this.begin);return this.property.interpolate(o.possiblyEvaluate(t,e,n),r,function(t){if(t<=0)return 0;if(t>=1)return 1;var e=t*t,n=e*t;return 4*(t<.5?n:3*(t-e)+n-.75)}(s))}return r};var dr=function(t){this._properties=t,this._values=Object.create(t.defaultTransitioningPropertyValues)};dr.prototype.possiblyEvaluate=function(t,e,n){for(var i=new Ar(this._properties),r=0,o=Object.keys(this._values);r<o.length;r+=1){var s=o[r];i._values[s]=this._values[s].possiblyEvaluate(t,e,n)}return i},dr.prototype.hasTransition=function(){for(var t=0,e=Object.keys(this._values);t<e.length;t+=1)if(this._values[e[t]].prior)return!0;return!1};var pr=function(t){this._properties=t,this._values=Object.create(t.defaultPropertyValues)};pr.prototype.getValue=function(t){return b(this._values[t].value)},pr.prototype.setValue=function(t,e){this._values[t]=new lr(this._values[t].property,null===e?void 0:b(e))},pr.prototype.serialize=function(){for(var t={},e=0,n=Object.keys(this._values);e<n.length;e+=1){var i=n[e],r=this.getValue(i);void 0!==r&&(t[i]=r)}return t},pr.prototype.possiblyEvaluate=function(t,e,n){for(var i=new Ar(this._properties),r=0,o=Object.keys(this._values);r<o.length;r+=1){var s=o[r];i._values[s]=this._values[s].possiblyEvaluate(t,e,n)}return i};var fr=function(t,e,n){this.property=t,this.value=e,this.parameters=n};fr.prototype.isConstant=function(){return"constant"===this.value.kind},fr.prototype.constantOr=function(t){return"constant"===this.value.kind?this.value.value:t},fr.prototype.evaluate=function(t,e,n,i){return this.property.evaluate(this.value,this.parameters,t,e,n,i)};var Ar=function(t){this._properties=t,this._values=Object.create(t.defaultPossiblyEvaluatedValues)};Ar.prototype.get=function(t){return this._values[t]};var gr=function(t){this.specification=t};gr.prototype.possiblyEvaluate=function(t,e){return t.expression.evaluate(e)},gr.prototype.interpolate=function(t,e,n){var i=We[this.specification.type];return i?i(t,e,n):t};var mr=function(t,e){this.specification=t,this.overrides=e};mr.prototype.possiblyEvaluate=function(t,e,n,i){return new fr(this,"constant"===t.expression.kind||"camera"===t.expression.kind?{kind:"constant",value:t.expression.evaluate(e,null,{},n,i)}:t.expression,e)},mr.prototype.interpolate=function(t,e,n){if("constant"!==t.value.kind||"constant"!==e.value.kind)return t;if(void 0===t.value.value||void 0===e.value.value)return new fr(this,{kind:"constant",value:void 0},t.parameters);var i=We[this.specification.type];return i?new fr(this,{kind:"constant",value:i(t.value.value,e.value.value,n)},t.parameters):t},mr.prototype.evaluate=function(t,e,n,i,r,o){return"constant"===t.kind?t.value:t.evaluate(e,n,i,r,o)};var yr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.possiblyEvaluate=function(t,e,n,i){if(void 0===t.value)return new fr(this,{kind:"constant",value:void 0},e);if("constant"===t.expression.kind){var r=t.expression.evaluate(e,null,{},n,i),o="resolvedImage"===t.property.specification.type&&"string"!=typeof r?r.name:r,s=this._calculate(o,o,o,e);return new fr(this,{kind:"constant",value:s},e)}if("camera"===t.expression.kind){var a=this._calculate(t.expression.evaluate({zoom:e.zoom-1}),t.expression.evaluate({zoom:e.zoom}),t.expression.evaluate({zoom:e.zoom+1}),e);return new fr(this,{kind:"constant",value:a},e)}return new fr(this,t.expression,e)},e.prototype.evaluate=function(t,e,n,i,r,o){if("source"===t.kind){var s=t.evaluate(e,n,i,r,o);return this._calculate(s,s,s,e)}return"composite"===t.kind?this._calculate(t.evaluate({zoom:Math.floor(e.zoom)-1},n,i),t.evaluate({zoom:Math.floor(e.zoom)},n,i),t.evaluate({zoom:Math.floor(e.zoom)+1},n,i),e):t.value},e.prototype._calculate=function(t,e,n,i){return i.zoom>i.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:n,to:e}},e.prototype.interpolate=function(t){return t},e}(mr),_r=function(t){this.specification=t};_r.prototype.possiblyEvaluate=function(t,e,n,i){if(void 0!==t.value){if("constant"===t.expression.kind){var r=t.expression.evaluate(e,null,{},n,i);return this._calculate(r,r,r,e)}return this._calculate(t.expression.evaluate(new ar(Math.floor(e.zoom-1),e)),t.expression.evaluate(new ar(Math.floor(e.zoom),e)),t.expression.evaluate(new ar(Math.floor(e.zoom+1),e)),e)}},_r.prototype._calculate=function(t,e,n,i){return i.zoom>i.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:n,to:e}},_r.prototype.interpolate=function(t){return t};var vr=function(t){this.specification=t};vr.prototype.possiblyEvaluate=function(t,e,n,i){return!!t.expression.evaluate(e,null,{},n,i)},vr.prototype.interpolate=function(){return!1};var br=function(t){for(var e in this.properties=t,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[],t){var n=t[e];n.specification.overridable&&this.overridableProperties.push(e);var i=this.defaultPropertyValues[e]=new lr(n,void 0),r=this.defaultTransitionablePropertyValues[e]=new cr(n);this.defaultTransitioningPropertyValues[e]=r.untransitioned(),this.defaultPossiblyEvaluatedValues[e]=i.possiblyEvaluate({})}};Ni("DataDrivenProperty",mr),Ni("DataConstantProperty",gr),Ni("CrossFadedDataDrivenProperty",yr),Ni("CrossFadedProperty",_r),Ni("ColorRampProperty",vr);var xr=function(t){function e(e,n){if(t.call(this),this.id=e.id,this.type=e.type,this._featureFilter={filter:function(){return!0},needGeometry:!1},"custom"!==e.type&&(this.metadata=e.metadata,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,"background"!==e.type&&(this.source=e.source,this.sourceLayer=e["source-layer"],this.filter=e.filter),n.layout&&(this._unevaluatedLayout=new pr(n.layout)),n.paint)){for(var i in this._transitionablePaint=new ur(n.paint),e.paint)this.setPaintProperty(i,e.paint[i],{validate:!1});for(var r in e.layout)this.setLayoutProperty(r,e.layout[r],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Ar(n.paint)}}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getCrossfadeParameters=function(){return this._crossfadeParameters},e.prototype.getLayoutProperty=function(t){return"visibility"===t?this.visibility:this._unevaluatedLayout.getValue(t)},e.prototype.setLayoutProperty=function(t,e,n){void 0===n&&(n={}),null!=e&&this._validate(Bi,"layers."+this.id+".layout."+t,t,e,n)||("visibility"!==t?this._unevaluatedLayout.setValue(t,e):this.visibility=e)},e.prototype.getPaintProperty=function(t){return y(t,"-transition")?this._transitionablePaint.getTransition(t.slice(0,-11)):this._transitionablePaint.getValue(t)},e.prototype.setPaintProperty=function(t,e,n){if(void 0===n&&(n={}),null!=e&&this._validate(Ii,"layers."+this.id+".paint."+t,t,e,n))return!1;if(y(t,"-transition"))return this._transitionablePaint.setTransition(t.slice(0,-11),e||void 0),!1;var i=this._transitionablePaint._values[t],r="cross-faded-data-driven"===i.property.specification["property-type"],o=i.value.isDataDriven(),s=i.value;this._transitionablePaint.setValue(t,e),this._handleSpecialPaintPropertyUpdate(t);var a=this._transitionablePaint._values[t].value;return a.isDataDriven()||o||r||this._handleOverridablePaintPropertyUpdate(t,s,a)},e.prototype._handleSpecialPaintPropertyUpdate=function(t){},e.prototype._handleOverridablePaintPropertyUpdate=function(t,e,n){return!1},e.prototype.isHidden=function(t){return!!(this.minzoom&&t<this.minzoom)||!!(this.maxzoom&&t>=this.maxzoom)||"none"===this.visibility},e.prototype.updateTransitions=function(t){this._transitioningPaint=this._transitionablePaint.transitioned(t,this._transitioningPaint)},e.prototype.hasTransition=function(){return this._transitioningPaint.hasTransition()},e.prototype.recalculate=function(t,e){t.getCrossfadeParameters&&(this._crossfadeParameters=t.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(t,void 0,e)),this.paint=this._transitioningPaint.possiblyEvaluate(t,void 0,e)},e.prototype.serialize=function(){var t={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(t.layout=t.layout||{},t.layout.visibility=this.visibility),v(t,(function(t,e){return!(void 0===t||"layout"===e&&!Object.keys(t).length||"paint"===e&&!Object.keys(t).length)}))},e.prototype._validate=function(t,e,n,i,r){return void 0===r&&(r={}),(!r||!1!==r.validate)&&Ri(this,t.call(Pi,{key:e,layerType:this.type,objectKey:n,value:i,styleSpec:Mt,style:{glyphs:!0,sprite:!0}}))},e.prototype.is3D=function(){return!1},e.prototype.isTileClipped=function(){return!1},e.prototype.hasOffscreenPass=function(){return!1},e.prototype.resize=function(){},e.prototype.isStateDependent=function(){for(var t in this.paint._values){var e=this.paint.get(t);if(e instanceof fr&&On(e.property.specification)&&("source"===e.value.kind||"composite"===e.value.kind)&&e.value.isStateDependent)return!0}return!1},e}(Pt),wr={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},Er=function(t,e){this._structArray=t,this._pos1=e*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8},Cr=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0)};function Tr(t,e){void 0===e&&(e=1);var n=0,i=0;return{members:t.map((function(t){var r=wr[t.type].BYTES_PER_ELEMENT,o=n=Sr(n,Math.max(e,r)),s=t.components||1;return i=Math.max(i,r),n+=r*s,{name:t.name,type:t.type,components:s,offset:o}})),size:Sr(n,Math.max(i,e)),alignment:e}}function Sr(t,e){return Math.ceil(t/e)*e}Cr.serialize=function(t,e){return t._trim(),e&&(t.isTransferred=!0,e.push(t.arrayBuffer)),{length:t.length,arrayBuffer:t.arrayBuffer}},Cr.deserialize=function(t){var e=Object.create(this.prototype);return e.arrayBuffer=t.arrayBuffer,e.length=t.length,e.capacity=t.arrayBuffer.byteLength/e.bytesPerElement,e._refreshViews(),e},Cr.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},Cr.prototype.clear=function(){this.length=0},Cr.prototype.resize=function(t){this.reserve(t),this.length=t},Cr.prototype.reserve=function(t){if(t>this.capacity){this.capacity=Math.max(t,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var e=this.uint8;this._refreshViews(),e&&this.uint8.set(e)}},Cr.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};var Pr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var n=this.length;return this.resize(n+1),this.emplace(n,t,e)},e.prototype.emplace=function(t,e,n){var i=2*t;return this.int16[i+0]=e,this.int16[i+1]=n,t},e}(Cr);Pr.prototype.bytesPerElement=4,Ni("StructArrayLayout2i4",Pr);var Mr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,n,i){var r=this.length;return this.resize(r+1),this.emplace(r,t,e,n,i)},e.prototype.emplace=function(t,e,n,i,r){var o=4*t;return this.int16[o+0]=e,this.int16[o+1]=n,this.int16[o+2]=i,this.int16[o+3]=r,t},e}(Cr);Mr.prototype.bytesPerElement=8,Ni("StructArrayLayout4i8",Mr);var Ir=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,n,i,r,o){var s=this.length;return this.resize(s+1),this.emplace(s,t,e,n,i,r,o)},e.prototype.emplace=function(t,e,n,i,r,o,s){var a=6*t;return this.int16[a+0]=e,this.int16[a+1]=n,this.int16[a+2]=i,this.int16[a+3]=r,this.int16[a+4]=o,this.int16[a+5]=s,t},e}(Cr);Ir.prototype.bytesPerElement=12,Ni("StructArrayLayout2i4i12",Ir);var Br=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,n,i,r,o){var s=this.length;return this.resize(s+1),this.emplace(s,t,e,n,i,r,o)},e.prototype.emplace=function(t,e,n,i,r,o,s){var a=4*t,l=8*t;return this.int16[a+0]=e,this.int16[a+1]=n,this.uint8[l+4]=i,this.uint8[l+5]=r,this.uint8[l+6]=o,this.uint8[l+7]=s,t},e}(Cr);Br.prototype.bytesPerElement=8,Ni("StructArrayLayout2i4ub8",Br);var Rr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var n=this.length;return this.resize(n+1),this.emplace(n,t,e)},e.prototype.emplace=function(t,e,n){var i=2*t;return this.float32[i+0]=e,this.float32[i+1]=n,t},e}(Cr);Rr.prototype.bytesPerElement=8,Ni("StructArrayLayout2f8",Rr);var Lr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,n,i,r,o,s,a,l,c){var u=this.length;return this.resize(u+1),this.emplace(u,t,e,n,i,r,o,s,a,l,c)},e.prototype.emplace=function(t,e,n,i,r,o,s,a,l,c,u){var h=10*t;return this.uint16[h+0]=e,this.uint16[h+1]=n,this.uint16[h+2]=i,this.uint16[h+3]=r,this.uint16[h+4]=o,this.uint16[h+5]=s,this.uint16[h+6]=a,this.uint16[h+7]=l,this.uint16[h+8]=c,this.uint16[h+9]=u,t},e}(Cr);Lr.prototype.bytesPerElement=20,Ni("StructArrayLayout10ui20",Lr);var Or=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,n,i,r,o,s,a,l,c,u,h){var d=this.length;return this.resize(d+1),this.emplace(d,t,e,n,i,r,o,s,a,l,c,u,h)},e.prototype.emplace=function(t,e,n,i,r,o,s,a,l,c,u,h,d){var p=12*t;return this.int16[p+0]=e,this.int16[p+1]=n,this.int16[p+2]=i,this.int16[p+3]=r,this.uint16[p+4]=o,this.uint16[p+5]=s,this.uint16[p+6]=a,this.uint16[p+7]=l,this.int16[p+8]=c,this.int16[p+9]=u,this.int16[p+10]=h,this.int16[p+11]=d,t},e}(Cr);Or.prototype.bytesPerElement=24,Ni("StructArrayLayout4i4ui4i24",Or);var Dr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,n){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,n)},e.prototype.emplace=function(t,e,n,i){var r=3*t;return this.float32[r+0]=e,this.float32[r+1]=n,this.float32[r+2]=i,t},e}(Cr);Dr.prototype.bytesPerElement=12,Ni("StructArrayLayout3f12",Dr);var kr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){return this.uint32[1*t+0]=e,t},e}(Cr);kr.prototype.bytesPerElement=4,Ni("StructArrayLayout1ul4",kr);var Fr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,n,i,r,o,s,a,l){var c=this.length;return this.resize(c+1),this.emplace(c,t,e,n,i,r,o,s,a,l)},e.prototype.emplace=function(t,e,n,i,r,o,s,a,l,c){var u=10*t,h=5*t;return this.int16[u+0]=e,this.int16[u+1]=n,this.int16[u+2]=i,this.int16[u+3]=r,this.int16[u+4]=o,this.int16[u+5]=s,this.uint32[h+3]=a,this.uint16[u+8]=l,this.uint16[u+9]=c,t},e}(Cr);Fr.prototype.bytesPerElement=20,Ni("StructArrayLayout6i1ul2ui20",Fr);var Nr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,n,i,r,o){var s=this.length;return this.resize(s+1),this.emplace(s,t,e,n,i,r,o)},e.prototype.emplace=function(t,e,n,i,r,o,s){var a=6*t;return this.int16[a+0]=e,this.int16[a+1]=n,this.int16[a+2]=i,this.int16[a+3]=r,this.int16[a+4]=o,this.int16[a+5]=s,t},e}(Cr);Nr.prototype.bytesPerElement=12,Ni("StructArrayLayout2i2i2i12",Nr);var zr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,n,i,r){var o=this.length;return this.resize(o+1),this.emplace(o,t,e,n,i,r)},e.prototype.emplace=function(t,e,n,i,r,o){var s=4*t,a=8*t;return this.float32[s+0]=e,this.float32[s+1]=n,this.float32[s+2]=i,this.int16[a+6]=r,this.int16[a+7]=o,t},e}(Cr);zr.prototype.bytesPerElement=16,Ni("StructArrayLayout2f1f2i16",zr);var Ur=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,n,i){var r=this.length;return this.resize(r+1),this.emplace(r,t,e,n,i)},e.prototype.emplace=function(t,e,n,i,r){var o=12*t,s=3*t;return this.uint8[o+0]=e,this.uint8[o+1]=n,this.float32[s+1]=i,this.float32[s+2]=r,t},e}(Cr);Ur.prototype.bytesPerElement=12,Ni("StructArrayLayout2ub2f12",Ur);var Gr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,n){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,n)},e.prototype.emplace=function(t,e,n,i){var r=3*t;return this.uint16[r+0]=e,this.uint16[r+1]=n,this.uint16[r+2]=i,t},e}(Cr);Gr.prototype.bytesPerElement=6,Ni("StructArrayLayout3ui6",Gr);var Vr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,n,i,r,o,s,a,l,c,u,h,d,p,f,A,g){var m=this.length;return this.resize(m+1),this.emplace(m,t,e,n,i,r,o,s,a,l,c,u,h,d,p,f,A,g)},e.prototype.emplace=function(t,e,n,i,r,o,s,a,l,c,u,h,d,p,f,A,g,m){var y=24*t,_=12*t,v=48*t;return this.int16[y+0]=e,this.int16[y+1]=n,this.uint16[y+2]=i,this.uint16[y+3]=r,this.uint32[_+2]=o,this.uint32[_+3]=s,this.uint32[_+4]=a,this.uint16[y+10]=l,this.uint16[y+11]=c,this.uint16[y+12]=u,this.float32[_+7]=h,this.float32[_+8]=d,this.uint8[v+36]=p,this.uint8[v+37]=f,this.uint8[v+38]=A,this.uint32[_+10]=g,this.int16[y+22]=m,t},e}(Cr);Vr.prototype.bytesPerElement=48,Ni("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",Vr);var jr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,n,i,r,o,s,a,l,c,u,h,d,p,f,A,g,m,y,_,v,b,x,w,E,C,T,S){var P=this.length;return this.resize(P+1),this.emplace(P,t,e,n,i,r,o,s,a,l,c,u,h,d,p,f,A,g,m,y,_,v,b,x,w,E,C,T,S)},e.prototype.emplace=function(t,e,n,i,r,o,s,a,l,c,u,h,d,p,f,A,g,m,y,_,v,b,x,w,E,C,T,S,P){var M=34*t,I=17*t;return this.int16[M+0]=e,this.int16[M+1]=n,this.int16[M+2]=i,this.int16[M+3]=r,this.int16[M+4]=o,this.int16[M+5]=s,this.int16[M+6]=a,this.int16[M+7]=l,this.uint16[M+8]=c,this.uint16[M+9]=u,this.uint16[M+10]=h,this.uint16[M+11]=d,this.uint16[M+12]=p,this.uint16[M+13]=f,this.uint16[M+14]=A,this.uint16[M+15]=g,this.uint16[M+16]=m,this.uint16[M+17]=y,this.uint16[M+18]=_,this.uint16[M+19]=v,this.uint16[M+20]=b,this.uint16[M+21]=x,this.uint16[M+22]=w,this.uint32[I+12]=E,this.float32[I+13]=C,this.float32[I+14]=T,this.float32[I+15]=S,this.float32[I+16]=P,t},e}(Cr);jr.prototype.bytesPerElement=68,Ni("StructArrayLayout8i15ui1ul4f68",jr);var Hr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){return this.float32[1*t+0]=e,t},e}(Cr);Hr.prototype.bytesPerElement=4,Ni("StructArrayLayout1f4",Hr);var Wr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,n){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,n)},e.prototype.emplace=function(t,e,n,i){var r=3*t;return this.int16[r+0]=e,this.int16[r+1]=n,this.int16[r+2]=i,t},e}(Cr);Wr.prototype.bytesPerElement=6,Ni("StructArrayLayout3i6",Wr);var qr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,n){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,n)},e.prototype.emplace=function(t,e,n,i){var r=4*t;return this.uint32[2*t+0]=e,this.uint16[r+2]=n,this.uint16[r+3]=i,t},e}(Cr);qr.prototype.bytesPerElement=8,Ni("StructArrayLayout1ul2ui8",qr);var Zr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var n=this.length;return this.resize(n+1),this.emplace(n,t,e)},e.prototype.emplace=function(t,e,n){var i=2*t;return this.uint16[i+0]=e,this.uint16[i+1]=n,t},e}(Cr);Zr.prototype.bytesPerElement=4,Ni("StructArrayLayout2ui4",Zr);var Xr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){return this.uint16[1*t+0]=e,t},e}(Cr);Xr.prototype.bytesPerElement=2,Ni("StructArrayLayout1ui2",Xr);var Kr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,n,i){var r=this.length;return this.resize(r+1),this.emplace(r,t,e,n,i)},e.prototype.emplace=function(t,e,n,i,r){var o=4*t;return this.float32[o+0]=e,this.float32[o+1]=n,this.float32[o+2]=i,this.float32[o+3]=r,t},e}(Cr);Kr.prototype.bytesPerElement=16,Ni("StructArrayLayout4f16",Kr);var Qr=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={anchorPointX:{configurable:!0},anchorPointY:{configurable:!0},x1:{configurable:!0},y1:{configurable:!0},x2:{configurable:!0},y2:{configurable:!0},featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0},anchorPoint:{configurable:!0}};return n.anchorPointX.get=function(){return this._structArray.int16[this._pos2+0]},n.anchorPointY.get=function(){return this._structArray.int16[this._pos2+1]},n.x1.get=function(){return this._structArray.int16[this._pos2+2]},n.y1.get=function(){return this._structArray.int16[this._pos2+3]},n.x2.get=function(){return this._structArray.int16[this._pos2+4]},n.y2.get=function(){return this._structArray.int16[this._pos2+5]},n.featureIndex.get=function(){return this._structArray.uint32[this._pos4+3]},n.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+8]},n.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+9]},n.anchorPoint.get=function(){return new r(this.anchorPointX,this.anchorPointY)},Object.defineProperties(e.prototype,n),e}(Er);Qr.prototype.size=20;var Jr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.get=function(t){return new Qr(this,t)},e}(Fr);Ni("CollisionBoxArray",Jr);var Yr=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={anchorX:{configurable:!0},anchorY:{configurable:!0},glyphStartIndex:{configurable:!0},numGlyphs:{configurable:!0},vertexStartIndex:{configurable:!0},lineStartIndex:{configurable:!0},lineLength:{configurable:!0},segment:{configurable:!0},lowerSize:{configurable:!0},upperSize:{configurable:!0},lineOffsetX:{configurable:!0},lineOffsetY:{configurable:!0},writingMode:{configurable:!0},placedOrientation:{configurable:!0},hidden:{configurable:!0},crossTileID:{configurable:!0},associatedIconIndex:{configurable:!0}};return n.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},n.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},n.glyphStartIndex.get=function(){return this._structArray.uint16[this._pos2+2]},n.numGlyphs.get=function(){return this._structArray.uint16[this._pos2+3]},n.vertexStartIndex.get=function(){return this._structArray.uint32[this._pos4+2]},n.lineStartIndex.get=function(){return this._structArray.uint32[this._pos4+3]},n.lineLength.get=function(){return this._structArray.uint32[this._pos4+4]},n.segment.get=function(){return this._structArray.uint16[this._pos2+10]},n.lowerSize.get=function(){return this._structArray.uint16[this._pos2+11]},n.upperSize.get=function(){return this._structArray.uint16[this._pos2+12]},n.lineOffsetX.get=function(){return this._structArray.float32[this._pos4+7]},n.lineOffsetY.get=function(){return this._structArray.float32[this._pos4+8]},n.writingMode.get=function(){return this._structArray.uint8[this._pos1+36]},n.placedOrientation.get=function(){return this._structArray.uint8[this._pos1+37]},n.placedOrientation.set=function(t){this._structArray.uint8[this._pos1+37]=t},n.hidden.get=function(){return this._structArray.uint8[this._pos1+38]},n.hidden.set=function(t){this._structArray.uint8[this._pos1+38]=t},n.crossTileID.get=function(){return this._structArray.uint32[this._pos4+10]},n.crossTileID.set=function(t){this._structArray.uint32[this._pos4+10]=t},n.associatedIconIndex.get=function(){return this._structArray.int16[this._pos2+22]},Object.defineProperties(e.prototype,n),e}(Er);Yr.prototype.size=48;var $r=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.get=function(t){return new Yr(this,t)},e}(Vr);Ni("PlacedSymbolArray",$r);var to=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={anchorX:{configurable:!0},anchorY:{configurable:!0},rightJustifiedTextSymbolIndex:{configurable:!0},centerJustifiedTextSymbolIndex:{configurable:!0},leftJustifiedTextSymbolIndex:{configurable:!0},verticalPlacedTextSymbolIndex:{configurable:!0},placedIconSymbolIndex:{configurable:!0},verticalPlacedIconSymbolIndex:{configurable:!0},key:{configurable:!0},textBoxStartIndex:{configurable:!0},textBoxEndIndex:{configurable:!0},verticalTextBoxStartIndex:{configurable:!0},verticalTextBoxEndIndex:{configurable:!0},iconBoxStartIndex:{configurable:!0},iconBoxEndIndex:{configurable:!0},verticalIconBoxStartIndex:{configurable:!0},verticalIconBoxEndIndex:{configurable:!0},featureIndex:{configurable:!0},numHorizontalGlyphVertices:{configurable:!0},numVerticalGlyphVertices:{configurable:!0},numIconVertices:{configurable:!0},numVerticalIconVertices:{configurable:!0},useRuntimeCollisionCircles:{configurable:!0},crossTileID:{configurable:!0},textBoxScale:{configurable:!0},textOffset0:{configurable:!0},textOffset1:{configurable:!0},collisionCircleDiameter:{configurable:!0}};return n.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},n.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},n.rightJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+2]},n.centerJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+3]},n.leftJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+4]},n.verticalPlacedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+5]},n.placedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+6]},n.verticalPlacedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+7]},n.key.get=function(){return this._structArray.uint16[this._pos2+8]},n.textBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+9]},n.textBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+10]},n.verticalTextBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+11]},n.verticalTextBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+12]},n.iconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+13]},n.iconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+14]},n.verticalIconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+15]},n.verticalIconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+16]},n.featureIndex.get=function(){return this._structArray.uint16[this._pos2+17]},n.numHorizontalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+18]},n.numVerticalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+19]},n.numIconVertices.get=function(){return this._structArray.uint16[this._pos2+20]},n.numVerticalIconVertices.get=function(){return this._structArray.uint16[this._pos2+21]},n.useRuntimeCollisionCircles.get=function(){return this._structArray.uint16[this._pos2+22]},n.crossTileID.get=function(){return this._structArray.uint32[this._pos4+12]},n.crossTileID.set=function(t){this._structArray.uint32[this._pos4+12]=t},n.textBoxScale.get=function(){return this._structArray.float32[this._pos4+13]},n.textOffset0.get=function(){return this._structArray.float32[this._pos4+14]},n.textOffset1.get=function(){return this._structArray.float32[this._pos4+15]},n.collisionCircleDiameter.get=function(){return this._structArray.float32[this._pos4+16]},Object.defineProperties(e.prototype,n),e}(Er);to.prototype.size=68;var eo=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.get=function(t){return new to(this,t)},e}(jr);Ni("SymbolInstanceArray",eo);var no=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getoffsetX=function(t){return this.float32[1*t+0]},e}(Hr);Ni("GlyphOffsetArray",no);var io=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getx=function(t){return this.int16[3*t+0]},e.prototype.gety=function(t){return this.int16[3*t+1]},e.prototype.gettileUnitDistanceFromAnchor=function(t){return this.int16[3*t+2]},e}(Wr);Ni("SymbolLineVertexArray",io);var ro=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0}};return n.featureIndex.get=function(){return this._structArray.uint32[this._pos4+0]},n.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+2]},n.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+3]},Object.defineProperties(e.prototype,n),e}(Er);ro.prototype.size=8;var oo=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.get=function(t){return new ro(this,t)},e}(qr);Ni("FeatureIndexArray",oo);var so=Tr([{name:"a_pos",components:2,type:"Int16"}],4).members,ao=function(t){void 0===t&&(t=[]),this.segments=t};function lo(t,e){return 256*(t=u(Math.floor(t),0,255))+u(Math.floor(e),0,255)}ao.prototype.prepareSegment=function(t,e,n,i){var r=this.segments[this.segments.length-1];return t>ao.MAX_VERTEX_ARRAY_LENGTH&&w("Max vertices per segment is "+ao.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+t),(!r||r.vertexLength+t>ao.MAX_VERTEX_ARRAY_LENGTH||r.sortKey!==i)&&(r={vertexOffset:e.length,primitiveOffset:n.length,vertexLength:0,primitiveLength:0},void 0!==i&&(r.sortKey=i),this.segments.push(r)),r},ao.prototype.get=function(){return this.segments},ao.prototype.destroy=function(){for(var t=0,e=this.segments;t<e.length;t+=1){var n=e[t];for(var i in n.vaos)n.vaos[i].destroy()}},ao.simpleSegment=function(t,e,n,i){return new ao([{vertexOffset:t,primitiveOffset:e,vertexLength:n,primitiveLength:i,vaos:{},sortKey:0}])},ao.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,Ni("SegmentVector",ao);var co=Tr([{name:"a_pattern_from",components:4,type:"Uint16"},{name:"a_pattern_to",components:4,type:"Uint16"},{name:"a_pixel_ratio_from",components:1,type:"Uint16"},{name:"a_pixel_ratio_to",components:1,type:"Uint16"}]),uo=e((function(t){t.exports=function(t,e){var n,i,r,o,s,a,l,c;for(i=t.length-(n=3&t.length),r=e,s=3432918353,a=461845907,c=0;c<i;)l=255&t.charCodeAt(c)|(255&t.charCodeAt(++c))<<8|(255&t.charCodeAt(++c))<<16|(255&t.charCodeAt(++c))<<24,++c,r=27492+(65535&(o=5*(65535&(r=(r^=l=(65535&(l=(l=(65535&l)*s+(((l>>>16)*s&65535)<<16)&4294967295)<<15|l>>>17))*a+(((l>>>16)*a&65535)<<16)&4294967295)<<13|r>>>19))+((5*(r>>>16)&65535)<<16)&4294967295))+((58964+(o>>>16)&65535)<<16);switch(l=0,n){case 3:l^=(255&t.charCodeAt(c+2))<<16;case 2:l^=(255&t.charCodeAt(c+1))<<8;case 1:r^=l=(65535&(l=(l=(65535&(l^=255&t.charCodeAt(c)))*s+(((l>>>16)*s&65535)<<16)&4294967295)<<15|l>>>17))*a+(((l>>>16)*a&65535)<<16)&4294967295}return r^=t.length,r=2246822507*(65535&(r^=r>>>16))+((2246822507*(r>>>16)&65535)<<16)&4294967295,r=3266489909*(65535&(r^=r>>>13))+((3266489909*(r>>>16)&65535)<<16)&4294967295,(r^=r>>>16)>>>0}})),ho=e((function(t){t.exports=function(t,e){for(var n,i=t.length,r=e^i,o=0;i>=4;)n=1540483477*(65535&(n=255&t.charCodeAt(o)|(255&t.charCodeAt(++o))<<8|(255&t.charCodeAt(++o))<<16|(255&t.charCodeAt(++o))<<24))+((1540483477*(n>>>16)&65535)<<16),r=1540483477*(65535&r)+((1540483477*(r>>>16)&65535)<<16)^(n=1540483477*(65535&(n^=n>>>24))+((1540483477*(n>>>16)&65535)<<16)),i-=4,++o;switch(i){case 3:r^=(255&t.charCodeAt(o+2))<<16;case 2:r^=(255&t.charCodeAt(o+1))<<8;case 1:r=1540483477*(65535&(r^=255&t.charCodeAt(o)))+((1540483477*(r>>>16)&65535)<<16)}return r=1540483477*(65535&(r^=r>>>13))+((1540483477*(r>>>16)&65535)<<16),(r^=r>>>15)>>>0}})),po=uo,fo=ho;po.murmur3=uo,po.murmur2=fo;var Ao=function(){this.ids=[],this.positions=[],this.indexed=!1};Ao.prototype.add=function(t,e,n,i){this.ids.push(mo(t)),this.positions.push(e,n,i)},Ao.prototype.getPositions=function(t){for(var e=mo(t),n=0,i=this.ids.length-1;n<i;){var r=n+i>>1;this.ids[r]>=e?i=r:n=r+1}for(var o=[];this.ids[n]===e;)o.push({index:this.positions[3*n],start:this.positions[3*n+1],end:this.positions[3*n+2]}),n++;return o},Ao.serialize=function(t,e){var n=new Float64Array(t.ids),i=new Uint32Array(t.positions);return function t(e,n,i,r){for(;i<r;){for(var o=e[i+r>>1],s=i-1,a=r+1;;){do{s++}while(e[s]<o);do{a--}while(e[a]>o);if(s>=a)break;yo(e,s,a),yo(n,3*s,3*a),yo(n,3*s+1,3*a+1),yo(n,3*s+2,3*a+2)}a-i<r-a?(t(e,n,i,a),i=a+1):(t(e,n,a+1,r),r=a)}}(n,i,0,n.length-1),e&&e.push(n.buffer,i.buffer),{ids:n,positions:i}},Ao.deserialize=function(t){var e=new Ao;return e.ids=t.ids,e.positions=t.positions,e.indexed=!0,e};var go=Math.pow(2,53)-1;function mo(t){var e=+t;return!isNaN(e)&&e<=go?e:po(String(t))}function yo(t,e,n){var i=t[e];t[e]=t[n],t[n]=i}Ni("FeaturePositionMap",Ao);var _o=function(t,e){this.gl=t.gl,this.location=e},vo=function(t){function e(e,n){t.call(this,e,n),this.current=0}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.set=function(t){this.current!==t&&(this.current=t,this.gl.uniform1i(this.location,t))},e}(_o),bo=function(t){function e(e,n){t.call(this,e,n),this.current=0}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.set=function(t){this.current!==t&&(this.current=t,this.gl.uniform1f(this.location,t))},e}(_o),xo=function(t){function e(e,n){t.call(this,e,n),this.current=[0,0]}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.set=function(t){t[0]===this.current[0]&&t[1]===this.current[1]||(this.current=t,this.gl.uniform2f(this.location,t[0],t[1]))},e}(_o),wo=function(t){function e(e,n){t.call(this,e,n),this.current=[0,0,0]}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.set=function(t){t[0]===this.current[0]&&t[1]===this.current[1]&&t[2]===this.current[2]||(this.current=t,this.gl.uniform3f(this.location,t[0],t[1],t[2]))},e}(_o),Eo=function(t){function e(e,n){t.call(this,e,n),this.current=[0,0,0,0]}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.set=function(t){t[0]===this.current[0]&&t[1]===this.current[1]&&t[2]===this.current[2]&&t[3]===this.current[3]||(this.current=t,this.gl.uniform4f(this.location,t[0],t[1],t[2],t[3]))},e}(_o),Co=function(t){function e(e,n){t.call(this,e,n),this.current=te.transparent}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.set=function(t){t.r===this.current.r&&t.g===this.current.g&&t.b===this.current.b&&t.a===this.current.a||(this.current=t,this.gl.uniform4f(this.location,t.r,t.g,t.b,t.a))},e}(_o),To=new Float32Array(16),So=function(t){function e(e,n){t.call(this,e,n),this.current=To}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.set=function(t){if(t[12]!==this.current[12]||t[0]!==this.current[0])return this.current=t,void this.gl.uniformMatrix4fv(this.location,!1,t);for(var e=1;e<16;e++)if(t[e]!==this.current[e]){this.current=t,this.gl.uniformMatrix4fv(this.location,!1,t);break}},e}(_o);function Po(t){return[lo(255*t.r,255*t.g),lo(255*t.b,255*t.a)]}var Mo=function(t,e,n){this.value=t,this.uniformNames=e.map((function(t){return"u_"+t})),this.type=n};Mo.prototype.setUniform=function(t,e,n){t.set(n.constantOr(this.value))},Mo.prototype.getBinding=function(t,e,n){return"color"===this.type?new Co(t,e):new bo(t,e)};var Io=function(t,e){this.uniformNames=e.map((function(t){return"u_"+t})),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1};Io.prototype.setConstantPatternPositions=function(t,e){this.pixelRatioFrom=e.pixelRatio,this.pixelRatioTo=t.pixelRatio,this.patternFrom=e.tlbr,this.patternTo=t.tlbr},Io.prototype.setUniform=function(t,e,n,i){var r="u_pattern_to"===i?this.patternTo:"u_pattern_from"===i?this.patternFrom:"u_pixel_ratio_to"===i?this.pixelRatioTo:"u_pixel_ratio_from"===i?this.pixelRatioFrom:null;r&&t.set(r)},Io.prototype.getBinding=function(t,e,n){return"u_pattern"===n.substr(0,9)?new Eo(t,e):new bo(t,e)};var Bo=function(t,e,n,i){this.expression=t,this.type=n,this.maxValue=0,this.paintVertexAttributes=e.map((function(t){return{name:"a_"+t,type:"Float32",components:"color"===n?2:1,offset:0}})),this.paintVertexArray=new i};Bo.prototype.populatePaintArray=function(t,e,n,i,r){var o=this.paintVertexArray.length,s=this.expression.evaluate(new ar(0),e,{},i,[],r);this.paintVertexArray.resize(t),this._setPaintValue(o,t,s)},Bo.prototype.updatePaintArray=function(t,e,n,i){var r=this.expression.evaluate({zoom:0},n,i);this._setPaintValue(t,e,r)},Bo.prototype._setPaintValue=function(t,e,n){if("color"===this.type)for(var i=Po(n),r=t;r<e;r++)this.paintVertexArray.emplace(r,i[0],i[1]);else{for(var o=t;o<e;o++)this.paintVertexArray.emplace(o,n);this.maxValue=Math.max(this.maxValue,Math.abs(n))}},Bo.prototype.upload=function(t){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))},Bo.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()};var Ro=function(t,e,n,i,r,o){this.expression=t,this.uniformNames=e.map((function(t){return"u_"+t+"_t"})),this.type=n,this.useIntegerZoom=i,this.zoom=r,this.maxValue=0,this.paintVertexAttributes=e.map((function(t){return{name:"a_"+t,type:"Float32",components:"color"===n?4:2,offset:0}})),this.paintVertexArray=new o};Ro.prototype.populatePaintArray=function(t,e,n,i,r){var o=this.expression.evaluate(new ar(this.zoom),e,{},i,[],r),s=this.expression.evaluate(new ar(this.zoom+1),e,{},i,[],r),a=this.paintVertexArray.length;this.paintVertexArray.resize(t),this._setPaintValue(a,t,o,s)},Ro.prototype.updatePaintArray=function(t,e,n,i){var r=this.expression.evaluate({zoom:this.zoom},n,i),o=this.expression.evaluate({zoom:this.zoom+1},n,i);this._setPaintValue(t,e,r,o)},Ro.prototype._setPaintValue=function(t,e,n,i){if("color"===this.type)for(var r=Po(n),o=Po(i),s=t;s<e;s++)this.paintVertexArray.emplace(s,r[0],r[1],o[0],o[1]);else{for(var a=t;a<e;a++)this.paintVertexArray.emplace(a,n,i);this.maxValue=Math.max(this.maxValue,Math.abs(n),Math.abs(i))}},Ro.prototype.upload=function(t){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))},Ro.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()},Ro.prototype.setUniform=function(t,e){var n=this.useIntegerZoom?Math.floor(e.zoom):e.zoom,i=u(this.expression.interpolationFactor(n,this.zoom,this.zoom+1),0,1);t.set(i)},Ro.prototype.getBinding=function(t,e,n){return new bo(t,e)};var Lo=function(t,e,n,i,r,o){this.expression=t,this.type=e,this.useIntegerZoom=n,this.zoom=i,this.layerId=o,this.zoomInPaintVertexArray=new r,this.zoomOutPaintVertexArray=new r};Lo.prototype.populatePaintArray=function(t,e,n){var i=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(t),this.zoomOutPaintVertexArray.resize(t),this._setPaintValues(i,t,e.patterns&&e.patterns[this.layerId],n)},Lo.prototype.updatePaintArray=function(t,e,n,i,r){this._setPaintValues(t,e,n.patterns&&n.patterns[this.layerId],r)},Lo.prototype._setPaintValues=function(t,e,n,i){if(i&&n){var r=i[n.min],o=i[n.mid],s=i[n.max];if(r&&o&&s)for(var a=t;a<e;a++)this.zoomInPaintVertexArray.emplace(a,o.tl[0],o.tl[1],o.br[0],o.br[1],r.tl[0],r.tl[1],r.br[0],r.br[1],o.pixelRatio,r.pixelRatio),this.zoomOutPaintVertexArray.emplace(a,o.tl[0],o.tl[1],o.br[0],o.br[1],s.tl[0],s.tl[1],s.br[0],s.br[1],o.pixelRatio,s.pixelRatio)}},Lo.prototype.upload=function(t){this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer&&(this.zoomInPaintVertexBuffer=t.createVertexBuffer(this.zoomInPaintVertexArray,co.members,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=t.createVertexBuffer(this.zoomOutPaintVertexArray,co.members,this.expression.isStateDependent))},Lo.prototype.destroy=function(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()};var Oo=function(t,e,n){this.binders={},this._buffers=[];var i=[];for(var r in t.paint._values)if(n(r)){var o=t.paint.get(r);if(o instanceof fr&&On(o.property.specification)){var s=ko(r,t.type),a=o.value,l=o.property.specification.type,c=o.property.useIntegerZoom,u=o.property.specification["property-type"],h="cross-faded"===u||"cross-faded-data-driven"===u;if("constant"===a.kind)this.binders[r]=h?new Io(a.value,s):new Mo(a.value,s,l),i.push("/u_"+r);else if("source"===a.kind||h){var d=Fo(r,l,"source");this.binders[r]=h?new Lo(a,l,c,e,d,t.id):new Bo(a,s,l,d),i.push("/a_"+r)}else{var p=Fo(r,l,"composite");this.binders[r]=new Ro(a,s,l,c,e,p),i.push("/z_"+r)}}}this.cacheKey=i.sort().join("")};Oo.prototype.getMaxValue=function(t){var e=this.binders[t];return e instanceof Bo||e instanceof Ro?e.maxValue:0},Oo.prototype.populatePaintArrays=function(t,e,n,i,r){for(var o in this.binders){var s=this.binders[o];(s instanceof Bo||s instanceof Ro||s instanceof Lo)&&s.populatePaintArray(t,e,n,i,r)}},Oo.prototype.setConstantPatternPositions=function(t,e){for(var n in this.binders){var i=this.binders[n];i instanceof Io&&i.setConstantPatternPositions(t,e)}},Oo.prototype.updatePaintArrays=function(t,e,n,i,r){var o=!1;for(var s in t)for(var a=0,l=e.getPositions(s);a<l.length;a+=1){var c=l[a],u=n.feature(c.index);for(var h in this.binders){var d=this.binders[h];if((d instanceof Bo||d instanceof Ro||d instanceof Lo)&&!0===d.expression.isStateDependent){var p=i.paint.get(h);d.expression=p.value,d.updatePaintArray(c.start,c.end,u,t[s],r),o=!0}}}return o},Oo.prototype.defines=function(){var t=[];for(var e in this.binders){var n=this.binders[e];(n instanceof Mo||n instanceof Io)&&t.push.apply(t,n.uniformNames.map((function(t){return"#define HAS_UNIFORM_"+t})))}return t},Oo.prototype.getBinderAttributes=function(){var t=[];for(var e in this.binders){var n=this.binders[e];if(n instanceof Bo||n instanceof Ro)for(var i=0;i<n.paintVertexAttributes.length;i++)t.push(n.paintVertexAttributes[i].name);else if(n instanceof Lo)for(var r=0;r<co.members.length;r++)t.push(co.members[r].name)}return t},Oo.prototype.getBinderUniforms=function(){var t=[];for(var e in this.binders){var n=this.binders[e];if(n instanceof Mo||n instanceof Io||n instanceof Ro)for(var i=0,r=n.uniformNames;i<r.length;i+=1)t.push(r[i])}return t},Oo.prototype.getPaintVertexBuffers=function(){return this._buffers},Oo.prototype.getUniforms=function(t,e){var n=[];for(var i in this.binders){var r=this.binders[i];if(r instanceof Mo||r instanceof Io||r instanceof Ro)for(var o=0,s=r.uniformNames;o<s.length;o+=1){var a=s[o];if(e[a]){var l=r.getBinding(t,e[a],a);n.push({name:a,property:i,binding:l})}}}return n},Oo.prototype.setUniforms=function(t,e,n,i){for(var r=0,o=e;r<o.length;r+=1){var s=o[r],a=s.name,l=s.property;this.binders[l].setUniform(s.binding,i,n.get(l),a)}},Oo.prototype.updatePaintBuffers=function(t){for(var e in this._buffers=[],this.binders){var n=this.binders[e];if(t&&n instanceof Lo){var i=2===t.fromScale?n.zoomInPaintVertexBuffer:n.zoomOutPaintVertexBuffer;i&&this._buffers.push(i)}else(n instanceof Bo||n instanceof Ro)&&n.paintVertexBuffer&&this._buffers.push(n.paintVertexBuffer)}},Oo.prototype.upload=function(t){for(var e in this.binders){var n=this.binders[e];(n instanceof Bo||n instanceof Ro||n instanceof Lo)&&n.upload(t)}this.updatePaintBuffers()},Oo.prototype.destroy=function(){for(var t in this.binders){var e=this.binders[t];(e instanceof Bo||e instanceof Ro||e instanceof Lo)&&e.destroy()}};var Do=function(t,e,n){void 0===n&&(n=function(){return!0}),this.programConfigurations={};for(var i=0,r=t;i<r.length;i+=1){var o=r[i];this.programConfigurations[o.id]=new Oo(o,e,n)}this.needsUpload=!1,this._featureMap=new Ao,this._bufferOffset=0};function ko(t,e){return{"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-extrusion-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"]}[t]||[t.replace(e+"-","").replace(/-/g,"_")]}function Fo(t,e,n){var i={color:{source:Rr,composite:Kr},number:{source:Hr,composite:Rr}},r=function(t){return{"line-pattern":{source:Lr,composite:Lr},"fill-pattern":{source:Lr,composite:Lr},"fill-extrusion-pattern":{source:Lr,composite:Lr}}[t]}(t);return r&&r[n]||i[e][n]}Do.prototype.populatePaintArrays=function(t,e,n,i,r,o){for(var s in this.programConfigurations)this.programConfigurations[s].populatePaintArrays(t,e,i,r,o);void 0!==e.id&&this._featureMap.add(e.id,n,this._bufferOffset,t),this._bufferOffset=t,this.needsUpload=!0},Do.prototype.updatePaintArrays=function(t,e,n,i){for(var r=0,o=n;r<o.length;r+=1){var s=o[r];this.needsUpload=this.programConfigurations[s.id].updatePaintArrays(t,this._featureMap,e,s,i)||this.needsUpload}},Do.prototype.get=function(t){return this.programConfigurations[t]},Do.prototype.upload=function(t){if(this.needsUpload){for(var e in this.programConfigurations)this.programConfigurations[e].upload(t);this.needsUpload=!1}},Do.prototype.destroy=function(){for(var t in this.programConfigurations)this.programConfigurations[t].destroy()},Ni("ConstantBinder",Mo),Ni("CrossFadedConstantBinder",Io),Ni("SourceExpressionBinder",Bo),Ni("CrossFadedCompositeBinder",Lo),Ni("CompositeExpressionBinder",Ro),Ni("ProgramConfiguration",Oo,{omit:["_buffers"]}),Ni("ProgramConfigurationSet",Do);var No=Math.pow(2,14)-1,zo=-No-1;function Uo(t){for(var e=8192/t.extent,n=t.loadGeometry(),i=0;i<n.length;i++)for(var r=n[i],o=0;o<r.length;o++){var s=r[o],a=Math.round(s.x*e),l=Math.round(s.y*e);s.x=u(a,zo,No),s.y=u(l,zo,No),(a<s.x||a>s.x+1||l<s.y||l>s.y+1)&&w("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return n}function Go(t,e){return{type:t.type,id:t.id,properties:t.properties,geometry:e?Uo(t):[]}}function Vo(t,e,n,i,r){t.emplaceBack(2*e+(i+1)/2,2*n+(r+1)/2)}var jo=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new Pr,this.indexArray=new Gr,this.segments=new ao,this.programConfigurations=new Do(t.layers,t.zoom),this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};function Ho(t,e){for(var n=0;n<t.length;n++)if($o(e,t[n]))return!0;for(var i=0;i<e.length;i++)if($o(t,e[i]))return!0;return!!Xo(t,e)}function Wo(t,e,n){return!!$o(t,e)||!!Qo(e,t,n)}function qo(t,e){if(1===t.length)return Yo(e,t[0]);for(var n=0;n<e.length;n++)for(var i=e[n],r=0;r<i.length;r++)if($o(t,i[r]))return!0;for(var o=0;o<t.length;o++)if(Yo(e,t[o]))return!0;for(var s=0;s<e.length;s++)if(Xo(t,e[s]))return!0;return!1}function Zo(t,e,n){if(t.length>1){if(Xo(t,e))return!0;for(var i=0;i<e.length;i++)if(Qo(e[i],t,n))return!0}for(var r=0;r<t.length;r++)if(Qo(t[r],e,n))return!0;return!1}function Xo(t,e){if(0===t.length||0===e.length)return!1;for(var n=0;n<t.length-1;n++)for(var i=t[n],r=t[n+1],o=0;o<e.length-1;o++)if(Ko(i,r,e[o],e[o+1]))return!0;return!1}function Ko(t,e,n,i){return E(t,n,i)!==E(e,n,i)&&E(t,e,n)!==E(t,e,i)}function Qo(t,e,n){var i=n*n;if(1===e.length)return t.distSqr(e[0])<i;for(var r=1;r<e.length;r++)if(Jo(t,e[r-1],e[r])<i)return!0;return!1}function Jo(t,e,n){var i=e.distSqr(n);if(0===i)return t.distSqr(e);var r=((t.x-e.x)*(n.x-e.x)+(t.y-e.y)*(n.y-e.y))/i;return t.distSqr(r<0?e:r>1?n:n.sub(e)._mult(r)._add(e))}function Yo(t,e){for(var n,i,r,o=!1,s=0;s<t.length;s++)for(var a=0,l=(n=t[s]).length-1;a<n.length;l=a++)(i=n[a]).y>e.y!=(r=n[l]).y>e.y&&e.x<(r.x-i.x)*(e.y-i.y)/(r.y-i.y)+i.x&&(o=!o);return o}function $o(t,e){for(var n=!1,i=0,r=t.length-1;i<t.length;r=i++){var o=t[i],s=t[r];o.y>e.y!=s.y>e.y&&e.x<(s.x-o.x)*(e.y-o.y)/(s.y-o.y)+o.x&&(n=!n)}return n}function ts(t,e,n){var i=n[0],r=n[2];if(t.x<i.x&&e.x<i.x||t.x>r.x&&e.x>r.x||t.y<i.y&&e.y<i.y||t.y>r.y&&e.y>r.y)return!1;var o=E(t,e,n[0]);return o!==E(t,e,n[1])||o!==E(t,e,n[2])||o!==E(t,e,n[3])}function es(t,e,n){var i=e.paint.get(t).value;return"constant"===i.kind?i.value:n.programConfigurations.get(e.id).getMaxValue(t)}function ns(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function is(t,e,n,i,o){if(!e[0]&&!e[1])return t;var s=r.convert(e)._mult(o);"viewport"===n&&s._rotate(-i);for(var a=[],l=0;l<t.length;l++)a.push(t[l].sub(s));return a}jo.prototype.populate=function(t,e,n){var i=this.layers[0],r=[],o=null;"circle"===i.type&&(o=i.layout.get("circle-sort-key"));for(var s=0,a=t;s<a.length;s+=1){var l=a[s],c=l.feature,u=l.id,h=l.index,d=l.sourceLayerIndex,p=this.layers[0]._featureFilter.needGeometry,f=Go(c,p);if(this.layers[0]._featureFilter.filter(new ar(this.zoom),f,n)){var A=o?o.evaluate(f,{},n):void 0,g={id:u,properties:c.properties,type:c.type,sourceLayerIndex:d,index:h,geometry:p?f.geometry:Uo(c),patterns:{},sortKey:A};r.push(g)}}o&&r.sort((function(t,e){return t.sortKey-e.sortKey}));for(var m=0,y=r;m<y.length;m+=1){var _=y[m],v=_.geometry,b=_.index,x=_.sourceLayerIndex,w=t[b].feature;this.addFeature(_,v,b,n),e.featureIndex.insert(w,v,b,x,this.index)}},jo.prototype.update=function(t,e,n){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,n)},jo.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},jo.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},jo.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,so),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0},jo.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},jo.prototype.addFeature=function(t,e,n,i){for(var r=0,o=e;r<o.length;r+=1)for(var s=0,a=o[r];s<a.length;s+=1){var l=a[s],c=l.x,u=l.y;if(!(c<0||c>=8192||u<0||u>=8192)){var h=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,t.sortKey),d=h.vertexLength;Vo(this.layoutVertexArray,c,u,-1,-1),Vo(this.layoutVertexArray,c,u,1,-1),Vo(this.layoutVertexArray,c,u,1,1),Vo(this.layoutVertexArray,c,u,-1,1),this.indexArray.emplaceBack(d,d+1,d+2),this.indexArray.emplaceBack(d,d+3,d+2),h.vertexLength+=4,h.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,n,{},i)},Ni("CircleBucket",jo,{omit:["layers"]});var rs=new br({"circle-sort-key":new mr(Mt.layout_circle["circle-sort-key"])}),os={paint:new br({"circle-radius":new mr(Mt.paint_circle["circle-radius"]),"circle-color":new mr(Mt.paint_circle["circle-color"]),"circle-blur":new mr(Mt.paint_circle["circle-blur"]),"circle-opacity":new mr(Mt.paint_circle["circle-opacity"]),"circle-translate":new gr(Mt.paint_circle["circle-translate"]),"circle-translate-anchor":new gr(Mt.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new gr(Mt.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new gr(Mt.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new mr(Mt.paint_circle["circle-stroke-width"]),"circle-stroke-color":new mr(Mt.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new mr(Mt.paint_circle["circle-stroke-opacity"])}),layout:rs},ss="undefined"!=typeof Float32Array?Float32Array:Array;function as(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function ls(t,e,n){var i=e[0],r=e[1],o=e[2],s=e[3],a=e[4],l=e[5],c=e[6],u=e[7],h=e[8],d=e[9],p=e[10],f=e[11],A=e[12],g=e[13],m=e[14],y=e[15],_=n[0],v=n[1],b=n[2],x=n[3];return t[0]=_*i+v*a+b*h+x*A,t[1]=_*r+v*l+b*d+x*g,t[2]=_*o+v*c+b*p+x*m,t[3]=_*s+v*u+b*f+x*y,t[4]=(_=n[4])*i+(v=n[5])*a+(b=n[6])*h+(x=n[7])*A,t[5]=_*r+v*l+b*d+x*g,t[6]=_*o+v*c+b*p+x*m,t[7]=_*s+v*u+b*f+x*y,t[8]=(_=n[8])*i+(v=n[9])*a+(b=n[10])*h+(x=n[11])*A,t[9]=_*r+v*l+b*d+x*g,t[10]=_*o+v*c+b*p+x*m,t[11]=_*s+v*u+b*f+x*y,t[12]=(_=n[12])*i+(v=n[13])*a+(b=n[14])*h+(x=n[15])*A,t[13]=_*r+v*l+b*d+x*g,t[14]=_*o+v*c+b*p+x*m,t[15]=_*s+v*u+b*f+x*y,t}Math.hypot||(Math.hypot=function(){for(var t=arguments,e=0,n=arguments.length;n--;)e+=t[n]*t[n];return Math.sqrt(e)});var cs,us=ls;function hs(t,e,n){var i=e[0],r=e[1],o=e[2],s=e[3];return t[0]=n[0]*i+n[4]*r+n[8]*o+n[12]*s,t[1]=n[1]*i+n[5]*r+n[9]*o+n[13]*s,t[2]=n[2]*i+n[6]*r+n[10]*o+n[14]*s,t[3]=n[3]*i+n[7]*r+n[11]*o+n[15]*s,t}cs=new ss(3),ss!=Float32Array&&(cs[0]=0,cs[1]=0,cs[2]=0),function(){var t=new ss(4);ss!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0)}();var ds=(function(){var t=new ss(2);ss!=Float32Array&&(t[0]=0,t[1]=0)}(),function(t){function e(e){t.call(this,e,os)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.createBucket=function(t){return new jo(t)},e.prototype.queryRadius=function(t){var e=t;return es("circle-radius",this,e)+es("circle-stroke-width",this,e)+ns(this.paint.get("circle-translate"))},e.prototype.queryIntersectsFeature=function(t,e,n,i,r,o,s,a){for(var l=is(t,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),o.angle,s),c=this.paint.get("circle-radius").evaluate(e,n)+this.paint.get("circle-stroke-width").evaluate(e,n),u="map"===this.paint.get("circle-pitch-alignment"),h=u?l:function(t,e){return t.map((function(t){return ps(t,e)}))}(l,a),d=u?c*s:c,p=0,f=i;p<f.length;p+=1)for(var A=0,g=f[p];A<g.length;A+=1){var m=g[A],y=u?m:ps(m,a),_=d,v=hs([],[m.x,m.y,0,1],a);if("viewport"===this.paint.get("circle-pitch-scale")&&"map"===this.paint.get("circle-pitch-alignment")?_*=v[3]/o.cameraToCenterDistance:"map"===this.paint.get("circle-pitch-scale")&&"viewport"===this.paint.get("circle-pitch-alignment")&&(_*=o.cameraToCenterDistance/v[3]),Wo(h,y,_))return!0}return!1},e}(xr));function ps(t,e){var n=hs([],[t.x,t.y,0,1],e);return new r(n[0]/n[3],n[1]/n[3])}var fs=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(jo);function As(t,e,n,i){var r=e.width,o=e.height;if(i){if(i instanceof Uint8ClampedArray)i=new Uint8Array(i.buffer);else if(i.length!==r*o*n)throw new RangeError("mismatched image size")}else i=new Uint8Array(r*o*n);return t.width=r,t.height=o,t.data=i,t}function gs(t,e,n){var i=e.width,r=e.height;if(i!==t.width||r!==t.height){var o=As({},{width:i,height:r},n);ms(t,o,{x:0,y:0},{x:0,y:0},{width:Math.min(t.width,i),height:Math.min(t.height,r)},n),t.width=i,t.height=r,t.data=o.data}}function ms(t,e,n,i,r,o){if(0===r.width||0===r.height)return e;if(r.width>t.width||r.height>t.height||n.x>t.width-r.width||n.y>t.height-r.height)throw new RangeError("out of range source coordinates for image copy");if(r.width>e.width||r.height>e.height||i.x>e.width-r.width||i.y>e.height-r.height)throw new RangeError("out of range destination coordinates for image copy");for(var s=t.data,a=e.data,l=0;l<r.height;l++)for(var c=((n.y+l)*t.width+n.x)*o,u=((i.y+l)*e.width+i.x)*o,h=0;h<r.width*o;h++)a[u+h]=s[c+h];return e}Ni("HeatmapBucket",fs,{omit:["layers"]});var ys=function(t,e){As(this,t,1,e)};ys.prototype.resize=function(t){gs(this,t,1)},ys.prototype.clone=function(){return new ys({width:this.width,height:this.height},new Uint8Array(this.data))},ys.copy=function(t,e,n,i,r){ms(t,e,n,i,r,1)};var _s=function(t,e){As(this,t,4,e)};_s.prototype.resize=function(t){gs(this,t,4)},_s.prototype.replace=function(t,e){e?this.data.set(t):this.data=t instanceof Uint8ClampedArray?new Uint8Array(t.buffer):t},_s.prototype.clone=function(){return new _s({width:this.width,height:this.height},new Uint8Array(this.data))},_s.copy=function(t,e,n,i,r){ms(t,e,n,i,r,4)},Ni("AlphaImage",ys),Ni("RGBAImage",_s);var vs={paint:new br({"heatmap-radius":new mr(Mt.paint_heatmap["heatmap-radius"]),"heatmap-weight":new mr(Mt.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new gr(Mt.paint_heatmap["heatmap-intensity"]),"heatmap-color":new vr(Mt.paint_heatmap["heatmap-color"]),"heatmap-opacity":new gr(Mt.paint_heatmap["heatmap-opacity"])})};function bs(t){var e={},n=t.resolution||256,i=t.clips?t.clips.length:1,r=t.image||new _s({width:n,height:i}),o=function(n,i,o){e[t.evaluationKey]=o;var s=t.expression.evaluate(e);r.data[n+i+0]=Math.floor(255*s.r/s.a),r.data[n+i+1]=Math.floor(255*s.g/s.a),r.data[n+i+2]=Math.floor(255*s.b/s.a),r.data[n+i+3]=Math.floor(255*s.a)};if(t.clips)for(var s=0,a=0;s<i;++s,a+=4*n)for(var l=0,c=0;l<n;l++,c+=4){var u=l/(n-1),h=t.clips[s];o(a,c,h.start*(1-u)+h.end*u)}else for(var d=0,p=0;d<n;d++,p+=4)o(0,p,d/(n-1));return r}var xs=function(t){function e(e){t.call(this,e,vs),this._updateColorRamp()}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.createBucket=function(t){return new fs(t)},e.prototype._handleSpecialPaintPropertyUpdate=function(t){"heatmap-color"===t&&this._updateColorRamp()},e.prototype._updateColorRamp=function(){this.colorRamp=bs({expression:this._transitionablePaint._values["heatmap-color"].value.expression,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null},e.prototype.resize=function(){this.heatmapFbo&&(this.heatmapFbo.destroy(),this.heatmapFbo=null)},e.prototype.queryRadius=function(){return 0},e.prototype.queryIntersectsFeature=function(){return!1},e.prototype.hasOffscreenPass=function(){return 0!==this.paint.get("heatmap-opacity")&&"none"!==this.visibility},e}(xr),ws={paint:new br({"hillshade-illumination-direction":new gr(Mt.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new gr(Mt.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new gr(Mt.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new gr(Mt.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new gr(Mt.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new gr(Mt.paint_hillshade["hillshade-accent-color"])})},Es=function(t){function e(e){t.call(this,e,ws)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.hasOffscreenPass=function(){return 0!==this.paint.get("hillshade-exaggeration")&&"none"!==this.visibility},e}(xr),Cs=Tr([{name:"a_pos",components:2,type:"Int16"}],4).members,Ts=Ps,Ss=Ps;function Ps(t,e,n){n=n||2;var i,r,o,s,a,l,c,u=e&&e.length,h=u?e[0]*n:t.length,d=Ms(t,0,h,n,!0),p=[];if(!d||d.next===d.prev)return p;if(u&&(d=function(t,e,n,i){var r,o,s,a=[];for(r=0,o=e.length;r<o;r++)(s=Ms(t,e[r]*i,r<o-1?e[r+1]*i:t.length,i,!1))===s.next&&(s.steiner=!0),a.push(Us(s));for(a.sort(ks),r=0;r<a.length;r++)Fs(a[r],n),n=Is(n,n.next);return n}(t,e,d,n)),t.length>80*n){i=o=t[0],r=s=t[1];for(var f=n;f<h;f+=n)(a=t[f])<i&&(i=a),(l=t[f+1])<r&&(r=l),a>o&&(o=a),l>s&&(s=l);c=0!==(c=Math.max(o-i,s-r))?1/c:0}return Bs(d,p,n,i,r,c),p}function Ms(t,e,n,i,r){var o,s;if(r===$s(t,e,n,i)>0)for(o=e;o<n;o+=i)s=Qs(o,t[o],t[o+1],s);else for(o=n-i;o>=e;o-=i)s=Qs(o,t[o],t[o+1],s);return s&&Hs(s,s.next)&&(Js(s),s=s.next),s}function Is(t,e){if(!t)return t;e||(e=t);var n,i=t;do{if(n=!1,i.steiner||!Hs(i,i.next)&&0!==js(i.prev,i,i.next))i=i.next;else{if(Js(i),(i=e=i.prev)===i.next)break;n=!0}}while(n||i!==e);return e}function Bs(t,e,n,i,r,o,s){if(t){!s&&o&&function(t,e,n,i){var r=t;do{null===r.z&&(r.z=zs(r.x,r.y,e,n,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,function(t){var e,n,i,r,o,s,a,l,c=1;do{for(n=t,t=null,o=null,s=0;n;){for(s++,i=n,a=0,e=0;e<c&&(a++,i=i.nextZ);e++);for(l=c;a>0||l>0&&i;)0!==a&&(0===l||!i||n.z<=i.z)?(r=n,n=n.nextZ,a--):(r=i,i=i.nextZ,l--),o?o.nextZ=r:t=r,r.prevZ=o,o=r;n=i}o.nextZ=null,c*=2}while(s>1)}(r)}(t,i,r,o);for(var a,l,c=t;t.prev!==t.next;)if(a=t.prev,l=t.next,o?Ls(t,i,r,o):Rs(t))e.push(a.i/n),e.push(t.i/n),e.push(l.i/n),Js(t),t=l.next,c=l.next;else if((t=l)===c){s?1===s?Bs(t=Os(Is(t),e,n),e,n,i,r,o,2):2===s&&Ds(t,e,n,i,r,o):Bs(Is(t),e,n,i,r,o,1);break}}}function Rs(t){var e=t.prev,n=t,i=t.next;if(js(e,n,i)>=0)return!1;for(var r=t.next.next;r!==t.prev;){if(Gs(e.x,e.y,n.x,n.y,i.x,i.y,r.x,r.y)&&js(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function Ls(t,e,n,i){var r=t.prev,o=t,s=t.next;if(js(r,o,s)>=0)return!1;for(var a=r.x>o.x?r.x>s.x?r.x:s.x:o.x>s.x?o.x:s.x,l=r.y>o.y?r.y>s.y?r.y:s.y:o.y>s.y?o.y:s.y,c=zs(r.x<o.x?r.x<s.x?r.x:s.x:o.x<s.x?o.x:s.x,r.y<o.y?r.y<s.y?r.y:s.y:o.y<s.y?o.y:s.y,e,n,i),u=zs(a,l,e,n,i),h=t.prevZ,d=t.nextZ;h&&h.z>=c&&d&&d.z<=u;){if(h!==t.prev&&h!==t.next&&Gs(r.x,r.y,o.x,o.y,s.x,s.y,h.x,h.y)&&js(h.prev,h,h.next)>=0)return!1;if(h=h.prevZ,d!==t.prev&&d!==t.next&&Gs(r.x,r.y,o.x,o.y,s.x,s.y,d.x,d.y)&&js(d.prev,d,d.next)>=0)return!1;d=d.nextZ}for(;h&&h.z>=c;){if(h!==t.prev&&h!==t.next&&Gs(r.x,r.y,o.x,o.y,s.x,s.y,h.x,h.y)&&js(h.prev,h,h.next)>=0)return!1;h=h.prevZ}for(;d&&d.z<=u;){if(d!==t.prev&&d!==t.next&&Gs(r.x,r.y,o.x,o.y,s.x,s.y,d.x,d.y)&&js(d.prev,d,d.next)>=0)return!1;d=d.nextZ}return!0}function Os(t,e,n){var i=t;do{var r=i.prev,o=i.next.next;!Hs(r,o)&&Ws(r,i,i.next,o)&&Xs(r,o)&&Xs(o,r)&&(e.push(r.i/n),e.push(i.i/n),e.push(o.i/n),Js(i),Js(i.next),i=t=o),i=i.next}while(i!==t);return Is(i)}function Ds(t,e,n,i,r,o){var s=t;do{for(var a=s.next.next;a!==s.prev;){if(s.i!==a.i&&Vs(s,a)){var l=Ks(s,a);return s=Is(s,s.next),l=Is(l,l.next),Bs(s,e,n,i,r,o),void Bs(l,e,n,i,r,o)}a=a.next}s=s.next}while(s!==t)}function ks(t,e){return t.x-e.x}function Fs(t,e){if(e=function(t,e){var n,i=e,r=t.x,o=t.y,s=-1/0;do{if(o<=i.y&&o>=i.next.y&&i.next.y!==i.y){var a=i.x+(o-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(a<=r&&a>s){if(s=a,a===r){if(o===i.y)return i;if(o===i.next.y)return i.next}n=i.x<i.next.x?i:i.next}}i=i.next}while(i!==e);if(!n)return null;if(r===s)return n;var l,c=n,u=n.x,h=n.y,d=1/0;i=n;do{r>=i.x&&i.x>=u&&r!==i.x&&Gs(o<h?r:s,o,u,h,o<h?s:r,o,i.x,i.y)&&(l=Math.abs(o-i.y)/(r-i.x),Xs(i,t)&&(l<d||l===d&&(i.x>n.x||i.x===n.x&&Ns(n,i)))&&(n=i,d=l)),i=i.next}while(i!==c);return n}(t,e)){var n=Ks(e,t);Is(e,e.next),Is(n,n.next)}}function Ns(t,e){return js(t.prev,t,e.prev)<0&&js(e.next,t,t.next)<0}function zs(t,e,n,i,r){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-n)*r)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-i)*r)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function Us(t){var e=t,n=t;do{(e.x<n.x||e.x===n.x&&e.y<n.y)&&(n=e),e=e.next}while(e!==t);return n}function Gs(t,e,n,i,r,o,s,a){return(r-s)*(e-a)-(t-s)*(o-a)>=0&&(t-s)*(i-a)-(n-s)*(e-a)>=0&&(n-s)*(o-a)-(r-s)*(i-a)>=0}function Vs(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&Ws(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}(t,e)&&(Xs(t,e)&&Xs(e,t)&&function(t,e){var n=t,i=!1,r=(t.x+e.x)/2,o=(t.y+e.y)/2;do{n.y>o!=n.next.y>o&&n.next.y!==n.y&&r<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next}while(n!==t);return i}(t,e)&&(js(t.prev,t,e.prev)||js(t,e.prev,e))||Hs(t,e)&&js(t.prev,t,t.next)>0&&js(e.prev,e,e.next)>0)}function js(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function Hs(t,e){return t.x===e.x&&t.y===e.y}function Ws(t,e,n,i){var r=Zs(js(t,e,n)),o=Zs(js(t,e,i)),s=Zs(js(n,i,t)),a=Zs(js(n,i,e));return r!==o&&s!==a||!(0!==r||!qs(t,n,e))||!(0!==o||!qs(t,i,e))||!(0!==s||!qs(n,t,i))||!(0!==a||!qs(n,e,i))}function qs(t,e,n){return e.x<=Math.max(t.x,n.x)&&e.x>=Math.min(t.x,n.x)&&e.y<=Math.max(t.y,n.y)&&e.y>=Math.min(t.y,n.y)}function Zs(t){return t>0?1:t<0?-1:0}function Xs(t,e){return js(t.prev,t,t.next)<0?js(t,e,t.next)>=0&&js(t,t.prev,e)>=0:js(t,e,t.prev)<0||js(t,t.next,e)<0}function Ks(t,e){var n=new Ys(t.i,t.x,t.y),i=new Ys(e.i,e.x,e.y),r=t.next,o=e.prev;return t.next=e,e.prev=t,n.next=r,r.prev=n,i.next=n,n.prev=i,o.next=i,i.prev=o,i}function Qs(t,e,n,i){var r=new Ys(t,e,n);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function Js(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function Ys(t,e,n){this.i=t,this.x=e,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function $s(t,e,n,i){for(var r=0,o=e,s=n-i;o<n;o+=i)r+=(t[s]-t[o])*(t[o+1]+t[s+1]),s=o;return r}function ta(t,e,n,i,r){!function t(e,n,i,r,o){for(;r>i;){if(r-i>600){var s=r-i+1,a=n-i+1,l=Math.log(s),c=.5*Math.exp(2*l/3),u=.5*Math.sqrt(l*c*(s-c)/s)*(a-s/2<0?-1:1);t(e,n,Math.max(i,Math.floor(n-a*c/s+u)),Math.min(r,Math.floor(n+(s-a)*c/s+u)),o)}var h=e[n],d=i,p=r;for(ea(e,i,n),o(e[r],h)>0&&ea(e,i,r);d<p;){for(ea(e,d,p),d++,p--;o(e[d],h)<0;)d++;for(;o(e[p],h)>0;)p--}0===o(e[i],h)?ea(e,i,p):ea(e,++p,r),p<=n&&(i=p+1),n<=p&&(r=p-1)}}(t,e,n||0,i||t.length-1,r||na)}function ea(t,e,n){var i=t[e];t[e]=t[n],t[n]=i}function na(t,e){return t<e?-1:t>e?1:0}function ia(t,e){var n=t.length;if(n<=1)return[t];for(var i,r,o=[],s=0;s<n;s++){var a=C(t[s]);0!==a&&(t[s].area=Math.abs(a),void 0===r&&(r=a<0),r===a<0?(i&&o.push(i),i=[t[s]]):i.push(t[s]))}if(i&&o.push(i),e>1)for(var l=0;l<o.length;l++)o[l].length<=e||(ta(o[l],e,1,o[l].length-1,ra),o[l]=o[l].slice(0,e));return o}function ra(t,e){return e.area-t.area}function oa(t,e,n){for(var i=n.patternDependencies,r=!1,o=0,s=e;o<s.length;o+=1){var a=s[o].paint.get(t+"-pattern");a.isConstant()||(r=!0);var l=a.constantOr(null);l&&(r=!0,i[l.to]=!0,i[l.from]=!0)}return r}function sa(t,e,n,i,r){for(var o=r.patternDependencies,s=0,a=e;s<a.length;s+=1){var l=a[s],c=l.paint.get(t+"-pattern").value;if("constant"!==c.kind){var u=c.evaluate({zoom:i-1},n,{},r.availableImages),h=c.evaluate({zoom:i},n,{},r.availableImages),d=c.evaluate({zoom:i+1},n,{},r.availableImages);h=h&&h.name?h.name:h,d=d&&d.name?d.name:d,o[u=u&&u.name?u.name:u]=!0,o[h]=!0,o[d]=!0,n.patterns[l.id]={min:u,mid:h,max:d}}}return n}Ps.deviation=function(t,e,n,i){var r=e&&e.length,o=Math.abs($s(t,0,r?e[0]*n:t.length,n));if(r)for(var s=0,a=e.length;s<a;s++)o-=Math.abs($s(t,e[s]*n,s<a-1?e[s+1]*n:t.length,n));var l=0;for(s=0;s<i.length;s+=3){var c=i[s]*n,u=i[s+1]*n,h=i[s+2]*n;l+=Math.abs((t[c]-t[h])*(t[u+1]-t[c+1])-(t[c]-t[u])*(t[h+1]-t[c+1]))}return 0===o&&0===l?0:Math.abs((l-o)/o)},Ps.flatten=function(t){for(var e=t[0][0].length,n={vertices:[],holes:[],dimensions:e},i=0,r=0;r<t.length;r++){for(var o=0;o<t[r].length;o++)for(var s=0;s<e;s++)n.vertices.push(t[r][o][s]);r>0&&n.holes.push(i+=t[r-1].length)}return n},Ts.default=Ss;var aa=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new Pr,this.indexArray=new Gr,this.indexArray2=new Zr,this.programConfigurations=new Do(t.layers,t.zoom),this.segments=new ao,this.segments2=new ao,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};aa.prototype.populate=function(t,e,n){this.hasPattern=oa("fill",this.layers,e);for(var i=this.layers[0].layout.get("fill-sort-key"),r=[],o=0,s=t;o<s.length;o+=1){var a=s[o],l=a.feature,c=a.id,u=a.index,h=a.sourceLayerIndex,d=this.layers[0]._featureFilter.needGeometry,p=Go(l,d);if(this.layers[0]._featureFilter.filter(new ar(this.zoom),p,n)){var f=i?i.evaluate(p,{},n,e.availableImages):void 0,A={id:c,properties:l.properties,type:l.type,sourceLayerIndex:h,index:u,geometry:d?p.geometry:Uo(l),patterns:{},sortKey:f};r.push(A)}}i&&r.sort((function(t,e){return t.sortKey-e.sortKey}));for(var g=0,m=r;g<m.length;g+=1){var y=m[g],_=y.geometry,v=y.index,b=y.sourceLayerIndex;if(this.hasPattern){var x=sa("fill",this.layers,y,this.zoom,e);this.patternFeatures.push(x)}else this.addFeature(y,_,v,n,{});e.featureIndex.insert(t[v].feature,_,v,b,this.index)}},aa.prototype.update=function(t,e,n){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,n)},aa.prototype.addFeatures=function(t,e,n){for(var i=0,r=this.patternFeatures;i<r.length;i+=1){var o=r[i];this.addFeature(o,o.geometry,o.index,e,n)}},aa.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},aa.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},aa.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Cs),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.indexBuffer2=t.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(t),this.uploaded=!0},aa.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())},aa.prototype.addFeature=function(t,e,n,i,r){for(var o=0,s=ia(e,500);o<s.length;o+=1){for(var a=s[o],l=0,c=0,u=a;c<u.length;c+=1)l+=u[c].length;for(var h=this.segments.prepareSegment(l,this.layoutVertexArray,this.indexArray),d=h.vertexLength,p=[],f=[],A=0,g=a;A<g.length;A+=1){var m=g[A];if(0!==m.length){m!==a[0]&&f.push(p.length/2);var y=this.segments2.prepareSegment(m.length,this.layoutVertexArray,this.indexArray2),_=y.vertexLength;this.layoutVertexArray.emplaceBack(m[0].x,m[0].y),this.indexArray2.emplaceBack(_+m.length-1,_),p.push(m[0].x),p.push(m[0].y);for(var v=1;v<m.length;v++)this.layoutVertexArray.emplaceBack(m[v].x,m[v].y),this.indexArray2.emplaceBack(_+v-1,_+v),p.push(m[v].x),p.push(m[v].y);y.vertexLength+=m.length,y.primitiveLength+=m.length}}for(var b=Ts(p,f),x=0;x<b.length;x+=3)this.indexArray.emplaceBack(d+b[x],d+b[x+1],d+b[x+2]);h.vertexLength+=l,h.primitiveLength+=b.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,n,r,i)},Ni("FillBucket",aa,{omit:["layers","patternFeatures"]});var la=new br({"fill-sort-key":new mr(Mt.layout_fill["fill-sort-key"])}),ca={paint:new br({"fill-antialias":new gr(Mt.paint_fill["fill-antialias"]),"fill-opacity":new mr(Mt.paint_fill["fill-opacity"]),"fill-color":new mr(Mt.paint_fill["fill-color"]),"fill-outline-color":new mr(Mt.paint_fill["fill-outline-color"]),"fill-translate":new gr(Mt.paint_fill["fill-translate"]),"fill-translate-anchor":new gr(Mt.paint_fill["fill-translate-anchor"]),"fill-pattern":new yr(Mt.paint_fill["fill-pattern"])}),layout:la},ua=function(t){function e(e){t.call(this,e,ca)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.recalculate=function(e,n){t.prototype.recalculate.call(this,e,n);var i=this.paint._values["fill-outline-color"];"constant"===i.value.kind&&void 0===i.value.value&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])},e.prototype.createBucket=function(t){return new aa(t)},e.prototype.queryRadius=function(){return ns(this.paint.get("fill-translate"))},e.prototype.queryIntersectsFeature=function(t,e,n,i,r,o,s){return qo(is(t,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),o.angle,s),i)},e.prototype.isTileClipped=function(){return!0},e}(xr),ha=Tr([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4).members,da=pa;function pa(t,e,n,i,r){this.properties={},this.extent=n,this.type=0,this._pbf=t,this._geometry=-1,this._keys=i,this._values=r,t.readFields(fa,this,e)}function fa(t,e,n){1==t?e.id=n.readVarint():2==t?function(t,e){for(var n=t.readVarint()+t.pos;t.pos<n;){var i=e._keys[t.readVarint()],r=e._values[t.readVarint()];e.properties[i]=r}}(n,e):3==t?e.type=n.readVarint():4==t&&(e._geometry=n.pos)}function Aa(t){for(var e,n,i=0,r=0,o=t.length,s=o-1;r<o;s=r++)i+=((n=t[s]).x-(e=t[r]).x)*(e.y+n.y);return i}pa.types=["Unknown","Point","LineString","Polygon"],pa.prototype.loadGeometry=function(){var t=this._pbf;t.pos=this._geometry;for(var e,n=t.readVarint()+t.pos,i=1,o=0,s=0,a=0,l=[];t.pos<n;){if(o<=0){var c=t.readVarint();i=7&c,o=c>>3}if(o--,1===i||2===i)s+=t.readSVarint(),a+=t.readSVarint(),1===i&&(e&&l.push(e),e=[]),e.push(new r(s,a));else{if(7!==i)throw new Error("unknown command "+i);e&&e.push(e[0].clone())}}return e&&l.push(e),l},pa.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,n=1,i=0,r=0,o=0,s=1/0,a=-1/0,l=1/0,c=-1/0;t.pos<e;){if(i<=0){var u=t.readVarint();n=7&u,i=u>>3}if(i--,1===n||2===n)(r+=t.readSVarint())<s&&(s=r),r>a&&(a=r),(o+=t.readSVarint())<l&&(l=o),o>c&&(c=o);else if(7!==n)throw new Error("unknown command "+n)}return[s,l,a,c]},pa.prototype.toGeoJSON=function(t,e,n){var i,r,o=this.extent*Math.pow(2,n),s=this.extent*t,a=this.extent*e,l=this.loadGeometry(),c=pa.types[this.type];function u(t){for(var e=0;e<t.length;e++){var n=t[e];t[e]=[360*(n.x+s)/o-180,360/Math.PI*Math.atan(Math.exp((180-360*(n.y+a)/o)*Math.PI/180))-90]}}switch(this.type){case 1:var h=[];for(i=0;i<l.length;i++)h[i]=l[i][0];u(l=h);break;case 2:for(i=0;i<l.length;i++)u(l[i]);break;case 3:for(l=function(t){var e=t.length;if(e<=1)return[t];for(var n,i,r=[],o=0;o<e;o++){var s=Aa(t[o]);0!==s&&(void 0===i&&(i=s<0),i===s<0?(n&&r.push(n),n=[t[o]]):n.push(t[o]))}return n&&r.push(n),r}(l),i=0;i<l.length;i++)for(r=0;r<l[i].length;r++)u(l[i][r])}1===l.length?l=l[0]:c="Multi"+c;var d={type:"Feature",geometry:{type:c,coordinates:l},properties:this.properties};return"id"in this&&(d.id=this.id),d};var ga=ma;function ma(t,e){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=t,this._keys=[],this._values=[],this._features=[],t.readFields(ya,this,e),this.length=this._features.length}function ya(t,e,n){15===t?e.version=n.readVarint():1===t?e.name=n.readString():5===t?e.extent=n.readVarint():2===t?e._features.push(n.pos):3===t?e._keys.push(n.readString()):4===t&&e._values.push(function(t){for(var e=null,n=t.readVarint()+t.pos;t.pos<n;){var i=t.readVarint()>>3;e=1===i?t.readString():2===i?t.readFloat():3===i?t.readDouble():4===i?t.readVarint64():5===i?t.readVarint():6===i?t.readSVarint():7===i?t.readBoolean():null}return e}(n))}function _a(t,e,n){if(3===t){var i=new ga(n,n.readVarint()+n.pos);i.length&&(e[i.name]=i)}}ma.prototype.feature=function(t){if(t<0||t>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[t];var e=this._pbf.readVarint()+this._pbf.pos;return new da(this._pbf,e,this.extent,this._keys,this._values)};var va={VectorTile:function(t,e){this.layers=t.readFields(_a,{},e)},VectorTileFeature:da,VectorTileLayer:ga},ba=va.VectorTileFeature.types,xa=Math.pow(2,13);function wa(t,e,n,i,r,o,s,a){t.emplaceBack(e,n,2*Math.floor(i*xa)+s,r*xa*2,o*xa*2,Math.round(a))}var Ea=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new Ir,this.indexArray=new Gr,this.programConfigurations=new Do(t.layers,t.zoom),this.segments=new ao,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};function Ca(t,e){return t.x===e.x&&(t.x<0||t.x>8192)||t.y===e.y&&(t.y<0||t.y>8192)}Ea.prototype.populate=function(t,e,n){this.features=[],this.hasPattern=oa("fill-extrusion",this.layers,e);for(var i=0,r=t;i<r.length;i+=1){var o=r[i],s=o.feature,a=o.id,l=o.index,c=o.sourceLayerIndex,u=this.layers[0]._featureFilter.needGeometry,h=Go(s,u);if(this.layers[0]._featureFilter.filter(new ar(this.zoom),h,n)){var d={id:a,sourceLayerIndex:c,index:l,geometry:u?h.geometry:Uo(s),properties:s.properties,type:s.type,patterns:{}};this.hasPattern?this.features.push(sa("fill-extrusion",this.layers,d,this.zoom,e)):this.addFeature(d,d.geometry,l,n,{}),e.featureIndex.insert(s,d.geometry,l,c,this.index,!0)}}},Ea.prototype.addFeatures=function(t,e,n){for(var i=0,r=this.features;i<r.length;i+=1){var o=r[i];this.addFeature(o,o.geometry,o.index,e,n)}},Ea.prototype.update=function(t,e,n){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,n)},Ea.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},Ea.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},Ea.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,ha),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0},Ea.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},Ea.prototype.addFeature=function(t,e,n,i,r){for(var o=0,s=ia(e,500);o<s.length;o+=1){for(var a=s[o],l=0,c=0,u=a;c<u.length;c+=1)l+=u[c].length;for(var h=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray),d=0,p=a;d<p.length;d+=1){var f=p[d];if(0!==f.length&&!((R=f).every((function(t){return t.x<0}))||R.every((function(t){return t.x>8192}))||R.every((function(t){return t.y<0}))||R.every((function(t){return t.y>8192}))))for(var A=0,g=0;g<f.length;g++){var m=f[g];if(g>=1){var y=f[g-1];if(!Ca(m,y)){h.vertexLength+4>ao.MAX_VERTEX_ARRAY_LENGTH&&(h=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var _=m.sub(y)._perp()._unit(),v=y.dist(m);A+v>32768&&(A=0),wa(this.layoutVertexArray,m.x,m.y,_.x,_.y,0,0,A),wa(this.layoutVertexArray,m.x,m.y,_.x,_.y,0,1,A),wa(this.layoutVertexArray,y.x,y.y,_.x,_.y,0,0,A+=v),wa(this.layoutVertexArray,y.x,y.y,_.x,_.y,0,1,A);var b=h.vertexLength;this.indexArray.emplaceBack(b,b+2,b+1),this.indexArray.emplaceBack(b+1,b+2,b+3),h.vertexLength+=4,h.primitiveLength+=2}}}}if(h.vertexLength+l>ao.MAX_VERTEX_ARRAY_LENGTH&&(h=this.segments.prepareSegment(l,this.layoutVertexArray,this.indexArray)),"Polygon"===ba[t.type]){for(var x=[],w=[],E=h.vertexLength,C=0,T=a;C<T.length;C+=1){var S=T[C];if(0!==S.length){S!==a[0]&&w.push(x.length/2);for(var P=0;P<S.length;P++){var M=S[P];wa(this.layoutVertexArray,M.x,M.y,0,0,1,1,0),x.push(M.x),x.push(M.y)}}}for(var I=Ts(x,w),B=0;B<I.length;B+=3)this.indexArray.emplaceBack(E+I[B],E+I[B+2],E+I[B+1]);h.primitiveLength+=I.length/3,h.vertexLength+=l}}var R;this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,n,r,i)},Ni("FillExtrusionBucket",Ea,{omit:["layers","features"]});var Ta={paint:new br({"fill-extrusion-opacity":new gr(Mt["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new mr(Mt["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new gr(Mt["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new gr(Mt["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new yr(Mt["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new mr(Mt["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new mr(Mt["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new gr(Mt["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})},Sa=function(t){function e(e){t.call(this,e,Ta)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.createBucket=function(t){return new Ea(t)},e.prototype.queryRadius=function(){return ns(this.paint.get("fill-extrusion-translate"))},e.prototype.is3D=function(){return!0},e.prototype.queryIntersectsFeature=function(t,e,n,i,o,s,a,l){var c=is(t,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),s.angle,a),u=this.paint.get("fill-extrusion-height").evaluate(e,n),h=this.paint.get("fill-extrusion-base").evaluate(e,n),d=function(t,e
2){for(var n=[],i=0,o=t;i<o.length;i+=1){var s=o[i],a=[s.x,s.y,0,1];hs(a,a,e),n.push(new r(a[0]/a[3],a[1]/a[3]))}return n
vendor: 117,005 bytes, line 2
2}(c,l),p=function(t,e,n,i){for(var o=[],s=[],a=i[8]*e,l=i[9]*e,c=i[10]*e,u=i[11]*e,h=i[8]*n,d=i[9]*n,p=i[10]*n,f=i[11]*n,A=0,g=t;A<g.length;A+=1){for(var m=[],y=[],_=0,v=g[A];_<v.length;_+=1){var b=v[_],x=b.x,w=b.y,E=i[0]*x+i[4]*w+i[12],C=i[1]*x+i[5]*w+i[13],T=i[2]*x+i[6]*w+i[14],S=i[3]*x+i[7]*w+i[15],P=T+c,M=S+u,I=E+h,B=C+d,R=T+p,L=S+f,O=new r((E+a)/M,(C+l)/M);O.z=P/M,m.push(O);var D=new r(I/L,B/L);D.z=R/L,y.push(D)}o.push(m),s.push(y)}return[o,s]}(i,h,u,l);return function(t,e,n){var i=1/0;qo(n,e)&&(i=Ma(n,e[0]));for(var r=0;r<e.length;r++)for(var o=e[r],s=t[r],a=0;a<o.length-1;a++){var l=o[a],c=[l,o[a+1],s[a+1],s[a],l];Ho(n,c)&&(i=Math.min(i,Ma(n,c)))}return i!==1/0&&i}(p[0],p[1],d)},e}(xr);function Pa(t,e){return t.x*e.x+t.y*e.y}function Ma(t,e){if(1===t.length){for(var n,i=0,r=e[i++];!n||r.equals(n);)if(!(n=e[i++]))return 1/0;for(;i<e.length;i++){var o=e[i],s=t[0],a=n.sub(r),l=o.sub(r),c=s.sub(r),u=Pa(a,a),h=Pa(a,l),d=Pa(l,l),p=Pa(c,a),f=Pa(c,l),A=u*d-h*h,g=(d*p-h*f)/A,m=(u*f-h*p)/A,y=r.z*(1-g-m)+n.z*g+o.z*m;if(isFinite(y))return y}return 1/0}for(var _=1/0,v=0,b=e;v<b.length;v+=1)_=Math.min(_,b[v].z);return _}var Ia=Tr([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4).members,Ba=Tr([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]).members,Ra=va.VectorTileFeature.types,La=Math.cos(Math.PI/180*37.5),Oa=Math.pow(2,14)/.5,Da=function(t){var e=this;this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach((function(t){e.gradients[t.id]={}})),this.layoutVertexArray=new Br,this.layoutVertexArray2=new Rr,this.indexArray=new Gr,this.programConfigurations=new Do(t.layers,t.zoom),this.segments=new ao,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};Da.prototype.populate=function(t,e,n){this.hasPattern=oa("line",this.layers,e);for(var i=this.layers[0].layout.get("line-sort-key"),r=[],o=0,s=t;o<s.length;o+=1){var a=s[o],l=a.feature,c=a.id,u=a.index,h=a.sourceLayerIndex,d=this.layers[0]._featureFilter.needGeometry,p=Go(l,d);if(this.layers[0]._featureFilter.filter(new ar(this.zoom),p,n)){var f=i?i.evaluate(p,{},n):void 0,A={id:c,properties:l.properties,type:l.type,sourceLayerIndex:h,index:u,geometry:d?p.geometry:Uo(l),patterns:{},sortKey:f};r.push(A)}}i&&r.sort((function(t,e){return t.sortKey-e.sortKey}));for(var g=0,m=r;g<m.length;g+=1){var y=m[g],_=y.geometry,v=y.index,b=y.sourceLayerIndex;if(this.hasPattern){var x=sa("line",this.layers,y,this.zoom,e);this.patternFeatures.push(x)}else this.addFeature(y,_,v,n,{});e.featureIndex.insert(t[v].feature,_,v,b,this.index)}},Da.prototype.update=function(t,e,n){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,n)},Da.prototype.addFeatures=function(t,e,n){for(var i=0,r=this.patternFeatures;i<r.length;i+=1){var o=r[i];this.addFeature(o,o.geometry,o.index,e,n)}},Da.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},Da.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},Da.prototype.upload=function(t){this.uploaded||(0!==this.layoutVertexArray2.length&&(this.layoutVertexBuffer2=t.createVertexBuffer(this.layoutVertexArray2,Ba)),this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Ia),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0},Da.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},Da.prototype.lineFeatureClips=function(t){if(t.properties&&t.properties.hasOwnProperty("mapbox_clip_start")&&t.properties.hasOwnProperty("mapbox_clip_end"))return{start:+t.properties.mapbox_clip_start,end:+t.properties.mapbox_clip_end}},Da.prototype.addFeature=function(t,e,n,i,r){var o=this.layers[0].layout,s=o.get("line-join").evaluate(t,{}),a=o.get("line-cap"),l=o.get("line-miter-limit"),c=o.get("line-round-limit");this.lineClips=this.lineFeatureClips(t);for(var u=0,h=e;u<h.length;u+=1)this.addLine(h[u],t,s,a,l,c);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,n,r,i)},Da.prototype.addLine=function(t,e,n,i,r,o){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(var s=0;s<t.length-1;s++)this.totalDistance+=t[s].dist(t[s+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}for(var a="Polygon"===Ra[e.type],l=t.length;l>=2&&t[l-1].equals(t[l-2]);)l--;for(var c=0;c<l-1&&t[c].equals(t[c+1]);)c++;if(!(l<(a?3:2))){"bevel"===n&&(r=1.05);var u,h=this.overscaling<=16?122880/(512*this.overscaling):0,d=this.segments.prepareSegment(10*l,this.layoutVertexArray,this.indexArray),p=void 0,f=void 0,A=void 0,g=void 0;this.e1=this.e2=-1,a&&(g=t[c].sub(u=t[l-2])._unit()._perp());for(var m=c;m<l;m++)if(!(f=m===l-1?a?t[c+1]:void 0:t[m+1])||!t[m].equals(f)){g&&(A=g),u&&(p=u),u=t[m],g=f?f.sub(u)._unit()._perp():A;var y=(A=A||g).add(g);0===y.x&&0===y.y||y._unit();var _=A.x*g.x+A.y*g.y,v=y.x*g.x+y.y*g.y,b=0!==v?1/v:1/0,x=2*Math.sqrt(2-2*v),w=v<La&&p&&f,E=A.x*g.y-A.y*g.x>0;if(w&&m>c){var C=u.dist(p);if(C>2*h){var T=u.sub(u.sub(p)._mult(h/C)._round());this.updateDistance(p,T),this.addCurrentVertex(T,A,0,0,d),p=T}}var S=p&&f,P=S?n:a?"butt":i;if(S&&"round"===P&&(b<o?P="miter":b<=2&&(P="fakeround")),"miter"===P&&b>r&&(P="bevel"),"bevel"===P&&(b>2&&(P="flipbevel"),b<r&&(P="miter")),p&&this.updateDistance(p,u),"miter"===P)y._mult(b),this.addCurrentVertex(u,y,0,0,d);else if("flipbevel"===P){if(b>100)y=g.mult(-1);else{var M=b*A.add(g).mag()/A.sub(g).mag();y._perp()._mult(M*(E?-1:1))}this.addCurrentVertex(u,y,0,0,d),this.addCurrentVertex(u,y.mult(-1),0,0,d)}else if("bevel"===P||"fakeround"===P){var I=-Math.sqrt(b*b-1),B=E?I:0,R=E?0:I;if(p&&this.addCurrentVertex(u,A,B,R,d),"fakeround"===P)for(var L=Math.round(180*x/Math.PI/20),O=1;O<L;O++){var D=O/L;if(.5!==D){var k=D-.5;D+=D*k*(D-1)*((1.0904+_*(_*(3.55645-1.43519*_)-3.2452))*k*k+(.848013+_*(.215638*_-1.06021)))}var F=g.sub(A)._mult(D)._add(A)._unit()._mult(E?-1:1);this.addHalfVertex(u,F.x,F.y,!1,E,0,d)}f&&this.addCurrentVertex(u,g,-B,-R,d)}else if("butt"===P)this.addCurrentVertex(u,y,0,0,d);else if("square"===P){var N=p?1:-1;this.addCurrentVertex(u,y,N,N,d)}else"round"===P&&(p&&(this.addCurrentVertex(u,A,0,0,d),this.addCurrentVertex(u,A,1,1,d,!0)),f&&(this.addCurrentVertex(u,g,-1,-1,d,!0),this.addCurrentVertex(u,g,0,0,d)));if(w&&m<l-1){var z=u.dist(f);if(z>2*h){var U=u.add(f.sub(u)._mult(h/z)._round());this.updateDistance(u,U),this.addCurrentVertex(U,g,0,0,d),u=U}}}}},Da.prototype.addCurrentVertex=function(t,e,n,i,r,o){void 0===o&&(o=!1);var s=e.y*i-e.x,a=-e.y-e.x*i;this.addHalfVertex(t,e.x+e.y*n,e.y-e.x*n,o,!1,n,r),this.addHalfVertex(t,s,a,o,!0,-i,r),this.distance>Oa/2&&0===this.totalDistance&&(this.distance=0,this.addCurrentVertex(t,e,n,i,r,o))},Da.prototype.addHalfVertex=function(t,e,n,i,r,o,s){var a=.5*(this.lineClips?this.scaledDistance*(Oa-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((t.x<<1)+(i?1:0),(t.y<<1)+(r?1:0),Math.round(63*e)+128,Math.round(63*n)+128,1+(0===o?0:o<0?-1:1)|(63&a)<<2,a>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);var l=s.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,l),s.primitiveLength++),r?this.e2=l:this.e1=l},Da.prototype.updateScaledDistance=function(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance},Da.prototype.updateDistance=function(t,e){this.distance+=t.dist(e),this.updateScaledDistance()},Ni("LineBucket",Da,{omit:["layers","patternFeatures"]});var ka=new br({"line-cap":new gr(Mt.layout_line["line-cap"]),"line-join":new mr(Mt.layout_line["line-join"]),"line-miter-limit":new gr(Mt.layout_line["line-miter-limit"]),"line-round-limit":new gr(Mt.layout_line["line-round-limit"]),"line-sort-key":new mr(Mt.layout_line["line-sort-key"])}),Fa={paint:new br({"line-opacity":new mr(Mt.paint_line["line-opacity"]),"line-color":new mr(Mt.paint_line["line-color"]),"line-translate":new gr(Mt.paint_line["line-translate"]),"line-translate-anchor":new gr(Mt.paint_line["line-translate-anchor"]),"line-width":new mr(Mt.paint_line["line-width"]),"line-gap-width":new mr(Mt.paint_line["line-gap-width"]),"line-offset":new mr(Mt.paint_line["line-offset"]),"line-blur":new mr(Mt.paint_line["line-blur"]),"line-dasharray":new _r(Mt.paint_line["line-dasharray"]),"line-pattern":new yr(Mt.paint_line["line-pattern"]),"line-gradient":new vr(Mt.paint_line["line-gradient"])}),layout:ka},Na=new(function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.possiblyEvaluate=function(e,n){return n=new ar(Math.floor(n.zoom),{now:n.now,fadeDuration:n.fadeDuration,zoomHistory:n.zoomHistory,transition:n.transition}),t.prototype.possiblyEvaluate.call(this,e,n)},e.prototype.evaluate=function(e,n,i,r){return n=d({},n,{zoom:Math.floor(n.zoom)}),t.prototype.evaluate.call(this,e,n,i,r)},e}(mr))(Fa.paint.properties["line-width"].specification);Na.useIntegerZoom=!0;var za=function(t){function e(e){t.call(this,e,Fa),this.gradientVersion=0}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._handleSpecialPaintPropertyUpdate=function(t){"line-gradient"===t&&(this.stepInterpolant=this._transitionablePaint._values["line-gradient"].value.expression._styleExpression.expression instanceof je,this.gradientVersion=(this.gradientVersion+1)%a)},e.prototype.gradientExpression=function(){return this._transitionablePaint._values["line-gradient"].value.expression},e.prototype.recalculate=function(e,n){t.prototype.recalculate.call(this,e,n),this.paint._values["line-floorwidth"]=Na.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)},e.prototype.createBucket=function(t){return new Da(t)},e.prototype.queryRadius=function(t){var e=t,n=Ua(es("line-width",this,e),es("line-gap-width",this,e)),i=es("line-offset",this,e);return n/2+Math.abs(i)+ns(this.paint.get("line-translate"))},e.prototype.queryIntersectsFeature=function(t,e,n,i,o,s,a){var l=is(t,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),s.angle,a),c=a/2*Ua(this.paint.get("line-width").evaluate(e,n),this.paint.get("line-gap-width").evaluate(e,n)),u=this.paint.get("line-offset").evaluate(e,n);return u&&(i=function(t,e){for(var n=[],i=new r(0,0),o=0;o<t.length;o++){for(var s=t[o],a=[],l=0;l<s.length;l++){var c=s[l],u=s[l+1],h=0===l?i:c.sub(s[l-1])._unit()._perp(),d=l===s.length-1?i:u.sub(c)._unit()._perp(),p=h._add(d)._unit();p._mult(1/(p.x*d.x+p.y*d.y)),a.push(p._mult(e)._add(c))}n.push(a)}return n}(i,u*a)),function(t,e,n){for(var i=0;i<e.length;i++){var r=e[i];if(t.length>=3)for(var o=0;o<r.length;o++)if($o(t,r[o]))return!0;if(Zo(t,r,n))return!0}return!1}(l,i,c)},e.prototype.isTileClipped=function(){return!0},e}(xr);function Ua(t,e){return e>0?e+2*t:t}var Ga=Tr([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),Va=Tr([{name:"a_projected_pos",components:3,type:"Float32"}],4),ja=(Tr([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),Tr([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}])),Ha=(Tr([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]),Tr([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4)),Wa=Tr([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function qa(t,e,n){return t.sections.forEach((function(t){t.text=function(t,e,n){var i=e.layout.get("text-transform").evaluate(n,{});return"uppercase"===i?t=t.toLocaleUpperCase():"lowercase"===i&&(t=t.toLocaleLowerCase()),sr.applyArabicShaping&&(t=sr.applyArabicShaping(t)),t}(t.text,e,n)})),t}Tr([{name:"triangle",components:3,type:"Uint16"}]),Tr([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"}]),Tr([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",components:2,name:"textOffset"},{type:"Float32",name:"collisionCircleDiameter"}]),Tr([{type:"Float32",name:"offsetX"}]),Tr([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);var Za={"!":"\ufe15","#":"\uff03",$:"\uff04","%":"\uff05","&":"\uff06","(":"\ufe35",")":"\ufe36","*":"\uff0a","+":"\uff0b",",":"\ufe10","-":"\ufe32",".":"\u30fb","/":"\uff0f",":":"\ufe13",";":"\ufe14","<":"\ufe3f","=":"\uff1d",">":"\ufe40","?":"\ufe16","@":"\uff20","[":"\ufe47","\\":"\uff3c","]":"\ufe48","^":"\uff3e",_:"\ufe33","`":"\uff40","{":"\ufe37","|":"\u2015","}":"\ufe38","~":"\uff5e","\xa2":"\uffe0","\xa3":"\uffe1","\xa5":"\uffe5","\xa6":"\uffe4","\xac":"\uffe2","\xaf":"\uffe3","\u2013":"\ufe32","\u2014":"\ufe31","\u2018":"\ufe43","\u2019":"\ufe44","\u201c":"\ufe41","\u201d":"\ufe42","\u2026":"\ufe19","\u2027":"\u30fb","\u20a9":"\uffe6","\u3001":"\ufe11","\u3002":"\ufe12","\u3008":"\ufe3f","\u3009":"\ufe40","\u300a":"\ufe3d","\u300b":"\ufe3e","\u300c":"\ufe41","\u300d":"\ufe42","\u300e":"\ufe43","\u300f":"\ufe44","\u3010":"\ufe3b","\u3011":"\ufe3c","\u3014":"\ufe39","\u3015":"\ufe3a","\u3016":"\ufe17","\u3017":"\ufe18","\uff01":"\ufe15","\uff08":"\ufe35","\uff09":"\ufe36","\uff0c":"\ufe10","\uff0d":"\ufe32","\uff0e":"\u30fb","\uff1a":"\ufe13","\uff1b":"\ufe14","\uff1c":"\ufe3f","\uff1e":"\ufe40","\uff1f":"\ufe16","\uff3b":"\ufe47","\uff3d":"\ufe48","\uff3f":"\ufe33","\uff5b":"\ufe37","\uff5c":"\u2015","\uff5d":"\ufe38","\uff5f":"\ufe35","\uff60":"\ufe36","\uff61":"\ufe12","\uff62":"\ufe41","\uff63":"\ufe42"},Xa=function(t,e,n,i,r){var o,s,a=8*r-i-1,l=(1<<a)-1,c=l>>1,u=-7,h=n?r-1:0,d=n?-1:1,p=t[e+h];for(h+=d,o=p&(1<<-u)-1,p>>=-u,u+=a;u>0;o=256*o+t[e+h],h+=d,u-=8);for(s=o&(1<<-u)-1,o>>=-u,u+=i;u>0;s=256*s+t[e+h],h+=d,u-=8);if(0===o)o=1-c;else{if(o===l)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,i),o-=c}return(p?-1:1)*s*Math.pow(2,o-i)},Ka=function(t,e,n,i,r,o){var s,a,l,c=8*o-r-1,u=(1<<c)-1,h=u>>1,d=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,p=i?0:o-1,f=i?1:-1,A=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=u):(s=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-s))<1&&(s--,l*=2),(e+=s+h>=1?d/l:d*Math.pow(2,1-h))*l>=2&&(s++,l/=2),s+h>=u?(a=0,s=u):s+h>=1?(a=(e*l-1)*Math.pow(2,r),s+=h):(a=e*Math.pow(2,h-1)*Math.pow(2,r),s=0));r>=8;t[n+p]=255&a,p+=f,a/=256,r-=8);for(s=s<<r|a,c+=r;c>0;t[n+p]=255&s,p+=f,s/=256,c-=8);t[n+p-f]|=128*A},Qa=Ja;function Ja(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}Ja.Varint=0,Ja.Fixed64=1,Ja.Bytes=2,Ja.Fixed32=5;var Ya="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function $a(t){return t.type===Ja.Bytes?t.readVarint()+t.pos:t.pos+1}function tl(t,e,n){return n?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function el(t,e,n){var i=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));n.realloc(i);for(var r=n.pos-1;r>=t;r--)n.buf[r+i]=n.buf[r]}function nl(t,e){for(var n=0;n<t.length;n++)e.writeVarint(t[n])}function il(t,e){for(var n=0;n<t.length;n++)e.writeSVarint(t[n])}function rl(t,e){for(var n=0;n<t.length;n++)e.writeFloat(t[n])}function ol(t,e){for(var n=0;n<t.length;n++)e.writeDouble(t[n])}function sl(t,e){for(var n=0;n<t.length;n++)e.writeBoolean(t[n])}function al(t,e){for(var n=0;n<t.length;n++)e.writeFixed32(t[n])}function ll(t,e){for(var n=0;n<t.length;n++)e.writeSFixed32(t[n])}function cl(t,e){for(var n=0;n<t.length;n++)e.writeFixed64(t[n])}function ul(t,e){for(var n=0;n<t.length;n++)e.writeSFixed64(t[n])}function hl(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+16777216*t[e+3]}function dl(t,e,n){t[n]=e,t[n+1]=e>>>8,t[n+2]=e>>>16,t[n+3]=e>>>24}function pl(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}function fl(t,e,n){1===t&&n.readMessage(Al,e)}function Al(t,e,n){if(3===t){var i=n.readMessage(gl,{}),r=i.width,o=i.height,s=i.left,a=i.top,l=i.advance;e.push({id:i.id,bitmap:new ys({width:r+6,height:o+6},i.bitmap),metrics:{width:r,height:o,left:s,top:a,advance:l}})}}function gl(t,e,n){1===t?e.id=n.readVarint():2===t?e.bitmap=n.readBytes():3===t?e.width=n.readVarint():4===t?e.height=n.readVarint():5===t?e.left=n.readSVarint():6===t?e.top=n.readSVarint():7===t&&(e.advance=n.readVarint())}function ml(t){for(var e=0,n=0,i=0,r=t;i<r.length;i+=1){var o=r[i];e+=o.w*o.h,n=Math.max(n,o.w)}t.sort((function(t,e){return e.h-t.h}));for(var s=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(e/.95)),n),h:1/0}],a=0,l=0,c=0,u=t;c<u.length;c+=1)for(var h=u[c],d=s.length-1;d>=0;d--){var p=s[d];if(!(h.w>p.w||h.h>p.h)){if(h.x=p.x,h.y=p.y,l=Math.max(l,h.y+h.h),a=Math.max(a,h.x+h.w),h.w===p.w&&h.h===p.h){var f=s.pop();d<s.length&&(s[d]=f)}else h.h===p.h?(p.x+=h.w,p.w-=h.w):h.w===p.w?(p.y+=h.h,p.h-=h.h):(s.push({x:p.x+h.w,y:p.y,w:p.w-h.w,h:h.h}),p.y+=h.h,p.h-=h.h);break}}return{w:a,h:l,fill:e/(a*l)||0}}Ja.prototype={destroy:function(){this.buf=null},readFields:function(t,e,n){for(n=n||this.length;this.pos<n;){var i=this.readVarint(),r=i>>3,o=this.pos;this.type=7&i,t(r,e,this),this.pos===o&&this.skip(i)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=hl(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=pl(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=hl(this.buf,this.pos)+4294967296*hl(this.buf,this.pos+4);return this.pos+=8,t},readSFixed64:function(){var t=hl(this.buf,this.pos)+4294967296*pl(this.buf,this.pos+4);return this.pos+=8,t},readFloat:function(){var t=Xa(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=Xa(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,n,i=this.buf;return e=127&(n=i[this.pos++]),n<128?e:(e|=(127&(n=i[this.pos++]))<<7,n<128?e:(e|=(127&(n=i[this.pos++]))<<14,n<128?e:(e|=(127&(n=i[this.pos++]))<<21,n<128?e:function(t,e,n){var i,r,o=n.buf;if(i=(112&(r=o[n.pos++]))>>4,r<128)return tl(t,i,e);if(i|=(127&(r=o[n.pos++]))<<3,r<128)return tl(t,i,e);if(i|=(127&(r=o[n.pos++]))<<10,r<128)return tl(t,i,e);if(i|=(127&(r=o[n.pos++]))<<17,r<128)return tl(t,i,e);if(i|=(127&(r=o[n.pos++]))<<24,r<128)return tl(t,i,e);if(i|=(1&(r=o[n.pos++]))<<31,r<128)return tl(t,i,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(n=i[this.pos]))<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2==1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=12&&Ya?function(t,e,n){return Ya.decode(t.subarray(e,n))}(this.buf,e,t):function(t,e,n){for(var i="",r=e;r<n;){var o,s,a,l=t[r],c=null,u=l>239?4:l>223?3:l>191?2:1;if(r+u>n)break;1===u?l<128&&(c=l):2===u?128==(192&(o=t[r+1]))&&(c=(31&l)<<6|63&o)<=127&&(c=null):3===u?(s=t[r+2],128==(192&(o=t[r+1]))&&128==(192&s)&&((c=(15&l)<<12|(63&o)<<6|63&s)<=2047||c>=55296&&c<=57343)&&(c=null)):4===u&&(s=t[r+2],a=t[r+3],128==(192&(o=t[r+1]))&&128==(192&s)&&128==(192&a)&&((c=(15&l)<<18|(63&o)<<12|(63&s)<<6|63&a)<=65535||c>=1114112)&&(c=null)),null===c?(c=65533,u=1):c>65535&&(c-=65536,i+=String.fromCharCode(c>>>10&1023|55296),c=56320|1023&c),i+=String.fromCharCode(c),r+=u}return i}(this.buf,e,t)},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){if(this.type!==Ja.Bytes)return t.push(this.readVarint(e));var n=$a(this);for(t=t||[];this.pos<n;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){if(this.type!==Ja.Bytes)return t.push(this.readSVarint());var e=$a(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==Ja.Bytes)return t.push(this.readBoolean());var e=$a(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==Ja.Bytes)return t.push(this.readFloat());var e=$a(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==Ja.Bytes)return t.push(this.readDouble());var e=$a(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==Ja.Bytes)return t.push(this.readFixed32());var e=$a(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==Ja.Bytes)return t.push(this.readSFixed32());var e=$a(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==Ja.Bytes)return t.push(this.readFixed64());var e=$a(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==Ja.Bytes)return t.push(this.readSFixed64());var e=$a(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=7&t;if(e===Ja.Varint)for(;this.buf[this.pos++]>127;);else if(e===Ja.Bytes)this.pos=this.readVarint()+this.pos;else if(e===Ja.Fixed32)this.pos+=4;else{if(e!==Ja.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e<this.pos+t;)e*=2;if(e!==this.length){var n=new Uint8Array(e);n.set(this.buf),this.buf=n,this.length=e}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(t){this.realloc(4),dl(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),dl(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),dl(this.buf,-1&t,this.pos),dl(this.buf,Math.floor(t*(1/4294967296)),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),dl(this.buf,-1&t,this.pos),dl(this.buf,Math.floor(t*(1/4294967296)),this.pos+4),this.pos+=8},writeVarint:function(t){(t=+t||0)>268435455||t<0?function(t,e){var n,i;if(t>=0?(n=t%4294967296|0,i=t/4294967296|0):(i=~(-t/4294967296),4294967295^(n=~(-t%4294967296))?n=n+1|0:(n=0,i=i+1|0)),t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),function(t,e,n){n.buf[n.pos++]=127&t|128,t>>>=7,n.buf[n.pos++]=127&t|128,t>>>=7,n.buf[n.pos++]=127&t|128,t>>>=7,n.buf[n.pos++]=127&t|128,n.buf[n.pos]=127&(t>>>=7)}(n,0,e),function(t,e){var n=(7&t)<<4;e.buf[e.pos++]|=n|((t>>>=3)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t)))))}(i,e)}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))))},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t),this.realloc(4*t.length),this.pos++;var e=this.pos;this.pos=function(t,e,n){for(var i,r,o=0;o<e.length;o++){if((i=e.charCodeAt(o))>55295&&i<57344){if(!r){i>56319||o+1===e.length?(t[n++]=239,t[n++]=191,t[n++]=189):r=i;continue}if(i<56320){t[n++]=239,t[n++]=191,t[n++]=189,r=i;continue}i=r-55296<<10|i-56320|65536,r=null}else r&&(t[n++]=239,t[n++]=191,t[n++]=189,r=null);i<128?t[n++]=i:(i<2048?t[n++]=i>>6|192:(i<65536?t[n++]=i>>12|224:(t[n++]=i>>18|240,t[n++]=i>>12&63|128),t[n++]=i>>6&63|128),t[n++]=63&i|128)}return n}(this.buf,t,this.pos);var n=this.pos-e;n>=128&&el(e,n,this),this.pos=e-1,this.writeVarint(n),this.pos+=n},writeFloat:function(t){this.realloc(4),Ka(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),Ka(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var n=0;n<e;n++)this.buf[this.pos++]=t[n]},writeRawMessage:function(t,e){this.pos++;var n=this.pos;t(e,this);var i=this.pos-n;i>=128&&el(n,i,this),this.pos=n-1,this.writeVarint(i),this.pos+=i},writeMessage:function(t,e,n){this.writeTag(t,Ja.Bytes),this.writeRawMessage(e,n)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,nl,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,il,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,sl,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,rl,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,ol,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,al,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,ll,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,cl,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,ul,e)},writeBytesField:function(t,e){this.writeTag(t,Ja.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,Ja.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,Ja.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,Ja.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,Ja.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,Ja.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,Ja.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,Ja.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,Ja.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,Ja.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}};var yl=function(t,e){var n=e.pixelRatio,i=e.version,r=e.stretchX,o=e.stretchY,s=e.content;this.paddedRect=t,this.pixelRatio=n,this.stretchX=r,this.stretchY=o,this.content=s,this.version=i},_l={tl:{configurable:!0},br:{configurable:!0},tlbr:{configurable:!0},displaySize:{configurable:!0}};_l.tl.get=function(){return[this.paddedRect.x+1,this.paddedRect.y+1]},_l.br.get=function(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]},_l.tlbr.get=function(){return this.tl.concat(this.br)},_l.displaySize.get=function(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]},Object.defineProperties(yl.prototype,_l);var vl=function(t,e){var n={},i={};this.haveRenderCallbacks=[];var r=[];this.addImages(t,n,r),this.addImages(e,i,r);var o=ml(r),s=new _s({width:o.w||1,height:o.h||1});for(var a in t){var l=t[a],c=n[a].paddedRect;_s.copy(l.data,s,{x:0,y:0},{x:c.x+1,y:c.y+1},l.data)}for(var u in e){var h=e[u],d=i[u].paddedRect,p=d.x+1,f=d.y+1,A=h.data.width,g=h.data.height;_s.copy(h.data,s,{x:0,y:0},{x:p,y:f},h.data),_s.copy(h.data,s,{x:0,y:g-1},{x:p,y:f-1},{width:A,height:1}),_s.copy(h.data,s,{x:0,y:0},{x:p,y:f+g},{width:A,height:1}),_s.copy(h.data,s,{x:A-1,y:0},{x:p-1,y:f},{width:1,height:g}),_s.copy(h.data,s,{x:0,y:0},{x:p+A,y:f},{width:1,height:g})}this.image=s,this.iconPositions=n,this.patternPositions=i};vl.prototype.addImages=function(t,e,n){for(var i in t){var r=t[i],o={x:0,y:0,w:r.data.width+2,h:r.data.height+2};n.push(o),e[i]=new yl(o,r),r.hasRenderCallback&&this.haveRenderCallbacks.push(i)}},vl.prototype.patchUpdatedImages=function(t,e){for(var n in t.dispatchRenderCallbacks(this.haveRenderCallbacks),t.updatedImages)this.patchUpdatedImage(this.iconPositions[n],t.getImage(n),e),this.patchUpdatedImage(this.patternPositions[n],t.getImage(n),e)},vl.prototype.patchUpdatedImage=function(t,e,n){if(t&&e&&t.version!==e.version){t.version=e.version;var i=t.tl;n.update(e.data,void 0,{x:i[0],y:i[1]})}},Ni("ImagePosition",yl),Ni("ImageAtlas",vl);var bl={horizontal:1,vertical:2,horizontalOnly:3},xl=function(){this.scale=1,this.fontStack="",this.imageName=null};xl.forText=function(t,e){var n=new xl;return n.scale=t||1,n.fontStack=e,n},xl.forImage=function(t){var e=new xl;return e.imageName=t,e};var wl=function(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null};function El(t,e,n,i,r,o,s,a,l,c,u,h,d,p,f,A){var g,m=wl.fromFeature(t,r);h===bl.vertical&&m.verticalizePunctuation();var y=sr.processBidirectionalText,_=sr.processStyledBidirectionalText;if(y&&1===m.sections.length){g=[];for(var v=0,b=y(m.toString(),Bl(m,c,o,e,i,p,f));v<b.length;v+=1){var x=b[v],w=new wl;w.text=x,w.sections=m.sections;for(var E=0;E<x.length;E++)w.sectionIndex.push(0);g.push(w)}}else if(_){g=[];for(var C=0,T=_(m.text,m.sectionIndex,Bl(m,c,o,e,i,p,f));C<T.length;C+=1){var S=T[C],P=new wl;P.text=S[0],P.sectionIndex=S[1],P.sections=m.sections,g.push(P)}}else g=function(t,e){for(var n=[],i=t.text,r=0,o=0,s=e;o<s.length;o+=1){var a=s[o];n.push(t.substring(r,a)),r=a}return r<i.length&&n.push(t.substring(r,i.length)),n}(m,Bl(m,c,o,e,i,p,f));var M=[],I={positionedLines:M,text:m.toString(),top:u[1],bottom:u[1],left:u[0],right:u[0],writingMode:h,iconsInText:!1,verticalizable:!1};return function(t,e,n,i,r,o,s,a,l,c,u,h){for(var d=0,p=-17,f=0,A=0,g="right"===a?1:"left"===a?0:.5,m=0,y=0,_=r;y<_.length;y+=1){var v=_[y];v.trim();var b=v.getMaxScale(),x=24*(b-1),w={positionedGlyphs:[],lineOffset:0};t.positionedLines[m]=w;var E=w.positionedGlyphs,C=0;if(v.length()){for(var T=0;T<v.length();T++){var S=v.getSection(T),P=v.getSectionIndex(T),M=v.getCharCode(T),I=0,B=null,R=null,L=null,O=24,D=!(l===bl.horizontal||!u&&!Zi(M)||u&&(Cl[M]||(H=M,Wi.Arabic(H)||Wi["Arabic Supplement"](H)||Wi["Arabic Extended-A"](H)||Wi["Arabic Presentation Forms-A"](H)||Wi["Arabic Presentation Forms-B"](H))));if(S.imageName){var k=i[S.imageName];if(!k)continue;L=S.imageName,t.iconsInText=t.iconsInText||!0,R=k.paddedRect;var F=k.displaySize;S.scale=24*S.scale/h,I=x+(24-F[1]*S.scale),O=(B={width:F[0],height:F[1],left:1,top:-3,advance:D?F[1]:F[0]}).advance;var N=D?F[0]*S.scale-24*b:F[1]*S.scale-24*b;N>0&&N>C&&(C=N)}else{var z=n[S.fontStack],U=z&&z[M];if(U&&U.rect)R=U.rect,B=U.metrics;else{var G=e[S.fontStack],V=G&&G[M];if(!V)continue;B=V.metrics}I=24*(b-S.scale)}D?(t.verticalizable=!0,E.push({glyph:M,imageName:L,x:d,y:p+I,vertical:D,scale:S.scale,fontStack:S.fontStack,sectionIndex:P,metrics:B,rect:R}),d+=O*S.scale+c):(E.push({glyph:M,imageName:L,x:d,y:p+I,vertical:D,scale:S.scale,fontStack:S.fontStack,sectionIndex:P,metrics:B,rect:R}),d+=B.advance*S.scale+c)}0!==E.length&&(f=Math.max(d-c,f),Ll(E,0,E.length-1,g,C)),d=0;var j=o*b+C;w.lineOffset=Math.max(C,x),p+=j,A=Math.max(j,A),++m}else p+=o,++m}var H,W=p- -17,q=Rl(s),Z=q.horizontalAlign,X=q.verticalAlign;(function(t,e,n,i,r,o,s,a,l){var c,u=(e-n)*r;c=o!==s?-a*i- -17:(-i*l+.5)*s;for(var h=0,d=t;h<d.length;h+=1)for(var p=0,f=d[h].positionedGlyphs;p<f.length;p+=1){var A=f[p];A.x+=u,A.y+=c}})(t.positionedLines,g,Z,X,f,A,o,W,r.length),t.top+=-X*W,t.bottom=t.top+W,t.left+=-Z*f,t.right=t.left+f}(I,e,n,i,g,s,a,l,h,c,d,A),!function(t){for(var e=0,n=t;e<n.length;e+=1)if(0!==n[e].positionedGlyphs.length)return!1;return!0}(M)&&I}wl.fromFeature=function(t,e){for(var n=new wl,i=0;i<t.sections.length;i++){var r=t.sections[i];r.image?n.addImageSection(r):n.addTextSection(r,e)}return n},wl.prototype.length=function(){return this.text.length},wl.prototype.getSection=function(t){return this.sections[this.sectionIndex[t]]},wl.prototype.getSectionIndex=function(t){return this.sectionIndex[t]},wl.prototype.getCharCode=function(t){return this.text.charCodeAt(t)},wl.prototype.verticalizePunctuation=function(){this.text=function(t){for(var e="",n=0;n<t.length;n++){var i=t.charCodeAt(n+1)||null,r=t.charCodeAt(n-1)||null;e+=i&&Xi(i)&&!Za[t[n+1]]||r&&Xi(r)&&!Za[t[n-1]]||!Za[t[n]]?t[n]:Za[t[n]]}return e}(this.text)},wl.prototype.trim=function(){for(var t=0,e=0;e<this.text.length&&Cl[this.text.charCodeAt(e)];e++)t++;for(var n=this.text.length,i=this.text.length-1;i>=0&&i>=t&&Cl[this.text.charCodeAt(i)];i--)n--;this.text=this.text.substring(t,n),this.sectionIndex=this.sectionIndex.slice(t,n)},wl.prototype.substring=function(t,e){var n=new wl;return n.text=this.text.substring(t,e),n.sectionIndex=this.sectionIndex.slice(t,e),n.sections=this.sections,n},wl.prototype.toString=function(){return this.text},wl.prototype.getMaxScale=function(){var t=this;return this.sectionIndex.reduce((function(e,n){return Math.max(e,t.sections[n].scale)}),0)},wl.prototype.addTextSection=function(t,e){this.text+=t.text,this.sections.push(xl.forText(t.scale,t.fontStack||e));for(var n=this.sections.length-1,i=0;i<t.text.length;++i)this.sectionIndex.push(n)},wl.prototype.addImageSection=function(t){var e=t.image?t.image.name:"";if(0!==e.length){var n=this.getNextImageSectionCharCode();n?(this.text+=String.fromCharCode(n),this.sections.push(xl.forImage(e)),this.sectionIndex.push(this.sections.length-1)):w("Reached maximum number of images 6401")}else w("Can't add FormattedSection with an empty image.")},wl.prototype.getNextImageSectionCharCode=function(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)};var Cl={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},Tl={};function Sl(t,e,n,i,r,o){if(e.imageName){var s=i[e.imageName];return s?s.displaySize[0]*e.scale*24/o+r:0}var a=n[e.fontStack],l=a&&a[t];return l?l.metrics.advance*e.scale+r:0}function Pl(t,e,n,i){var r=Math.pow(t-e,2);return i?t<e?r/2:2*r:r+Math.abs(n)*n}function Ml(t,e,n){var i=0;return 10===t&&(i-=1e4),n&&(i+=150),40!==t&&65288!==t||(i+=50),41!==e&&65289!==e||(i+=50),i}function Il(t,e,n,i,r,o){for(var s=null,a=Pl(e,n,r,o),l=0,c=i;l<c.length;l+=1){var u=c[l],h=Pl(e-u.x,n,r,o)+u.badness;h<=a&&(s=u,a=h)}return{index:t,x:e,priorBreak:s,badness:a}}function Bl(t,e,n,i,r,o,s){if("point"!==o)return[];if(!t)return[];for(var a,l=[],c=function(t,e,n,i,r,o){for(var s=0,a=0;a<t.length();a++){var l=t.getSection(a);s+=Sl(t.getCharCode(a),l,i,r,e,o)}return s/Math.max(1,Math.ceil(s/n))}(t,e,n,i,r,s),u=t.text.indexOf("\u200b")>=0,h=0,d=0;d<t.length();d++){var p=t.getSection(d),f=t.getCharCode(d);if(Cl[f]||(h+=Sl(f,p,i,r,e,s)),d<t.length()-1){var A=!((a=f)<11904||!(Wi["Bopomofo Extended"](a)||Wi.Bopomofo(a)||Wi["CJK Compatibility Forms"](a)||Wi["CJK Compatibility Ideographs"](a)||Wi["CJK Compatibility"](a)||Wi["CJK Radicals Supplement"](a)||Wi["CJK Strokes"](a)||Wi["CJK Symbols and Punctuation"](a)||Wi["CJK Unified Ideographs Extension A"](a)||Wi["CJK Unified Ideographs"](a)||Wi["Enclosed CJK Letters and Months"](a)||Wi["Halfwidth and Fullwidth Forms"](a)||Wi.Hiragana(a)||Wi["Ideographic Description Characters"](a)||Wi["Kangxi Radicals"](a)||Wi["Katakana Phonetic Extensions"](a)||Wi.Katakana(a)||Wi["Vertical Forms"](a)||Wi["Yi Radicals"](a)||Wi["Yi Syllables"](a)));(Tl[f]||A||p.imageName)&&l.push(Il(d+1,h,c,l,Ml(f,t.getCharCode(d+1),A&&u),!1))}}return function t(e){return e?t(e.priorBreak).concat(e.index):[]}(Il(t.length(),h,c,l,0,!0))}function Rl(t){var e=.5,n=.5;switch(t){case"right":case"top-right":case"bottom-right":e=1;break;case"left":case"top-left":case"bottom-left":e=0}switch(t){case"bottom":case"bottom-right":case"bottom-left":n=1;break;case"top":case"top-right":case"top-left":n=0}return{horizontalAlign:e,verticalAlign:n}}function Ll(t,e,n,i,r){if(i||r)for(var o=t[n],s=(t[n].x+o.metrics.advance*o.scale)*i,a=e;a<=n;a++)t[a].x-=s,t[a].y+=r}function Ol(t,e,n,i,r,o){var s,a=t.image;if(a.content){var l=a.content,c=a.pixelRatio||1;s=[l[0]/c,l[1]/c,a.displaySize[0]-l[2]/c,a.displaySize[1]-l[3]/c]}var u,h,d,p,f=e.left*o,A=e.right*o;"width"===n||"both"===n?(p=r[0]+f-i[3],h=r[0]+A+i[1]):h=(p=r[0]+(f+A-a.displaySize[0])/2)+a.displaySize[0];var g=e.top*o,m=e.bottom*o;return"height"===n||"both"===n?(u=r[1]+g-i[0],d=r[1]+m+i[2]):d=(u=r[1]+(g+m-a.displaySize[1])/2)+a.displaySize[1],{image:a,top:u,right:h,bottom:d,left:p,collisionPadding:s}}Tl[10]=!0,Tl[32]=!0,Tl[38]=!0,Tl[40]=!0,Tl[41]=!0,Tl[43]=!0,Tl[45]=!0,Tl[47]=!0,Tl[173]=!0,Tl[183]=!0,Tl[8203]=!0,Tl[8208]=!0,Tl[8211]=!0,Tl[8231]=!0;var Dl=function(t){function e(e,n,i,r){t.call(this,e,n),this.angle=i,void 0!==r&&(this.segment=r)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.clone=function(){return new e(this.x,this.y,this.angle,this.segment)},e}(r);function kl(t,e){var n=e.expression;if("constant"===n.kind)return{kind:"constant",layoutSize:n.evaluate(new ar(t+1))};if("source"===n.kind)return{kind:"source"};for(var i=n.zoomStops,r=n.interpolationType,o=0;o<i.length&&i[o]<=t;)o++;for(var s=o=Math.max(0,o-1);s<i.length&&i[s]<t+1;)s++;s=Math.min(i.length-1,s);var a=i[o],l=i[s];return"composite"===n.kind?{kind:"composite",minZoom:a,maxZoom:l,interpolationType:r}:{kind:"camera",minZoom:a,maxZoom:l,minSize:n.evaluate(new ar(a)),maxSize:n.evaluate(new ar(l)),interpolationType:r}}function Fl(t,e,n){var i=e.uSize,r=n.lowerSize;return"source"===t.kind?r/128:"composite"===t.kind?He(r/128,n.upperSize/128,e.uSizeT):i}function Nl(t,e){var n=0,i=0;if("constant"===t.kind)i=t.layoutSize;else if("source"!==t.kind){var r=t.interpolationType,o=r?u(sn.interpolationFactor(r,e,t.minZoom,t.maxZoom),0,1):0;"camera"===t.kind?i=He(t.minSize,t.maxSize,o):n=o}return{uSizeT:n,uSize:i}}Ni("Anchor",Dl);var zl=Object.freeze({__proto__:null,getSizeData:kl,evaluateSizeForFeature:Fl,evaluateSizeForZoom:Nl,SIZE_PACK_FACTOR:128});function Ul(t,e,n,i,r){if(void 0===e.segment)return!0;for(var o=e,s=e.segment+1,a=0;a>-n/2;){if(--s<0)return!1;a-=t[s].dist(o),o=t[s]}a+=t[s].dist(t[s+1]),s++;for(var l=[],c=0;a<n/2;){var u=t[s],h=t[s+1];if(!h)return!1;var d=t[s-1].angleTo(u)-u.angleTo(h);for(d=Math.abs((d+3*Math.PI)%(2*Math.PI)-Math.PI),l.push({distance:a,angleDelta:d}),c+=d;a-l[0].distance>i;)c-=l.shift().angleDelta;if(c>r)return!1;s++,a+=u.dist(h)}return!0}function Gl(t){for(var e=0,n=0;n<t.length-1;n++)e+=t[n].dist(t[n+1]);return e}function Vl(t,e,n){return t?.6*e*n:0}function jl(t,e){return Math.max(t?t.right-t.left:0,e?e.right-e.left:0)}function Hl(t,e,n,i,r,o){for(var s=Vl(n,r,o),a=jl(n,i)*o,l=0,c=Gl(t)/2,u=0;u<t.length-1;u++){var h=t[u],d=t[u+1],p=h.dist(d);if(l+p>c){var f=(c-l)/p,A=He(h.x,d.x,f),g=He(h.y,d.y,f),m=new Dl(A,g,d.angleTo(h),u);return m._round(),!s||Ul(t,m,a,s,e)?m:void 0}l+=p}}function Wl(t,e,n,i,r,o,s,a,l){var c=Vl(i,o,s),u=jl(i,r),h=u*s,d=0===t[0].x||t[0].x===l||0===t[0].y||t[0].y===l;return e-h<e/4&&(e=h+e/4),function t(e,n,i,r,o,s,a,l,c){for(var u=s/2,h=Gl(e),d=0,p=n-i,f=[],A=0;A<e.length-1;A++){for(var g=e[A],m=e[A+1],y=g.dist(m),_=m.angleTo(g);p+i<d+y;){var v=((p+=i)-d)/y,b=He(g.x,m.x,v),x=He(g.y,m.y,v);if(b>=0&&b<c&&x>=0&&x<c&&p-u>=0&&p+u<=h){var w=new Dl(b,x,_,A);w._round(),r&&!Ul(e,w,s,r,o)||f.push(w)}}d+=y}return l||f.length||a||(f=t(e,d/2,i,r,o,s,a,!0,c)),f}(t,d?e/2*a%e:(u/2+2*o)*s*a%e,e,c,n,h,d,!1,l)}function ql(t,e,n,i,o){for(var s=[],a=0;a<t.length;a++)for(var l=t[a],c=void 0,u=0;u<l.length-1;u++){var h=l[u],d=l[u+1];h.x<e&&d.x<e||(h.x<e?h=new r(e,h.y+(e-h.x)/(d.x-h.x)*(d.y-h.y))._round():d.x<e&&(d=new r(e,h.y+(e-h.x)/(d.x-h.x)*(d.y-h.y))._round()),h.y<n&&d.y<n||(h.y<n?h=new r(h.x+(n-h.y)/(d.y-h.y)*(d.x-h.x),n)._round():d.y<n&&(d=new r(h.x+(n-h.y)/(d.y-h.y)*(d.x-h.x),n)._round()),h.x>=i&&d.x>=i||(h.x>=i?h=new r(i,h.y+(i-h.x)/(d.x-h.x)*(d.y-h.y))._round():d.x>=i&&(d=new r(i,h.y+(i-h.x)/(d.x-h.x)*(d.y-h.y))._round()),h.y>=o&&d.y>=o||(h.y>=o?h=new r(h.x+(o-h.y)/(d.y-h.y)*(d.x-h.x),o)._round():d.y>=o&&(d=new r(h.x+(o-h.y)/(d.y-h.y)*(d.x-h.x),o)._round()),c&&h.equals(c[c.length-1])||s.push(c=[h]),c.push(d)))))}return s}function Zl(t,e,n,i){var o=[],s=t.image,a=s.pixelRatio,l=s.paddedRect.w-2,c=s.paddedRect.h-2,u=t.right-t.left,h=t.bottom-t.top,d=s.stretchX||[[0,l]],p=s.stretchY||[[0,c]],f=function(t,e){return t+e[1]-e[0]},A=d.reduce(f,0),g=p.reduce(f,0),m=l-A,y=c-g,_=0,v=A,b=0,x=g,w=0,E=m,C=0,T=y;if(s.content&&i){var S=s.content;_=Xl(d,0,S[0]),b=Xl(p,0,S[1]),v=Xl(d,S[0],S[2]),x=Xl(p,S[1],S[3]),w=S[0]-_,C=S[1]-b,E=S[2]-S[0]-v,T=S[3]-S[1]-x}var P=function(i,o,l,c){var d=Ql(i.stretch-_,v,u,t.left),p=Jl(i.fixed-w,E,i.stretch,A),f=Ql(o.stretch-b,x,h,t.top),m=Jl(o.fixed-C,T,o.stretch,g),y=Ql(l.stretch-_,v,u,t.left),S=Jl(l.fixed-w,E,l.stretch,A),P=Ql(c.stretch-b,x,h,t.top),M=Jl(c.fixed-C,T,c.stretch,g),I=new r(d,f),B=new r(y,f),R=new r(y,P),L=new r(d,P),O=new r(p/a,m/a),D=new r(S/a,M/a),k=e*Math.PI/180;if(k){var F=Math.sin(k),N=Math.cos(k),z=[N,-F,F,N];I._matMult(z),B._matMult(z),L._matMult(z),R._matMult(z)}var U=i.stretch+i.fixed,G=o.stretch+o.fixed;return{tl:I,tr:B,bl:L,br:R,tex:{x:s.paddedRect.x+1+U,y:s.paddedRect.y+1+G,w:l.stretch+l.fixed-U,h:c.stretch+c.fixed-G},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:O,pixelOffsetBR:D,minFontScaleX:E/a/u,minFontScaleY:T/a/h,isSDF:n}};if(i&&(s.stretchX||s.stretchY))for(var M=Kl(d,m,A),I=Kl(p,y,g),B=0;B<M.length-1;B++)for(var R=M[B],L=M[B+1],O=0;O<I.length-1;O++)o.push(P(R,I[O],L,I[O+1]));else o.push(P({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:l+1},{fixed:0,stretch:c+1}));return o}function Xl(t,e,n){for(var i=0,r=0,o=t;r<o.length;r+=1){var s=o[r];i+=Math.max(e,Math.min(n,s[1]))-Math.max(e,Math.min(n,s[0]))}return i}function Kl(t,e,n){for(var i=[{fixed:-1,stretch:0}],r=0,o=t;r<o.length;r+=1){var s=o[r],a=s[0],l=s[1],c=i[i.length-1];i.push({fixed:a-c.stretch,stretch:c.stretch}),i.push({fixed:a-c.stretch,stretch:c.stretch+(l-a)})}return i.push({fixed:e+1,stretch:n}),i}function Ql(t,e,n,i){return t/e*n+i}function Jl(t,e,n,i){return t-e*n/i}var Yl=function(t,e,n,i,o,s,a,l,c,u){if(this.boxStartIndex=t.length,c){var h=s.top,d=s.bottom,p=s.collisionPadding;p&&(h-=p[1],d+=p[3]);var f=d-h;f>0&&(f=Math.max(10,f),this.circleDiameter=f)}else{var A=s.top*a-l,g=s.bottom*a+l,m=s.left*a-l,y=s.right*a+l,_=s.collisionPadding;if(_&&(m-=_[0]*a,A-=_[1]*a,y+=_[2]*a,g+=_[3]*a),u){var v=new r(m,A),b=new r(y,A),x=new r(m,g),w=new r(y,g),E=u*Math.PI/180;v._rotate(E),b._rotate(E),x._rotate(E),w._rotate(E),m=Math.min(v.x,b.x,x.x,w.x),y=Math.max(v.x,b.x,x.x,w.x),A=Math.min(v.y,b.y,x.y,w.y),g=Math.max(v.y,b.y,x.y,w.y)}t.emplaceBack(e.x,e.y,m,A,y,g,n,i,o)}this.boxEndIndex=t.length},$l=function(t,e){if(void 0===t&&(t=[]),void 0===e&&(e=tc),this.data=t,this.length=this.data.length,this.compare=e,this.length>0)for(var n=(this.length>>1)-1;n>=0;n--)this._down(n)};function tc(t,e){return t<e?-1:t>e?1:0}function ec(t,e,n){void 0===e&&(e=1),void 0===n&&(n=!1);for(var i=1/0,o=1/0,s=-1/0,a=-1/0,l=t[0],c=0;c<l.length;c++){var u=l[c];(!c||u.x<i)&&(i=u.x),(!c||u.y<o)&&(o=u.y),(!c||u.x>s)&&(s=u.x),(!c||u.y>a)&&(a=u.y)}var h=Math.min(s-i,a-o),d=h/2,p=new $l([],nc);if(0===h)return new r(i,o);for(var f=i;f<s;f+=h)for(var A=o;A<a;A+=h)p.push(new ic(f+d,A+d,d,t));for(var g=function(t){for(var e=0,n=0,i=0,r=t[0],o=0,s=r.length,a=s-1;o<s;a=o++){var l=r[o],c=r[a],u=l.x*c.y-c.x*l.y;n+=(l.x+c.x)*u,i+=(l.y+c.y)*u,e+=3*u}return new ic(n/e,i/e,0,t)}(t),m=p.length;p.length;){var y=p.pop();(y.d>g.d||!g.d)&&(g=y,n&&console.log("found best %d after %d probes",Math.round(1e4*y.d)/1e4,m)),y.max-g.d<=e||(p.push(new ic(y.p.x-(d=y.h/2),y.p.y-d,d,t)),p.push(new ic(y.p.x+d,y.p.y-d,d,t)),p.push(new ic(y.p.x-d,y.p.y+d,d,t)),p.push(new ic(y.p.x+d,y.p.y+d,d,t)),m+=4)}return n&&(console.log("num probes: "+m),console.log("best distance: "+g.d)),g.p}function nc(t,e){return e.max-t.max}function ic(t,e,n,i){this.p=new r(t,e),this.h=n,this.d=function(t,e){for(var n=!1,i=1/0,r=0;r<e.length;r++)for(var o=e[r],s=0,a=o.length,l=a-1;s<a;l=s++){var c=o[s],u=o[l];c.y>t.y!=u.y>t.y&&t.x<(u.x-c.x)*(t.y-c.y)/(u.y-c.y)+c.x&&(n=!n),i=Math.min(i,Jo(t,c,u))}return(n?1:-1)*Math.sqrt(i)}(this.p,i),this.max=this.d+this.h*Math.SQRT2}$l.prototype.push=function(t){this.data.push(t),this.length++,this._up(this.length-1)},$l.prototype.pop=function(){if(0!==this.length){var t=this.data[0],e=this.data.pop();return this.length--,this.length>0&&(this.data[0]=e,this._down(0)),t}},$l.prototype.peek=function(){return this.data[0]},$l.prototype._up=function(t){for(var e=this.data,n=this.compare,i=e[t];t>0;){var r=t-1>>1,o=e[r];if(n(i,o)>=0)break;e[t]=o,t=r}e[t]=i},$l.prototype._down=function(t){for(var e=this.data,n=this.compare,i=this.length>>1,r=e[t];t<i;){var o=1+(t<<1),s=e[o],a=o+1;if(a<this.length&&n(e[a],s)<0&&(o=a,s=e[a]),n(s,r)>=0)break;e[t]=s,t=o}e[t]=r};var rc=Number.POSITIVE_INFINITY;function oc(t,e){return e[1]!==rc?function(t,e,n){var i=0,r=0;switch(e=Math.abs(e),n=Math.abs(n),t){case"top-right":case"top-left":case"top":r=n-7;break;case"bottom-right":case"bottom-left":case"bottom":r=7-n}switch(t){case"top-right":case"bottom-right":case"right":i=-e;break;case"top-left":case"bottom-left":case"left":i=e}return[i,r]}(t,e[0],e[1]):function(t,e){var n=0,i=0;e<0&&(e=0);var r=e/Math.sqrt(2);switch(t){case"top-right":case"top-left":i=r-7;break;case"bottom-right":case"bottom-left":i=7-r;break;case"bottom":i=7-e;break;case"top":i=e-7}switch(t){case"top-right":case"bottom-right":n=-r;break;case"top-left":case"bottom-left":n=r;break;case"left":n=e;break;case"right":n=-e}return[n,i]}(t,e[0])}function sc(t){switch(t){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function ac(t,e,n,i,o,s,a,l,c,u,h,d,p,f,A){var g=function(t,e,n,i,o,s,a,l){for(var c=i.layout.get("text-rotate").evaluate(s,{})*Math.PI/180,u=[],h=0,d=e.positionedLines;h<d.length;h+=1)for(var p=d[h],f=0,A=p.positionedGlyphs;f<A.length;f+=1){var g=A[f];if(g.rect){var m=g.rect||{},y=4,_=!0,v=1,b=0,x=(o||l)&&g.vertical,w=g.metrics.advance*g.scale/2;if(l&&e.verticalizable&&(b=p.lineOffset/2-(g.imageName?-(24-g.metrics.width*g.scale)/2:24*(g.scale-1))),g.imageName){var E=a[g.imageName];_=E.sdf,y=1/(v=E.pixelRatio)}var C=o?[g.x+w,g.y]:[0,0],T=o?[0,0]:[g.x+w+n[0],g.y+n[1]-b],S=[0,0];x&&(S=T,T=[0,0]);var P=(g.metrics.left-y)*g.scale-w+T[0],M=(-g.metrics.top-y)*g.scale+T[1],I=P+m.w*g.scale/v,B=M+m.h*g.scale/v,R=new r(P,M),L=new r(I,M),O=new r(P,B),D=new r(I,B);if(x){var k=new r(-w,w- -17),F=-Math.PI/2,N=12-w,z=new r(22-N,-(g.imageName?N:0)),U=new(Function.prototype.bind.apply(r,[null].concat(S)));R._rotateAround(F,k)._add(z)._add(U),L._rotateAround(F,k)._add(z)._add(U),O._rotateAround(F,k)._add(z)._add(U),D._rotateAround(F,k)._add(z)._add(U)}if(c){var G=Math.sin(c),V=Math.cos(c),j=[V,-G,G,V];R._matMult(j),L._matMult(j),O._matMult(j),D._matMult(j)}var H=new r(0,0),W=new r(0,0);u.push({tl:R,tr:L,bl:O,br:D,tex:m,writingMode:e.writingMode,glyphOffset:C,sectionIndex:g.sectionIndex,isSDF:_,pixelOffsetTL:H,pixelOffsetBR:W,minFontScaleX:0,minFontScaleY:0})}}return u}(0,n,l,o,s,a,i,t.allowVerticalPlacement),m=t.textSizeData,y=null;"source"===m.kind?(y=[128*o.layout.get("text-size").evaluate(a,{})])[0]>32640&&w(t.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'):"composite"===m.kind&&((y=[128*f.compositeTextSizes[0].evaluate(a,{},A),128*f.compositeTextSizes[1].evaluate(a,{},A)])[0]>32640||y[1]>32640)&&w(t.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'),t.addSymbols(t.text,g,y,l,s,a,u,e,c.lineStartIndex,c.lineLength,p,A);for(var _=0,v=h;_<v.length;_+=1)d[v[_]]=t.text.placedSymbolArray.length-1;return 4*g.length}function lc(t){for(var e in t)return t[e];return null}function cc(t,e,n,i){var r=t.compareText;if(e in r){for(var o=r[e],s=o.length-1;s>=0;s--)if(i.dist(o[s])<n)return!0}else r[e]=[];return r[e].push(i),!1}var uc=va.VectorTileFeature.types,hc=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function dc(t,e,n,i,r,o,s,a,l,c,u,h,d){var p=a?Math.min(32640,Math.round(a[0])):0,f=a?Math.min(32640,Math.round(a[1])):0;t.emplaceBack(e,n,Math.round(32*i),Math.round(32*r),o,s,(p<<1)+(l?1:0),f,16*c,16*u,256*h,256*d)}function pc(t,e,n){t.emplaceBack(e.x,e.y,n),t.emplaceBack(e.x,e.y,n),t.emplaceBack(e.x,e.y,n),t.emplaceBack(e.x,e.y,n)}function fc(t){for(var e=0,n=t.sections;e<n.length;e+=1)if(Ji(n[e].text))return!0;return!1}var Ac=function(t){this.layoutVertexArray=new Or,this.indexArray=new Gr,this.programConfigurations=t,this.segments=new ao,this.dynamicLayoutVertexArray=new Dr,this.opacityVertexArray=new kr,this.placedSymbolArray=new $r};Ac.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length&&0===this.indexArray.length&&0===this.dynamicLayoutVertexArray.length&&0===this.opacityVertexArray.length},Ac.prototype.upload=function(t,e,n,i){this.isEmpty()||(n&&(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Ga.members),this.indexBuffer=t.createIndexBuffer(this.indexArray,e),this.dynamicLayoutVertexBuffer=t.createVertexBuffer(this.dynamicLayoutVertexArray,Va.members,!0),this.opacityVertexBuffer=t.createVertexBuffer(this.opacityVertexArray,hc,!0),this.opacityVertexBuffer.itemSize=1),(n||i)&&this.programConfigurations.upload(t))},Ac.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())},Ni("SymbolBuffers",Ac);var gc=function(t,e,n){this.layoutVertexArray=new t,this.layoutAttributes=e,this.indexArray=new n,this.segments=new ao,this.collisionVertexArray=new Ur};gc.prototype.upload=function(t){this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=t.createVertexBuffer(this.collisionVertexArray,ja.members,!0)},gc.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())},Ni("CollisionBuffers",gc);var mc=function(t){this.collisionBoxArray=t.collisionBoxArray,this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.pixelRatio=t.pixelRatio,this.sourceLayerIndex=t.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=as([]),this.placementViewportMatrix=as([]);var e=this.layers[0]._unevaluatedLayout._values;this.textSizeData=kl(this.zoom,e["text-size"]),this.iconSizeData=kl(this.zoom,e["icon-size"]);var n=this.layers[0].layout,i=n.get("symbol-sort-key"),r=n.get("symbol-z-order");this.canOverlap=n.get("text-allow-overlap")||n.get("icon-allow-overlap")||n.get("text-ignore-placement")||n.get("icon-ignore-placement"),this.sortFeaturesByKey="viewport-y"!==r&&void 0!==i.constantOr(1),this.sortFeaturesByY=("viewport-y"===r||"auto"===r&&!this.sortFeaturesByKey)&&this.canOverlap,"point"===n.get("symbol-placement")&&(this.writingModes=n.get("text-writing-mode").map((function(t){return bl[t]}))),this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id})),this.sourceID=t.sourceID};mc.prototype.createArrays=function(){this.text=new Ac(new Do(this.layers,this.zoom,(function(t){return/^text/.test(t)}))),this.icon=new Ac(new Do(this.layers,this.zoom,(function(t){return/^icon/.test(t)}))),this.glyphOffsetArray=new no,this.lineVertexArray=new io,this.symbolInstances=new eo},mc.prototype.calculateGlyphDependencies=function(t,e,n,i,r){for(var o=0;o<t.length;o++)if(e[t.charCodeAt(o)]=!0,(n||i)&&r){var s=Za[t.charAt(o)];s&&(e[s.charCodeAt(0)]=!0)}},mc.prototype.populate=function(t,e,n){var i=this.layers[0],r=i.layout,o=r.get("text-font"),s=r.get("text-field"),a=r.get("icon-image"),l=("constant"!==s.value.kind||s.value.value instanceof ie&&!s.value.value.isEmpty()||s.value.value.toString().length>0)&&("constant"!==o.value.kind||o.value.value.length>0),c="constant"!==a.value.kind||!!a.value.value||Object.keys(a.parameters).length>0,u=r.get("symbol-sort-key");if(this.features=[],l||c){for(var h=e.iconDependencies,d=e.glyphDependencies,p=e.availableImages,f=new ar(this.zoom),A=0,g=t;A<g.length;A+=1){var m=g[A],y=m.feature,_=m.id,v=m.index,b=m.sourceLayerIndex,x=i._featureFilter.needGeometry,w=Go(y,x);if(i._featureFilter.filter(f,w,n)){x||(w.geometry=Uo(y));var E=void 0;if(l){var C=i.getValueAndResolveTokens("text-field",w,n,p),T=ie.factory(C);fc(T)&&(this.hasRTLText=!0),(!this.hasRTLText||"unavailable"===rr()||this.hasRTLText&&sr.isParsed())&&(E=qa(T,i,w))}var S=void 0;if(c){var P=i.getValueAndResolveTokens("icon-image",w,n,p);S=P instanceof re?P:re.fromString(P)}if(E||S){var M=this.sortFeaturesByKey?u.evaluate(w,{},n):void 0;if(this.features.push({id:_,text:E,icon:S,index:v,sourceLayerIndex:b,geometry:w.geometry,properties:y.properties,type:uc[y.type],sortKey:M}),S&&(h[S.name]=!0),E){var I=o.evaluate(w,{},n).join(","),B="map"===r.get("text-rotation-alignment")&&"point"!==r.get("symbol-placement");this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(bl.vertical)>=0;for(var R=0,L=E.sections;R<L.length;R+=1){var O=L[R];if(O.image)h[O.image.name]=!0;else{var D=qi(E.toString()),k=O.fontStack||I,F=d[k]=d[k]||{};this.calculateGlyphDependencies(O.text,F,B,this.allowVerticalPlacement,D)}}}}}}"line"===r.get("symbol-placement")&&(this.features=function(t){var e={},n={},i=[],r=0;function o(e){i.push(t[e]),r++}function s(t,e,r){var o=n[t];return delete n[t],n[e]=o,i[o].geometry[0].pop(),i[o].geometry[0]=i[o].geometry[0].concat(r[0]),o}function a(t,n,r){var o=e[n];return delete e[n],e[t]=o,i[o].geometry[0].shift(),i[o].geometry[0]=r[0].concat(i[o].geometry[0]),o}function l(t,e,n){var i=n?e[0][e[0].length-1]:e[0][0];return t+":"+i.x+":"+i.y}for(var c=0;c<t.length;c++){var u=t[c],h=u.geometry,d=u.text?u.text.toString():null;if(d){var p=l(d,h),f=l(d,h,!0);if(p in n&&f in e&&n[p]!==e[f]){var A=a(p,f,h),g=s(p,f,i[A].geometry);delete e[p],delete n[f],n[l(d,i[g].geometry,!0)]=g,i[A].geometry=null}else p in n?s(p,f,h):f in e?a(p,f,h):(o(c),e[p]=r-1,n[f]=r-1)}else o(c)}return i.filter((function(t){return t.geometry}))}(this.features)),this.sortFeaturesByKey&&this.features.sort((function(t,e){return t.sortKey-e.sortKey}))}},mc.prototype.update=function(t,e,n){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(t,e,this.layers,n),this.icon.programConfigurations.updatePaintArrays(t,e,this.layers,n))},mc.prototype.isEmpty=function(){return 0===this.symbolInstances.length&&!this.hasRTLText},mc.prototype.uploadPending=function(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload},mc.prototype.upload=function(t){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(t),this.iconCollisionBox.upload(t)),this.text.upload(t,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(t,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0},mc.prototype.destroyDebugData=function(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()},mc.prototype.destroy=function(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()},mc.prototype.addToLineVertexArray=function(t,e){var n=this.lineVertexArray.length;if(void 0!==t.segment){for(var i=t.dist(e[t.segment+1]),r=t.dist(e[t.segment]),o={},s=t.segment+1;s<e.length;s++)o[s]={x:e[s].x,y:e[s].y,tileUnitDistanceFromAnchor:i},s<e.length-1&&(i+=e[s+1].dist(e[s]));for(var a=t.segment||0;a>=0;a--)o[a]={x:e[a].x,y:e[a].y,tileUnitDistanceFromAnchor:r},a>0&&(r+=e[a-1].dist(e[a]));for(var l=0;l<e.length;l++){var c=o[l];this.lineVertexArray.emplaceBack(c.x,c.y,c.tileUnitDistanceFromAnchor)}}return{lineStartIndex:n,lineLength:this.lineVertexArray.length-n}},mc.prototype.addSymbols=function(t,e,n,i,r,o,s,a,l,c,u,h){for(var d=t.indexArray,p=t.layoutVertexArray,f=t.segments.prepareSegment(4*e.length,p,d,this.canOverlap?o.sortKey:void 0),A=this.glyphOffsetArray.length,g=f.vertexLength,m=this.allowVerticalPlacement&&s===bl.vertical?Math.PI/2:0,y=o.text&&o.text.sections,_=0;_<e.length;_++){var v=e[_],b=v.tl,x=v.tr,w=v.bl,E=v.br,C=v.tex,T=v.pixelOffsetTL,S=v.pixelOffsetBR,P=v.minFontScaleX,M=v.minFontScaleY,I=v.glyphOffset,B=v.isSDF,R=v.sectionIndex,L=f.vertexLength,O=I[1];dc(p,a.x,a.y,b.x,O+b.y,C.x,C.y,n,B,T.x,T.y,P,M),dc(p,a.x,a.y,x.x,O+x.y,C.x+C.w,C.y,n,B,S.x,T.y,P,M),dc(p,a.x,a.y,w.x,O+w.y,C.x,C.y+C.h,n,B,T.x,S.y,P,M),dc(p,a.x,a.y,E.x,O+E.y,C.x+C.w,C.y+C.h,n,B,S.x,S.y,P,M),pc(t.dynamicLayoutVertexArray,a,m),d.emplaceBack(L,L+1,L+2),d.emplaceBack(L+1,L+2,L+3),f.vertexLength+=4,f.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(I[0]),_!==e.length-1&&R===e[_+1].sectionIndex||t.programConfigurations.populatePaintArrays(p.length,o,o.index,{},h,y&&y[R])}t.placedSymbolArray.emplaceBack(a.x,a.y,A,this.glyphOffsetArray.length-A,g,l,c,a.segment,n?n[0]:0,n?n[1]:0,i[0],i[1],s,0,!1,0,u)},mc.prototype._addCollisionDebugVertex=function(t,e,n,i,r,o){return e.emplaceBack(0,0),t.emplaceBack(n.x,n.y,i,r,Math.round(o.x),Math.round(o.y))},mc.prototype.addCollisionDebugVertices=function(t,e,n,i,o,s,a){var l=o.segments.prepareSegment(4,o.layoutVertexArray,o.indexArray),c=l.vertexLength,u=o.layoutVertexArray,h=o.collisionVertexArray,d=a.anchorX,p=a.anchorY;this._addCollisionDebugVertex(u,h,s,d,p,new r(t,e)),this._addCollisionDebugVertex(u,h,s,d,p,new r(n,e)),this._addCollisionDebugVertex(u,h,s,d,p,new r(n,i)),this._addCollisionDebugVertex(u,h,s,d,p,new r(t,i)),l.vertexLength+=4;var f=o.indexArray;f.emplaceBack(c,c+1),f.emplaceBack(c+1,c+2),f.emplaceBack(c+2,c+3),f.emplaceBack(c+3,c),l.primitiveLength+=4},mc.prototype.addDebugCollisionBoxes=function(t,e,n,i){for(var r=t;r<e;r++){var o=this.collisionBoxArray.get(r);this.addCollisionDebugVertices(o.x1,o.y1,o.x2,o.y2,i?this.textCollisionBox:this.iconCollisionBox,o.anchorPoint,n)}},mc.prototype.generateCollisionDebugBuffers=function(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new gc(Nr,Ha.members,Zr),this.iconCollisionBox=new gc(Nr,Ha.members,Zr);for(var t=0;t<this.symbolInstances.length;t++){var e=this.symbolInstances.get(t);this.addDebugCollisionBoxes(e.textBoxStartIndex,e.textBoxEndIndex,e,!0),this.addDebugCollisionBoxes(e.verticalTextBoxStartIndex,e.verticalTextBoxEndIndex,e,!0),this.addDebugCollisionBoxes(e.iconBoxStartIndex,e.iconBoxEndIndex,e,!1),this.addDebugCollisionBoxes(e.verticalIconBoxStartIndex,e.verticalIconBoxEndIndex,e,!1)}},mc.prototype._deserializeCollisionBoxesForSymbol=function(t,e,n,i,r,o,s,a,l){for(var c={},u=e;u<n;u++){var h=t.get(u);c.textBox={x1:h.x1,y1:h.y1,x2:h.x2,y2:h.y2,anchorPointX:h.anchorPointX,anchorPointY:h.anchorPointY},c.textFeatureIndex=h.featureIndex;break}for(var d=i;d<r;d++){var p=t.get(d);c.verticalTextBox={x1:p.x1,y1:p.y1,x2:p.x2,y2:p.y2,anchorPointX:p.anchorPointX,anchorPointY:p.anchorPointY},c.verticalTextFeatureIndex=p.featureIndex;break}for(var f=o;f<s;f++){var A=t.get(f);c.iconBox={x1:A.x1,y1:A.y1,x2:A.x2,y2:A.y2,anchorPointX:A.anchorPointX,anchorPointY:A.anchorPointY},c.iconFeatureIndex=A.featureIndex;break}for(var g=a;g<l;g++){var m=t.get(g);c.verticalIconBox={x1:m.x1,y1:m.y1,x2:m.x2,y2:m.y2,anchorPointX:m.anchorPointX,anchorPointY:m.anchorPointY},c.verticalIconFeatureIndex=m.featureIndex;break}return c},mc.prototype.deserializeCollisionBoxes=function(t){this.collisionArrays=[];for(var e=0;e<this.symbolInstances.length;e++){var n=this.symbolInstances.get(e);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(t,n.textBoxStartIndex,n.textBoxEndIndex,n.verticalTextBoxStartIndex,n.verticalTextBoxEndIndex,n.iconBoxStartIndex,n.iconBoxEndIndex,n.verticalIconBoxStartIndex,n.verticalIconBoxEndIndex))}},mc.prototype.hasTextData=function(){return this.text.segments.get().length>0},mc.prototype.hasIconData=function(){return this.icon.segments.get().length>0},mc.prototype.hasDebugData=function(){return this.textCollisionBox&&this.iconCollisionBox},mc.prototype.hasTextCollisionBoxData=function(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0},mc.prototype.hasIconCollisionBoxData=function(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0},mc.prototype.addIndicesForPlacedSymbol=function(t,e){for(var n=t.placedSymbolArray.get(e),i=n.vertexStartIndex+4*n.numGlyphs,r=n.vertexStartIndex;r<i;r+=4)t.indexArray.emplaceBack(r,r+1,r+2),t.indexArray.emplaceBack(r+1,r+2,r+3)},mc.prototype.getSortedSymbolIndexes=function(t){if(this.sortedAngle===t&&void 0!==this.symbolInstanceIndexes)return this.symbolInstanceIndexes;for(var e=Math.sin(t),n=Math.cos(t),i=[],r=[],o=[],s=0;s<this.symbolInstances.length;++s){o.push(s);var a=this.symbolInstances.get(s);i.push(0|Math.round(e*a.anchorX+n*a.anchorY)),r.push(a.featureIndex)}return o.sort((function(t,e){return i[t]-i[e]||r[e]-r[t]})),o},mc.prototype.addToSortKeyRanges=function(t,e){var n=this.sortKeyRanges[this.sortKeyRanges.length-1];n&&n.sortKey===e?n.symbolInstanceEnd=t+1:this.sortKeyRanges.push({sortKey:e,symbolInstanceStart:t,symbolInstanceEnd:t+1})},mc.prototype.sortFeatures=function(t){var e=this;if(this.sortFeaturesByY&&this.sortedAngle!==t&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(t),this.sortedAngle=t,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(var n=0,i=this.symbolInstanceIndexes;n<i.length;n+=1){var r=this.symbolInstances.get(i[n]);this.featureSortOrder.push(r.featureIndex),[r.rightJustifiedTextSymbolIndex,r.centerJustifiedTextSymbolIndex,r.leftJustifiedTextSymbolIndex].forEach((function(t,n,i){t>=0&&i.indexOf(t)===n&&e.addIndicesForPlacedSymbol(e.text,t)})),r.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,r.verticalPlacedTextSymbolIndex),r.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,r.placedIconSymbolIndex),r.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,r.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}},Ni("SymbolBucket",mc,{omit:["layers","collisionBoxArray","features","compareText"]}),mc.MAX_GLYPHS=65535,mc.addDynamicAttributes=pc;var yc=new br({"symbol-placement":new gr(Mt.layout_symbol["symbol-placement"]),"symbol-spacing":new gr(Mt.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new gr(Mt.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new mr(Mt.layout_symbol["symbol-sort-key"]),"symbol-z-order":new gr(Mt.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new gr(Mt.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new gr(Mt.layout_symbol["icon-ignore-placement"]),"icon-optional":new gr(Mt.layout_symbol["icon-optional"]),"icon-rotation-alignment":new gr(Mt.layout_symbol["icon-rotation-alignment"]),"icon-size":new mr(Mt.layout_symbol["icon-size"]),"icon-text-fit":new gr(Mt.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new gr(Mt.layout_symbol["icon-text-fit-padding"]),"icon-image":new mr(Mt.layout_symbol["icon-image"]),"icon-rotate":new mr(Mt.layout_symbol["icon-rotate"]),"icon-padding":new gr(Mt.layout_symbol["icon-padding"]),"icon-keep-upright":new gr(Mt.layout_symbol["icon-keep-upright"]),"icon-offset":new mr(Mt.layout_symbol["icon-offset"]),"icon-anchor":new mr(Mt.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new gr(Mt.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new gr(Mt.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new gr(Mt.layout_symbol["text-rotation-alignment"]),"text-field":new mr(Mt.layout_symbol["text-field"]),"text-font":new mr(Mt.layout_symbol["text-font"]),"text-size":new mr(Mt.layout_symbol["text-size"]),"text-max-width":new mr(Mt.layout_symbol["text-max-width"]),"text-line-height":new gr(Mt.layout_symbol["text-line-height"]),"text-letter-spacing":new mr(Mt.layout_symbol["text-letter-spacing"]),"text-justify":new mr(Mt.layout_symbol["text-justify"]),"text-radial-offset":new mr(Mt.layout_symbol["text-radial-offset"]),"text-variable-anchor":new gr(Mt.layout_symbol["text-variable-anchor"]),"text-anchor":new mr(Mt.layout_symbol["text-anchor"]),"text-max-angle":new gr(Mt.layout_symbol["text-max-angle"]),"text-writing-mode":new gr(Mt.layout_symbol["text-writing-mode"]),"text-rotate":new mr(Mt.layout_symbol["text-rotate"]),"text-padding":new gr(Mt.layout_symbol["text-padding"]),"text-keep-upright":new gr(Mt.layout_symbol["text-keep-upright"]),"text-transform":new mr(Mt.layout_symbol["text-transform"]),"text-offset":new mr(Mt.layout_symbol["text-offset"]),"text-allow-overlap":new gr(Mt.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new gr(Mt.layout_symbol["text-ignore-placement"]),"text-optional":new gr(Mt.layout_symbol["text-optional"])}),_c={paint:new br({"icon-opacity":new mr(Mt.paint_symbol["icon-opacity"]),"icon-color":new mr(Mt.paint_symbol["icon-color"]),"icon-halo-color":new mr(Mt.paint_symbol["icon-halo-color"]),"icon-halo-width":new mr(Mt.paint_symbol["icon-halo-width"]),"icon-halo-blur":new mr(Mt.paint_symbol["icon-halo-blur"]),"icon-translate":new gr(Mt.paint_symbol["icon-translate"]),"icon-translate-anchor":new gr(Mt.paint_symbol["icon-translate-anchor"]),"text-opacity":new mr(Mt.paint_symbol["text-opacity"]),"text-color":new mr(Mt.paint_symbol["text-color"],{runtimeType:Gt,getOverride:function(t){return t.textColor},hasOverride:function(t){return!!t.textColor}}),"text-halo-color":new mr(Mt.paint_symbol["text-halo-color"]),"text-halo-width":new mr(Mt.paint_symbol["text-halo-width"]),"text-halo-blur":new mr(Mt.paint_symbol["text-halo-blur"]),"text-translate":new gr(Mt.paint_symbol["text-translate"]),"text-translate-anchor":new gr(Mt.paint_symbol["text-translate-anchor"])}),layout:yc},vc=function(t){this.type=t.property.overrides?t.property.overrides.runtimeType:Ft,this.defaultValue=t};vc.prototype.evaluate=function(t){if(t.formattedSection){var e=this.defaultValue.property.overrides;if(e&&e.hasOverride(t.formattedSection))return e.getOverride(t.formattedSection)}return t.feature&&t.featureState?this.defaultValue.evaluate(t.feature,t.featureState):this.defaultValue.property.specification.default},vc.prototype.eachChild=function(t){this.defaultValue.isConstant()||t(this.defaultValue.value._styleExpression.expression)},vc.prototype.outputDefined=function(){return!1},vc.prototype.serialize=function(){return null},Ni("FormatSectionOverride",vc,{omit:["defaultValue"]});var bc=function(t){function e(e){t.call(this,e,_c)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.recalculate=function(e,n){if(t.prototype.recalculate.call(this,e,n),"auto"===this.layout.get("icon-rotation-alignment")&&(this.layout._values["icon-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-rotation-alignment")&&(this.layout._values["text-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-pitch-alignment")&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),"auto"===this.layout.get("icon-pitch-alignment")&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),"point"===this.layout.get("symbol-placement")){var i=this.layout.get("text-writing-mode");if(i){for(var r=[],o=0,s=i;o<s.length;o+=1){var a=s[o];r.indexOf(a)<0&&r.push(a)}this.layout._values["text-writing-mode"]=r}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()},e.prototype.getValueAndResolveTokens=function(t,e,n,i){var r=this.layout.get(t).evaluate(e,{},n,i),o=this._unevaluatedLayout._values[t];return o.isDataDriven()||qn(o.value)||!r?r:function(t,e){return e.replace(/{([^{}]+)}/g,(function(e,n){return n in t?String(t[n]):""}))}(e.properties,r)},e.prototype.createBucket=function(t){return new mc(t)},e.prototype.queryRadius=function(){return 0},e.prototype.queryIntersectsFeature=function(){return!1},e.prototype._setPaintOverrides=function(){for(var t=0,n=_c.paint.overridableProperties;t<n.length;t+=1){var i=n[t];if(e.hasPaintOverride(this.layout,i)){var r,o=this.paint.get(i),s=new vc(o),a=new Wn(s,o.property.specification);r="constant"===o.value.kind||"source"===o.value.kind?new Xn("source",a):new Kn("composite",a,o.value.zoomStops,o.value._interpolationType),this.paint._values[i]=new fr(o.property,r,o.parameters)}}},e.prototype._handleOverridablePaintPropertyUpdate=function(t,n,i){return!(!this.layout||n.isDataDriven()||i.isDataDriven())&&e.hasPaintOverride(this.layout,t)},e.hasPaintOverride=function(t,e){var n=t.get("text-field"),i=_c.paint.properties[e],r=!1,o=function(t){for(var e=0,n=t;e<n.length;e+=1)if(i.overrides&&i.overrides.hasOverride(n[e]))return void(r=!0)};if("constant"===n.value.kind&&n.value.value instanceof ie)o(n.value.value.sections);else if("source"===n.value.kind){var s=function(t){r||(t instanceof ce&&ae(t.value)===Wt?o(t.value.sections):t instanceof pe?o(t.sections):t.eachChild(s))},a=n.value;a._styleExpression&&s(a._styleExpression.expression)}return r},e}(xr),xc={paint:new br({"background-color":new gr(Mt.paint_background["background-color"]),"background-pattern":new _r(Mt.paint_background["background-pattern"]),"background-opacity":new gr(Mt.paint_background["background-opacity"])})},wc=function(t){function e(e){t.call(this,e,xc)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(xr),Ec={paint:new br({"raster-opacity":new gr(Mt.paint_raster["raster-opacity"]),"raster-hue-rotate":new gr(Mt.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new gr(Mt.paint_raster["raster-brightness-min"]),"raster-brightness-max":new gr(Mt.paint_raster["raster-brightness-max"]),"raster-saturation":new gr(Mt.paint_raster["raster-saturation"]),"raster-contrast":new gr(Mt.paint_raster["raster-contrast"]),"raster-resampling":new gr(Mt.paint_raster["raster-resampling"]),"raster-fade-duration":new gr(Mt.paint_raster["raster-fade-duration"])})},Cc=function(t){function e(e){t.call(this,e,Ec)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(xr),Tc=function(t){function e(e){t.call(this,e,{}),this.implementation=e}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.is3D=function(){return"3d"===this.implementation.renderingMode},e.prototype.hasOffscreenPass=function(){return void 0!==this.implementation.prerender},e.prototype.recalculate=function(){},e.prototype.updateTransitions=function(){},e.prototype.hasTransition=function(){},e.prototype.serialize=function(){},e.prototype.onAdd=function(t){this.implementation.onAdd&&this.implementation.onAdd(t,t.painter.context.gl)},e.prototype.onRemove=function(t){this.implementation.onRemove&&this.implementation.onRemove(t,t.painter.context.gl)},e}(xr),Sc={circle:ds,heatmap:xs,hillshade:Es,fill:ua,"fill-extrusion":Sa,line:za,symbol:bc,background:wc,raster:Cc},Pc=s.HTMLImageElement,Mc=s.HTMLCanvasElement,Ic=s.HTMLVideoElement,Bc=s.ImageData,Rc=s.ImageBitmap,Lc=function(t,e,n,i){this.context=t,this.format=n,this.texture=t.gl.createTexture(),this.update(e,i)};Lc.prototype.update=function(t,e,n){var i=t.width,r=t.height,o=!(this.size&&this.size[0]===i&&this.size[1]===r||n),s=this.context,a=s.gl;if(this.useMipmap=Boolean(e&&e.useMipmap),a.bindTexture(a.TEXTURE_2D,this.texture),s.pixelStoreUnpackFlipY.set(!1),s.pixelStoreUnpack.set(1),s.pixelStoreUnpackPremultiplyAlpha.set(this.format===a.RGBA&&(!e||!1!==e.premultiply)),o)this.size=[i,r],t instanceof Pc||t instanceof Mc||t instanceof Ic||t instanceof Bc||Rc&&t instanceof Rc?a.texImage2D(a.TEXTURE_2D,0,this.format,this.format,a.UNSIGNED_BYTE,t):a.texImage2D(a.TEXTURE_2D,0,this.format,i,r,0,this.format,a.UNSIGNED_BYTE,t.data);else{var l=n||{x:0,y:0},c=l.x,u=l.y;t instanceof Pc||t instanceof Mc||t instanceof Ic||t instanceof Bc||Rc&&t instanceof Rc?a.texSubImage2D(a.TEXTURE_2D,0,c,u,a.RGBA,a.UNSIGNED_BYTE,t):a.texSubImage2D(a.TEXTURE_2D,0,c,u,i,r,a.RGBA,a.UNSIGNED_BYTE,t.data)}this.useMipmap&&this.isSizePowerOfTwo()&&a.generateMipmap(a.TEXTURE_2D)},Lc.prototype.bind=function(t,e,n){var i=this.context.gl;i.bindTexture(i.TEXTURE_2D,this.texture),n!==i.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(n=i.LINEAR),t!==this.filter&&(i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,t),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,n||t),this.filter=t),e!==this.wrap&&(i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,e),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,e),this.wrap=e)},Lc.prototype.isSizePowerOfTwo=function(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0},Lc.prototype.destroy=function(){this.context.gl.deleteTexture(this.texture),this.texture=null};var Oc=function(t){var e=this;this._callback=t,this._triggered=!1,"undefined"!=typeof MessageChannel&&(this._channel=new MessageChannel,this._channel.port2.onmessage=function(){e._triggered=!1,e._callback()})};Oc.prototype.trigger=function(){var t=this;this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout((function(){t._triggered=!1,t._callback()}),0))},Oc.prototype.remove=function(){delete this._channel,this._callback=function(){}};var Dc=function(t,e,n){this.target=t,this.parent=e,this.mapId=n,this.callbacks={},this.tasks={},this.taskQueue=[],this.cancelCallbacks={},m(["receive","process"],this),this.invoker=new Oc(this.process),this.target.addEventListener("message",this.receive,!1),this.globalScope=T()?t:s};function kc(t,e,n){var i=2*Math.PI*6378137/256/Math.pow(2,n);return[t*i-2*Math.PI*6378137/2,e*i-2*Math.PI*6378137/2]}Dc.prototype.send=function(t,e,n,i,r){var o=this;void 0===r&&(r=!1);var s=Math.round(1e18*Math.random()).toString(36).substring(0,10);n&&(this.callbacks[s]=n);var a=M(this.globalScope)?void 0:[];return this.target.postMessage({id:s,type:t,hasCallback:!!n,targetMapId:i,mustQueue:r,sourceMapId:this.mapId,data:Vi(e,a)},a),{cancel:function(){n&&delete o.callbacks[s],o.target.postMessage({id:s,type:"<cancel>",targetMapId:i,sourceMapId:o.mapId})}}},Dc.prototype.receive=function(t){var e=t.data,n=e.id;if(n&&(!e.targetMapId||this.mapId===e.targetMapId))if("<cancel>"===e.type){delete this.tasks[n];var i=this.cancelCallbacks[n];delete this.cancelCallbacks[n],i&&i()}else T()||e.mustQueue?(this.tasks[n]=e,this.taskQueue.push(n),this.invoker.trigger()):this.processTask(n,e)},Dc.prototype.process=function(){if(this.taskQueue.length){var t=this.taskQueue.shift(),e=this.tasks[t];delete this.tasks[t],this.taskQueue.length&&this.invoker.trigger(),e&&this.processTask(t,e)}},Dc.prototype.processTask=function(t,e){var n=this;if("<response>"===e.type){var i=this.callbacks[t];delete this.callbacks[t],i&&(e.error?i(ji(e.error)):i(null,ji(e.data)))}else{var r=!1,o=M(this.globalScope)?void 0:[],s=e.hasCallback?function(e,i){r=!0,delete n.cancelCallbacks[t],n.target.postMessage({id:t,type:"<response>",sourceMapId:n.mapId,error:e?Vi(e):null,data:Vi(i,o)},o)}:function(t){r=!0},a=null,l=ji(e.data);if(this.parent[e.type])a=this.parent[e.type](e.sourceMapId,l,s);else if(this.parent.getWorkerSource){var c=e.type.split(".");a=this.parent.getWorkerSource(e.sourceMapId,c[0],l.source)[c[1]](l,s)}else s(new Error("Could not find function "+e.type));!r&&a&&a.cancel&&(this.cancelCallbacks[t]=a.cancel)}},Dc.prototype.remove=function(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)};var Fc=function(t,e){t&&(e?this.setSouthWest(t).setNorthEast(e):4===t.length?this.setSouthWest([t[0],t[1]]).setNorthEast([t[2],t[3]]):this.setSouthWest(t[0]).setNorthEast(t[1]))};Fc.prototype.setNorthEast=function(t){return this._ne=t instanceof Nc?new Nc(t.lng,t.lat):Nc.convert(t),this},Fc.prototype.setSouthWest=function(t){return this._sw=t instanceof Nc?new Nc(t.lng,t.lat):Nc.convert(t),this},Fc.prototype.extend=function(t){var e,n,i=this._sw,r=this._ne;if(t instanceof Nc)e=t,n=t;else{if(!(t instanceof Fc))return Array.isArray(t)?4===t.length||t.every(Array.isArray)?this.extend(Fc.convert(t)):this.extend(Nc.convert(t)):this;if(n=t._ne,!(e=t._sw)||!n)return this}return i||r?(i.lng=Math.min(e.lng,i.lng),i.lat=Math.min(e.lat,i.lat),r.lng=Math.max(n.lng,r.lng),r.lat=Math.max(n.lat,r.lat)):(this._sw=new Nc(e.lng,e.lat),this._ne=new Nc(n.lng,n.lat)),this},Fc.prototype.getCenter=function(){return new Nc((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},Fc.prototype.getSouthWest=function(){return this._sw},Fc.prototype.getNorthEast=function(){return this._ne},Fc.prototype.getNorthWest=function(){return new Nc(this.getWest(),this.getNorth())},Fc.prototype.getSouthEast=function(){return new Nc(this.getEast(),this.getSouth())},Fc.prototype.getWest=function(){return this._sw.lng},Fc.prototype.getSouth=function(){return this._sw.lat},Fc.prototype.getEast=function(){return this._ne.lng},Fc.prototype.getNorth=function(){return this._ne.lat},Fc.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},Fc.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},Fc.prototype.isEmpty=function(){return!(this._sw&&this._ne)},Fc.prototype.contains=function(t){var e=Nc.convert(t),n=e.lng,i=e.lat,r=this._sw.lng<=n&&n<=this._ne.lng;return this._sw.lng>this._ne.lng&&(r=this._sw.lng>=n&&n>=this._ne.lng),this._sw.lat<=i&&i<=this._ne.lat&&r},Fc.convert=function(t){return!t||t instanceof Fc?t:new Fc(t)};var Nc=function(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid LngLat object: ("+t+", "+e+")");if(this.lng=+t,this.lat=+e,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")};Nc.prototype.wrap=function(){return new Nc(h(this.lng,-180,180),this.lat)},Nc.prototype.toArray=function(){return[this.lng,this.lat]},Nc.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},Nc.prototype.distanceTo=function(t){var e=Math.PI/180,n=this.lat*e,i=t.lat*e,r=Math.sin(n)*Math.sin(i)+Math.cos(n)*Math.cos(i)*Math.cos((t.lng-this.lng)*e);return 6371008.8*Math.acos(Math.min(r,1))},Nc.prototype.toBounds=function(t){void 0===t&&(t=0);var e=360*t/40075017,n=e/Math.cos(Math.PI/180*this.lat);return new Fc(new Nc(this.lng-n,this.lat-e),new Nc(this.lng+n,this.lat+e))},Nc.convert=function(t){if(t instanceof Nc)return t;if(Array.isArray(t)&&(2===t.length||3===t.length))return new Nc(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&"object"==typeof t&&null!==t)return new Nc(Number("lng"in t?t.lng:t.lon),Number(t.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, an object {lon: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]")};var zc=2*Math.PI*6371008.8;function Uc(t){return zc*Math.cos(t*Math.PI/180)}function Gc(t){return(180+t)/360}function Vc(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}function jc(t,e){return t/Uc(e)}function Hc(t){return 360/Math.PI*Math.atan(Math.exp((180-360*t)*Math.PI/180))-90}var Wc=function(t,e,n){void 0===n&&(n=0),this.x=+t,this.y=+e,this.z=+n};Wc.fromLngLat=function(t,e){void 0===e&&(e=0);var n=Nc.convert(t);return new Wc(Gc(n.lng),Vc(n.lat),jc(e,n.lat))},Wc.prototype.toLngLat=function(){return new Nc(360*this.x-180,Hc(this.y))},Wc.prototype.toAltitude=function(){return this.z*Uc(Hc(this.y))},Wc.prototype.meterInMercatorCoordinateUnits=function(){return 1/zc*(t=Hc(this.y),1/Math.cos(t*Math.PI/180));var t};var qc=function(t,e,n){this.z=t,this.x=e,this.y=n,this.key=Kc(0,t,t,e,n)};qc.prototype.equals=function(t){return this.z===t.z&&this.x===t.x&&this.y===t.y},qc.prototype.url=function(t,e){var n,i,r,o,s,a=(i=this.y,r=this.z,o=kc(256*(n=this.x),256*(i=Math.pow(2,r)-i-1),r),s=kc(256*(n+1),256*(i+1),r),o[0]+","+o[1]+","+s[0]+","+s[1]),l=function(t,e,n){for(var i,r="",o=t;o>0;o--)r+=(e&(i=1<<o-1)?1:0)+(n&i?2:0);return r}(this.z,this.x,this.y);return t[(this.x+this.y)%t.length].replace("{prefix}",(this.x%16).toString(16)+(this.y%16).toString(16)).replace("{z}",String(this.z)).replace("{x}",String(this.x)).replace("{y}",String("tms"===e?Math.pow(2,this.z)-this.y-1:this.y)).replace("{quadkey}",l).replace("{bbox-epsg-3857}",a)},qc.prototype.getTilePoint=function(t){var e=Math.pow(2,this.z);return new r(8192*(t.x*e-this.x),8192*(t.y*e-this.y))},qc.prototype.toString=function(){return this.z+"/"+this.x+"/"+this.y};var Zc=function(t,e){this.wrap=t,this.canonical=e,this.key=Kc(t,e.z,e.z,e.x,e.y)},Xc=function(t,e,n,i,r){this.overscaledZ=t,this.wrap=e,this.canonical=new qc(n,+i,+r),this.key=Kc(e,t,n,i,r)};function Kc(t,e,n,i,r){(t*=2)<0&&(t=-1*t-1);var o=1<<n;return(o*o*t+o*r+i).toString(36)+n.toString(36)+e.toString(36)}Xc.prototype.equals=function(t){return this.overscaledZ===t.overscaledZ&&this.wrap===t.wrap&&this.canonical.equals(t.canonical)},Xc.prototype.scaledTo=function(t){var e=this.canonical.z-t;return t>this.canonical.z?new Xc(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Xc(t,this.wrap,t,this.canonical.x>>e,this.canonical.y>>e)},Xc.prototype.calculateScaledKey=function(t,e){var n=this.canonical.z-t;return t>this.canonical.z?Kc(this.wrap*+e,t,this.canonical.z,this.canonical.x,this.canonical.y):Kc(this.wrap*+e,t,t,this.canonical.x>>n,this.canonical.y>>n)},Xc.prototype.isChildOf=function(t){if(t.wrap!==this.wrap)return!1;var e=this.canonical.z-t.canonical.z;return 0===t.overscaledZ||t.overscaledZ<this.overscaledZ&&t.canonical.x===this.canonical.x>>e&&t.canonical.y===this.canonical.y>>e},Xc.prototype.children=function(t){if(this.overscaledZ>=t)return[new Xc(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];var e=this.canonical.z+1,n=2*this.canonical.x,i=2*this.canonical.y;return[new Xc(e,this.wrap,e,n,i),new Xc(e,this.wrap,e,n+1,i),new Xc(e,this.wrap,e,n,i+1),new Xc(e,this.wrap,e,n+1,i+1)]},Xc.prototype.isLessThan=function(t){return this.wrap<t.wrap||!(this.wrap>t.wrap)&&(this.overscaledZ<t.overscaledZ||!(this.overscaledZ>t.overscaledZ)&&(this.canonical.x<t.canonical.x||!(this.canonical.x>t.canonical.x)&&this.canonical.y<t.canonical.y))},Xc.prototype.wrapped=function(){return new Xc(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)},Xc.prototype.unwrapTo=function(t){return new Xc(this.overscaledZ,t,this.canonical.z,this.canonical.x,this.canonical.y)},Xc.prototype.overscaleFactor=function(){return Math.pow(2,this.overscaledZ-this.canonical.z)},Xc.prototype.toUnwrapped=function(){return new Zc(this.wrap,this.canonical)},Xc.prototype.toString=function(){return this.overscaledZ+"/"+this.canonical.x+"/"+this.canonical.y},Xc.prototype.getTilePoint=function(t){return this.canonical.getTilePoint(new Wc(t.x-this.wrap,t.y))},Ni("CanonicalTileID",qc),Ni("OverscaledTileID",Xc,{omit:["posMatrix"]});var Qc=function(t,e,n){if(this.uid=t,e.height!==e.width)throw new RangeError("DEM tiles must be square");if(n&&"mapbox"!==n&&"terrarium"!==n)return w('"'+n+'" is not a valid encoding type. Valid types include "mapbox" and "terrarium".');this.stride=e.height;var i=this.dim=e.height-2;this.data=new Uint32Array(e.data.buffer),this.encoding=n||"mapbox";for(var r=0;r<i;r++)this.data[this._idx(-1,r)]=this.data[this._idx(0,r)],this.data[this._idx(i,r)]=this.data[this._idx(i-1,r)],this.data[this._idx(r,-1)]=this.data[this._idx(r,0)],this.data[this._idx(r,i)]=this.data[this._idx(r,i-1)];this.data[this._idx(-1,-1)]=this.data[this._idx(0,0)],this.data[this._idx(i,-1)]=this.data[this._idx(i-1,0)],this.data[this._idx(-1,i)]=this.data[this._idx(0,i-1)],this.data[this._idx(i,i)]=this.data[this._idx(i-1,i-1)]};Qc.prototype.get=function(t,e){var n=new Uint8Array(this.data.buffer),i=4*this._idx(t,e);return("terrarium"===this.encoding?this._unpackTerrarium:this._unpackMapbox)(n[i],n[i+1],n[i+2])},Qc.prototype.getUnpackVector=function(){return"terrarium"===this.encoding?[256,1,1/256,32768]:[6553.6,25.6,.1,1e4]},Qc.prototype._idx=function(t,e){if(t<-1||t>=this.dim+1||e<-1||e>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(e+1)*this.stride+(t+1)},Qc.prototype._unpackMapbox=function(t,e,n){return(256*t*256+256*e+n)/10-1e4},Qc.prototype._unpackTerrarium=function(t,e,n){return 256*t+e+n/256-32768},Qc.prototype.getPixels=function(){return new _s({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},Qc.prototype.backfillBorder=function(t,e,n){if(this.dim!==t.dim)throw new Error("dem dimension mismatch");var i=e*this.dim,r=e*this.dim+this.dim,o=n*this.dim,s=n*this.dim+this.dim;switch(e){case-1:i=r-1;break;case 1:r=i+1}switch(n){case-1:o=s-1;break;case 1:s=o+1}for(var a=-e*this.dim,l=-n*this.dim,c=o;c<s;c++)for(var u=i;u<r;u++)this.data[this._idx(u,c)]=t.data[this._idx(u+a,c+l)]},Ni("DEMData",Qc);var Jc=function(t){this._stringToNumber={},this._numberToString=[];for(var e=0;e<t.length;e++){var n=t[e];this._stringToNumber[n]=e,this._numberToString[e]=n}};Jc.prototype.encode=function(t){return this._stringToNumber[t]},Jc.prototype.decode=function(t){return this._numberToString[t]};var Yc=function(t,e,n,i,r){this.type="Feature",this._vectorTileFeature=t,t._z=e,t._x=n,t._y=i,this.properties=t.properties,this.id=r},$c={geometry:{configurable:!0}};$c.geometry.get=function(){return void 0===this._geometry&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry},$c.geometry.set=function(t){this._geometry=t},Yc.prototype.toJSON=function(){var t={geometry:this.geometry};for(var e in this)"_geometry"!==e&&"_vectorTileFeature"!==e&&(t[e]=this[e]);return t},Object.defineProperties(Yc.prototype,$c);var tu=function(){this.state={},this.stateChanges={},this.deletedStates={}};tu.prototype.updateState=function(t,e,n){var i=String(e);if(this.stateChanges[t]=this.stateChanges[t]||{},this.stateChanges[t][i]=this.stateChanges[t][i]||{},d(this.stateChanges[t][i],n),null===this.deletedStates[t])for(var r in this.deletedStates[t]={},this.state[t])r!==i&&(this.deletedStates[t][r]=null);else if(this.deletedStates[t]&&null===this.deletedStates[t][i])for(var o in this.deletedStates[t][i]={},this.state[t][i])n[o]||(this.deletedStates[t][i][o]=null);else for(var s in n)this.deletedStates[t]&&this.deletedStates[t][i]&&null===this.deletedStates[t][i][s]&&delete this.deletedStates[t][i][s]},tu.prototype.removeFeatureState=function(t,e,n){if(null!==this.deletedStates[t]){var i=String(e);if(this.deletedStates[t]=this.deletedStates[t]||{},n&&void 0!==e)null!==this.deletedStates[t][i]&&(this.deletedStates[t][i]=this.deletedStates[t][i]||{},this.deletedStates[t][i][n]=null);else if(void 0!==e)if(this.stateChanges[t]&&this.stateChanges[t][i])for(n in this.deletedStates[t][i]={},this.stateChanges[t][i])this.deletedStates[t][i][n]=null;else this.deletedStates[t][i]=null;else this.deletedStates[t]=null}},tu.prototype.getState=function(t,e){var n=String(e),i=d({},(this.state[t]||{})[n],(this.stateChanges[t]||{})[n]);if(null===this.deletedStates[t])return{};if(this.deletedStates[t]){var r=this.deletedStates[t][e];if(null===r)return{};for(var o in r)delete i[o]}return i},tu.prototype.initializeTileState=function(t,e){t.setFeatureState(this.state,e)},tu.prototype.coalesceChanges=function(t,e){var n={};for(var i in this.stateChanges){this.state[i]=this.state[i]||{};var r={};for(var o in this.stateChanges[i])this.state[i][o]||(this.state[i][o]={}),d(this.state[i][o],this.stateChanges[i][o]),r[o]=this.state[i][o];n[i]=r}for(var s in this.deletedStates){this.state[s]=this.state[s]||{};var a={};if(null===this.deletedStates[s])for(var l in this.state[s])a[l]={},this.state[s][l]={};else for(var c in this.deletedStates[s]){if(null===this.deletedStates[s][c])this.state[s][c]={};else for(var u=0,h=Object.keys(this.deletedStates[s][c]);u<h.length;u+=1)delete this.state[s][c][h[u]];a[c]=this.state[s][c]}n[s]=n[s]||{},d(n[s],a)}if(this.stateChanges={},this.deletedStates={},0!==Object.keys(n).length)for(var p in t)t[p].setFeatureState(n,e)};var eu=function(t,e){this.tileID=t,this.x=t.canonical.x,this.y=t.canonical.y,this.z=t.canonical.z,this.grid=new Li(8192,16,0),this.grid3D=new Li(8192,16,0),this.featureIndexArray=new oo,this.promoteId=e};function nu(t,e,n,i,r){return _(t,(function(t,o){var s=e instanceof Ar?e.get(o):null;return s&&s.evaluate?s.evaluate(n,i,r):s}))}function iu(t){for(var e=1/0,n=1/0,i=-1/0,r=-1/0,o=0,s=t;o<s.length;o+=1){var a=s[o];e=Math.min(e,a.x),n=Math.min(n,a.y),i=Math.max(i,a.x),r=Math.max(r,a.y)}return{minX:e,minY:n,maxX:i,maxY:r}}function ru(t,e){return e-t}eu.prototype.insert=function(t,e,n,i,r,o){var s=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(n,i,r);for(var a=o?this.grid3D:this.grid,l=0;l<e.length;l++){for(var c=e[l],u=[1/0,1/0,-1/0,-1/0],h=0;h<c.length;h++){var d=c[h];u[0]=Math.min(u[0],d.x),u[1]=Math.min(u[1],d.y),u[2]=Math.max(u[2],d.x),u[3]=Math.max(u[3],d.y)}u[0]<8192&&u[1]<8192&&u[2]>=0&&u[3]>=0&&a.insert(s,u[0],u[1],u[2],u[3])}},eu.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new va.VectorTile(new Qa(this.rawTileData)).layers,this.sourceLayerCoder=new Jc(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},eu.prototype.query=function(t,e,n,i){var o=this;this.loadVTLayers();for(var s=t.params||{},a=8192/t.tileSize/t.scale,l=si(s.filter),c=t.queryGeometry,u=t.queryPadding*a,h=iu(c),d=this.grid.query(h.minX-u,h.minY-u,h.maxX+u,h.maxY+u),p=iu(t.cameraQueryGeometry),f=this.grid3D.query(p.minX-u,p.minY-u,p.maxX+u,p.maxY+u,(function(e,n,i,o){return function(t,e,n,i,o){for(var s=0,a=t;s<a.length;s+=1){var l=a[s];if(e<=l.x&&n<=l.y&&i>=l.x&&o>=l.y)return!0}var c=[new r(e,n),new r(e,o),new r(i,o),new r(i,n)];if(t.length>2)for(var u=0,h=c;u<h.length;u+=1)if($o(t,h[u]))return!0;for(var d=0;d<t.length-1;d++)if(ts(t[d],t[d+1],c))return!0;return!1}(t.cameraQueryGeometry,e-u,n-u,i+u,o+u)})),A=0,g=f;A<g.length;A+=1)d.push(g[A]);d.sort(ru);for(var m,y={},_=function(r){var u=d[r];if(u!==m){m=u;var h=o.featureIndexArray.get(u),p=null;o.loadMatchingFeature(y,h.bucketIndex,h.sourceLayerIndex,h.featureIndex,l,s.layers,s.availableImages,e,n,i,(function(e,n,i){return p||(p=Uo(e)),n.queryIntersectsFeature(c,e,i,p,o.z,t.transform,a,t.pixelPosMatrix)}))}},v=0;v<d.length;v++)_(v);return y},eu.prototype.loadMatchingFeature=function(t,e,n,i,r,o,s,a,l,c,u){var h=this.bucketLayerIDs[e];if(!o||function(t,e){for(var n=0;n<t.length;n++)if(e.indexOf(t[n])>=0)return!0;return!1}(o,h)){var p=this.sourceLayerCoder.decode(n),f=this.vtLayers[p].feature(i);if(r.needGeometry){var A=Go(f,!0);if(!r.filter(new ar(this.tileID.overscaledZ),A,this.tileID.canonical))return}else if(!r.filter(new ar(this.tileID.overscaledZ),f))return;for(var g=this.getId(f,p),m=0;m<h.length;m++){var y=h[m];if(!(o&&o.indexOf(y)<0)){var _=a[y];if(_){var v={};void 0!==g&&c&&(v=c.getState(_.sourceLayer||"_geojsonTileLayer",g));var b=d({},l[y]);b.paint=nu(b.paint,_.paint,f,v,s),b.layout=nu(b.layout,_.layout,f,v,s);var x=!u||u(f,_,v);if(x){var w=new Yc(f,this.z,this.x,this.y,g);w.layer=b;var E=t[y];void 0===E&&(E=t[y]=[]),E.push({featureIndex:i,feature:w,intersectionZ:x})}}}}}},eu.prototype.lookupSymbolFeatures=function(t,e,n,i,r,o,s,a){var l={};this.loadVTLayers();for(var c=si(r),u=0,h=t;u<h.length;u+=1)this.loadMatchingFeature(l,n,i,h[u],c,o,s,a,e);return l},eu.prototype.hasLayer=function(t){for(var e=0,n=this.bucketLayerIDs;e<n.length;e+=1)for(var i=0,r=n[e];i<r.length;i+=1)if(t===r[i])return!0;return!1},eu.prototype.getId=function(t,e){var n=t.id;return this.promoteId&&"boolean"==typeof(n=t.properties["string"==typeof this.promoteId?this.promoteId:this.promoteId[e]])&&(n=Number(n)),n},Ni("FeatureIndex",eu,{omit:["rawTileData","sourceLayerCoder"]});var ou=function(t,e){this.tileID=t,this.uid=f(),this.uses=0,this.tileSize=e,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.expiredRequestCount=0,this.state="loading"};ou.prototype.registerFadeDuration=function(t){var e=t+this.timeAdded;e<N.now()||this.fadeEndTime&&e<this.fadeEndTime||(this.fadeEndTime=e)},ou.prototype.wasRequested=function(){return"errored"===this.state||"loaded"===this.state||"reloading"===this.state},ou.prototype.loadVectorData=function(t,e,n){if(this.hasData()&&this.unloadVectorData(),this.state="loaded",t){for(var i in t.featureIndex&&(this.latestFeatureIndex=t.featureIndex,t.rawTileData?(this.latestRawTileData=t.rawTileData,this.latestFeatureIndex.rawTileData=t.rawTileData):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData)),this.collisionBoxArray=t.collisionBoxArray,this.buckets=function(t,e){var n={};if(!e)return n;for(var i=function(){var t=o[r],i=t.layerIds.map((function(t){return e.getLayer(t)})).filter(Boolean);if(0!==i.length){t.layers=i,t.stateDependentLayerIds&&(t.stateDependentLayers=t.stateDependentLayerIds.map((function(t){return i.filter((function(e){return e.id===t}))[0]})));for(var s=0,a=i;s<a.length;s+=1)n[a[s].id]=t}},r=0,o=t;r<o.length;r+=1)i();return n}(t.buckets,e.style),this.hasSymbolBuckets=!1,this.buckets){var r=this.buckets[i];if(r instanceof mc){if(this.hasSymbolBuckets=!0,!n)break;r.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(var o in this.buckets){var s=this.buckets[o];if(s instanceof mc&&s.hasRTLText){this.hasRTLText=!0,sr.isLoading()||sr.isLoaded()||"deferred"!==rr()||or();break}}for(var a in this.queryPadding=0,this.buckets){var l=this.buckets[a];this.queryPadding=Math.max(this.queryPadding,e.style.getLayer(a).queryRadius(l))}t.imageAtlas&&(this.imageAtlas=t.imageAtlas),t.glyphAtlasImage&&(this.glyphAtlasImage=t.glyphAtlasImage)}else this.collisionBoxArray=new Jr},ou.prototype.unloadVectorData=function(){for(var t in this.buckets)this.buckets[t].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded"},ou.prototype.getBucket=function(t){return this.buckets[t.id]},ou.prototype.upload=function(t){for(var e in this.buckets){var n=this.buckets[e];n.uploadPending()&&n.upload(t)}var i=t.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new Lc(t,this.imageAtlas.image,i.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new Lc(t,this.glyphAtlasImage,i.ALPHA),this.glyphAtlasImage=null)},ou.prototype.prepare=function(t){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(t,this.imageAtlasTexture)},ou.prototype.queryRenderedFeatures=function(t,e,n,i,r,o,s,a,l,c){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:i,cameraQueryGeometry:r,scale:o,tileSize:this.tileSize,pixelPosMatrix:c,transform:a,params:s,queryPadding:this.queryPadding*l},t,e,n):{}},ou.prototype.querySourceFeatures=function(t,e){var n=this.latestFeatureIndex;if(n&&n.rawTileData){var i=n.loadVTLayers(),r=e?e.sourceLayer:"",o=i._geojsonTileLayer||i[r];if(o)for(var s=si(e&&e.filter),a=this.tileID.canonical,l=a.z,c=a.x,u=a.y,h={z:l,x:c,y:u},d=0;d<o.length;d++){var p=o.feature(d);if(s.needGeometry){var f=Go(p,!0);if(!s.filter(new ar(this.tileID.overscaledZ),f,this.tileID.canonical))continue}else if(!s.filter(new ar(this.tileID.overscaledZ),p))continue;var A=n.getId(p,r),g=new Yc(p,l,c,u,A);g.tile=h,t.push(g)}}},ou.prototype.hasData=function(){return"loaded"===this.state||"reloading"===this.state||"expired"===this.state},ou.prototype.patternsLoaded=function(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length},ou.prototype.setExpiryData=function(t){var e=this.expirationTime;if(t.cacheControl){var n=S(t.cacheControl);n["max-age"]&&(this.expirationTime=Date.now()+1e3*n["max-age"])}else t.expires&&(this.expirationTime=new Date(t.expires).getTime());if(this.expirationTime){var i=Date.now(),r=!1;if(this.expirationTime>i)r=!1;else if(e)if(this.expirationTime<e)r=!0;else{var o=this.expirationTime-e;o?this.expirationTime=i+Math.max(o,3e4):r=!0}else r=!0;r?(this.expiredRequestCount++,this.state="expired"):this.expiredRequestCount=0}},ou.prototype.getExpiryTimeout=function(){if(this.expirationTime)return this.expiredRequestCount?1e3*(1<<Math.min(this.expiredRequestCount-1,31)):Math.min(this.expirationTime-(new Date).getTime(),Math.pow(2,31)-1)},ou.prototype.setFeatureState=function(t,e){if(this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData&&0!==Object.keys(t).length){var n=this.latestFeatureIndex.loadVTLayers();for(var i in this.buckets)if(e.style.hasLayer(i)){var r=this.buckets[i],o=r.layers[0].sourceLayer||"_geojsonTileLayer",s=n[o],a=t[o];if(s&&a&&0!==Object.keys(a).length){r.update(a,s,this.imageAtlas&&this.imageAtlas.patternPositions||{});var l=e&&e.style&&e.style.getLayer(i);l&&(this.queryPadding=Math.max(this.queryPadding,l.queryRadius(r)))}}}},ou.prototype.holdingForFade=function(){return void 0!==this.symbolFadeHoldUntil},ou.prototype.symbolFadeFinished=function(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<N.now()},ou.prototype.clearFadeHold=function(){this.symbolFadeHoldUntil=void 0},ou.prototype.setHoldDuration=function(t){this.symbolFadeHoldUntil=N.now()+t},ou.prototype.setDependencies=function(t,e){for(var n={},i=0,r=e;i<r.length;i+=1)n[r[i]]=!0;this.dependencies[t]=n},ou.prototype.hasDependency=function(t,e){for(var n=0,i=t;n<i.length;n+=1){var r=this.dependencies[i[n]];if(r)for(var o=0,s=e;o<s.length;o+=1)if(r[s[o]])return!0}return!1};var su=s.performance,au=function(t){this._marks={start:[t.url,"start"].join("#"),end:[t.url,"end"].join("#"),measure:t.url.toString()},su.mark(this._marks.start)};au.prototype.finish=function(){su.mark(this._marks.end);var t=su.getEntriesByName(this._marks.measure);return 0===t.length&&(su.measure(this._marks.measure,this._marks.start,this._marks.end),t=su.getEntriesByName(this._marks.measure),su.clearMarks(this._marks.start),su.clearMarks(this._marks.end),su.clearMeasures(this._marks.measure)),t},t.Actor=Dc,t.AlphaImage=ys,t.CanonicalTileID=qc,t.CollisionBoxArray=Jr,t.Color=te,t.DEMData=Qc,t.DataConstantProperty=gr,t.DictionaryCoder=Jc,t.EXTENT=8192,t.ErrorEvent=St,t.EvaluationParameters=ar,t.Event=Tt,t.Evented=Pt,t.FeatureIndex=eu,t.FillBucket=aa,t.FillExtrusionBucket=Ea,t.ImageAtlas=vl,t.ImagePosition=yl,t.LineBucket=Da,t.LngLat=Nc,t.LngLatBounds=Fc,t.MercatorCoordinate=Wc,t.ONE_EM=24,t.OverscaledTileID=Xc,t.Point=r,t.Point$1=r,t.Properties=br,t.Protobuf=Qa,t.RGBAImage=_s,t.RequestManager=W,t.RequestPerformance=au,t.ResourceType=ft,t.SegmentVector=ao,t.SourceFeatureState=tu,t.StructArrayLayout1ui2=Xr,t.StructArrayLayout2f1f2i16=zr,t.StructArrayLayout2i4=Pr,t.StructArrayLayout3ui6=Gr,t.StructArrayLayout4i8=Mr,t.SymbolBucket=mc,t.Texture=Lc,t.Tile=ou,t.Transitionable=ur,t.Uniform1f=bo,t.Uniform1i=vo,t.Uniform2f=xo,t.Uniform3f=wo,t.Uniform4f=Eo,t.UniformColor=Co,t.UniformMatrix4f=So,t.UnwrappedTileID=Zc,t.ValidationError=It,t.WritingMode=bl,t.ZoomHistory=Hi,t.add=function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t},t.addDynamicAttributes=pc,t.asyncAll=function(t,e,n){if(!t.length)return n(null,[]);var i=t.length,r=new Array(t.length),o=null;t.forEach((function(t,s){e(t,(function(t,e){t&&(o=t),r[s]=e,0==--i&&n(o,r)}))}))},t.bezier=l,t.bindAll=m,t.browser=N,t.cacheEntryPossiblyAdded=function(t){++dt>lt&&(t.getActor().send("enforceCacheSizeLimit",at),dt=0)},t.clamp=u,t.clearTileCache=function(t){var e=s.caches.delete("mapbox-tiles");t&&e.catch(t).then((function(){return t()}))},t.clipLine=ql,t.clone=function(t){var e=new ss(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},t.clone$1=b,t.clone$2=function(t){var e=new ss(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e},t.collisionCircleLayout=Wa,t.config=z,t.create=function(){var t=new ss(16);return ss!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t},t.create$1=function(){var t=new ss(9);return ss!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t},t.create$2=function(){var t=new ss(4);return ss!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t},t.createCommonjsModule=e,t.createExpression=Zn,t.createLayout=Tr,t.createStyleLayer=function(t){return"custom"===t.type?new Tc(t):new Sc[t.type](t)},t.cross=function(t,e,n){var i=e[0],r=e[1],o=e[2],s=n[0],a=n[1],l=n[2];return t[0]=r*l-o*a,t[1]=o*s-i*l,t[2]=i*a-r*s,t},t.deepEqual=function t(e,n){if(Array.isArray(e)){if(!Array.isArray(n)||e.length!==n.length)return!1;for(var i=0;i<e.length;i++)if(!t(e[i],n[i]))return!1;return!0}if("object"==typeof e&&null!==e&&null!==n){if("object"!=typeof n)return!1;if(Object.keys(e).length!==Object.keys(n).length)return!1;for(var r in e)if(!t(e[r],n[r]))return!1;return!0}return e===n},t.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]},t.dot$1=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]},t.ease=c,t.emitValidationErrors=Ri,t.endsWith=y,t.enforceCacheSizeLimit=function(t){ct(),tt&&tt.then((function(e){e.keys().then((function(n){for(var i=0;i<n.length-t;i++)e.delete(n[i])}))}))},t.evaluateSizeForFeature=Fl,t.evaluateSizeForZoom=Nl,t.evaluateVariableOffset=oc,t.evented=ir,t.extend=d,t.featureFilter=si,t.filterObject=v,t.fromRotation=function(t,e){var n=Math.sin(e),i=Math.cos(e);return t[0]=i,t[1]=n,t[2]=0,t[3]=-n,t[4]=i,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},t.getAnchorAlignment=Rl,t.getAnchorJustification=sc,t.getArrayBuffer=vt,t.getImage=wt,t.getJSON=function(t,e){return _t(d(t,{type:"json"}),e)},t.getRTLTextPluginStatus=rr,t.getReferrer=yt,t.getVideo=function(t,e){var n,i,r=s.document.createElement("video");r.muted=!0,r.onloadstart=function(){e(null,r)};for(var o=0;o<t.length;o++){var a=s.document.createElement("source");n=t[o],i=void 0,(i=s.document.createElement("a")).href=n,(i.protocol!==s.document.location.protocol||i.host!==s.document.location.host)&&(r.crossOrigin="Anonymous"),a.src=t[o],r.appendChild(a)}return{cancel:function(){}}},t.identity=as,t.invert=function(t,e){var n=e[0],i=e[1],r=e[2],o=e[3],s=e[4],a=e[5],l=e[6],c=e[7],u=e[8],h=e[9],d=e[10],p=e[11],f=e[12],A=e[13],g=e[14],m=e[15],y=n*a-i*s,_=n*l-r*s,v=n*c-o*s,b=i*l-r*a,x=i*c-o*a,w=r*c-o*l,E=u*A-h*f,C=u*g-d*f,T=u*m-p*f,S=h*g-d*A,P=h*m-p*A,M=d*m-p*g,I=y*M-_*P+v*S+b*T-x*C+w*E;return I?(t[0]=(a*M-l*P+c*S)*(I=1/I),t[1]=(r*P-i*M-o*S)*I,t[2]=(A*w-g*x+m*b)*I,t[3]=(d*x-h*w-p*b)*I,t[4]=(l*T-s*M-c*C)*I,t[5]=(n*M-r*T+o*C)*I,t[6]=(g*v-f*w-m*_)*I,t[7]=(u*w-d*v+p*_)*I,t[8]=(s*P-a*T+c*E)*I,t[9]=(i*T-n*P-o*E)*I,t[10]=(f*x-A*v+m*y)*I,t[11]=(h*v-u*x-p*y)*I,t[12]=(a*C-s*S-l*E)*I,t[13]=(n*S-i*C+r*E)*I,t[14]=(A*_-f*b-g*y)*I,t[15]=(u*b-h*_+d*y)*I,t):null},t.isChar=Wi,t.isMapboxURL=q,t.keysDifference=function(t,e){var n=[];for(var i in t)i in e||n.push(i);return n},t.makeRequest=_t,t.mapObject=_,t.mercatorXfromLng=Gc,t.mercatorYfromLat=Vc,t.mercatorZfromAltitude=jc,t.mul=us,t.multiply=ls,t.mvt=va,t.nextPowerOfTwo=function(t){return t<=1?1:Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))},t.normalize=function(t,e){var n=e[0],i=e[1],r=e[2],o=n*n+i*i+r*r;return o>0&&(o=1/Math.sqrt(o)),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o,t},t.number=He,t.offscreenCanvasSupported=pt,t.ortho=function(t,e,n,i,r,o,s){var a=1/(e-n),l=1/(i-r),c=1/(o-s);return t[0]=-2*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(e+n)*a,t[13]=(r+i)*l,t[14]=(s+o)*c,t[15]=1,t},t.parseGlyphPBF=function(t){return new Qa(t).readFields(fl,[])},t.pbf=Qa,t.performSymbolLayout=function(t,e,n,i,r,o,s){t.createArrays(),t.tilePixelRatio=8192/(512*t.overscaling),t.compareText={},t.iconsNeedLinear=!1;var a=t.layers[0].layout,l=t.layers[0]._unevaluatedLayout._values,c={};if("composite"===t.textSizeData.kind){var u=t.textSizeData,h=u.maxZoom;c.compositeTextSizes=[l["text-size"].possiblyEvaluate(new ar(u.minZoom),s),l["text-size"].possiblyEvaluate(new ar(h),s)]}if("composite"===t.iconSizeData.kind){var d=t.iconSizeData,p=d.maxZoom;c.compositeIconSizes=[l["icon-size"].possiblyEvaluate(new ar(d.minZoom),s),l["icon-size"].possiblyEvaluate(new ar(p),s)]}c.layoutTextSize=l["text-size"].possiblyEvaluate(new ar(t.zoom+1),s),c.layoutIconSize=l["icon-size"].possiblyEvaluate(new ar(t.zoom+1),s),c.textMaxSize=l["text-size"].possiblyEvaluate(new ar(18));for(var f=24*a.get("text-line-height"),A="map"===a.get("text-rotation-alignment")&&"point"!==a.get("symbol-placement"),g=a.get("text-keep-upright"),m=a.get("text-size"),y=function(){var o=v[_],l=a.get("text-font").evaluate(o,{},s).join(","),u=m.evaluate(o,{},s),h=c.layoutTextSize.evaluate(o,{},s),d=c.layoutIconSize.evaluate(o,{},s),p={horizontal:{},vertical:void 0},y=o.text,b=[0,0];if(y){var x=y.toString(),E=24*a.get("text-letter-spacing").evaluate(o,{},s),C=function(t){for(var e=0,n=t;e<n.length;e+=1)if(i=n[e].charCodeAt(0),Wi.Arabic(i)||Wi["Arabic Supplement"](i)||Wi["Arabic Extended-A"](i)||Wi["Arabic Presentation Forms-A"](i)||Wi["Arabic Presentation Forms-B"](i))return!1;var i;return!0}(x)?E:0,T=a.get("text-anchor").evaluate(o,{},s),S=a.get("text-variable-anchor");if(!S){var P=a.get("text-radial-offset").evaluate(o,{},s);b=P?oc(T,[24*P,rc]):a.get("text-offset").evaluate(o,{},s).map((function(t){return 24*t}))}var M=A?"center":a.get("text-justify").evaluate(o,{},s),I=a.get("symbol-placement"),B="point"===I?24*a.get("text-max-width").evaluate(o,{},s):0,R=function(){t.allowVerticalPlacement&&qi(x)&&(p.vertical=El(y,e,n,r,l,B,f,T,"left",C,b,bl.vertical,!0,I,h,u))};if(!A&&S){for(var L="auto"===M?S.map((function(t){return sc(t)})):[M],O=!1,D=0;D<L.length;D++){var k=L[D];if(!p.horizontal[k])if(O)p.horizontal[k]=p.horizontal[0];else{var F=El(y,e,n,r,l,B,f,"center",k,C,b,bl.horizontal,!1,I,h,u);F&&(p.horizontal[k]=F,O=1===F.positionedLines.length)}}R()}else{"auto"===M&&(M=sc(T));var N=El(y,e,n,r,l,B,f,T,M,C,b,bl.horizontal,!1,I,h,u);N&&(p.horizontal[M]=N),R(),qi(x)&&A&&g&&(p.vertical=El(y,e,n,r,l,B,f,T,M,C,b,bl.vertical,!1,I,h,u))}}var z=void 0,U=!1;if(o.icon&&o.icon.name){var G=i[o.icon.name];G&&(z=function(t,e,n){var i=Rl(n),r=e[0]-t.displaySize[0]*i.horizontalAlign,o=e[1]-t.displaySize[1]*i.verticalAlign;return{image:t,top:o,bottom:o+t.displaySize[1],left:r,right:r+t.displaySize[0]}}(r[o.icon.name],a.get("icon-offset").evaluate(o,{},s),a.get("icon-anchor").evaluate(o,{},s)),U=G.sdf,void 0===t.sdfIcons?t.sdfIcons=G.sdf:t.sdfIcons!==G.sdf&&w("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(G.pixelRatio!==t.pixelRatio||0!==a.get("icon-rotate").constantOr(1))&&(t.iconsNeedLinear=!0))}var V=lc(p.horizontal)||p.vertical;t.iconsInText=!!V&&V.iconsInText,(V||z)&&function(t,e,n,i,r,o,s,a,l,c,u){var h=o.textMaxSize.evaluate(e,{});void 0===h&&(h=s);var d,p=t.layers[0].layout,f=p.get("icon-offset").evaluate(e,{},u),A=lc(n.horizontal),g=s/24,m=t.tilePixelRatio*g,y=t.tilePixelRatio*h/24,_=t.tilePixelRatio*a,v=t.tilePixelRatio*p.get("symbol-spacing"),b=p.get("text-padding")*t.tilePixelRatio,x=p.get("icon-padding")*t.tilePixelRatio,E=p.get("text-max-angle")/180*Math.PI,C="map"===p.get("text-rotation-alignment")&&"point"!==p.get("symbol-placement"),T="map"===p.get("icon-rotation-alignment")&&"point"!==p.get("symbol-placement"),S=p.get("symbol-placement"),P=v/2,M=p.get("icon-text-fit");i&&"none"!==M&&(t.allowVerticalPlacement&&n.vertical&&(d=Ol(i,n.vertical,M,p.get("icon-text-fit-padding"),f,g)),A&&(i=Ol(i,A,M,p.get("icon-text-fit-padding"),f,g)));var I=function(a,h){h.x<0||h.x>=8192||h.y<0||h.y>=8192||function(t,e,n,i,r,o,s,a,l,c,u,h,d,p,f,A,g,m,y,_,v,b,x,E,C){var T,S,P,M,I,B=t.addToLineVertexArray(e,n),R=0,L=0,O=0,D=0,k=-1,F=-1,N={},z=po(""),U=0,G=0;if(void 0===a._unevaluatedLayout.getValue("text-radial-offset")?(U=(T=a.layout.get("text-offset").evaluate(v,{},E).map((function(t){return 24*t})))[0],G=T[1]):(U=24*a.layout.get("text-radial-offset").evaluate(v,{},E),G=rc),t.allowVerticalPlacement&&i.vertical){var V=a.layout.get("text-rotate").evaluate(v,{},E)+90;M=new Yl(l,e,c,u,h,i.vertical,d,p,f,V),s&&(I=new Yl(l,e,c,u,h,s,g,m,f,V))}if(r){var j=a.layout.get("icon-rotate").evaluate(v,{}),H="none"!==a.layout.get("icon-text-fit"),W=Zl(r,j,x,H),q=s?Zl(s,j,x,H):void 0;P=new Yl(l,e,c,u,h,r,g,m,!1,j),R=4*W.length;var Z=t.iconSizeData,X=null;"source"===Z.kind?(X=[128*a.layout.get("icon-size").evaluate(v,{})])[0]>32640&&w(t.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'):"composite"===Z.kind&&((X=[128*b.compositeIconSizes[0].evaluate(v,{},E),128*b.compositeIconSizes[1].evaluate(v,{},E)])[0]>32640||X[1]>32640)&&w(t.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'),t.addSymbols(t.icon,W,X,_,y,v,!1,e,B.lineStartIndex,B.lineLength,-1,E),k=t.icon.placedSymbolArray.length-1,q&&(L=4*q.length,t.addSymbols(t.icon,q,X,_,y,v,bl.vertical,e,B.lineStartIndex,B.lineLength,-1,E),F=t.icon.placedSymbolArray.length-1)}for(var K in i.horizontal){var Q=i.horizontal[K];if(!S){z=po(Q.text);var J=a.layout.get("text-rotate").evaluate(v,{},E);S=new Yl(l,e,c,u,h,Q,d,p,f,J)}var Y=1===Q.positionedLines.length;if(O+=ac(t,e,Q,o,a,f,v,A,B,i.vertical?bl.horizontal:bl.horizontalOnly,Y?Object.keys(i.horizontal):[K],N,k,b,E),Y)break}i.vertical&&(D+=ac(t,e,i.vertical,o,a,f,v,A,B,bl.vertical,["vertical"],N,F,b,E));var $=S?S.boxStartIndex:t.collisionBoxArray.length,tt=S?S.boxEndIndex:t.collisionBoxArray.length,et=M?M.boxStartIndex:t.collisionBoxArray.length,nt=M?M.boxEndIndex:t.collisionBoxArray.length,it=P?P.boxStartIndex:t.collisionBoxArray.length,rt=P?P.boxEndIndex:t.collisionBoxArray.length,ot=I?I.boxStartIndex:t.collisionBoxArray.length,st=I?I.boxEndIndex:t.collisionBoxArray.length,at=-1,lt=function(t,e){return t&&t.circleDiameter?Math.max(t.circleDiameter,e):e};at=lt(S,at),at=lt(M,at),at=lt(P,at);var ct=(at=lt(I,at))>-1?1:0;ct&&(at*=C/24),t.glyphOffsetArray.length>=mc.MAX_GLYPHS&&w("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),void 0!==v.sortKey&&t.addToSortKeyRanges(t.symbolInstances.length,v.sortKey),t.symbolInstances.emplaceBack(e.x,e.y,N.right>=0?N.right:-1,N.center>=0?N.center:-1,N.left>=0?N.left:-1,N.vertical||-1,k,F,z,$,tt,et,nt,it,rt,ot,st,c,O,D,R,L,ct,0,d,U,G,at)}(t,h,a,n,i,r,d,t.layers[0],t.collisionBoxArray,e.index,e.sourceLayerIndex,t.index,m,b,C,l,_,x,T,f,e,o,c,u,s)};if("line"===S)for(var B=0,R=ql(e.geometry,0,0,8192,8192);B<R.length;B+=1)for(var L=R[B],O=0,D=Wl(L,v,E,n.vertical||A,i,24,y,t.overscaling,8192);O<D.length;O+=1){var k=D[O];A&&cc(t,A.text,P,k)||I(L,k)}else if("line-center"===S)for(var F=0,N=e.geometry;F<N.length;F+=1){var z=N[F];if(z.length>1){var U=Hl(z,E,n.vertical||A,i,24,y);U&&I(z,U)}}else if("Polygon"===e.type)for(var G=0,V=ia(e.geometry,0);G<V.length;G+=1){var j=V[G],H=ec(j,16);I(j[0],new Dl(H.x,H.y,0))}else if("LineString"===e.type)for(var W=0,q=e.geometry;W<q.length;W+=1){var Z=q[W];I(Z,new Dl(Z[0].x,Z[0].y,0))}else if("Point"===e.type)for(var X=0,K=e.geometry;X<K.length;X+=1)for(var Q=0,J=K[X];Q<J.length;Q+=1){var Y=J[Q];I([Y],new Dl(Y.x,Y.y,0))}}(t,o,p,z,i,c,h,d,b,U,s)},_=0,v=t.features;_<v.length;_+=1)y();o&&t.generateCollisionDebugBuffers()},t.perspective=function(t,e,n,i,r){var o,s=1/Math.tan(e/2);return t[0]=s/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=s,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=r&&r!==1/0?(t[10]=(r+i)*(o=1/(i-r)),t[14]=2*r*i*o):(t[10]=-1,t[14]=-2*i),t},t.pick=function(t,e){for(var n={},i=0;i<e.length;i++){var r=e[i];r in t&&(n[r]=t[r])}return n},t.plugin=sr,t.polygonIntersectsPolygon=Ho,t.postMapLoadEvent=st,t.postTurnstileEvent=rt,t.potpack=ml,t.refProperties=["type","source","source-layer","minzoom","maxzoom","filter","layout"],t.register=Ni,t.registerForPluginStateChange=function(t){return t({pluginStatus:$i,pluginURL:tr}),ir.on("pluginStateChange",t),t},t.renderColorRamp=bs,t.rotate=function(t,e,n){var i=e[0],r=e[1],o=e[2],s=e[3],a=Math.sin(n),l=Math.cos(n);return t[0]=i*l+o*a,t[1]=r*l+s*a,t[2]=i*-a+o*l,t[3]=r*-a+s*l,t},t.rotateX=function(t,e,n){var i=Math.sin(n),r=Math.cos(n),o=e[4],s=e[5],a=e[6],l=e[7],c=e[8],u=e[9],h=e[10],d=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=o*r+c*i,t[5]=s*r+u*i,t[6]=a*r+h*i,t[7]=l*r+d*i,t[8]=c*r-o*i,t[9]=u*r-s*i,t[10]=h*r-a*i,t[11]=d*r-l*i,t},t.rotateZ=function(t,e,n){var i=Math.sin(n),r=Math.cos(n),o=e[0],s=e[1],a=e[2],l=e[3],c=e[4],u=e[5],h=e[6],d=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*r+c*i,t[1]=s*r+u*i,t[2]=a*r+h*i,t[3]=l*r+d*i,t[4]=c*r-o*i,t[5]=u*r-s*i,t[6]=h*r-a*i,t[7]=d*r-l*i,t},t.scale=function(t,e,n){var i=n[0],r=n[1],o=n[2];return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t[3]=e[3]*i,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*o,t[9]=e[9]*o,t[10]=e[10]*o,t[11]=e[11]*o,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},t.scale$1=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t},t.scale$2=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t},t.setCacheLimits=function(t,e){at=t,lt=e},t.setRTLTextPlugin=function(t,e,n){if(void 0===n&&(n=!1),"deferred"===$i||"loading"===$i||"loaded"===$i)throw new Error("setRTLTextPlugin cannot be called multiple times.");tr=N.resolveURL(t),$i="deferred",Yi=e,nr(),n||or()},t.sphericalToCartesian=function(t){var e=t[0],n=t[1],i=t[2];return n+=90,n*=Math.PI/180,i*=Math.PI/180,{x:e*Math.cos(n)*Math.sin(i),y:e*Math.sin(n)*Math.sin(i),z:e*Math.cos(i)}},t.sqrLen=function(t){var e=t[0],n=t[1];return e*e+n*n},t.styleSpec=Mt,t.sub=function(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t},t.symbolSize=zl,t.transformMat3=function(t,e,n){var i=e[0],r=e[1],o=e[2];return t[0]=i*n[0]+r*n[3]+o*n[6],t[1]=i*n[1]+r*n[4]+o*n[7],t[2]=i*n[2]+r*n[5]+o*n[8],t},t.transformMat4=hs,t.translate=function(t,e,n){var i,r,o,s,a,l,c,u,h,d,p,f,A=n[0],g=n[1],m=n[2];return e===t?(t[12]=e[0]*A+e[4]*g+e[8]*m+e[12],t[13]=e[1]*A+e[5]*g+e[9]*m+e[13],t[14]=e[2]*A+e[6]*g+e[10]*m+e[14],t[15]=e[3]*A+e[7]*g+e[11]*m+e[15]):(r=e[1],o=e[2],s=e[3],a=e[4],l=e[5],c=e[6],u=e[7],h=e[8],d=e[9],p=e[10],f=e[11],t[0]=i=e[0],t[1]=r,t[2]=o,t[3]=s,t[4]=a,t[5]=l,t[6]=c,t[7]=u,t[8]=h,t[9]=d,t[10]=p,t[11]=f,t[12]=i*A+a*g+h*m+e[12],t[13]=r*A+l*g+d*m+e[13],t[14]=o*A+c*g+p*m+e[14],t[15]=s*A+u*g+f*m+e[15]),t},t.triggerPluginCompletionEvent=er,t.uniqueId=f,t.validateCustomStyleLayer=function(t){var e=[],n=t.id;return void 0===n&&e.push({message:"layers."+n+': missing required property "id"'}),void 0===t.render&&e.push({message:"layers."+n+': missing required method "render"'}),t.renderingMode&&"2d"!==t.renderingMode&&"3d"!==t.renderingMode&&e.push({message:"layers."+n+': property "renderingMode" must be either "2d" or "3d"'}),e},t.validateLight=Mi,t.validateStyle=Pi,t.values=function(t){var e=[];for(var n in t)e.push(t[n]);return e},t.vectorTile=va,t.version="1.13.
22
vendor: 7,115 bytes, line 2
2",t.warnOnce=w,t.webpSupported=U,t.window=s,t.wrap=h})),i(["./shared"],(function(t){function e(t){var n=typeof t;if("number"===n||"boolean"===n||"string"===n||null==t)return JSON.stringify(t);if(Array.isArray(t)){for(var i="[",r=0,o=t;r<o.length;r+=1)i+=e(o[r])+",";return i+"]"}for(var s=Object.keys(t).sort(),a="{",l=0;l<s.length;l++)a+=JSON.stringify(s[l])+":"+e(t[s[l]])+",";return a+"}"}function n(n){for(var i="",r=0,o=t.refProperties;r<o.length;r+=1)i+="/"+e(n[o[r]]);return i}var i=function(t){this.keyCache={},t&&this.replace(t)};i.prototype.replace=function(t){this._layerConfigs={},this._layers={},this.update(t,[])},i.prototype.update=function(e,i){for(var r=this,o=0,s=e;o<s.length;o+=1){var a=s[o];this._layerConfigs[a.id]=a;var l=this._layers[a.id]=t.createStyleLayer(a);l._featureFilter=t.featureFilter(l.filter),this.keyCache[a.id]&&delete this.keyCache[a.id]}for(var c=0,u=i;c<u.length;c+=1){var h=u[c];delete this.keyCache[h],delete this._layerConfigs[h],delete this._layers[h]}this.familiesBySource={};for(var d=0,p=function(t,e){for(var i={},r=0;r<t.length;r++){var o=e&&e[t[r].id]||n(t[r]);e&&(e[t[r].id]=o);var s=i[o];s||(s=i[o]=[]),s.push(t[r])}var a=[];for(var l in i)a.push(i[l]);return a}(t.values(this._layerConfigs),this.keyCache);d<p.length;d+=1){var f=p[d].map((function(t){return r._layers[t.id]})),A=f[0];if("none"!==A.visibility){var g=A.source||"",m=this.familiesBySource[g];m||(m=this.familiesBySource[g]={});var y=A.sourceLayer||"_geojsonTileLayer",_=m[y];_||(_=m[y]=[]),_.push(f)}}};var r=function(e){var n={},i=[];for(var r in e){var o=e[r],s=n[r]={};for(var a in o){var l=o[+a];if(l&&0!==l.bitmap.width&&0!==l.bitmap.height){var c={x:0,y:0,w:l.bitmap.width+2,h:l.bitmap.height+2};i.push(c),s[a]={rect:c,metrics:l.metrics}}}}var u=t.potpack(i),h=new t.AlphaImage({width:u.w||1,height:u.h||1});for(var d in e){var p=e[d];for(var f in p){var A=p[+f];if(A&&0!==A.bitmap.width&&0!==A.bitmap.height){var g=n[d][f].rect;t.AlphaImage.copy(A.bitmap,h,{x:0,y:0},{x:g.x+1,y:g.y+1},A.bitmap)}}}this.image=h,this.positions=n};t.register("GlyphAtlas",r);var o=function(e){this.tileID=new t.OverscaledTileID(e.tileID.overscaledZ,e.tileID.wrap,e.tileID.canonical.z,e.tileID.canonical.x,e.tileID.canonical.y),this.uid=e.uid,this.zoom=e.zoom,this.pixelRatio=e.pixelRatio,this.tileSize=e.tileSize,this.source=e.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=e.showCollisionBoxes,this.collectResourceTiming=!!e.collectResourceTiming,this.returnDependencies=!!e.returnDependencies,this.promoteId=e.promoteId};function s(e,n,i){for(var r=new t.EvaluationParameters(n),o=0,s=e;o<s.length;o+=1)s[o].recalculate(r,i)}function a(e,n){var i=t.getArrayBuffer(e.request,(function(e,i,r,o){e?n(e):i&&n(null,{vectorTile:new t.vectorTile.VectorTile(new t.pbf(i)),rawData:i,cacheControl:r,expires:o})}));return function(){i.cancel(),n()}}o.prototype.parse=function(e,n,i,o,a){var l=this;this.status="parsing",this.data=e,this.collisionBoxArray=new t.CollisionBoxArray;var c=new t.DictionaryCoder(Object.keys(e.layers).sort()),u=new t.FeatureIndex(this.tileID,this.promoteId);u.bucketLayerIDs=[];var h,d,p,f,A={},g={featureIndex:u,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:i},m=n.familiesBySource[this.source];for(var y in m){var _=e.layers[y];if(_){1===_.version&&t.warnOnce('Vector tile source "'+this.source+'" layer "'+y+'" does not use vector tile spec v2 and therefore may have some rendering errors.');for(var v=c.encode(y),b=[],x=0;x<_.length;x++){var w=_.feature(x),E=u.getId(w,y);b.push({feature:w,id:E,index:x,sourceLayerIndex:v})}for(var C=0,T=m[y];C<T.length;C+=1){var S=T[C],P=S[0];P.minzoom&&this.zoom<Math.floor(P.minzoom)||P.maxzoom&&this.zoom>=P.maxzoom||"none"!==P.visibility&&(s(S,this.zoom,i),(A[P.id]=P.createBucket({index:u.bucketLayerIDs.length,layers:S,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:v,sourceID:this.source})).populate(b,g,this.tileID.canonical),u.bucketLayerIDs.push(S.map((function(t){return t.id}))))}}}var M=t.mapObject(g.glyphDependencies,(function(t){return Object.keys(t).map(Number)}));Object.keys(M).length?o.send("getGlyphs",{uid:this.uid,stacks:M},(function(t,e){h||(h=t,d=e,R.call(l))})):d={};var I=Object.keys(g.iconDependencies);I.length?o.send("getImages",{icons:I,source:this.source,tileID:this.tileID,type:"icons"},(function(t,e){h||(h=t,p=e,R.call(l))})):p={};var B=Object.keys(g.patternDependencies);function R(){if(h)return a(h);if(d&&p&&f){var e=new r(d),n=new t.ImageAtlas(p,f);for(var o in A){var l=A[o];l instanceof t.SymbolBucket?(s(l.layers,this.zoom,i),t.performSymbolLayout(l,d,e.positions,p,n.iconPositions,this.showCollisionBoxes,this.tileID.canonical)):l.hasPattern&&(l instanceof t.LineBucket||l instanceof t.FillBucket||l instanceof t.FillExtrusionBucket)&&(s(l.layers,this.zoom,i),l.addFeatures(g,this.tileID.canonical,n.patternPositions))}this.status="done",a(null,{buckets:t.values(A).filter((function(t){return!t.isEmpty()})),featureIndex:u,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:e.image,imageAtlas:n,glyphMap:this.returnDependencies?d:null,iconMap:this.returnDependencies?p:null,glyphPositions:this.returnDependencies?e.positions:null})}}B.length?o.send("getImages",{icons:B,source:this.source,tileID:this.tileID,type:"patterns"},(function(t,e){h||(h=t,f=e,R.call(l))})):f={},R.call(this)};var l=function(t,e,n,i){this.actor=t,this.layerIndex=e,this.availableImages=n,this.loadVectorData=i||a,this.loading={},this.loaded={}};l.prototype.loadTile=function(e,n){var i=this,r=e.uid;this.loading||(this.loading={});var s=!!(e&&e.request&&e.request.collectResourceTiming)&&new t.RequestPerformance(e.request),a=this.loading[r]=new o(e);a.abort=this.loadVectorData(e,(function(e,o){if(delete i.loading[r],e||!o)return a.status="done",i.loaded[r]=a,n(e);var l=o.rawData,c={};o.expires&&(c.expires=o.expires),o.cacheControl&&(c.cacheControl=o.cacheControl);var u={};if(s){var h=s.finish();h&&(u.resourceTiming=JSON.parse(JSON.stringify(h)))}a.vectorTile=o.vectorTile,a.parse(o.vectorTile,i.layerIndex,i.availableImages,i.actor,(function(e,i){if(e||!i)return n(e);n(null,t.extend({rawTileData:l.slice(0)},i,c,u))})),i.loaded=i.loaded||{},i.loaded[r]=a}))},l.prototype.reloadTile=function(t,e){var n=this,i=this.loaded,r=t.uid,o=this;if(i&&i[r]){var s=i[r];s.showCollisionBoxes=t.showCollisionBoxes;var a=function(t,i){var r=s.reloadCallback;r&&(delete s.reloadCallback,s.parse(s.vectorTile,o.layerIndex,n.availableImages,o.actor,r)),e(t,i)};"parsing"===s.status?s.reloadCallback=a:"done"===s.status&&(s.vectorTile?s.parse(s.vectorTile,this.layerIndex,this.availableImages,this.actor,a):a())}},l.prototype.abortTile=function(t,e){var n=this.loading,i=t.uid;n&&n[i]&&n[i].abort&&(n[i].abort(),delete n[i]),e()},l.prototype.removeTile=function(t,e){var n=this.loaded,i=t.uid;n&&n[i]&&delete n[i],e()};var c=t.window.ImageBitmap,u=function(){this.loaded={}};function h(t,e){if(0!==t.length){d(t[0],e);for(var n=1;n<t.length;n++)d(t[n],!e)}}function d(t,e){for(var n=0,i=0,r=
2t.length,o=r-1;i<r;o=i++)n+=(t[i][0]-t[o][0])*(t[o][1]+t[i][1]);n
vendor: 257,577 bytes, line 2
2>=0!=!!e&&t.reverse()}u.prototype.loadTile=function(e,n){var i=e.uid,r=e.encoding,o=e.rawImageData,s=c&&o instanceof c?this.getImageData(o):o,a=new t.DEMData(i,s,r);this.loaded=this.loaded||{},this.loaded[i]=a,n(null,a)},u.prototype.getImageData=function(e){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(e.width,e.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d")),this.offscreenCanvas.width=e.width,this.offscreenCanvas.height=e.height,this.offscreenCanvasContext.drawImage(e,0,0,e.width,e.height);var n=this.offscreenCanvasContext.getImageData(-1,-1,e.width+2,e.height+2);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),new t.RGBAImage({width:n.width,height:n.height},n.data)},u.prototype.removeTile=function(t){var e=this.loaded,n=t.uid;e&&e[n]&&delete e[n]};var p=t.vectorTile.VectorTileFeature.prototype.toGeoJSON,f=function(e){this._feature=e,this.extent=t.EXTENT,this.type=e.type,this.properties=e.tags,"id"in e&&!isNaN(e.id)&&(this.id=parseInt(e.id,10))};f.prototype.loadGeometry=function(){if(1===this._feature.type){for(var e=[],n=0,i=this._feature.geometry;n<i.length;n+=1){var r=i[n];e.push([new t.Point$1(r[0],r[1])])}return e}for(var o=[],s=0,a=this._feature.geometry;s<a.length;s+=1){for(var l=[],c=0,u=a[s];c<u.length;c+=1){var h=u[c];l.push(new t.Point$1(h[0],h[1]))}o.push(l)}return o},f.prototype.toGeoJSON=function(t,e,n){return p.call(this,t,e,n)};var A=function(e){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=t.EXTENT,this.length=e.length,this._features=e};A.prototype.feature=function(t){return new f(this._features[t])};var g=t.vectorTile.VectorTileFeature,m=y;function y(t,e){this.options=e||{},this.features=t,this.length=t.length}function _(t,e){this.id="number"==typeof t.id?t.id:void 0,this.type=t.type,this.rawGeometry=1===t.type?[t.geometry]:t.geometry,this.properties=t.tags,this.extent=e||4096}y.prototype.feature=function(t){return new _(this.features[t],this.options.extent)},_.prototype.loadGeometry=function(){var e=this.rawGeometry;this.geometry=[];for(var n=0;n<e.length;n++){for(var i=e[n],r=[],o=0;o<i.length;o++)r.push(new t.Point$1(i[o][0],i[o][1]));this.geometry.push(r)}return this.geometry},_.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var t=this.geometry,e=1/0,n=-1/0,i=1/0,r=-1/0,o=0;o<t.length;o++)for(var s=t[o],a=0;a<s.length;a++){var l=s[a];e=Math.min(e,l.x),n=Math.max(n,l.x),i=Math.min(i,l.y),r=Math.max(r,l.y)}return[e,i,n,r]},_.prototype.toGeoJSON=g.prototype.toGeoJSON;var v=x,b=m;function x(e){var n=new t.pbf;return function(t,e){for(var n in t.layers)e.writeMessage(3,w,t.layers[n])}(e,n),n.finish()}function w(t,e){var n;e.writeVarintField(15,t.version||1),e.writeStringField(1,t.name||""),e.writeVarintField(5,t.extent||4096);var i={keys:[],values:[],keycache:{},valuecache:{}};for(n=0;n<t.length;n++)i.feature=t.feature(n),e.writeMessage(2,E,i);var r=i.keys;for(n=0;n<r.length;n++)e.writeStringField(3,r[n]);var o=i.values;for(n=0;n<o.length;n++)e.writeMessage(4,M,o[n])}function E(t,e){var n=t.feature;void 0!==n.id&&e.writeVarintField(1,n.id),e.writeMessage(2,C,t),e.writeVarintField(3,n.type),e.writeMessage(4,P,n)}function C(t,e){var n=t.feature,i=t.keys,r=t.values,o=t.keycache,s=t.valuecache;for(var a in n.properties){var l=o[a];void 0===l&&(i.push(a),o[a]=l=i.length-1),e.writeVarint(l);var c=n.properties[a],u=typeof c;"string"!==u&&"boolean"!==u&&"number"!==u&&(c=JSON.stringify(c));var h=u+":"+c,d=s[h];void 0===d&&(r.push(c),s[h]=d=r.length-1),e.writeVarint(d)}}function T(t,e){return(e<<3)+(7&t)}function S(t){return t<<1^t>>31}function P(t,e){for(var n=t.loadGeometry(),i=t.type,r=0,o=0,s=n.length,a=0;a<s;a++){var l=n[a],c=1;1===i&&(c=l.length),e.writeVarint(T(1,c));for(var u=3===i?l.length-1:l.length,h=0;h<u;h++){1===h&&1!==i&&e.writeVarint(T(2,u-1));var d=l[h].x-r,p=l[h].y-o;e.writeVarint(S(d)),e.writeVarint(S(p)),r+=d,o+=p}3===i&&e.writeVarint(T(7,1))}}function M(t,e){var n=typeof t;"string"===n?e.writeStringField(1,t):"boolean"===n?e.writeBooleanField(7,t):"number"===n&&(t%1!=0?e.writeDoubleField(3,t):t<0?e.writeSVarintField(6,t):e.writeVarintField(5,t))}function I(t,e,n,i){B(t,n,i),B(e,2*n,2*i),B(e,2*n+1,2*i+1)}function B(t,e,n){var i=t[e];t[e]=t[n],t[n]=i}function R(t,e,n,i){var r=t-n,o=e-i;return r*r+o*o}v.fromVectorTileJs=x,v.fromGeojsonVt=function(t,e){e=e||{};var n={};for(var i in t)n[i]=new m(t[i].features,e),n[i].name=i,n[i].version=e.version,n[i].extent=e.extent;return x({layers:n})},v.GeoJSONWrapper=b;var L=function(t){return t[0]},O=function(t){return t[1]},D=function(t,e,n,i,r){void 0===e&&(e=L),void 0===n&&(n=O),void 0===i&&(i=64),void 0===r&&(r=Float64Array),this.nodeSize=i,this.points=t;for(var o=t.length<65536?Uint16Array:Uint32Array,s=this.ids=new o(t.length),a=this.coords=new r(2*t.length),l=0;l<t.length;l++)s[l]=l,a[2*l]=e(t[l]),a[2*l+1]=n(t[l]);!function t(e,n,i,r,o,s){if(!(o-r<=i)){var a=r+o>>1;!function t(e,n,i,r,o,s){for(;o>r;){if(o-r>600){var a=o-r+1,l=i-r+1,c=Math.log(a),u=.5*Math.exp(2*c/3),h=.5*Math.sqrt(c*u*(a-u)/a)*(l-a/2<0?-1:1);t(e,n,i,Math.max(r,Math.floor(i-l*u/a+h)),Math.min(o,Math.floor(i+(a-l)*u/a+h)),s)}var d=n[2*i+s],p=r,f=o;for(I(e,n,r,i),n[2*o+s]>d&&I(e,n,r,o);p<f;){for(I(e,n,p,f),p++,f--;n[2*p+s]<d;)p++;for(;n[2*f+s]>d;)f--}n[2*r+s]===d?I(e,n,r,f):I(e,n,++f,o),f<=i&&(r=f+1),i<=f&&(o=f-1)}}(e,n,a,r,o,s%2),t(e,n,i,r,a-1,s+1),t(e,n,i,a+1,o,s+1)}}(s,a,i,0,s.length-1,0)};D.prototype.range=function(t,e,n,i){return function(t,e,n,i,r,o,s){for(var a,l,c=[0,t.length-1,0],u=[];c.length;){var h=c.pop(),d=c.pop(),p=c.pop();if(d-p<=s)for(var f=p;f<=d;f++)l=e[2*f+1],(a=e[2*f])>=n&&a<=r&&l>=i&&l<=o&&u.push(t[f]);else{var A=Math.floor((p+d)/2);l=e[2*A+1],(a=e[2*A])>=n&&a<=r&&l>=i&&l<=o&&u.push(t[A]);var g=(h+1)%2;(0===h?n<=a:i<=l)&&(c.push(p),c.push(A-1),c.push(g)),(0===h?r>=a:o>=l)&&(c.push(A+1),c.push(d),c.push(g))}}return u}(this.ids,this.coords,t,e,n,i,this.nodeSize)},D.prototype.within=function(t,e,n){return function(t,e,n,i,r,o){for(var s=[0,t.length-1,0],a=[],l=r*r;s.length;){var c=s.pop(),u=s.pop(),h=s.pop();if(u-h<=o)for(var d=h;d<=u;d++)R(e[2*d],e[2*d+1],n,i)<=l&&a.push(t[d]);else{var p=Math.floor((h+u)/2),f=e[2*p],A=e[2*p+1];R(f,A,n,i)<=l&&a.push(t[p]);var g=(c+1)%2;(0===c?n-r<=f:i-r<=A)&&(s.push(h),s.push(p-1),s.push(g)),(0===c?n+r>=f:i+r>=A)&&(s.push(p+1),s.push(u),s.push(g))}}return a}(this.ids,this.coords,t,e,n,this.nodeSize)};var k={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:function(t){return t}},F=function(t){this.options=H(Object.create(k),t),this.trees=new Array(this.options.maxZoom+1)};function N(t,e,n,i,r){return{x:t,y:e,zoom:1/0,id:n,parentId:-1,numPoints:i,properties:r}}function z(t,e){var n=t.geometry.coordinates,i=n[1];return{x:V(n[0]),y:j(i),zoom:1/0,index:e,parentId:-1}}function U(t){return{type:"Feature",id:t.id,properties:G(t),geometry:{type:"Point",coordinates:[(i=t.x,360*(i-.5)),(e=t.y,n=(180-360*e)*Math.PI/180,360*Math.atan(Math.exp(n))/Math.PI-90)]}};var e,n,i}function G(t){var e=t.numPoints,n=e>=1e4?Math.round(e/1e3)+"k":e>=1e3?Math.round(e/100)/10+"k":e;return H(H({},t.properties),{cluster:!0,cluster_id:t.id,point_count:e,point_count_abbreviated:n})}function V(t){return t/360+.5}function j(t){var e=Math.sin(t*Math.PI/180),n=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return n<0?0:n>1?1:n}function H(t,e){for(var n in e)t[n]=e[n];return t}function W(t){return t.x}function q(t){return t.y}function Z(t,e,n,i,r,o){var s=r-n,a=o-i;if(0!==s||0!==a){var l=((t-n)*s+(e-i)*a)/(s*s+a*a);l>1?(n=r,i=o):l>0&&(n+=s*l,i+=a*l)}return(s=t-n)*s+(a=e-i)*a}function X(t,e,n,i){var r={id:void 0===t?null:t,type:e,geometry:n,tags:i,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(t){var e=t.geometry,n=t.type;if("Point"===n||"MultiPoint"===n||"LineString"===n)K(t,e);else if("Polygon"===n||"MultiLineString"===n)for(var i=0;i<e.length;i++)K(t,e[i]);else if("MultiPolygon"===n)for(i=0;i<e.length;i++)for(var r=0;r<e[i].length;r++)K(t,e[i][r])}(r),r}function K(t,e){for(var n=0;n<e.length;n+=3)t.minX=Math.min(t.minX,e[n]),t.minY=Math.min(t.minY,e[n+1]),t.maxX=Math.max(t.maxX,e[n]),t.maxY=Math.max(t.maxY,e[n+1])}function Q(t,e,n,i){if(e.geometry){var r=e.geometry.coordinates,o=e.geometry.type,s=Math.pow(n.tolerance/((1<<n.maxZoom)*n.extent),2),a=[],l=e.id;if(n.promoteId?l=e.properties[n.promoteId]:n.generateId&&(l=i||0),"Point"===o)J(r,a);else if("MultiPoint"===o)for(var c=0;c<r.length;c++)J(r[c],a);else if("LineString"===o)Y(r,a,s,!1);else if("MultiLineString"===o){if(n.lineMetrics){for(c=0;c<r.length;c++)Y(r[c],a=[],s,!1),t.push(X(l,"LineString",a,e.properties));return}$(r,a,s,!1)}else if("Polygon"===o)$(r,a,s,!0);else{if("MultiPolygon"!==o){if("GeometryCollection"===o){for(c=0;c<e.geometry.geometries.length;c++)Q(t,{id:l,geometry:e.geometry.geometries[c],properties:e.properties},n,i);return}throw new Error("Input data is not a valid GeoJSON object.")}for(c=0;c<r.length;c++){var u=[];$(r[c],u,s,!0),a.push(u)}}t.push(X(l,o,a,e.properties))}}function J(t,e){e.push(tt(t[0])),e.push(et(t[1])),e.push(0)}function Y(t,e,n,i){for(var r,o,s=0,a=0;a<t.length;a++){var l=tt(t[a][0]),c=et(t[a][1]);e.push(l),e.push(c),e.push(0),a>0&&(s+=i?(r*c-l*o)/2:Math.sqrt(Math.pow(l-r,2)+Math.pow(c-o,2))),r=l,o=c}var u=e.length-3;e[2]=1,function t(e,n,i,r){for(var o,s=r,a=i-n>>1,l=i-n,c=e[n],u=e[n+1],h=e[i],d=e[i+1],p=n+3;p<i;p+=3){var f=Z(e[p],e[p+1],c,u,h,d);if(f>s)o=p,s=f;else if(f===s){var A=Math.abs(p-a);A<l&&(o=p,l=A)}}s>r&&(o-n>3&&t(e,n,o,r),e[o+2]=s,i-o>3&&t(e,o,i,r))}(e,0,u,n),e[u+2]=1,e.size=Math.abs(s),e.start=0,e.end=e.size}function $(t,e,n,i){for(var r=0;r<t.length;r++){var o=[];Y(t[r],o,n,i),e.push(o)}}function tt(t){return t/360+.5}function et(t){var e=Math.sin(t*Math.PI/180),n=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return n<0?0:n>1?1:n}function nt(t,e,n,i,r,o,s,a){if(i/=e,o>=(n/=e)&&s<i)return t;if(s<n||o>=i)return null;for(var l=[],c=0;c<t.length;c++){var u=t[c],h=u.geometry,d=u.type,p=0===r?u.minX:u.minY,f=0===r?u.maxX:u.maxY;if(p>=n&&f<i)l.push(u);else if(!(f<n||p>=i)){var A=[];if("Point"===d||"MultiPoint"===d)it(h,A,n,i,r);else if("LineString"===d)rt(h,A,n,i,r,!1,a.lineMetrics);else if("MultiLineString"===d)st(h,A,n,i,r,!1);else if("Polygon"===d)st(h,A,n,i,r,!0);else if("MultiPolygon"===d)for(var g=0;g<h.length;g++){var m=[];st(h[g],m,n,i,r,!0),m.length&&A.push(m)}if(A.length){if(a.lineMetrics&&"LineString"===d){for(g=0;g<A.length;g++)l.push(X(u.id,d,A[g],u.tags));continue}"LineString"!==d&&"MultiLineString"!==d||(1===A.length?(d="LineString",A=A[0]):d="MultiLineString"),"Point"!==d&&"MultiPoint"!==d||(d=3===A.length?"Point":"MultiPoint"),l.push(X(u.id,d,A,u.tags))}}}return l.length?l:null}function it(t,e,n,i,r){for(var o=0;o<t.length;o+=3){var s=t[o+r];s>=n&&s<=i&&(e.push(t[o]),e.push(t[o+1]),e.push(t[o+2]))}}function rt(t,e,n,i,r,o,s){for(var a,l,c=ot(t),u=0===r?lt:ct,h=t.start,d=0;d<t.length-3;d+=3){var p=t[d],f=t[d+1],A=t[d+2],g=t[d+3],m=t[d+4],y=0===r?p:f,_=0===r?g:m,v=!1;s&&(a=Math.sqrt(Math.pow(p-g,2)+Math.pow(f-m,2))),y<n?_>n&&(l=u(c,p,f,g,m,n),s&&(c.start=h+a*l)):y>i?_<i&&(l=u(c,p,f,g,m,i),s&&(c.start=h+a*l)):at(c,p,f,A),_<n&&y>=n&&(l=u(c,p,f,g,m,n),v=!0),_>i&&y<=i&&(l=u(c,p,f,g,m,i),v=!0),!o&&v&&(s&&(c.end=h+a*l),e.push(c),c=ot(t)),s&&(h+=a)}var b=t.length-3;p=t[b],f=t[b+1],A=t[b+2],(y=0===r?p:f)>=n&&y<=i&&at(c,p,f,A),b=c.length-3,o&&b>=3&&(c[b]!==c[0]||c[b+1]!==c[1])&&at(c,c[0],c[1],c[2]),c.length&&e.push(c)}function ot(t){var e=[];return e.size=t.size,e.start=t.start,e.end=t.end,e}function st(t,e,n,i,r,o){for(var s=0;s<t.length;s++)rt(t[s],e,n,i,r,o,!1)}function at(t,e,n,i){t.push(e),t.push(n),t.push(i)}function lt(t,e,n,i,r,o){var s=(o-e)/(i-e);return t.push(o),t.push(n+(r-n)*s),t.push(1),s}function ct(t,e,n,i,r,o){var s=(o-n)/(r-n);return t.push(e+(i-e)*s),t.push(o),t.push(1),s}function ut(t,e){for(var n=[],i=0;i<t.length;i++){var r,o=t[i],s=o.type;if("Point"===s||"MultiPoint"===s||"LineString"===s)r=ht(o.geometry,e);else if("MultiLineString"===s||"Polygon"===s){r=[];for(var a=0;a<o.geometry.length;a++)r.push(ht(o.geometry[a],e))}else if("MultiPolygon"===s)for(r=[],a=0;a<o.geometry.length;a++){for(var l=[],c=0;c<o.geometry[a].length;c++)l.push(ht(o.geometry[a][c],e));r.push(l)}n.push(X(o.id,s,r,o.tags))}return n}function ht(t,e){var n=[];n.size=t.size,void 0!==t.start&&(n.start=t.start,n.end=t.end);for(var i=0;i<t.length;i+=3)n.push(t[i]+e,t[i+1],t[i+2]);return n}function dt(t,e){if(t.transformed)return t;var n,i,r,o=1<<t.z,s=t.x,a=t.y;for(n=0;n<t.features.length;n++){var l=t.features[n],c=l.geometry,u=l.type;if(l.geometry=[],1===u)for(i=0;i<c.length;i+=2)l.geometry.push(pt(c[i],c[i+1],e,o,s,a));else for(i=0;i<c.length;i++){var h=[];for(r=0;r<c[i].length;r+=2)h.push(pt(c[i][r],c[i][r+1],e,o,s,a));l.geometry.push(h)}}return t.transformed=!0,t}function pt(t,e,n,i,r,o){return[Math.round(n*(t*i-r)),Math.round(n*(e*i-o))]}function ft(t,e,n,i,r){for(var o=e===r.maxZoom?0:r.tolerance/((1<<e)*r.extent),s={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:n,y:i,z:e,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0},a=0;a<t.length;a++){s.numFeatures++,At(s,t[a],o,r);var l=t[a].minX,c=t[a].minY,u=t[a].maxX,h=t[a].maxY;l<s.minX&&(s.minX=l),c<s.minY&&(s.minY=c),u>s.maxX&&(s.maxX=u),h>s.maxY&&(s.maxY=h)}return s}function At(t,e,n,i){var r=e.geometry,o=e.type,s=[];if("Point"===o||"MultiPoint"===o)for(var a=0;a<r.length;a+=3)s.push(r[a]),s.push(r[a+1]),t.numPoints++,t.numSimplified++;else if("LineString"===o)gt(s,r,t,n,!1,!1);else if("MultiLineString"===o||"Polygon"===o)for(a=0;a<r.length;a++)gt(s,r[a],t,n,"Polygon"===o,0===a);else if("MultiPolygon"===o)for(var l=0;l<r.length;l++){var c=r[l];for(a=0;a<c.length;a++)gt(s,c[a],t,n,!0,0===a)}if(s.length){var u=e.tags||null;if("LineString"===o&&i.lineMetrics){for(var h in u={},e.tags)u[h]=e.tags[h];u.mapbox_clip_start=r.start/r.size,u.mapbox_clip_end=r.end/r.size}var d={geometry:s,type:"Polygon"===o||"MultiPolygon"===o?3:"LineString"===o||"MultiLineString"===o?2:1,tags:u};null!==e.id&&(d.id=e.id),t.features.push(d)}}function gt(t,e,n,i,r,o){var s=i*i;if(i>0&&e.size<(r?s:i))n.numPoints+=e.length/3;else{for(var a=[],l=0;l<e.length;l+=3)(0===i||e[l+2]>s)&&(n.numSimplified++,a.push(e[l]),a.push(e[l+1])),n.numPoints++;r&&function(t,e){for(var n=0,i=0,r=t.length,o=r-2;i<r;o=i,i+=2)n+=(t[i]-t[o])*(t[i+1]+t[o+1]);if(n>0===e)for(i=0,r=t.length;i<r/2;i+=2){var s=t[i],a=t[i+1];t[i]=t[r-2-i],t[i+1]=t[r-1-i],t[r-2-i]=s,t[r-1-i]=a}}(a,o),t.push(a)}}function mt(t,e){var n=(e=this.options=function(t,e){for(var n in e)t[n]=e[n];return t}(Object.create(this.options),e)).debug;if(n&&console.time("preprocess data"),e.maxZoom<0||e.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(e.promoteId&&e.generateId)throw new Error("promoteId and generateId cannot be used together.");var i=function(t,e){var n=[];if("FeatureCollection"===t.type)for(var i=0;i<t.features.length;i++)Q(n,t.features[i],e,i);else Q(n,"Feature"===t.type?t:{geometry:t},e);return n}(t,e);this.tiles={},this.tileCoords=[],n&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",e.indexMaxZoom,e.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),(i=function(t,e){var n=e.buffer/e.extent,i=t,r=nt(t,1,-1-n,n,0,-1,2,e),o=nt(t,1,1-n,2+n,0,-1,2,e);return(r||o)&&(i=nt(t,1,-n,1+n,0,-1,2,e)||[],r&&(i=ut(r,1).concat(i)),o&&(i=i.concat(ut(o,-1)))),i}(i,e)).length&&this.splitTile(i,0,0,0),n&&(i.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}function yt(t,e,n){return 32*((1<<t)*n+e)+t}function _t(t,e){var n=t.tileID.canonical;if(!this._geoJSONIndex)return e(null,null);var i=this._geoJSONIndex.getTile(n.z,n.x,n.y);if(!i)return e(null,null);var r=new A(i.features),o=v(r);0===o.byteOffset&&o.byteLength===o.buffer.byteLength||(o=new Uint8Array(o)),e(null,{vectorTile:r,rawData:o.buffer})}F.prototype.load=function(t){var e=this.options,n=e.log,i=e.minZoom,r=e.maxZoom,o=e.nodeSize;n&&console.time("total time");var s="prepare "+t.length+" points";n&&console.time(s),this.points=t;for(var a=[],l=0;l<t.length;l++)t[l].geometry&&a.push(z(t[l],l));this.trees[r+1]=new D(a,W,q,o,Float32Array),n&&console.timeEnd(s);for(var c=r;c>=i;c--){var u=+Date.now();a=this._cluster(a,c),this.trees[c]=new D(a,W,q,o,Float32Array),n&&console.log("z%d: %d clusters in %dms",c,a.length,+Date.now()-u)}return n&&console.timeEnd("total time"),this},F.prototype.getClusters=function(t,e){var n=((t[0]+180)%360+360)%360-180,i=Math.max(-90,Math.min(90,t[1])),r=180===t[2]?180:((t[2]+180)%360+360)%360-180,o=Math.max(-90,Math.min(90,t[3]));if(t[2]-t[0]>=360)n=-180,r=180;else if(n>r){var s=this.getClusters([n,i,180,o],e),a=this.getClusters([-180,i,r,o],e);return s.concat(a)}for(var l=this.trees[this._limitZoom(e)],c=[],u=0,h=l.range(V(n),j(o),V(r),j(i));u<h.length;u+=1){var d=l.points[h[u]];c.push(d.numPoints?U(d):this.points[d.index])}return c},F.prototype.getChildren=function(t){var e=this._getOriginId(t),n=this._getOriginZoom(t),i="No cluster with the specified id.",r=this.trees[n];if(!r)throw new Error(i);var o=r.points[e];if(!o)throw new Error(i);for(var s=this.options.radius/(this.options.extent*Math.pow(2,n-1)),a=[],l=0,c=r.within(o.x,o.y,s);l<c.length;l+=1){var u=r.points[c[l]];u.parentId===t&&a.push(u.numPoints?U(u):this.points[u.index])}if(0===a.length)throw new Error(i);return a},F.prototype.getLeaves=function(t,e,n){var i=[];return this._appendLeaves(i,t,e=e||10,n=n||0,0),i},F.prototype.getTile=function(t,e,n){var i=this.trees[this._limitZoom(t)],r=Math.pow(2,t),o=this.options,s=o.radius/o.extent,a=(n-s)/r,l=(n+1+s)/r,c={features:[]};return this._addTileFeatures(i.range((e-s)/r,a,(e+1+s)/r,l),i.points,e,n,r,c),0===e&&this._addTileFeatures(i.range(1-s/r,a,1,l),i.points,r,n,r,c),e===r-1&&this._addTileFeatures(i.range(0,a,s/r,l),i.points,-1,n,r,c),c.features.length?c:null},F.prototype.getClusterExpansionZoom=function(t){for(var e=this._getOriginZoom(t)-1;e<=this.options.maxZoom;){var n=this.getChildren(t);if(e++,1!==n.length)break;t=n[0].properties.cluster_id}return e},F.prototype._appendLeaves=function(t,e,n,i,r){for(var o=0,s=this.getChildren(e);o<s.length;o+=1){var a=s[o],l=a.properties;if(l&&l.cluster?r+l.point_count<=i?r+=l.point_count:r=this._appendLeaves(t,l.cluster_id,n,i,r):r<i?r++:t.push(a),t.length===n)break}return r},F.prototype._addTileFeatures=function(t,e,n,i,r,o){for(var s=0,a=t;s<a.length;s+=1){var l=e[a[s]],c=l.numPoints,u={type:1,geometry:[[Math.round(this.options.extent*(l.x*r-n)),Math.round(this.options.extent*(l.y*r-i))]],tags:c?G(l):this.points[l.index].properties},h=void 0;c?h=l.id:this.options.generateId?h=l.index:this.points[l.index].id&&(h=this.points[l.index].id),void 0!==h&&(u.id=h),o.features.push(u)}},F.prototype._limitZoom=function(t){return Math.max(this.options.minZoom,Math.min(+t,this.options.maxZoom+1))},F.prototype._cluster=function(t,e){for(var n=[],i=this.options,r=i.reduce,o=i.minPoints,s=i.radius/(i.extent*Math.pow(2,e)),a=0;a<t.length;a++){var l=t[a];if(!(l.zoom<=e)){l.zoom=e;for(var c=this.trees[e+1],u=c.within(l.x,l.y,s),h=l.numPoints||1,d=h,p=0,f=u;p<f.length;p+=1){var A=c.points[f[p]];A.zoom>e&&(d+=A.numPoints||1)}if(d>=o){for(var g=l.x*h,m=l.y*h,y=r&&h>1?this._map(l,!0):null,_=(a<<5)+(e+1)+this.points.length,v=0,b=u;v<b.length;v+=1){var x=c.points[b[v]];if(!(x.zoom<=e)){x.zoom=e;var w=x.numPoints||1;g+=x.x*w,m+=x.y*w,x.parentId=_,r&&(y||(y=this._map(l,!0)),r(y,this._map(x)))}}l.parentId=_,n.push(N(g/d,m/d,_,d,y))}else if(n.push(l),d>1)for(var E=0,C=u;E<C.length;E+=1){var T=c.points[C[E]];T.zoom<=e||(T.zoom=e,n.push(T))}}}return n},F.prototype._getOriginId=function(t){return t-this.points.length>>5},F.prototype._getOriginZoom=function(t){return(t-this.points.length)%32},F.prototype._map=function(t,e){if(t.numPoints)return e?H({},t.properties):t.properties;var n=this.points[t.index].properties,i=this.options.map(n);return e&&i===n?H({},i):i},mt.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},mt.prototype.splitTile=function(t,e,n,i,r,o,s){for(var a=[t,e,n,i],l=this.options,c=l.debug;a.length;){i=a.pop(),n=a.pop(),e=a.pop(),t=a.pop();var u=1<<e,h=yt(e,n,i),d=this.tiles[h];if(!d&&(c>1&&console.time("creation"),d=this.tiles[h]=ft(t,e,n,i,l),this.tileCoords.push({z:e,x:n,y:i}),c)){c>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",e,n,i,d.numFeatures,d.numPoints,d.numSimplified),console.timeEnd("creation"));var p="z"+e;this.stats[p]=(this.stats[p]||0)+1,this.total++}if(d.source=t,r){if(e===l.maxZoom||e===r)continue;var f=1<<r-e;if(n!==Math.floor(o/f)||i!==Math.floor(s/f))continue}else if(e===l.indexMaxZoom||d.numPoints<=l.indexMaxPoints)continue;if(d.source=null,0!==t.length){c>1&&console.time("clipping");var A,g,m,y,_,v,b=.5*l.buffer/l.extent,x=.5-b,w=.5+b,E=1+b;A=g=m=y=null,_=nt(t,u,n-b,n+w,0,d.minX,d.maxX,l),v=nt(t,u,n+x,n+E,0,d.minX,d.maxX,l),t=null,_&&(A=nt(_,u,i-b,i+w,1,d.minY,d.maxY,l),g=nt(_,u,i+x,i+E,1,d.minY,d.maxY,l),_=null),v&&(m=nt(v,u,i-b,i+w,1,d.minY,d.maxY,l),y=nt(v,u,i+x,i+E,1,d.minY,d.maxY,l),v=null),c>1&&console.timeEnd("clipping"),a.push(A||[],e+1,2*n,2*i),a.push(g||[],e+1,2*n,2*i+1),a.push(m||[],e+1,2*n+1,2*i),a.push(y||[],e+1,2*n+1,2*i+1)}}},mt.prototype.getTile=function(t,e,n){var i=this.options,r=i.extent,o=i.debug;if(t<0||t>24)return null;var s=1<<t,a=yt(t,e=(e%s+s)%s,n);if(this.tiles[a])return dt(this.tiles[a],r);o>1&&console.log("drilling down to z%d-%d-%d",t,e,n);for(var l,c=t,u=e,h=n;!l&&c>0;)c--,u=Math.floor(u/2),h=Math.floor(h/2),l=this.tiles[yt(c,u,h)];return l&&l.source?(o>1&&console.log("found parent tile z%d-%d-%d",c,u,h),o>1&&console.time("drilling down"),this.splitTile(l.source,c,u,h,t,e,n),o>1&&console.timeEnd("drilling down"),this.tiles[a]?dt(this.tiles[a],r):null):null};var vt=function(e){function n(t,n,i,r){e.call(this,t,n,i,_t),r&&(this.loadGeoJSON=r)}return e&&(n.__proto__=e),(n.prototype=Object.create(e&&e.prototype)).constructor=n,n.prototype.loadData=function(t,e){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),this._pendingCallback=e,this._pendingLoadDataParams=t,this._state&&"Idle"!==this._state?this._state="NeedsLoadData":(this._state="Coalescing",this._loadData())},n.prototype._loadData=function(){var e=this;if(this._pendingCallback&&this._pendingLoadDataParams){var n=this._pendingCallback,i=this._pendingLoadDataParams;delete this._pendingCallback,delete this._pendingLoadDataParams;var r=!!(i&&i.request&&i.request.collectResourceTiming)&&new t.RequestPerformance(i.request);this.loadGeoJSON(i,(function(o,s){if(o||!s)return n(o);if("object"!=typeof s)return n(new Error("Input data given to '"+i.source+"' is not a valid GeoJSON object."));!function t(e,n){var i,r=e&&e.type;if("FeatureCollection"===r)for(i=0;i<e.features.length;i++)t(e.features[i],n);else if("GeometryCollection"===r)for(i=0;i<e.geometries.length;i++)t(e.geometries[i],n);else if("Feature"===r)t(e.geometry,n);else if("Polygon"===r)h(e.coordinates,n);else if("MultiPolygon"===r)for(i=0;i<e.coordinates.length;i++)h(e.coordinates[i],n);return e}(s,!0);try{if(i.filter){var a=t.createExpression(i.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if("error"===a.result)throw new Error(a.value.map((function(t){return t.key+": "+t.message})).join(", "));var l=s.features.filter((function(t){return a.value.evaluate({zoom:0},t)}));s={type:"FeatureCollection",features:l}}e._geoJSONIndex=i.cluster?new F(function(e){var n=e.superclusterOptions,i=e.clusterProperties;if(!i||!n)return n;for(var r={},o={},s={accumulated:null,zoom:0},a={properties:null},l=Object.keys(i),c=0,u=l;c<u.length;c+=1){var h=u[c],d=i[h],p=d[0],f=t.createExpression(d[1]),A=t.createExpression("string"==typeof p?[p,["accumulated"],["get",h]]:p);r[h]=f.value,o[h]=A.value}return n.map=function(t){a.properties=t;for(var e={},n=0,i=l;n<i.length;n+=1){var o=i[n];e[o]=r[o].evaluate(s,a)}return e},n.reduce=function(t,e){a.properties=e;for(var n=0,i=l;n<i.length;n+=1){var r=i[n];s.accumulated=t[r],t[r]=o[r].evaluate(s,a)}},n}(i)).load(s.features):function(t,e){return new mt(t,e)}(s,i.geojsonVtOptions)}catch(o){return n(o)}e.loaded={};var c={};if(r){var u=r.finish();u&&(c.resourceTiming={},c.resourceTiming[i.source]=JSON.parse(JSON.stringify(u)))}n(null,c)}))}},n.prototype.coalesce=function(){"Coalescing"===this._state?this._state="Idle":"NeedsLoadData"===this._state&&(this._state="Coalescing",this._loadData())},n.prototype.reloadTile=function(t,n){var i=this.loaded;return i&&i[t.uid]?e.prototype.reloadTile.call(this,t,n):this.loadTile(t,n)},n.prototype.loadGeoJSON=function(e,n){if(e.request)t.getJSON(e.request,n);else{if("string"!=typeof e.data)return n(new Error("Input data given to '"+e.source+"' is not a valid GeoJSON object."));try{return n(null,JSON.parse(e.data))}catch(t){return n(new Error("Input data given to '"+e.source+"' is not a valid GeoJSON object."))}}},n.prototype.removeSource=function(t,e){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),e()},n.prototype.getClusterExpansionZoom=function(t,e){try{e(null,this._geoJSONIndex.getClusterExpansionZoom(t.clusterId))}catch(t){e(t)}},n.prototype.getClusterChildren=function(t,e){try{e(null,this._geoJSONIndex.getChildren(t.clusterId))}catch(t){e(t)}},n.prototype.getClusterLeaves=function(t,e){try{e(null,this._geoJSONIndex.getLeaves(t.clusterId,t.limit,t.offset))}catch(t){e(t)}},n}(l),bt=function(e){var n=this;this.self=e,this.actor=new t.Actor(e,this),this.layerIndexes={},this.availableImages={},this.workerSourceTypes={vector:l,geojson:vt},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=function(t,e){if(n.workerSourceTypes[t])throw new Error('Worker source with name "'+t+'" already registered.');n.workerSourceTypes[t]=e},this.self.registerRTLTextPlugin=function(e){if(t.plugin.isParsed())throw new Error("RTL text plugin already registered.");t.plugin.applyArabicShaping=e.applyArabicShaping,t.plugin.processBidirectionalText=e.processBidirectionalText,t.plugin.processStyledBidirectionalText=e.processStyledBidirectionalText}};return bt.prototype.setReferrer=function(t,e){this.referrer=e},bt.prototype.setImages=function(t,e,n){for(var i in this.availableImages[t]=e,this.workerSources[t]){var r=this.workerSources[t][i];for(var o in r)r[o].availableImages=e}n()},bt.prototype.setLayers=function(t,e,n){this.getLayerIndex(t).replace(e),n()},bt.prototype.updateLayers=function(t,e,n){this.getLayerIndex(t).update(e.layers,e.removedIds),n()},bt.prototype.loadTile=function(t,e,n){this.getWorkerSource(t,e.type,e.source).loadTile(e,n)},bt.prototype.loadDEMTile=function(t,e,n){this.getDEMWorkerSource(t,e.source).loadTile(e,n)},bt.prototype.reloadTile=function(t,e,n){this.getWorkerSource(t,e.type,e.source).reloadTile(e,n)},bt.prototype.abortTile=function(t,e,n){this.getWorkerSource(t,e.type,e.source).abortTile(e,n)},bt.prototype.removeTile=function(t,e,n){this.getWorkerSource(t,e.type,e.source).removeTile(e,n)},bt.prototype.removeDEMTile=function(t,e){this.getDEMWorkerSource(t,e.source).removeTile(e)},bt.prototype.removeSource=function(t,e,n){if(this.workerSources[t]&&this.workerSources[t][e.type]&&this.workerSources[t][e.type][e.source]){var i=this.workerSources[t][e.type][e.source];delete this.workerSources[t][e.type][e.source],void 0!==i.removeSource?i.removeSource(e,n):n()}},bt.prototype.loadWorkerSource=function(t,e,n){try{this.self.importScripts(e.url),n()}catch(t){n(t.toString())}},bt.prototype.syncRTLPluginState=function(e,n,i){try{t.plugin.setState(n);var r=t.plugin.getPluginURL();if(t.plugin.isLoaded()&&!t.plugin.isParsed()&&null!=r){this.self.importScripts(r);var o=t.plugin.isParsed();i(o?void 0:new Error("RTL Text Plugin failed to import scripts from "+r),o)}}catch(t){i(t.toString())}},bt.prototype.getAvailableImages=function(t){var e=this.availableImages[t];return e||(e=[]),e},bt.prototype.getLayerIndex=function(t){var e=this.layerIndexes[t];return e||(e=this.layerIndexes[t]=new i),e},bt.prototype.getWorkerSource=function(t,e,n){var i=this;return this.workerSources[t]||(this.workerSources[t]={}),this.workerSources[t][e]||(this.workerSources[t][e]={}),this.workerSources[t][e][n]||(this.workerSources[t][e][n]=new this.workerSourceTypes[e]({send:function(e,n,r){i.actor.send(e,n,r,t)}},this.getLayerIndex(t),this.getAvailableImages(t))),this.workerSources[t][e][n]},bt.prototype.getDEMWorkerSource=function(t,e){return this.demWorkerSources[t]||(this.demWorkerSources[t]={}),this.demWorkerSources[t][e]||(this.demWorkerSources[t][e]=new u),this.demWorkerSources[t][e]},bt.prototype.enforceCacheSizeLimit=function(e,n){t.enforceCacheSizeLimit(n)},"undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof self&&self instanceof WorkerGlobalScope&&(self.worker=new bt(self)),bt})),i(["./shared"],(function(t){var e=t.createCommonjsModule((function(t){function e(t){return!n(t)}function n(t){return"undefined"==typeof window||"undefined"==typeof document?"not a browser":Array.prototype&&Array.prototype.every&&Array.prototype.filter&&Array.prototype.forEach&&Array.prototype.indexOf&&Array.prototype.lastIndexOf&&Array.prototype.map&&Array.prototype.some&&Array.prototype.reduce&&Array.prototype.reduceRight&&Array.isArray?Function.prototype&&Function.prototype.bind?Object.keys&&Object.create&&Object.getPrototypeOf&&Object.getOwnPropertyNames&&Object.isSealed&&Object.isFrozen&&Object.isExtensible&&Object.getOwnPropertyDescriptor&&Object.defineProperty&&Object.defineProperties&&Object.seal&&Object.freeze&&Object.preventExtensions?"JSON"in window&&"parse"in JSON&&"stringify"in JSON?function(){if(!("Worker"in window&&"Blob"in window&&"URL"in window))return!1;var t,e,n=new Blob([""],{type:"text/javascript"}),i=URL.createObjectURL(n);try{e=new Worker(i),t=!0}catch(e){t=!1}return e&&e.terminate(),URL.revokeObjectURL(i),t}()?"Uint8ClampedArray"in window?ArrayBuffer.isView?function(){var t=document.createElement("canvas");t.width=t.height=1;var e=t.getContext("2d");if(!e)return!1;var n=e.getImageData(0,0,1,1);return n&&n.width===t.width}()?(void 0===i[n=t&&t.failIfMajorPerformanceCaveat]&&(i[n]=function(t){var n=function(t){var n=document.createElement("canvas"),i=Object.create(e.webGLContextAttributes);return i.failIfMajorPerformanceCaveat=t,n.probablySupportsContext?n.probablySupportsContext("webgl",i)||n.probablySupportsContext("experimental-webgl",i):n.supportsContext?n.supportsContext("webgl",i)||n.supportsContext("experimental-webgl",i):n.getContext("webgl",i)||n.getContext("experimental-webgl",i)}(t);if(!n)return!1;var i=n.createShader(n.VERTEX_SHADER);return!(!i||n.isContextLost())&&(n.shaderSource(i,"void main() {}"),n.compileShader(i),!0===n.getShaderParameter(i,n.COMPILE_STATUS))}(n)),i[n]?void 0:"insufficient WebGL support"):"insufficient Canvas/getImageData support":"insufficient ArrayBuffer support":"insufficient Uint8ClampedArray support":"insufficient worker support":"insufficient JSON support":"insufficient Object support":"insufficient Function support":"insufficent Array support";var n}t.exports?t.exports=e:window&&(window.mapboxgl=window.mapboxgl||{},window.mapboxgl.supported=e,window.mapboxgl.notSupportedReason=n);var i={};e.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0}})),n={create:function(e,n,i){var r=t.window.document.createElement(e);return void 0!==n&&(r.className=n),i&&i.appendChild(r),r},createNS:function(e,n){return t.window.document.createElementNS(e,n)}},i=t.window.document&&t.window.document.documentElement.style;function r(t){if(!i)return t[0];for(var e=0;e<t.length;e++)if(t[e]in i)return t[e];return t[0]}var o,s=r(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]);n.disableDrag=function(){i&&s&&(o=i[s],i[s]="none")},n.enableDrag=function(){i&&s&&(i[s]=o)};var a=r(["transform","WebkitTransform"]);n.setTransform=function(t,e){t.style[a]=e};var l=!1;try{var c=Object.defineProperty({},"passive",{get:function(){l=!0}});t.window.addEventListener("test",c,c),t.window.removeEventListener("test",c,c)}catch(t){l=!1}n.addEventListener=function(t,e,n,i){void 0===i&&(i={}),t.addEventListener(e,n,"passive"in i&&l?i:i.capture)},n.removeEventListener=function(t,e,n,i){void 0===i&&(i={}),t.removeEventListener(e,n,"passive"in i&&l?i:i.capture)};var u=function(e){e.preventDefault(),e.stopPropagation(),t.window.removeEventListener("click",u,!0)};function h(t){var e=t.userImage;return!!(e&&e.render&&e.render())&&(t.data.replace(new Uint8Array(e.data.buffer)),!0)}n.suppressClick=function(){t.window.addEventListener("click",u,!0),t.window.setTimeout((function(){t.window.removeEventListener("click",u,!0)}),0)},n.mousePos=function(e,n){var i=e.getBoundingClientRect();return new t.Point(n.clientX-i.left-e.clientLeft,n.clientY-i.top-e.clientTop)},n.touchPos=function(e,n){for(var i=e.getBoundingClientRect(),r=[],o=0;o<n.length;o++)r.push(new t.Point(n[o].clientX-i.left-e.clientLeft,n[o].clientY-i.top-e.clientTop));return r},n.mouseButton=function(e){return void 0!==t.window.InstallTrigger&&2===e.button&&e.ctrlKey&&t.window.navigator.platform.toUpperCase().indexOf("MAC")>=0?0:e.button},n.remove=function(t){t.parentNode&&t.parentNode.removeChild(t)};var d=function(e){function n(){e.call(this),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new t.RGBAImage({width:1,height:1}),this.dirty=!0}return e&&(n.__proto__=e),(n.prototype=Object.create(e&&e.prototype)).constructor=n,n.prototype.isLoaded=function(){return this.loaded},n.prototype.setLoaded=function(t){if(this.loaded!==t&&(this.loaded=t,t)){for(var e=0,n=this.requestors;e<n.length;e+=1){var i=n[e];this._notify(i.ids,i.callback)}this.requestors=[]}},n.prototype.getImage=function(t){return this.images[t]},n.prototype.addImage=function(t,e){this._validate(t,e)&&(this.images[t]=e)},n.prototype._validate=function(e,n){var i=!0;return this._validateStretch(n.stretchX,n.data&&n.data.width)||(this.fire(new t.ErrorEvent(new Error('Image "'+e+'" has invalid "stretchX" value'))),i=!1),this._validateStretch(n.stretchY,n.data&&n.data.height)||(this.fire(new t.ErrorEvent(new Error('Image "'+e+'" has invalid "stretchY" value'))),i=!1),this._validateContent(n.content,n)||(this.fire(new t.ErrorEvent(new Error('Image "'+e+'" has invalid "content" value'))),i=!1),i},n.prototype._validateStretch=function(t,e){if(!t)return!0;for(var n=0,i=0,r=t;i<r.length;i+=1){var o=r[i];if(o[0]<n||o[1]<o[0]||e<o[1])return!1;n=o[1]}return!0},n.prototype._validateContent=function(t,e){return!(t&&(4!==t.length||t[0]<0||e.data.width<t[0]||t[1]<0||e.data.height<t[1]||t[2]<0||e.data.width<t[2]||t[3]<0||e.data.height<t[3]||t[2]<t[0]||t[3]<t[1]))},n.prototype.updateImage=function(t,e){e.version=this.images[t].version+1,this.images[t]=e,this.updatedImages[t]=!0},n.prototype.removeImage=function(t){var e=this.images[t];delete this.images[t],delete this.patterns[t],e.userImage&&e.userImage.onRemove&&e.userImage.onRemove()},n.prototype.listImages=function(){return Object.keys(this.images)},n.prototype.getImages=function(t,e){var n=!0;if(!this.isLoaded())for(var i=0,r=t;i<r.length;i+=1)this.images[r[i]]||(n=!1);this.isLoaded()||n?this._notify(t,e):this.requestors.push({ids:t,callback:e})},n.prototype._notify=function(e,n){for(var i={},r=0,o=e;r<o.length;r+=1){var s=o[r];this.images[s]||this.fire(new t.Event("styleimagemissing",{id:s}));var a=this.images[s];a?i[s]={data:a.data.clone(),pixelRatio:a.pixelRatio,sdf:a.sdf,version:a.version,stretchX:a.stretchX,stretchY:a.stretchY,content:a.content,hasRenderCallback:Boolean(a.userImage&&a.userImage.render)}:t.warnOnce('Image "'+s+'" could not be loaded. Please make sure you have added the image with map.addImage() or a "sprite" property in your style. You can provide missing images by listening for the "styleimagemissing" map event.')}n(null,i)},n.prototype.getPixelSize=function(){var t=this.atlasImage;return{width:t.width,height:t.height}},n.prototype.getPattern=function(e){var n=this.patterns[e],i=this.getImage(e);if(!i)return null;if(n&&n.position.version===i.version)return n.position;if(n)n.position.version=i.version;else{var r={w:i.data.width+2,h:i.data.height+2,x:0,y:0},o=new t.ImagePosition(r,i);this.patterns[e]={bin:r,position:o}}return this._updatePatternAtlas(),this.patterns[e].position},n.prototype.bind=function(e){var n=e.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new t.Texture(e,this.atlasImage,n.RGBA),this.atlasTexture.bind(n.LINEAR,n.CLAMP_TO_EDGE)},n.prototype._updatePatternAtlas=function(){var e=[];for(var n in this.patterns)e.push(this.patterns[n].bin);var i=t.potpack(e),r=i.w,o=i.h,s=this.atlasImage;for(var a in s.resize({width:r||1,height:o||1}),this.patterns){var l=this.patterns[a].bin,c=l.x+1,u=l.y+1,h=this.images[a].data,d=h.width,p=h.height;t.RGBAImage.copy(h,s,{x:0,y:0},{x:c,y:u},{width:d,height:p}),t.RGBAImage.copy(h,s,{x:0,y:p-1},{x:c,y:u-1},{width:d,height:1}),t.RGBAImage.copy(h,s,{x:0,y:0},{x:c,y:u+p},{width:d,height:1}),t.RGBAImage.copy(h,s,{x:d-1,y:0},{x:c-1,y:u},{width:1,height:p}),t.RGBAImage.copy(h,s,{x:0,y:0},{x:c+d,y:u},{width:1,height:p})}this.dirty=!0},n.prototype.beginFrame=function(){this.callbackDispatchedThisFrame={}},n.prototype.dispatchRenderCallbacks=function(t){for(var e=0,n=t;e<n.length;e+=1){var i=n[e];if(!this.callbackDispatchedThisFrame[i]){this.callbackDispatchedThisFrame[i]=!0;var r=this.images[i];h(r)&&this.updateImage(i,r)}}},n}(t.Evented),p=g,f=g,A=1e20;function g(t,e,n,i,r,o){this.fontSize=t||24,this.buffer=void 0===e?3:e,this.cutoff=i||.25,this.fontFamily=r||"sans-serif",this.fontWeight=o||"normal",this.radius=n||8;var s=this.size=this.fontSize+2*this.buffer;this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=s,this.ctx=this.canvas.getContext("2d"),this.ctx.font=this.fontWeight+" "+this.fontSize+"px "+this.fontFamily,this.ctx.textBaseline="middle",this.ctx.fillStyle="black",this.gridOuter=new Float64Array(s*s),this.gridInner=new Float64Array(s*s),this.f=new Float64Array(s),this.d=new Float64Array(s),this.z=new Float64Array(s+1),this.v=new Int16Array(s),this.middle=Math.round(s/2*(navigator.userAgent.indexOf("Gecko/")>=0?1.2:1))}function m(t,e,n,i,r,o,s){for(var a=0;a<e;a++){for(var l=0;l<n;l++)i[l]=t[l*e+a];for(y(i,r,o,s,n),l=0;l<n;l++)t[l*e+a]=r[l]}for(l=0;l<n;l++){for(a=0;a<e;a++)i[a]=t[l*e+a];for(y(i,r,o,s,e),a=0;a<e;a++)t[l*e+a]=Math.sqrt(r[a])}}function y(t,e,n,i,r){n[0]=0,i[0]=-A,i[1]=+A;for(var o=1,s=0;o<r;o++){for(var a=(t[o]+o*o-(t[n[s]]+n[s]*n[s]))/(2*o-2*n[s]);a<=i[s];)s--,a=(t[o]+o*o-(t[n[s]]+n[s]*n[s]))/(2*o-2*n[s]);n[++s]=o,i[s]=a,i[s+1]=+A}for(o=0,s=0;o<r;o++){for(;i[s+1]<o;)s++;e[o]=(o-n[s])*(o-n[s])+t[n[s]]}}g.prototype.draw=function(t){this.ctx.clearRect(0,0,this.size,this.size),this.ctx.fillText(t,this.buffer,this.middle);for(var e=this.ctx.getImageData(0,0,this.size,this.size),n=new Uint8ClampedArray(this.size*this.size),i=0;i<this.size*this.size;i++){var r=e.data[4*i+3]/255;this.gridOuter[i]=1===r?0:0===r?A:Math.pow(Math.max(0,.5-r),2),this.gridInner[i]=1===r?A:0===r?0:Math.pow(Math.max(0,r-.5),2)}for(m(this.gridOuter,this.size,this.size,this.f,this.d,this.v,this.z),m(this.gridInner,this.size,this.size,this.f,this.d,this.v,this.z),i=0;i<this.size*this.size;i++)n[i]=Math.max(0,Math.min(255,Math.round(255-255*((this.gridOuter[i]-this.gridInner[i])/this.radius+this.cutoff))));return n},p.default=f;var _=function(t,e){this.requestManager=t,this.localIdeographFontFamily=e,this.entries={}};_.prototype.setURL=function(t){this.url=t},_.prototype.getGlyphs=function(e,n){var i=this,r=[];for(var o in e)for(var s=0,a=e[o];s<a.length;s+=1)r.push({stack:o,id:a[s]});t.asyncAll(r,(function(t,e){var n=t.stack,r=t.id,o=i.entries[n];o||(o=i.entries[n]={glyphs:{},requests:{},ranges:{}});var s=o.glyphs[r];if(void 0===s){if(s=i._tinySDF(o,n,r))return o.glyphs[r]=s,void e(null,{stack:n,id:r,glyph:s});var a=Math.floor(r/256);if(256*a>65535)e(new Error("glyphs > 65535 not supported"));else if(o.ranges[a])e(null,{stack:n,id:r,glyph:s});else{var l=o.requests[a];l||(l=o.requests[a]=[],_.loadGlyphRange(n,a,i.url,i.requestManager,(function(t,e){if(e){for(var n in e)i._doesCharSupportLocalGlyph(+n)||(o.glyphs[+n]=e[+n]);o.ranges[a]=!0}for(var r=0,s=l;r<s.length;r+=1)(0,s[r])(t,e);delete o.requests[a]}))),l.push((function(t,i){t?e(t):i&&e(null,{stack:n,id:r,glyph:i[r]||null})}))}}else e(null,{stack:n,id:r,glyph:s})}),(function(t,e){if(t)n(t);else if(e){for(var i={},r=0,o=e;r<o.length;r+=1){var s=o[r],a=s.stack,l=s.id,c=s.glyph;(i[a]||(i[a]={}))[l]=c&&{id:c.id,bitmap:c.bitmap.clone(),metrics:c.metrics}}n(null,i)}}))},_.prototype._doesCharSupportLocalGlyph=function(e){return!!this.localIdeographFontFamily&&(t.isChar["CJK Unified Ideographs"](e)||t.isChar["Hangul Syllables"](e)||t.isChar.Hiragana(e)||t.isChar.Katakana(e))},_.prototype._tinySDF=function(e,n,i){var r=this.localIdeographFontFamily;if(r&&this._doesCharSupportLocalGlyph(i)){var o=e.tinySDF;if(!o){var s="400";/bold/i.test(n)?s="900":/medium/i.test(n)?s="500":/light/i.test(n)&&(s="200"),o=e.tinySDF=new _.TinySDF(24,3,8,.25,r,s)}return{id:i,bitmap:new t.AlphaImage({width:30,height:30},o.draw(String.fromCharCode(i))),metrics:{width:24,height:24,left:0,top:-8,advance:24}}}},_.loadGlyphRange=function(e,n,i,r,o){var s=256*n,a=s+255,l=r.transformRequest(r.normalizeGlyphsURL(i).replace("{fontstack}",e).replace("{range}",s+"-"+a),t.ResourceType.Glyphs);t.getArrayBuffer(l,(function(e,n){if(e)o(e);else if(n){for(var i={},r=0,s=t.parseGlyphPBF(n);r<s.length;r+=1){var a=s[r];i[a.id]=a}o(null,i)}}))},_.TinySDF=p;var v=function(){this.specification=t.styleSpec.light.position};v.prototype.possiblyEvaluate=function(e,n){return t.sphericalToCartesian(e.expression.evaluate(n))},v.prototype.interpolate=function(e,n,i){return{x:t.number(e.x,n.x,i),y:t.number(e.y,n.y,i),z:t.number(e.z,n.z,i)}};var b=new t.Properties({anchor:new t.DataConstantProperty(t.styleSpec.light.anchor),position:new v,color:new t.DataConstantProperty(t.styleSpec.light.color),intensity:new t.DataConstantProperty(t.styleSpec.light.intensity)}),x=function(e){function n(n){e.call(this),this._transitionable=new t.Transitionable(b),this.setLight(n),this._transitioning=this._transitionable.untransitioned()}return e&&(n.__proto__=e),(n.prototype=Object.create(e&&e.prototype)).constructor=n,n.prototype.getLight=function(){return this._transitionable.serialize()},n.prototype.setLight=function(e,n){if(void 0===n&&(n={}),!this._validate(t.validateLight,e,n))for(var i in e){var r=e[i];t.endsWith(i,"-transition")?this._transitionable.setTransition(i.slice(0,-11),r):this._transitionable.setValue(i,r)}},n.prototype.updateTransitions=function(t){this._transitioning=this._transitionable.transitioned(t,this._transitioning)},n.prototype.hasTransition=function(){return this._transitioning.hasTransition()},n.prototype.recalculate=function(t){this.properties=this._transitioning.possiblyEvaluate(t)},n.prototype._validate=function(e,n,i){return(!i||!1!==i.validate)&&t.emitValidationErrors(this,e.call(t.validateStyle,t.extend({value:n,style:{glyphs:!0,sprite:!0},styleSpec:t.styleSpec})))},n}(t.Evented),w=function(t,e){this.width=t,this.height=e,this.nextRow=0,this.data=new Uint8Array(this.width*this.height),this.dashEntry={}};w.prototype.getDash=function(t,e){var n=t.join(",")+String(e);return this.dashEntry[n]||(this.dashEntry[n]=this.addDash(t,e)),this.dashEntry[n]},w.prototype.getDashRanges=function(t,e,n){var i=[],r=t.length%2==1?-t[t.length-1]*n:0,o=t[0]*n,s=!0;i.push({left:r,right:o,isDash:s,zeroLength:0===t[0]});for(var a=t[0],l=1;l<t.length;l++){var c=t[l];i.push({left:r=a*n,right:o=(a+=c)*n,isDash:s=!s,zeroLength:0===c})}return i},w.prototype.addRoundDash=function(t,e,n){for(var i=e/2,r=-n;r<=n;r++)for(var o=this.width*(this.nextRow+n+r),s=0,a=t[s],l=0;l<this.width;l++){l/a.right>1&&(a=t[++s]);var c=Math.abs(l-a.left),u=Math.abs(l-a.right),h=Math.min(c,u),d=void 0,p=r/n*(i+1);if(a.isDash){var f=i-Math.abs(p);d=Math.sqrt(h*h+f*f)}else d=i-Math.sqrt(h*h+p*p);this.data[o+l]=Math.max(0,Math.min(255,d+128))}},w.prototype.addRegularDash=function(t){for(var e=t.length-1;e>=0;--e){var n=t[e],i=t[e+1];n.zeroLength?t.splice(e,1):i&&i.isDash===n.isDash&&(i.left=n.left,t.splice(e,1))}var r=t[0],o=t[t.length-1];r.isDash===o.isDash&&(r.left=o.left-this.width,o.right=r.right+this.width);for(var s=this.width*this.nextRow,a=0,l=t[a],c=0;c<this.width;c++){c/l.right>1&&(l=t[++a]);var u=Math.abs(c-l.left),h=Math.abs(c-l.right),d=Math.min(u,h);this.data[s+c]=Math.max(0,Math.min(255,(l.isDash?d:-d)+128))}},w.prototype.addDash=function(e,n){var i=n?7:0,r=2*i+1;if(this.nextRow+r>this.height)return t.warnOnce("LineAtlas out of space"),null;for(var o=0,s=0;s<e.length;s++)o+=e[s];if(0!==o){var a=this.width/o,l=this.getDashRanges(e,this.width,a);n?this.addRoundDash(l,a,i):this.addRegularDash(l)}var c={y:(this.nextRow+i+.5)/this.height,height:2*i/this.height,width:o};return this.nextRow+=r,this.dirty=!0,c},w.prototype.bind=function(t){var e=t.gl;this.texture?(e.bindTexture(e.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,e.texSubImage2D(e.TEXTURE_2D,0,0,0,this.width,this.height,e.ALPHA,e.UNSIGNED_BYTE,this.data))):(this.texture=e.createTexture(),e.bindTexture(e.TEXTURE_2D,this.texture),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.REPEAT),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.REPEAT),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texImage2D(e.TEXTURE_2D,0,e.ALPHA,this.width,this.height,0,e.ALPHA,e.UNSIGNED_BYTE,this.data))};var E=function e(n,i){this.workerPool=n,this.actors=[],this.currentActor=0,this.id=t.uniqueId();for(var r=this.workerPool.acquire(this.id),o=0;o<r.length;o++){var s=new e.Actor(r[o],i,this.id);s.name="Worker "+o,this.actors.push(s)}};function C(e,n,i){var r=function(r,o){if(r)return i(r);if(o){var s=t.pick(t.extend(o,e),["tiles","minzoom","maxzoom","attribution","mapbox_logo","bounds","scheme","tileSize","encoding"]);o.vector_layers&&(s.vectorLayers=o.vector_layers,s.vectorLayerIds=s.vectorLayers.map((function(t){return t.id}))),s.tiles=n.canonicalizeTileset(s,e.url),i(null,s)}};return e.url?t.getJSON(n.transformRequest(n.normalizeSourceURL(e.url),t.ResourceType.Source),r):t.browser.frame((function(){return r(null,e)}))}E.prototype.broadcast=function(e,n,i){t.asyncAll(this.actors,(function(t,i){t.send(e,n,i)}),i=i||function(){})},E.prototype.getActor=function(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]},E.prototype.remove=function(){this.actors.forEach((function(t){t.remove()})),this.actors=[],this.workerPool.release(this.id)},E.Actor=t.Actor;var T=function(e,n,i){this.bounds=t.LngLatBounds.convert(this.validateBounds(e)),this.minzoom=n||0,this.maxzoom=i||24};T.prototype.validateBounds=function(t){return Array.isArray(t)&&4===t.length?[Math.max(-180,t[0]),Math.max(-90,t[1]),Math.min(180,t[2]),Math.min(90,t[3])]:[-180,-90,180,90]},T.prototype.contains=function(e){var n=Math.pow(2,e.z),i=Math.floor(t.mercatorXfromLng(this.bounds.getWest())*n),r=Math.floor(t.mercatorYfromLat(this.bounds.getNorth())*n),o=Math.ceil(t.mercatorXfromLng(this.bounds.getEast())*n),s=Math.ceil(t.mercatorYfromLat(this.bounds.getSouth())*n);return e.x>=i&&e.x<o&&e.y>=r&&e.y<s};var S=function(e){function n(n,i,r,o){if(e.call(this),this.id=n,this.dispatcher=r,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,t.extend(this,t.pick(i,["url","scheme","tileSize","promoteId"])),this._options=t.extend({type:"vector"},i),this._collectResourceTiming=i.collectResourceTiming,512!==this.tileSize)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(o)}return e&&(n.__proto__=e),(n.prototype=Object.create(e&&e.prototype)).constructor=n,n.prototype.load=function(){var e=this;this._loaded=!1,this.fire(new t.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=C(this._options,this.map._requestManager,(function(n,i){e._tileJSONRequest=null,e._loaded=!0,n?e.fire(new t.ErrorEvent(n)):i&&(t.extend(e,i),i.bounds&&(e.tileBounds=new T(i.bounds,e.minzoom,e.maxzoom)),t.postTurnstileEvent(i.tiles,e.map._requestManager._customAccessToken),t.postMapLoadEvent(i.tiles,e.map._getMapId(),e.map._requestManager._skuToken,e.map._requestManager._customAccessToken),e.fire(new t.Event("data",{dataType:"source",sourceDataType:"metadata"})),e.fire(new t.Event("data",{dataType:"source",sourceDataType:"content"})))}))},n.prototype.loaded=function(){return this._loaded},n.prototype.hasTile=function(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)},n.prototype.onAdd=function(t){this.map=t,this.load()},n.prototype.setSourceProperty=function(t){this._tileJSONRequest&&this._tileJSONRequest.cancel(),t(),this.map.style.sourceCaches[this.id].clearTiles(),this.load()},n.prototype.setTiles=function(t){var e=this;return this.setSourceProperty((function(){e._options.tiles=t})),this},n.prototype.setUrl=function(t){var e=this;return this.setSourceProperty((function(){e.url=t,e._options.url=t})),this},n.prototype.onRemove=function(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)},n.prototype.serialize=function(){return t.extend({},this._options)},n.prototype.loadTile=function(e,n){var i=this.map._requestManager.normalizeTileURL(e.tileID.canonical.url(this.tiles,this.scheme)),r={request:this.map._requestManager.transformRequest(i,t.ResourceType.Tile),uid:e.uid,tileID:e.tileID,zoom:e.tileID.overscaledZ,tileSize:this.tileSize*e.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:t.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};function o(i,r){return delete e.request,e.aborted?n(null):i&&404!==i.status?n(i):(r&&r.resourceTiming&&(e.resourceTiming=r.resourceTiming),this.map._refreshExpiredTiles&&r&&e.setExpiryData(r),e.loadVectorData(r,this.map.painter),t.cacheEntryPossiblyAdded(this.dispatcher),n(null),void(e.reloadCallback&&(this.loadTile(e,e.reloadCallback),e.reloadCallback=null)))}r.request.collectResourceTiming=this._collectResourceTiming,e.actor&&"expired"!==e.state?"loading"===e.state?e.reloadCallback=n:e.request=e.actor.send("reloadTile",r,o.bind(this)):(e.actor=this.dispatcher.getActor(),e.request=e.actor.send("loadTile",r,o.bind(this)))},n.prototype.abortTile=function(t){t.request&&(t.request.cancel(),delete t.request),t.actor&&t.actor.send("abortTile",{uid:t.uid,type:this.type,source:this.id},void 0)},n.prototype.unloadTile=function(t){t.unloadVectorData(),t.actor&&t.actor.send("removeTile",{uid:t.uid,type:this.type,source:this.id},void 0)},n.prototype.hasTransition=function(){return!1},n}(t.Evented),P=function(e){function n(n,i,r,o){e.call(this),this.id=n,this.dispatcher=r,this.setEventedParent(o),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=t.extend({type:"raster"},i),t.extend(this,t.pick(i,["url","scheme","tileSize"]))}return e&&(n.__proto__=e),(n.prototype=Object.create(e&&e.prototype)).constructor=n,n.prototype.load=function(){var e=this;this._loaded=!1,this.fire(new t.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=C(this._options,this.map._requestManager,(function(n,i){e._tileJSONRequest=null,e._loaded=!0,n?e.fire(new t.ErrorEvent(n)):i&&(t.extend(e,i),i.bounds&&(e.tileBounds=new T(i.bounds,e.minzoom,e.maxzoom)),t.postTurnstileEvent(i.tiles),t.postMapLoadEvent(i.tiles,e.map._getMapId(),e.map._requestManager._skuToken),e.fire(new t.Event("data",{dataType:"source",sourceDataType:"metadata"})),e.fire(new t.Event("data",{dataType:"source",sourceDataType:"content"})))}))},n.prototype.loaded=function(){return this._loaded},n.prototype.onAdd=function(t){this.map=t,this.load()},n.prototype.onRemove=function(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)},n.prototype.serialize=function(){return t.extend({},this._options)},n.prototype.hasTile=function(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)},n.prototype.loadTile=function(e,n){var i=this,r=this.map._requestManager.normalizeTileURL(e.tileID.canonical.url(this.tiles,this.scheme),this.tileSize);e.request=t.getImage(this.map._requestManager.transformRequest(r,t.ResourceType.Tile),(function(r,o){if(delete e.request,e.aborted)e.state="unloaded",n(null);else if(r)e.state="errored",n(r);else if(o){i.map._refreshExpiredTiles&&e.setExpiryData(o),delete o.cacheControl,delete o.expires;var s=i.map.painter.context,a=s.gl;e.texture=i.map.painter.getTileTexture(o.width),e.texture?e.texture.update(o,{useMipmap:!0}):(e.texture=new t.Texture(s,o,a.RGBA,{useMipmap:!0}),e.texture.bind(a.LINEAR,a.CLAMP_TO_EDGE,a.LINEAR_MIPMAP_NEAREST),s.extTextureFilterAnisotropic&&a.texParameterf(a.TEXTURE_2D,s.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,s.extTextureFilterAnisotropicMax)),e.state="loaded",t.cacheEntryPossiblyAdded(i.dispatcher),n(null)}}))},n.prototype.abortTile=function(t,e){t.request&&(t.request.cancel(),delete t.request),e()},n.prototype.unloadTile=function(t,e){t.texture&&this.map.painter.saveTileTexture(t.texture),e()},n.prototype.hasTransition=function(){return!1},n}(t.Evented),M=function(e){function n(n,i,r,o){e.call(this,n,i,r,o),this.type="raster-dem",this.maxzoom=22,this._options=t.extend({type:"raster-dem"},i),this.encoding=i.encoding||"mapbox"}return e&&(n.__proto__=e),(n.prototype=Object.create(e&&e.prototype)).constructor=n,n.prototype.serialize=function(){return{type:"raster-dem",url:this.url,tileSize:this.tileSize,tiles:this.tiles,bounds:this.bounds,encoding:this.encoding}},n.prototype.loadTile=function(e,n){var i=this.map._requestManager.normalizeTileURL(e.tileID.canonical.url(this.tiles,this.scheme),this.tileSize);function r(t,i){t&&(e.state="errored",n(t)),i&&(e.dem=i,e.needsHillshadePrepare=!0,e.state="loaded",n(null))}e.request=t.getImage(this.map._requestManager.transformRequest(i,t.ResourceType.Tile),function(i,o){if(delete e.request,e.aborted)e.state="unloaded",n(null);else if(i)e.state="errored",n(i);else if(o){this.map._refreshExpiredTiles&&e.setExpiryData(o),delete o.cacheControl,delete o.expires;var s=t.window.ImageBitmap&&o instanceof t.window.ImageBitmap&&t.offscreenCanvasSupported()?o:t.browser.getImageData(o,1),a={uid:e.uid,coord:e.tileID,source:this.id,rawImageData:s,encoding:this.encoding};e.actor&&"expired"!==e.state||(e.actor=this.dispatcher.getActor(),e.actor.send("loadDEMTile",a,r.bind(this)))}}.bind(this)),e.neighboringTiles=this._getNeighboringTiles(e.tileID)},n.prototype._getNeighboringTiles=function(e){var n=e.canonical,i=Math.pow(2,n.z),r=(n.x-1+i)%i,o=0===n.x?e.wrap-1:e.wrap,s=(n.x+1+i)%i,a=n.x+1===i?e.wrap+1:e.wrap,l={};return l[new t.OverscaledTileID(e.overscaledZ,o,n.z,r,n.y).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,a,n.z,s,n.y).key]={backfilled:!1},n.y>0&&(l[new t.OverscaledTileID(e.overscaledZ,o,n.z,r,n.y-1).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,e.wrap,n.z,n.x,n.y-1).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,a,n.z,s,n.y-1).key]={backfilled:!1}),n.y+1<i&&(l[new t.OverscaledTileID(e.overscaledZ,o,n.z,r,n.y+1).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,e.wrap,n.z,n.x,n.y+1).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,a,n.z,s,n.y+1).key]={backfilled:!1}),l},n.prototype.unloadTile=function(t){t.demTexture&&this.map.painter.saveTileTexture(t.demTexture),t.fbo&&(t.fbo.destroy(),delete t.fbo),t.dem&&delete t.dem,delete t.neighboringTiles,t.state="unloaded",t.actor&&t.actor.send("removeDEMTile",{uid:t.uid,source:this.id})},n}(P),I=function(e){function n(n,i,r,o){e.call(this),this.id=n,this.type="geojson",this.minzoom=0,this.maxzoom=18,this.tileSize=512,this.isTileClipped=!0,this.reparseOverscaled=!0,this._removed=!1,this._loaded=!1,this.actor=r.getActor(),this.setEventedParent(o),this._data=i.data,this._options=t.extend({},i),this._collectResourceTiming=i.collectResourceTiming,this._resourceTiming=[],void 0!==i.maxzoom&&(this.maxzoom=i.maxzoom),i.type&&(this.type=i.type),i.attribution&&(this.attribution=i.attribution),this.promoteId=i.promoteId;var s=t.EXTENT/this.tileSize;this.workerOptions=t.extend({source:this.id,cluster:i.cluster||!1,geojsonVtOptions:{buffer:(void 0!==i.buffer?i.buffer:128)*s,tolerance:(void 0!==i.tolerance?i.tolerance:.375)*s,extent:t.EXTENT,maxZoom:this.maxzoom,lineMetrics:i.lineMetrics||!1,generateId:i.generateId||!1},superclusterOptions:{maxZoom:void 0!==i.clusterMaxZoom?Math.min(i.clusterMaxZoom,this.maxzoom-1):this.maxzoom-1,minPoints:Math.max(2,i.clusterMinPoints||2),extent:t.EXTENT,radius:(i.clusterRadius||50)*s,log:!1,generateId:i.generateId||!1},clusterProperties:i.clusterProperties,filter:i.filter},i.workerOptions)}return e&&(n.__proto__=e),(n.prototype=Object.create(e&&e.prototype)).constructor=n,n.prototype.load=function(){var e=this;this.fire(new t.Event("dataloading",{dataType:"source"})),this._updateWorkerData((function(n){if(n)e.fire(new t.ErrorEvent(n));else{var i={dataType:"source",sourceDataType:"metadata"};e._collectResourceTiming&&e._resourceTiming&&e._resourceTiming.length>0&&(i.resourceTiming=e._resourceTiming,e._resourceTiming=[]),e.fire(new t.Event("data",i))}}))},n.prototype.onAdd=function(t){this.map=t,this.load()},n.prototype.setData=function(e){var n=this;return this._data=e,this.fire(new t.Event("dataloading",{dataType:"source"})),this._updateWorkerData((function(e){if(e)n.fire(new t.ErrorEvent(e));else{var i={dataType:"source",sourceDataType:"content"};n._collectResourceTiming&&n._resourceTiming&&n._resourceTiming.length>0&&(i.resourceTiming=n._resourceTiming,n._resourceTiming=[]),n.fire(new t.Event("data",i))}})),this},n.prototype.getClusterExpansionZoom=function(t,e){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:t,source:this.id},e),this},n.prototype.getClusterChildren=function(t,e){return this.actor.send("geojson.getClusterChildren",{clusterId:t,source:this.id},e),this},n.prototype.getClusterLeaves=function(t,e,n,i){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:t,limit:e,offset:n},i),this},n.prototype._updateWorkerData=function(e){var n=this;this._loaded=!1;var i=t.extend({},this.workerOptions),r=this._data;"string"==typeof r?(i.request=this.map._requestManager.transformRequest(t.browser.resolveURL(r),t.ResourceType.Source),i.request.collectResourceTiming=this._collectResourceTiming):i.data=JSON.stringify(r),this.actor.send(this.type+".loadData",i,(function(t,r){n._removed||r&&r.abandoned||(n._loaded=!0,r&&r.resourceTiming&&r.resourceTiming[n.id]&&(n._resourceTiming=r.resourceTiming[n.id].slice(0)),n.actor.send(n.type+".coalesce",{source:i.source},null),e(t))}))},n.prototype.loaded=function(){return this._loaded},n.prototype.loadTile=function(e,n){var i=this,r=e.actor?"reloadTile":"loadTile";e.actor=this.actor,e.request=this.actor.send(r,{type:this.type,uid:e.uid,tileID:e.tileID,zoom:e.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:t.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId},(function(t,o){return delete e.request,e.unloadVectorData(),e.aborted?n(null):t?n(t):(e.loadVectorData(o,i.map.painter,"reloadTile"===r),n(null))}))},n.prototype.abortTile=function(t){t.request&&(t.request.cancel(),delete t.request),t.aborted=!0},n.prototype.unloadTile=function(t){t.unloadVectorData(),this.actor.send("removeTile",{uid:t.uid,type:this.type,source:this.id})},n.prototype.onRemove=function(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})},n.prototype.serialize=function(){return t.extend({},this._options,{type:this.type,data:this._data})},n.prototype.hasTransition=function(){return!1},n}(t.Evented),B=t.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]),R=function(e){function n(t,n,i,r){e.call(this),this.id=t,this.dispatcher=i,this.coordinates=n.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(r),this.options=n}return e&&(n.__proto__=e),(n.prototype=Object.create(e&&e.prototype)).constructor=n,n.prototype.load=function(e,n){var i=this;this._loaded=!1,this.fire(new t.Event("dataloading",{dataType:"source"})),this.url=this.options.url,t.getImage(this.map._requestManager.transformRequest(this.url,t.ResourceType.Image),(function(r,o){i._loaded=!0,r?i.fire(new t.ErrorEvent(r)):o&&(i.image=o,e&&(i.coordinates=e),n&&n(),i._finishLoading())}))},n.prototype.loaded=function(){return this._loaded},n.prototype.updateImage=function(t){var e=this;return this.image&&t.url?(this.options.url=t.url,this.load(t.coordinates,(function(){e.texture=null})),this):this},n.prototype._finishLoading=function(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new t.Event("data",{dataType:"source",sourceDataType:"metadata"})))},n.prototype.onAdd=function(t){this.map=t,this.load()},n.prototype.setCoordinates=function(e){var n=this;this.coordinates=e;var i=e.map(t.MercatorCoordinate.fromLngLat);this.tileID=function(e){for(var n=1/0,i=1/0,r=-1/0,o=-1/0,s=0,a=e;s<a.length;s+=1){var l=a[s];n=Math.min(n,l.x),i=Math.min(i,l.y),r=Math.max(r,l.x),o=Math.max(o,l.y)}var c=Math.max(r-n,o-i),u=Math.max(0,Math.floor(-Math.log(c)/Math.LN2)),h=Math.pow(2,u);return new t.CanonicalTileID(u,Math.floor((n+r)/2*h),Math.floor((i+o)/2*h))}(i),this.minzoom=this.maxzoom=this.tileID.z;var r=i.map((function(t){return n.tileID.getTilePoint(t)._round()}));return this._boundsArray=new t.StructArrayLayout4i8,this._boundsArray.emplaceBack(r[0].x,r[0].y,0,0),this._boundsArray.emplaceBack(r[1].x,r[1].y,t.EXTENT,0),this._boundsArray.emplaceBack(r[3].x,r[3].y,0,t.EXTENT),this._boundsArray.emplaceBack(r[2].x,r[2].y,t.EXTENT,t.EXTENT),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new t.Event("data",{dataType:"source",sourceDataType:"content"})),this},n.prototype.prepare=function(){if(0!==Object.keys(this.tiles).length&&this.image){var e=this.map.painter.context,n=e.gl;for(var i in this.boundsBuffer||(this.boundsBuffer=e.createVertexBuffer(this._boundsArray,B.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture||(this.texture=new t.Texture(e,this.image,n.RGBA),this.texture.bind(n.LINEAR,n.CLAMP_TO_EDGE)),this.tiles){var r=this.tiles[i];"loaded"!==r.state&&(r.state="loaded",r.texture=this.texture)}}},n.prototype.loadTile=function(t,e){this.tileID&&this.tileID.equals(t.tileID.canonical)?(this.tiles[String(t.tileID.wrap)]=t,t.buckets={},e(null)):(t.state="errored",e(null))},n.prototype.serialize=function(){return{type:"image",url:this.options.url,coordinates:this.coordinates}},n.prototype.hasTransition=function(){return!1},n}(t.Evented),L=function(e){function n(t,n,i,r){e.call(this,t,n,i,r),this.roundZoom=!0,this.type="video",this.options=n}return e&&(n.__proto__=e),(n.prototype=Object.create(e&&e.prototype)).constructor=n,n.prototype.load=function(){var e=this;this._loaded=!1;var n=this.options;this.urls=[];for(var i=0,r=n.urls;i<r.length;i+=1)this.urls.push(this.map._requestManager.transformRequest(r[i],t.ResourceType.Source).url);t.getVideo(this.urls,(function(n,i){e._loaded=!0,n?e.fire(new t.ErrorEvent(n)):i&&(e.video=i,e.video.loop=!0,e.video.addEventListener("playing",(function(){e.map.triggerRepaint()})),e.map&&e.video.play(),e._finishLoading())}))},n.prototype.pause=function(){this.video&&this.video.pause()},n.prototype.play=function(){this.video&&this.video.play()},n.prototype.seek=function(e){if(this.video){var n=this.video.seekable;e<n.start(0)||e>n.end(0)?this.fire(new t.ErrorEvent(new t.ValidationError("sources."+this.id,null,"Playback for this video can be set only between the "+n.start(0)+" and "+n.end(0)+"-second mark."))):this.video.currentTime=e}},n.prototype.getVideo=function(){return this.video},n.prototype.onAdd=function(t){this.map||(this.map=t,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},n.prototype.prepare=function(){if(!(0===Object.keys(this.tiles).length||this.video.readyState<2)){var e=this.map.painter.context,n=e.gl;for(var i in this.boundsBuffer||(this.boundsBuffer=e.createVertexBuffer(this._boundsArray,B.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(n.LINEAR,n.CLAMP_TO_EDGE),n.texSubImage2D(n.TEXTURE_2D,0,0,0,n.RGBA,n.UNSIGNED_BYTE,this.video)):(this.texture=new t.Texture(e,this.video,n.RGBA),this.texture.bind(n.LINEAR,n.CLAMP_TO_EDGE)),this.tiles){var r=this.tiles[i];"loaded"!==r.state&&(r.state="loaded",r.texture=this.texture)}}},n.prototype.serialize=function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}},n.prototype.hasTransition=function(){return this.video&&!this.video.paused},n}(R),O=function(e){function n(n,i,r,o){e.call(this,n,i,r,o),i.coordinates?Array.isArray(i.coordinates)&&4===i.coordinates.length&&!i.coordinates.some((function(t){return!Array.isArray(t)||2!==t.length||t.some((function(t){return"number"!=typeof t}))}))||this.fire(new t.ErrorEvent(new t.ValidationError("sources."+n,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new t.ErrorEvent(new t.ValidationError("sources."+n,null,'missing required property "coordinates"'))),i.animate&&"boolean"!=typeof i.animate&&this.fire(new t.ErrorEvent(new t.ValidationError("sources."+n,null,'optional "animate" property must be a boolean value'))),i.canvas?"string"==typeof i.canvas||i.canvas instanceof t.window.HTMLCanvasElement||this.fire(new t.ErrorEvent(new t.ValidationError("sources."+n,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new t.ErrorEvent(new t.ValidationError("sources."+n,null,'missing required property "canvas"'))),this.options=i,this.animate=void 0===i.animate||i.animate}return e&&(n.__proto__=e),(n.prototype=Object.create(e&&e.prototype)).constructor=n,n.prototype.load=function(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof t.window.HTMLCanvasElement?this.options.canvas:t.window.document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new t.ErrorEvent(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())},n.prototype.getCanvas=function(){return this.canvas},n.prototype.onAdd=function(t){this.map=t,this.load(),this.canvas&&this.animate&&this.play()},n.prototype.onRemove=function(){this.pause()},n.prototype.prepare=function(){var e=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,e=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,e=!0),!this._hasInvalidDimensions()&&0!==Object.keys(this.tiles).length){var n=this.map.painter.context,i=n.gl;for(var r in this.boundsBuffer||(this.boundsBuffer=n.createVertexBuffer(this._boundsArray,B.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(e||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new t.Texture(n,this.canvas,i.RGBA,{premultiply:!0}),this.tiles){var o=this.tiles[r];"loaded"!==o.state&&(o.state="loaded",o.texture=this.texture)}}},n.prototype.serialize=function(){return{type:"canvas",coordinates:this.coordinates}},n.prototype.hasTransition=function(){return this._playing},n.prototype._hasInvalidDimensions=function(){for(var t=0,e=[this.canvas.width,this.canvas.height];t<e.length;t+=1){var n=e[t];if(isNaN(n)||n<=0)return!0}return!1},n}(R),D={vector:S,raster:P,"raster-dem":M,geojson:I,video:L,image:R,canvas:O};function k(e,n){var i=t.identity([]);return t.translate(i,i,[1,1,0]),t.scale(i,i,[.5*e.width,.5*e.height,1]),t.multiply(i,i,e.calculatePosMatrix(n.toUnwrapped()))}function F(t,e,n,i,r,o){var s=function(t,e,n){if(t)for(var i=0,r=t;i<r.length;i+=1){var o=e[r[i]];if(o&&o.source===n&&"fill-extrusion"===o.type)return!0}else for(var s in e){var a=e[s];if(a.source===n&&"fill-extrusion"===a.type)return!0}return!1}(r&&r.layers,e,t.id),a=o.maxPitchScaleFactor(),l=t.tilesIn(i,a,s);l.sort(N);for(var c=[],u=0,h=l;u<h.length;u+=1){var d=h[u];c.push({wrappedTileID:d.tileID.wrapped().key,queryResults:d.tile.queryRenderedFeatures(e,n,t._state,d.queryGeometry,d.cameraQueryGeometry,d.scale,r,o,a,k(t.transform,d.tileID))})}var p=function(t){for(var e={},n={},i=0,r=t;i<r.length;i+=1){var o=r[i],s=o.queryResults,a=o.wrappedTileID,l=n[a]=n[a]||{};for(var c in s)for(var u=s[c],h=l[c]=l[c]||{},d=e[c]=e[c]||[],p=0,f=u;p<f.length;p+=1){var A=f[p];h[A.featureIndex]||(h[A.featureIndex]=!0,d.push(A))}}return e}(c);for(var f in p)p[f].forEach((function(e){var n=e.feature,i=t.getFeatureState(n.layer["source-layer"],n.id);n.source=n.layer.source,n.layer["source-layer"]&&(n.sourceLayer=n.layer["source-layer"]),n.state=i}));return p}function N(t,e){var n=t.tileID,i=e.tileID;return n.overscaledZ-i.overscaledZ||n.canonical.y-i.canonical.y||n.wrap-i.wrap||n.canonical.x-i.canonical.x}var z=function(t,e){this.max=t,this.onRemove=e,this.reset()};z.prototype.reset=function(){for(var t in this.data)for(var e=0,n=this.data[t];e<n.length;e+=1){var i=n[e];i.timeout&&clearTimeout(i.timeout),this.onRemove(i.value)}return this.data={},this.order=[],this},z.prototype.add=function(t,e,n){var i=this,r=t.wrapped().key;void 0===this.data[r]&&(this.data[r]=[]);var o={value:e,timeout:void 0};if(void 0!==n&&(o.timeout=setTimeout((function(){i.remove(t,o)}),n)),this.data[r].push(o),this.order.push(r),this.order.length>this.max){var s=this._getAndRemoveByKey(this.order[0]);s&&this.onRemove(s)}return this},z.prototype.has=function(t){return t.wrapped().key in this.data},z.prototype.getAndRemove=function(t){return this.has(t)?this._getAndRemoveByKey(t.wrapped().key):null},z.prototype._getAndRemoveByKey=function(t){var e=this.data[t].shift();return e.timeout&&clearTimeout(e.timeout),0===this.data[t].length&&delete this.data[t],this.order.splice(this.order.indexOf(t),1),e.value},z.prototype.getByKey=function(t){var e=this.data[t];return e?e[0].value:null},z.prototype.get=function(t){return this.has(t)?this.data[t.wrapped().key][0].value:null},z.prototype.remove=function(t,e){if(!this.has(t))return this;var n=t.wrapped().key,i=void 0===e?0:this.data[n].indexOf(e),r=this.data[n][i];return this.data[n].splice(i,1),r.timeout&&clearTimeout(r.timeout),0===this.data[n].length&&delete this.data[n],this.onRemove(r.value),this.order.splice(this.order.indexOf(n),1),this},z.prototype.setMaxSize=function(t){for(this.max=t;this.order.length>this.max;){var e=this._getAndRemoveByKey(this.order[0]);e&&this.onRemove(e)}return this},z.prototype.filter=function(t){var e=[];for(var n in this.data)for(var i=0,r=this.data[n];i<r.length;i+=1){var o=r[i];t(o.value)||e.push(o)}for(var s=0,a=e;s<a.length;s+=1){var l=a[s];this.remove(l.value.tileID,l)}};var U=function(t,e,n){this.context=t;var i=t.gl;this.buffer=i.createBuffer(),this.dynamicDraw=Boolean(n),this.context.unbindVAO(),t.bindElementBuffer.set(this.buffer),i.bufferData(i.ELEMENT_ARRAY_BUFFER,e.arrayBuffer,this.dynamicDraw?i.DYNAMIC_DRAW:i.STATIC_DRAW),this.dynamicDraw||delete e.arrayBuffer};U.prototype.bind=function(){this.context.bindElementBuffer.set(this.buffer)},U.prototype.updateData=function(t){var e=this.context.gl;this.context.unbindVAO(),this.bind(),e.bufferSubData(e.ELEMENT_ARRAY_BUFFER,0,t.arrayBuffer)},U.prototype.destroy=function(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)};var G={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"},V=function(t,e,n,i){this.length=e.length,this.attributes=n,this.itemSize=e.bytesPerElement,this.dynamicDraw=i,this.context=t;var r=t.gl;this.buffer=r.createBuffer(),t.bindVertexBuffer.set(this.buffer),r.bufferData(r.ARRAY_BUFFER,e.arrayBuffer,this.dynamicDraw?r.DYNAMIC_DRAW:r.STATIC_DRAW),this.dynamicDraw||delete e.arrayBuffer};V.prototype.bind=function(){this.context.bindVertexBuffer.set(this.buffer)},V.prototype.updateData=function(t){var e=this.context.gl;this.bind(),e.bufferSubData(e.ARRAY_BUFFER,0,t.arrayBuffer)},V.prototype.enableAttributes=function(t,e){for(var n=0;n<this.attributes.length;n++){var i=e.attributes[this.attributes[n].name];void 0!==i&&t.enableVertexAttribArray(i)}},V.prototype.setVertexAttribPointers=function(t,e,n){for(var i=0;i<this.attributes.length;i++){var r=this.attributes[i],o=e.attributes[r.name];void 0!==o&&t.vertexAttribPointer(o,r.components,t[G[r.type]],!1,this.itemSize,r.offset+this.itemSize*(n||0))}},V.prototype.destroy=function(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)};var j=function(t){this.gl=t.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1};j.prototype.get=function(){return this.current},j.prototype.set=function(t){},j.prototype.getDefault=function(){return this.default},j.prototype.setDefault=function(){this.set(this.default)};var H=function(e){function n(){e.apply(this,arguments)}return e&&(n.__proto__=e),(n.prototype=Object.create(e&&e.prototype)).constructor=n,n.prototype.getDefault=function(){return t.Color.transparent},n.prototype.set=function(t){var e=this.current;(t.r!==e.r||t.g!==e.g||t.b!==e.b||t.a!==e.a||this.dirty)&&(this.gl.clearColor(t.r,t.g,t.b,t.a),this.current=t,this.dirty=!1)},n}(j),W=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return 1},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.clearDepth(t),this.current=t,this.dirty=!1)},e}(j),q=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return 0},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.clearStencil(t),this.current=t,this.dirty=!1)},e}(j),Z=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return[!0,!0,!0,!0]},e.prototype.set=function(t){var e=this.current;(t[0]!==e[0]||t[1]!==e[1]||t[2]!==e[2]||t[3]!==e[3]||this.dirty)&&(this.gl.colorMask(t[0],t[1],t[2],t[3]),this.current=t,this.dirty=!1)},e}(j),X=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return!0},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.depthMask(t),this.current=t,this.dirty=!1)},e}(j),K=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return 255},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.stencilMask(t),this.current=t,this.dirty=!1)},e}(j),Q=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return{func:this.gl.ALWAYS,ref:0,mask:255}},e.prototype.set=function(t){var e=this.current;(t.func!==e.func||t.ref!==e.ref||t.mask!==e.mask||this.dirty)&&(this.gl.stencilFunc(t.func,t.ref,t.mask),this.current=t,this.dirty=!1)},e}(j),J=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){var t=this.gl;return[t.KEEP,t.KEEP,t.KEEP]},e.prototype.set=function(t){var e=this.current;(t[0]!==e[0]||t[1]!==e[1]||t[2]!==e[2]||this.dirty)&&(this.gl.stencilOp(t[0],t[1],t[2]),this.current=t,this.dirty=!1)},e}(j),Y=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return!1},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;t?e.enable(e.STENCIL_TEST):e.disable(e.STENCIL_TEST),this.current=t,this.dirty=!1}},e}(j),$=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return[0,1]},e.prototype.set=function(t){var e=this.current;(t[0]!==e[0]||t[1]!==e[1]||this.dirty)&&(this.gl.depthRange(t[0],t[1]),this.current=t,this.dirty=!1)},e}(j),tt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return!1},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;t?e.enable(e.DEPTH_TEST):e.disable(e.DEPTH_TEST),this.current=t,this.dirty=!1}},e}(j),et=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return this.gl.LESS},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.depthFunc(t),this.current=t,this.dirty=!1)},e}(j),nt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return!1},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;t?e.enable(e.BLEND):e.disable(e.BLEND),this.current=t,this.dirty=!1}},e}(j),it=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){var t=this.gl;return[t.ONE,t.ZERO]},e.prototype.set=function(t){var e=this.current;(t[0]!==e[0]||t[1]!==e[1]||this.dirty)&&(this.gl.blendFunc(t[0],t[1]),this.current=t,this.dirty=!1)},e}(j),rt=function(e){function n(){e.apply(this,arguments)}return e&&(n.__proto__=e),(n.prototype=Object.create(e&&e.prototype)).constructor=n,n.prototype.getDefault=function(){return t.Color.transparent},n.prototype.set=function(t){var e=this.current;(t.r!==e.r||t.g!==e.g||t.b!==e.b||t.a!==e.a||this.dirty)&&(this.gl.blendColor(t.r,t.g,t.b,t.a),this.current=t,this.dirty=!1)},n}(j),ot=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return this.gl.FUNC_ADD},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.blendEquation(t),this.current=t,this.dirty=!1)},e}(j),st=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return!1},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;t?e.enable(e.CULL_FACE):e.disable(e.CULL_FACE),this.current=t,this.dirty=!1}},e}(j),at=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return this.gl.BACK},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.cullFace(t),this.current=t,this.dirty=!1)},e}(j),lt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return this.gl.CCW},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.frontFace(t),this.current=t,this.dirty=!1)},e}(j),ct=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.useProgram(t),this.current=t,this.dirty=!1)},e}(j),ut=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return this.gl.TEXTURE0},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.activeTexture(t),this.current=t,this.dirty=!1)},e}(j),ht=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){var t=this.gl;return[0,0,t.drawingBufferWidth,t.drawingBufferHeight]},e.prototype.set=function(t){var e=this.current;(t[0]!==e[0]||t[1]!==e[1]||t[2]!==e[2]||t[3]!==e[3]||this.dirty)&&(this.gl.viewport(t[0],t[1],t[2],t[3]),this.current=t,this.dirty=!1)},e}(j),dt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.bindFramebuffer(e.FRAMEBUFFER,t),this.current=t,this.dirty=!1}},e}(j),pt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.bindRenderbuffer(e.RENDERBUFFER,t),this.current=t,this.dirty=!1}},e}(j),ft=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.bindTexture(e.TEXTURE_2D,t),this.current=t,this.dirty=!1}},e}(j),At=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.bindBuffer(e.ARRAY_BUFFER,t),this.current=t,this.dirty=!1}},e}(j),gt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){var e=this.gl;e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t),this.current=t,this.dirty=!1},e}(j),mt=function(t){function e(e){t.call(this,e),this.vao=e.extVertexArrayObject}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){this.vao&&(t!==this.current||this.dirty)&&(this.vao.bindVertexArrayOES(t),this.current=t,this.dirty=!1)},e}(j),yt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return 4},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.pixelStorei(e.UNPACK_ALIGNMENT,t),this.current=t,this.dirty=!1}},e}(j),_t=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return!1},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t),this.current=t,this.dirty=!1}},e}(j),vt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return!1},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,t),this.current=t,this.dirty=!1}},e}(j),bt=function(t){function e(e,n){t.call(this,e),this.context=e,this.parent=n}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return null},e}(j),xt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.setDirty=function(){this.dirty=!0},e.prototype.set=function(t){if(t!==this.current||this.dirty){this.context.bindFramebuffer.set(this.parent);var e=this.gl;e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t,0),this.current=t,this.dirty=!1}},e}(bt),wt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.set=function(t){if(t!==this.current||this.dirty){this.context.bindFramebuffer.set(this.parent);var e=this.gl;e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,t),this.current=t,this.dirty=!1}},e}(bt),Et=function(t,e,n,i){this.context=t,this.width=e,this.height=n;var r=this.framebuffer=t.gl.createFramebuffer();this.colorAttachment=new xt(t,r),i&&(this.depthAttachment=new wt(t,r))};Et.prototype.destroy=function(){var t=this.context.gl,e=this.colorAttachment.get();if(e&&t.deleteTexture(e),this.depthAttachment){var n=this.depthAttachment.get();n&&t.deleteRenderbuffer(n)}t.deleteFramebuffer(this.framebuffer)};var Ct=function(t,e,n){this.func=t,this.mask=e,this.range=n};Ct.ReadOnly=!1,Ct.ReadWrite=!0,Ct.disabled=new Ct(519,Ct.ReadOnly,[0,1]);var Tt=function(t,e,n,i,r,o){this.test=t,this.ref=e,this.mask=n,this.fail=i,this.depthFail=r,this.pass=o};Tt.disabled=new Tt({func:519,mask:0},0,0,7680,7680,7680);var St=function(t,e,n){this.blendFunction=t,this.blendColor=e,this.mask=n};St.disabled=new St(St.Replace=[1,0],t.Color.transparent,[!1,!1,!1,!1]),St.unblended=new St(St.Replace,t.Color.transparent,[!0,!0,!0,!0]),St.alphaBlended=new St([1,771],t.Color.transparent,[!0,!0,!0,!0]);var Pt=function(t,e,n){this.enable=t,this.mode=e,this.frontFace=n};Pt.disabled=new Pt(!1,1029,2305),Pt.backCCW=new Pt(!0,1029,2305);var Mt=function(t){this.gl=t,this.extVertexArrayObject=this.gl.getExtension("OES_vertex_array_object"),this.clearColor=new H(this),this.clearDepth=new W(this),this.clearStencil=new q(this),this.colorMask=new Z(this),this.depthMask=new X(this),this.stencilMask=new K(this),this.stencilFunc=new Q(this),this.stencilOp=new J(this),this.stencilTest=new Y(this),this.depthRange=new $(this),this.depthTest=new tt(this),this.depthFunc=new et(this),this.blend=new nt(this),this.blendFunc=new it(this),this.blendColor=new rt(this),this.blendEquation=new ot(this),this.cullFace=new st(this),this.cullFaceSide=new at(this),this.frontFace=new lt(this),this.program=new ct(this),this.activeTexture=new ut(this),this.viewport=new ht(this),this.bindFramebuffer=new dt(this),this.bindRenderbuffer=new pt(this),this.bindTexture=new ft(this),this.bindVertexBuffer=new At(this),this.bindElementBuffer=new gt(this),this.bindVertexArrayOES=this.extVertexArrayObject&&new mt(this),this.pixelStoreUnpack=new yt(this),this.pixelStoreUnpackPremultiplyAlpha=new _t(this),this.pixelStoreUnpackFlipY=new vt(this),this.extTextureFilterAnisotropic=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("MOZ_EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=t.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.extTextureHalfFloat=t.getExtension("OES_texture_half_float"),this.extTextureHalfFloat&&(t.getExtension("OES_texture_half_float_linear"),this.extRenderToTextureHalfFloat=t.getExtension("EXT_color_buffer_half_float")),this.extTimerQuery=t.getExtension("EXT_disjoint_timer_query"),this.maxTextureSize=t.getParameter(t.MAX_TEXTURE_SIZE)};Mt.prototype.setDefault=function(){this.unbindVAO(),this.clearColor.setDefault(),this.clearDepth.setDefault(),this.clearStencil.setDefault(),this.colorMask.setDefault(),this.depthMask.setDefault(),this.stencilMask.setDefault(),this.stencilFunc.setDefault(),this.stencilOp.setDefault(),this.stencilTest.setDefault(),this.depthRange.setDefault(),this.depthTest.setDefault(),this.depthFunc.setDefault(),this.blend.setDefault(),this.blendFunc.setDefault(),this.blendColor.setDefault(),this.blendEquation.setDefault(),this.cullFace.setDefault(),this.cullFaceSide.setDefault(),this.frontFace.setDefault(),this.program.setDefault(),this.activeTexture.setDefault(),this.bindFramebuffer.setDefault(),this.pixelStoreUnpack.setDefault(),this.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.pixelStoreUnpackFlipY.setDefault()},Mt.prototype.setDirty=function(){this.clearColor.dirty=!0,this.clearDepth.dirty=!0,this.clearStencil.dirty=!0,this.colorMask.dirty=!0,this.depthMask.dirty=!0,this.stencilMask.dirty=!0,this.stencilFunc.dirty=!0,this.stencilOp.dirty=!0,this.stencilTest.dirty=!0,this.depthRange.dirty=!0,this.depthTest.dirty=!0,this.depthFunc.dirty=!0,this.blend.dirty=!0,this.blendFunc.dirty=!0,this.blendColor.dirty=!0,this.blendEquation.dirty=!0,this.cullFace.dirty=!0,this.cullFaceSide.dirty=!0,this.frontFace.dirty=!0,this.program.dirty=!0,this.activeTexture.dirty=!0,this.viewport.dirty=!0,this.bindFramebuffer.dirty=!0,this.bindRenderbuffer.dirty=!0,this.bindTexture.dirty=!0,this.bindVertexBuffer.dirty=!0,this.bindElementBuffer.dirty=!0,this.extVertexArrayObject&&(this.bindVertexArrayOES.dirty=!0),this.pixelStoreUnpack.dirty=!0,this.pixelStoreUnpackPremultiplyAlpha.dirty=!0,this.pixelStoreUnpackFlipY.dirty=!0},Mt.prototype.createIndexBuffer=function(t,e){return new U(this,t,e)},Mt.prototype.createVertexBuffer=function(t,e,n){return new V(this,t,e,n)},Mt.prototype.createRenderbuffer=function(t,e,n){var i=this.gl,r=i.createRenderbuffer();return this.bindRenderbuffer.set(r),i.renderbufferStorage(i.RENDERBUFFER,t,e,n),this.bindRenderbuffer.set(null),r},Mt.prototype.createFramebuffer=function(t,e,n){return new Et(this,t,e,n)},Mt.prototype.clear=function(t){var e=t.color,n=t.depth,i=this.gl,r=0;e&&(r|=i.COLOR_BUFFER_BIT,this.clearColor.set(e),this.colorMask.set([!0,!0,!0,!0])),void 0!==n&&(r|=i.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(n),this.depthMask.set(!0)),i.clear(r)},Mt.prototype.setCullFace=function(t){!1===t.enable?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(t.mode),this.frontFace.set(t.frontFace))},Mt.prototype.setDepthMode=function(t){t.func!==this.gl.ALWAYS||t.mask?(this.depthTest.set(!0),this.depthFunc.set(t.func),this.depthMask.set(t.mask),this.depthRange.set(t.range)):this.depthTest.set(!1)},Mt.prototype.setStencilMode=function(t){t.test.func!==this.gl.ALWAYS||t.mask?(this.stencilTest.set(!0),this.stencilMask.set(t.mask),this.stencilOp.set([t.fail,t.depthFail,t.pass]),this.stencilFunc.set({func:t.test.func,ref:t.ref,mask:t.test.mask})):this.stencilTest.set(!1)},Mt.prototype.setColorMode=function(e){t.deepEqual(e.blendFunction,St.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(e.blendFunction),this.blendColor.set(e.blendColor)),this.colorMask.set(e.mask)},Mt.prototype.unbindVAO=function(){this.extVertexArrayObject&&this.bindVertexArrayOES.set(null)};var It=function(e){function n(n,i,r){var o=this;e.call(this),this.id=n,this.dispatcher=r,this.on("data",(function(t){"source"===t.dataType&&"metadata"===t.sourceDataType&&(o._sourceLoaded=!0),o._sourceLoaded&&!o._paused&&"source"===t.dataType&&"content"===t.sourceDataType&&(o.reload(),o.transform&&o.update(o.transform))})),this.on("error",(function(){o._sourceErrored=!0})),this._source=function(e,n,i,r){var o=new D[n.type](e,n,i,r);if(o.id!==e)throw new Error("Expected Source id to be "+e+" instead of "+o.id);return t.bindAll(["load","abort","unload","serialize","prepare"],o),o}(n,i,r,this),this._tiles={},this._cache=new z(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new t.SourceFeatureState}return e&&(n.__proto__=e),(n.prototype=Object.create(e&&e.prototype)).constructor=n,n.prototype.onAdd=function(t){this.map=t,this._maxTileCacheSize=t?t._maxTileCacheSize:null,this._source&&this._source.onAdd&&this._source.onAdd(t)},n.prototype.onRemove=function(t){this._source&&this._source.onRemove&&this._source.onRemove(t)},n.prototype.loaded=function(){if(this._sourceErrored)return!0;if(!this._sourceLoaded)return!1;if(!this._source.loaded())return!1;for(var t in this._tiles){var e=this._tiles[t];if("loaded"!==e.state&&"errored"!==e.state)return!1}return!0},n.prototype.getSource=function(){return this._source},n.prototype.pause=function(){this._paused=!0},n.prototype.resume=function(){if(this._paused){var t=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,t&&this.reload(),this.transform&&this.update(this.transform)}},n.prototype._loadTile=function(t,e){return this._source.loadTile(t,e)},n.prototype._unloadTile=function(t){if(this._source.unloadTile)return this._source.unloadTile(t,(function(){}))},n.prototype._abortTile=function(t){if(this._source.abortTile)return this._source.abortTile(t,(function(){}))},n.prototype.serialize=function(){return this._source.serialize()},n.prototype.prepare=function(t){for(var e in this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null),this._tiles){var n=this._tiles[e];n.upload(t),n.prepare(this.map.style.imageManager)}},n.prototype.getIds=function(){return t.values(this._tiles).map((function(t){return t.tileID})).sort(Bt).map((function(t){return t.key}))},n.prototype.getRenderableIds=function(e){var n=this,i=[];for(var r in this._tiles)this._isIdRenderable(r,e)&&i.push(this._tiles[r]);return e?i.sort((function(e,i){var r=e.tileID,o=i.tileID,s=new t.Point(r.canonical.x,r.canonical.y)._rotate(n.transform.angle),a=new t.Point(o.canonical.x,o.canonical.y)._rotate(n.transform.angle);return r.overscaledZ-o.overscaledZ||a.y-s.y||a.x-s.x})).map((function(t){return t.tileID.key})):i.map((function(t){return t.tileID})).sort(Bt).map((function(t){return t.key}))},n.prototype.hasRenderableParent=function(t){var e=this.findLoadedParent(t,0);return!!e&&this._isIdRenderable(e.tileID.key)},n.prototype._isIdRenderable=function(t,e){return this._tiles[t]&&this._tiles[t].hasData()&&!this._coveredTiles[t]&&(e||!this._tiles[t].holdingForFade())},n.prototype.reload=function(){if(this._paused)this._shouldReloadOnResume=!0;else for(var t in this._cache.reset(),this._tiles)"errored"!==this._tiles[t].state&&this._reloadTile(t,"reloading")},n.prototype._reloadTile=function(t,e){var n=this._tiles[t];n&&("loading"!==n.state&&(n.state=e),this._loadTile(n,this._tileLoaded.bind(this,n,t,e)))},n.prototype._tileLoaded=function(e,n,i,r){if(r)return e.state="errored",void(404!==r.status?this._source.fire(new t.ErrorEvent(r,{tile:e})):this.update(this.transform));e.timeAdded=t.browser.now(),"expired"===i&&(e.refreshedUponExpiration=!0),this._setTileReloadTimer(n,e),"raster-dem"===this.getSource().type&&e.dem&&this._backfillDEM(e),this._state.initializeTileState(e,this.map?this.map.painter:null),this._source.fire(new t.Event("data",{dataType:"source",tile:e,coord:e.tileID}))},n.prototype._backfillDEM=function(t){for(var e=this.getRenderableIds(),n=0;n<e.length;n++){var i=e[n];if(t.neighboringTiles&&t.neighboringTiles[i]){var r=this.getTileByID(i);o(t,r),o(r,t)}}function o(t,e){t.needsHillshadePrepare=!0;var n=e.tileID.canonical.x-t.tileID.canonical.x,i=e.tileID.canonical.y-t.tileID.canonical.y,r=Math.pow(2,t.tileID.canonical.z),o=e.tileID.key;0===n&&0===i||Math.abs(i)>1||(Math.abs(n)>1&&(1===Math.abs(n+r)?n+=r:1===Math.abs(n-r)&&(n-=r)),e.dem&&t.dem&&(t.dem.backfillBorder(e.dem,n,i),t.neighboringTiles&&t.neighboringTiles[o]&&(t.neighboringTiles[o].backfilled=!0)))}},n.prototype.getTile=function(t){return this.getTileByID(t.key)},n.prototype.getTileByID=function(t){return this._tiles[t]},n.prototype._retainLoadedChildren=function(t,e,n,i){for(var r in this._tiles){var o=this._tiles[r];if(!(i[r]||!o.hasData()||o.tileID.overscaledZ<=e||o.tileID.overscaledZ>n)){for(var s=o.tileID;o&&o.tileID.overscaledZ>e+1;){var a=o.tileID.scaledTo(o.tileID.overscaledZ-1);(o=this._tiles[a.key])&&o.hasData()&&(s=a)}for(var l=s;l.overscaledZ>e;)if(t[(l=l.scaledTo(l.overscaledZ-1)).key]){i[s.key]=s;break}}}},n.prototype.findLoadedParent=function(t,e){if(t.key in this._loadedParentTiles){var n=this._loadedParentTiles[t.key];return n&&n.tileID.overscaledZ>=e?n:null}for(var i=t.overscaledZ-1;i>=e;i--){var r=t.scaledTo(i),o=this._getLoadedTile(r);if(o)return o}},n.prototype._getLoadedTile=function(t){var e=this._tiles[t.key];return e&&e.hasData()?e:this._cache.getByKey(t.wrapped().key)},n.prototype.updateCacheSize=function(t){var e=Math.ceil(t.width/this._source.tileSize)+1,n=Math.ceil(t.height/this._source.tileSize)+1,i=Math.floor(e*n*5),r="number"==typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,i):i;this._cache.setMaxSize(r)},n.prototype.handleWrapJump=function(t){var e=Math.round((t-(void 0===this._prevLng?t:this._prevLng))/360);if(this._prevLng=t,e){var n={};for(var i in this._tiles){var r=this._tiles[i];r.tileID=r.tileID.unwrapTo(r.tileID.wrap+e),n[r.tileID.key]=r}for(var o in this._tiles=n,this._timers)clearTimeout(this._timers[o]),delete this._timers[o];for(var s in this._tiles)this._setTileReloadTimer(s,this._tiles[s])}},n.prototype.update=function(e){var i=this;if(this.transform=e,this._sourceLoaded&&!this._paused){var r;this.updateCacheSize(e),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used?this._source.tileID?r=e.getVisibleUnwrappedCoordinates(this._source.tileID).map((function(e){return new t.OverscaledTileID(e.canonical.z,e.wrap,e.canonical.z,e.canonical.x,e.canonical.y)})):(r=e.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}),this._source.hasTile&&(r=r.filter((function(t){return i._source.hasTile(t)})))):r=[];var o=e.coveringZoomLevel(this._source),s=Math.max(o-n.maxOverzooming,this._source.minzoom),a=Math.max(o+n.maxUnderzooming,this._source.minzoom),l=this._updateRetainedTiles(r,o);if(Rt(this._source.type)){for(var c={},u={},h=0,d=Object.keys(l);h<d.length;h+=1){var p=d[h],f=l[p],A=this._tiles[p];if(A&&!(A.fadeEndTime&&A.fadeEndTime<=t.browser.now())){var g=this.findLoadedParent(f,s);g&&(this._addTile(g.tileID),c[g.tileID.key]=g.tileID),u[p]=f}}for(var m in this._retainLoadedChildren(u,o,a,l),c)l[m]||(this._coveredTiles[m]=!0,l[m]=c[m])}for(var y in l)this._tiles[y].clearFadeHold();for(var _=0,v=t.keysDifference(this._tiles,l);_<v.length;_+=1){var b=v[_],x=this._tiles[b];x.hasSymbolBuckets&&!x.holdingForFade()?x.setHoldDuration(this.map._fadeDuration):x.hasSymbolBuckets&&!x.symbolFadeFinished()||this._removeTile(b)}this._updateLoadedParentTileCache()}},n.prototype.releaseSymbolFadeTiles=function(){for(var t in this._tiles)this._tiles[t].holdingForFade()&&this._removeTile(t)},n.prototype._updateRetainedTiles=function(t,e){for(var i={},r={},o=Math.max(e-n.maxOverzooming,this._source.minzoom),s=Math.max(e+n.maxUnderzooming,this._source.minzoom),a={},l=0,c=t;l<c.length;l+=1){var u=c[l],h=this._addTile(u);i[u.key]=u,h.hasData()||e<this._source.maxzoom&&(a[u.key]=u)}this._retainLoadedChildren(a,e,s,i);for(var d=0,p=t;d<p.length;d+=1){var f=p[d],A=this._tiles[f.key];if(!A.hasData()){if(e+1>this._source.maxzoom){var g=f.children(this._source.maxzoom)[0],m=this.getTile(g);if(m&&m.hasData()){i[g.key]=g;continue}}else{var y=f.children(this._source.maxzoom);if(i[y[0].key]&&i[y[1].key]&&i[y[2].key]&&i[y[3].key])continue}for(var _=A.wasRequested(),v=f.overscaledZ-1;v>=o;--v){var b=f.scaledTo(v);if(r[b.key])break;if(r[b.key]=!0,!(A=this.getTile(b))&&_&&(A=this._addTile(b)),A&&(i[b.key]=b,_=A.wasRequested(),A.hasData()))break}}}return i},n.prototype._updateLoadedParentTileCache=function(){for(var t in this._loadedParentTiles={},this._tiles){for(var e=[],n=void 0,i=this._tiles[t].tileID;i.overscaledZ>0;){if(i.key in this._loadedParentTiles){n=this._loadedParentTiles[i.key];break}e.push(i.key);var r=i.scaledTo(i.overscaledZ-1);if(n=this._getLoadedTile(r))break;i=r}for(var o=0,s=e;o<s.length;o+=1)this._loadedParentTiles[s[o]]=n}},n.prototype._addTile=function(e){var n=this._tiles[e.key];if(n)return n;(n=this._cache.getAndRemove(e))&&(this._setTileReloadTimer(e.key,n),n.tileID=e,this._state.initializeTileState(n,this.map?this.map.painter:null),this._cacheTimers[e.key]&&(clearTimeout(this._cacheTimers[e.key]),delete this._cacheTimers[e.key],this._setTileReloadTimer(e.key,n)));var i=Boolean(n);return i||(n=new t.Tile(e,this._source.tileSize*e.overscaleFactor()),this._loadTile(n,this._tileLoaded.bind(this,n,e.key,n.state))),n?(n.uses++,this._tiles[e.key]=n,i||this._source.fire(new t.Event("dataloading",{tile:n,coord:n.tileID,dataType:"source"})),n):null},n.prototype._setTileReloadTimer=function(t,e){var n=this;t in this._timers&&(clearTimeout(this._timers[t]),delete this._timers[t]);var i=e.getExpiryTimeout();i&&(this._timers[t]=setTimeout((function(){n._reloadTile(t,"expired"),delete n._timers[t]}),i))},n.prototype._removeTile=function(t){var e=this._tiles[t];e&&(e.uses--,delete this._tiles[t],this._timers[t]&&(clearTimeout(this._timers[t]),delete this._timers[t]),e.uses>0||(e.hasData()&&"reloading"!==e.state?this._cache.add(e.tileID,e,e.getExpiryTimeout()):(e.aborted=!0,this._abortTile(e),this._unloadTile(e))))},n.prototype.clearTiles=function(){for(var t in this._shouldReloadOnResume=!1,this._paused=!1,this._tiles)this._removeTile(t);this._cache.reset()},n.prototype.tilesIn=function(e,n,i){var r=this,o=[],s=this.transform;if(!s)return o;for(var a=i?s.getCameraQueryGeometry(e):e,l=e.map((function(t){return s.pointCoordinate(t)})),c=a.map((function(t){return s.pointCoordinate(t)})),u=this.getIds(),h=1/0,d=1/0,p=-1/0,f=-1/0,A=0,g=c;A<g.length;A+=1){var m=g[A];h=Math.min(h,m.x),d=Math.min(d,m.y),p=Math.max(p,m.x),f=Math.max(f,m.y)}for(var y=function(e){var i=r._tiles[u[e]];if(!i.holdingForFade()){var a=i.tileID,A=Math.pow(2,s.zoom-i.tileID.overscaledZ),g=n*i.queryPadding*t.EXTENT/i.tileSize/A,m=[a.getTilePoint(new t.MercatorCoordinate(h,d)),a.getTilePoint(new t.MercatorCoordinate(p,f))];if(m[0].x-g<t.EXTENT&&m[0].y-g<t.EXTENT&&m[1].x+g>=0&&m[1].y+g>=0){var y=l.map((function(t){return a.getTilePoint(t)})),_=c.map((function(t){return a.getTilePoint(t)}));o.push({tile:i,tileID:a,queryGeometry:y,cameraQueryGeometry:_,scale:A})}}},_=0;_<u.length;_++)y(_);return o},n.prototype.getVisibleCoordinates=function(t){for(var e=this,n=this.getRenderableIds(t).map((function(t){return e._tiles[t].tileID})),i=0,r=n;i<r.length;i+=1){var o=r[i];o.posMatrix=this.transform.calculatePosMatrix(o.toUnwrapped())}return n},n.prototype.hasTransition=function(){if(this._source.hasTransition())return!0;if(Rt(this._source.type))for(var e in this._tiles){var n=this._tiles[e];if(void 0!==n.fadeEndTime&&n.fadeEndTime>=t.browser.now())return!0}return!1},n.prototype.setFeatureState=function(t,e,n){this._state.updateState(t=t||"_geojsonTileLayer",e,n)},n.prototype.removeFeatureState=function(t,e,n){this._state.removeFeatureState(t=t||"_geojsonTileLayer",e,n)},n.prototype.getFeatureState=function(t,e){return this._state.getState(t=t||"_geojsonTileLayer",e)},n.prototype.setDependencies=function(t,e,n){var i=this._tiles[t];i&&i.setDependencies(e,n)},n.prototype.reloadTilesForDependencies=function(t,e){for(var n in this._tiles)this._tiles[n].hasDependency(t,e)&&this._reloadTile(n,"reloading");this._cache.filter((function(n){return!n.hasDependency(t,e)}))},n}(t.Evented);function Bt(t,e){var n=Math.abs(2*t.wrap)-+(t.wrap<0),i=Math.abs(2*e.wrap)-+(e.wrap<0);return t.overscaledZ-e.overscaledZ||i-n||e.canonical.y-t.canonical.y||e.canonical.x-t.canonical.x}function Rt(t){return"raster"===t||"image"===t||"video"===t}function Lt(){return new t.window.Worker(Kr.workerUrl)}It.maxOverzooming=10,It.maxUnderzooming=3;var Ot="mapboxgl_preloaded_worker_pool",Dt=function(){this.active={}};Dt.prototype.acquire=function(t){if(!this.workers)for(this.workers=[];this.workers.length<Dt.workerCount;)this.workers.push(new Lt);return this.active[t]=!0,this.workers.slice()},Dt.prototype.release=function(t){delete this.active[t],0===this.numActive()&&(this.workers.forEach((function(t){t.terminate()})),this.workers=null)},Dt.prototype.isPreloaded=function(){return!!this.active[Ot]},Dt.prototype.numActive=function(){return Object.keys(this.active).length};var kt,Ft=Math.floor(t.browser.hardwareConcurrency/2);function Nt(){return kt||(kt=new Dt),kt}function zt(e,n){var i={};for(var r in e)"ref"!==r&&(i[r]=e[r]);return t.refProperties.forEach((function(t){t in n&&(i[t]=n[t])})),i}function Ut(t){t=t.slice();for(var e=Object.create(null),n=0;n<t.length;n++)e[t[n].id]=t[n];for(var i=0;i<t.length;i++)"ref"in t[i]&&(t[i]=zt(t[i],e[t[i].ref]));return t}Dt.workerCount=Math.max(Math.min(Ft,6),1);var Gt={setStyle:"setStyle",addLayer:"addLayer",removeLayer:"removeLayer",setPaintProperty:"setPaintProperty",setLayoutProperty:"setLayoutProperty",setFilter:"setFilter",addSource:"addSource",removeSource:"removeSource",setGeoJSONSourceData:"setGeoJSONSourceData",setLayerZoomRange:"setLayerZoomRange",setLayerProperty:"setLayerProperty",setCenter:"setCenter",setZoom:"setZoom",setBearing:"setBearing",setPitch:"setPitch",setSprite:"setSprite",setGlyphs:"setGlyphs",setTransition:"setTransition",setLight:"setLight"};function Vt(t,e,n){n.push({command:Gt.addSource,args:[t,e[t]]})}function jt(t,e,n){e.push({command:Gt.removeSource,args:[t]}),n[t]=!0}function Ht(t,e,n,i){jt(t,n,i),Vt(t,e,n)}function Wt(e,n,i){var r;for(r in e[i])if(e[i].hasOwnProperty(r)&&"data"!==r&&!t.deepEqual(e[i][r],n[i][r]))return!1;for(r in n[i])if(n[i].hasOwnProperty(r)&&"data"!==r&&!t.deepEqual(e[i][r],n[i][r]))return!1;return!0}function qt(e,n,i,r,o,s){var a;for(a in n=n||{},e=e||{})e.hasOwnProperty(a)&&(t.deepEqual(e[a],n[a])||i.push({command:s,args:[r,a,n[a],o]}));for(a in n)n.hasOwnProperty(a)&&!e.hasOwnProperty(a)&&(t.deepEqual(e[a],n[a])||i.push({command:s,args:[r,a,n[a],o]}))}function Zt(t){return t.id}function Xt(t,e){return t[e.id]=e,t}var Kt=function(t,e){this.reset(t,e)};Kt.prototype.reset=function(t,e){this.points=t||[],this._distances=[0];for(var n=1;n<this.points.length;n++)this._distances[n]=this._distances[n-1]+this.points[n].dist(this.points[n-1]);this.length=this._distances[this._distances.length-1],this.padding=Math.min(e||0,.5*this.length),this.paddedLength=this.length-2*this.padding},Kt.prototype.lerp=function(e){if(1===this.points.length)return this.points[0];e=t.clamp(e,0,1);for(var n=1,i=this._distances[n],r=e*this.paddedLength+this.padding;i<r&&n<this._distances.length;)i=this._distances[++n];var o=n-1,s=this._distances[o],a=i-s,l=a>0?(r-s)/a:0;return this.points[o].mult(1-l).add(this.points[n].mult(l))};var Qt=function(t,e,n){var i=this.boxCells=[],r=this.circleCells=[];this.xCellCount=Math.ceil(t/n),this.yCellCount=Math.ceil(e/n);for(var o=0;o<this.xCellCount*this.yCellCount;o++)i.push([]),r.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=t,this.height=e,this.xScale=this.xCellCount/t,this.yScale=this.yCellCount/e,this.boxUid=0,this.circleUid=0};function Jt(e,n,i,r,o){var s=t.create();return n?(t.scale(s,s,[1/o,1/o,1]),i||t.rotateZ(s,s,r.angle)):t.multiply(s,r.labelPlaneMatrix,e),s}function Yt(e,n,i,r,o){if(n){var s=t.clone(e);return t.scale(s,s,[o,o,1]),i||t.rotateZ(s,s,-r.angle),s}return r.glCoordMatrix}function $t(e,n){var i=[e.x,e.y,0,1];ue(i,i,n);var r=i[3];return{point:new t.Point(i[0]/r,i[1]/r),signedDistanceFromCamera:r}}function te(t,e){return.5+t/e*.5}function ee(t,e){var n=t[0]/t[3],i=t[1]/t[3];return n>=-e[0]&&n<=e[0]&&i>=-e[1]&&i<=e[1]}function ne(e,n,i,r,o,s,a,l){var c=r?e.textSizeData:e.iconSizeData,u=t.evaluateSizeForZoom(c,i.transform.zoom),h=[256/i.width*2+1,256/i.height*2+1],d=r?e.text.dynamicLayoutVertexArray:e.icon.dynamicLayoutVertexArray;d.clear();for(var p=e.lineVertexArray,f=r?e.text.placedSymbolArray:e.icon.placedSymbolArray,A=i.transform.width/i.transform.height,g=!1,m=0;m<f.length;m++){var y=f.get(m);if(y.hidden||y.writingMode===t.WritingMode.vertical&&!g)ce(y.numGlyphs,d);else{g=!1;var _=[y.anchorX,y.anchorY,0,1];if(t.transformMat4(_,_,n),ee(_,h)){var v=te(i.transform.cameraToCenterDistance,_[3]),b=t.evaluateSizeForFeature(c,u,y),x=a?b/v:b*v,w=new t.Point(y.anchorX,y.anchorY),E=$t(w,o).point,C={},T=oe(y,x,!1,l,n,o,s,e.glyphOffsetArray,p,d,E,w,C,A);g=T.useVertical,(T.notEnoughRoom||g||T.needsFlipping&&oe(y,x,!0,l,n,o,s,e.glyphOffsetArray,p,d,E,w,C,A).notEnoughRoom)&&ce(y.numGlyphs,d)}else ce(y.numGlyphs,d)}}r?e.text.dynamicLayoutVertexBuffer.updateData(d):e.icon.dynamicLayoutVertexBuffer.updateData(d)}function ie(t,e,n,i,r,o,s,a,l,c,u){var h=a.glyphStartIndex+a.numGlyphs,d=a.lineStartIndex,p=a.lineStartIndex+a.lineLength,f=e.getoffsetX(a.glyphStartIndex),A=e.getoffsetX(h-1),g=ae(t*f,n,i,r,o,s,a.segment,d,p,l,c,u);if(!g)return null;var m=ae(t*A,n,i,r,o,s,a.segment,d,p,l,c,u);return m?{first:g,last:m}:null}function re(e,n,i,r){return e===t.WritingMode.horizontal&&Math.abs(i.y-n.y)>Math.abs(i.x-n.x)*r?{useVertical:!0}:(e===t.WritingMode.vertical?n.y<i.y:n.x>i.x)?{needsFlipping:!0}:null}function oe(e,n,i,r,o,s,a,l,c,u,h,d,p,f){var A,g=n/24,m=e.lineOffsetX*g,y=e.lineOffsetY*g;if(e.numGlyphs>1){var _=e.glyphStartIndex+e.numGlyphs,v=e.lineStartIndex,b=e.lineStartIndex+e.lineLength,x=ie(g,l,m,y,i,h,d,e,c,s,p);if(!x)return{notEnoughRoom:!0};var w=$t(x.first.point,a).point,E=$t(x.last.point,a).point;if(r&&!i){var C=re(e.writingMode,w,E,f);if(C)return C}A=[x.first];for(var T=e.glyphStartIndex+1;T<_-1;T++)A.push(ae(g*l.getoffsetX(T),m,y,i,h,d,e.segment,v,b,c,s,p));A.push(x.last)}else{if(r&&!i){var S=$t(d,o).point,P=e.lineStartIndex+e.segment+1,M=new t.Point(c.getx(P),c.gety(P)),I=$t(M,o),B=I.signedDistanceFromCamera>0?I.point:se(d,M,S,1,o),R=re(e.writingMode,S,B,f);if(R)return R}var L=ae(g*l.getoffsetX(e.glyphStartIndex),m,y,i,h,d,e.segment,e.lineStartIndex,e.lineStartIndex+e.lineLength,c,s,p);if(!L)return{notEnoughRoom:!0};A=[L]}for(var O=0,D=A;O<D.length;O+=1){var k=D[O];t.addDynamicAttributes(u,k.point,k.angle)}return{}}function se(t,e,n,i,r){var o=$t(t.add(t.sub(e)._unit()),r).point,s=n.sub(o);return n.add(s._mult(i/s.mag()))}function ae(e,n,i,r,o,s,a,l,c,u,h,d){var p=r?e-n:e+n,f=p>0?1:-1,A=0;r&&(f*=-1,A=Math.PI),f<0&&(A+=Math.PI);for(var g=f>0?l+a:l+a+1,m=o,y=o,_=0,v=0,b=Math.abs(p),x=[];_+v<=b;){if((g+=f)<l||g>=c)return null;if(y=m,x.push(m),void 0===(m=d[g])){var w=new t.Point(u.getx(g),u.gety(g)),E=$t(w,h);if(E.signedDistanceFromCamera>0)m=d[g]=E.point;else{var C=g-f;m=se(0===_?s:new t.Point(u.getx(C),u.gety(C)),w,y,b-_+1,h)}}_+=v,v=y.dist(m)}var T=(b-_)/v,S=m.sub(y),P=S.mult(T)._add(y);P._add(S._unit()._perp()._mult(i*f));var M=A+Math.atan2(m.y-y.y,m.x-y.x);return x.push(P),{point:P,angle:M,path:x}}Qt.prototype.keysLength=function(){return this.boxKeys.length+this.circleKeys.length},Qt.prototype.insert=function(t,e,n,i,r){this._forEachCell(e,n,i,r,this._insertBoxCell,this.boxUid++),this.boxKeys.push(t),this.bboxes.push(e),this.bboxes.push(n),this.bboxes.push(i),this.bboxes.push(r)},Qt.prototype.insertCircle=function(t,e,n,i){this._forEachCell(e-i,n-i,e+i,n+i,this._insertCircleCell,this.circleUid++),this.circleKeys.push(t),this.circles.push(e),this.circles.push(n),this.circles.push(i)},Qt.prototype._insertBoxCell=function(t,e,n,i,r,o){this.boxCells[r].push(o)},Qt.prototype._insertCircleCell=function(t,e,n,i,r,o){this.circleCells[r].push(o)},Qt.prototype._query=function(t,e,n,i,r,o){if(n<0||t>this.width||i<0||e>this.height)return!r&&[];var s=[];if(t<=0&&e<=0&&this.width<=n&&this.height<=i){if(r)return!0;for(var a=0;a<this.boxKeys.length;a++)s.push({key:this.boxKeys[a],x1:this.bboxes[4*a],y1:this.bboxes[4*a+1],x2:this.bboxes[4*a+2],y2:this.bboxes[4*a+3]});for(var l=0;l<this.circleKeys.length;l++){var c=this.circles[3*l],u=this.circles[3*l+1],h=this.circles[3*l+2];s.push({key:this.circleKeys[l],x1:c-h,y1:u-h,x2:c+h,y2:u+h})}return o?s.filter(o):s}return this._forEachCell(t,e,n,i,this._queryCell,s,{hitTest:r,seenUids:{box:{},circle:{}}},o),r?s.length>0:s},Qt.prototype._queryCircle=function(t,e,n,i,r){var o=t-n,s=t+n,a=e-n,l=e+n;if(s<0||o>this.width||l<0||a>this.height)return!i&&[];var c=[];return this._forEachCell(o,a,s,l,this._queryCellCircle,c,{hitTest:i,circle:{x:t,y:e,radius:n},seenUids:{box:{},circle:{}}},r),i?c.length>0:c},Qt.prototype.query=function(t,e,n,i,r){return this._query(t,e,n,i,!1,r)},Qt.prototype.hitTest=function(t,e,n,i,r){return this._query(t,e,n,i,!0,r)},Qt.prototype.hitTestCircle=function(t,e,n,i){return this._queryCircle(t,e,n,!0,i)},Qt.prototype._queryCell=function(t,e,n,i,r,o,s,a){var l=s.seenUids,c=this.boxCells[r];if(null!==c)for(var u=this.bboxes,h=0,d=c;h<d.length;h+=1){var p=d[h];if(!l.box[p]){l.box[p]=!0;var f=4*p;if(t<=u[f+2]&&e<=u[f+3]&&n>=u[f+0]&&i>=u[f+1]&&(!a||a(this.boxKeys[p]))){if(s.hitTest)return o.push(!0),!0;o.push({key:this.boxKeys[p],x1:u[f],y1:u[f+1],x2:u[f+2],y2:u[f+3]})}}}var A=this.circleCells[r];if(null!==A)for(var g=this.circles,m=0,y=A;m<y.length;m+=1){var _=y[m];if(!l.circle[_]){l.circle[_]=!0;var v=3*_;if(this._circleAndRectCollide(g[v],g[v+1],g[v+2],t,e,n,i)&&(!a||a(this.circleKeys[_]))){if(s.hitTest)return o.push(!0),!0;var b=g[v],x=g[v+1],w=g[v+2];o.push({key:this.circleKeys[_],x1:b-w,y1:x-w,x2:b+w,y2:x+w})}}}},Qt.prototype._queryCellCircle=function(t,e,n,i,r,o,s,a){var l=s.circle,c=s.seenUids,u=this.boxCells[r];if(null!==u)for(var h=this.bboxes,d=0,p=u;d<p.length;d+=1){var f=p[d];if(!c.box[f]){c.box[f]=!0;var A=4*f;if(this._circleAndRectCollide(l.x,l.y,l.radius,h[A+0],h[A+1],h[A+2],h[A+3])&&(!a||a(this.boxKeys[f])))return o.push(!0),!0}}var g=this.circleCells[r];if(null!==g)for(var m=this.circles,y=0,_=g;y<_.length;y+=1){var v=_[y];if(!c.circle[v]){c.circle[v]=!0;var b=3*v;if(this._circlesCollide(m[b],m[b+1],m[b+2],l.x,l.y,l.radius)&&(!a||a(this.circleKeys[v])))return o.push(!0),!0}}},Qt.prototype._forEachCell=function(t,e,n,i,r,o,s,a){for(var l=this._convertToXCellCoord(t),c=this._convertToYCellCoord(e),u=this._convertToXCellCoord(n),h=this._convertToYCellCoord(i),d=l;d<=u;d++)for(var p=c;p<=h;p++)if(r.call(this,t,e,n,i,this.xCellCount*p+d,o,s,a))return},Qt.prototype._convertToXCellCoord=function(t){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(t*this.xScale)))},Qt.prototype._convertToYCellCoord=function(t){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(t*this.yScale)))},Qt.prototype._circlesCollide=function(t,e,n,i,r,o){var s=i-t,a=r-e,l=n+o;return l*l>s*s+a*a},Qt.prototype._circleAndRectCollide=function(t,e,n,i,r,o,s){var a=(o-i)/2,l=Math.abs(t-(i+a));if(l>a+n)return!1;var c=(s-r)/2,u=Math.abs(e-(r+c));if(u>c+n)return!1;if(l<=a||u<=c)return!0;var h=l-a,d=u-c;return h*h+d*d<=n*n};var le=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function ce(t,e){for(var n=0;n<t;n++){var i=e.length;e.resize(i+4),e.float32.set(le,3*i)}}function ue(t,e,n){var i=e[0],r=e[1];return t[0]=n[0]*i+n[4]*r+n[12],t[1]=n[1]*i+n[5]*r+n[13],t[3]=n[3]*i+n[7]*r+n[15],t}var he=function(t,e,n){void 0===e&&(e=new Qt(t.width+200,t.height+200,25)),void 0===n&&(n=new Qt(t.width+200,t.height+200,25)),this.transform=t,this.grid=e,this.ignoredGrid=n,this.pitchfactor=Math.cos(t._pitch)*t.cameraToCenterDistance,this.screenRightBoundary=t.width+100,this.screenBottomBoundary=t.height+100,this.gridRightBoundary=t.width+200,this.gridBottomBoundary=t.height+200};function de(e,n,i){return n*(t.EXTENT/(e.tileSize*Math.pow(2,i-e.tileID.overscaledZ)))}he.prototype.placeCollisionBox=function(t,e,n,i,r){var o=this.projectAndGetPerspectiveRatio(i,t.anchorPointX,t.anchorPointY),s=n*o.perspectiveRatio,a=t.x1*s+o.point.x,l=t.y1*s+o.point.y,c=t.x2*s+o.point.x,u=t.y2*s+o.point.y;return!this.isInsideGrid(a,l,c,u)||!e&&this.grid.hitTest(a,l,c,u,r)?{box:[],offscreen:!1}:{box:[a,l,c,u],offscreen:this.isOffscreen(a,l,c,u)}},he.prototype.placeCollisionCircles=function(e,n,i,r,o,s,a,l,c,u,h,d,p){var f=[],A=new t.Point(n.anchorX,n.anchorY),g=$t(A,s),m=te(this.transform.cameraToCenterDistance,g.signedDistanceFromCamera),y=(u?o/m:o*m)/t.ONE_EM,_=$t(A,a).point,v=ie(y,r,n.lineOffsetX*y,n.lineOffsetY*y,!1,_,A,n,i,a,{}),b=!1,x=!1,w=!0;if(v){for(var E=.5*d*m+p,C=new t.Point(-100,-100),T=new t.Point(this.screenRightBoundary,this.screenBottomBoundary),S=new Kt,P=v.first,M=v.last,I=[],B=P.path.length-1;B>=1;B--)I.push(P.path[B]);for(var R=1;R<M.path.length;R++)I.push(M.path[R]);var L=2.5*E;if(l){var O=I.map((function(t){return $t(t,l)}));I=O.some((function(t){return t.signedDistanceFromCamera<=0}))?[]:O.map((function(t){return t.point}))}var D=[];if(I.length>0){for(var k=I[0].clone(),F=I[0].clone(),N=1;N<I.length;N++)k.x=Math.min(k.x,I[N].x),k.y=Math.min(k.y,I[N].y),F.x=Math.max(F.x,I[N].x),F.y=Math.max(F.y,I[N].y);D=k.x>=C.x&&F.x<=T.x&&k.y>=C.y&&F.y<=T.y?[I]:F.x<C.x||k.x>T.x||F.y<C.y||k.y>T.y?[]:t.clipLine([I],C.x,C.y,T.x,T.y)}for(var z=0,U=D;z<U.length;z+=1){var G;S.reset(U[z],.25*E),G=S.length<=.5*E?1:Math.ceil(S.paddedLength/L)+1;for(var V=0;V<G;V++){var j=V/Math.max(G-1,1),H=S.lerp(j),W=H.x+100,q=H.y+100;f.push(W,q,E,0);var Z=W-E,X=q-E,K=W+E,Q=q+E;if(w=w&&this.isOffscreen(Z,X,K,Q),x=x||this.isInsideGrid(Z,X,K,Q),!e&&this.grid.hitTestCircle(W,q,E,h)&&(b=!0,!c))return{circles:[],offscreen:!1,collisionDetected:b}}}}return{circles:!c&&b||!x?[]:f,offscreen:w,collisionDetected:b}},he.prototype.queryRenderedSymbols=function(e){if(0===e.length||0===this.grid.keysLength()&&0===this.ignoredGrid.keysLength())return{};for(var n=[],i=1/0,r=1/0,o=-1/0,s=-1/0,a=0,l=e;a<l.length;a+=1){var c=l[a],u=new t.Point(c.x+100,c.y+100);i=Math.min(i,u.x),r=Math.min(r,u.y),o=Math.max(o,u.x),s=Math.max(s,u.y),n.push(u)}for(var h={},d={},p=0,f=this.grid.query(i,r,o,s).concat(this.ignoredGrid.query(i,r,o,s));p<f.length;p+=1){var A=f[p],g=A.key;if(void 0===h[g.bucketInstanceId]&&(h[g.bucketInstanceId]={}),!h[g.bucketInstanceId][g.featureIndex]){var m=[new t.Point(A.x1,A.y1),new t.Point(A.x2,A.y1),new t.Point(A.x2,A.y2),new t.Point(A.x1,A.y2)];t.polygonIntersectsPolygon(n,m)&&(h[g.bucketInstanceId][g.featureIndex]=!0,void 0===d[g.bucketInstanceId]&&(d[g.bucketInstanceId]=[]),d[g.bucketInstanceId].push(g.featureIndex))}}return d},he.prototype.insertCollisionBox=function(t,e,n,i,r){(e?this.ignoredGrid:this.grid).insert({bucketInstanceId:n,featureIndex:i,collisionGroupID:r},t[0],t[1],t[2],t[3])},he.prototype.insertCollisionCircles=function(t,e,n,i,r){for(var o=e?this.ignoredGrid:this.grid,s={bucketInstanceId:n,featureIndex:i,collisionGroupID:r},a=0;a<t.length;a+=4)o.insertCircle(s,t[a],t[a+1],t[a+2])},he.prototype.projectAndGetPerspectiveRatio=function(e,n,i){var r=[n,i,0,1];return ue(r,r,e),{point:new t.Point((r[0]/r[3]+1)/2*this.transform.width+100,(-r[1]/r[3]+1)/2*this.transform.height+100),perspectiveRatio:.5+this.transform.cameraToCenterDistance/r[3]*.5}},he.prototype.isOffscreen=function(t,e,n,i){return n<100||t>=this.screenRightBoundary||i<100||e>this.screenBottomBoundary},he.prototype.isInsideGrid=function(t,e,n,i){return n>=0&&t<this.gridRightBoundary&&i>=0&&e<this.gridBottomBoundary},he.prototype.getViewportMatrix=function(){var e=t.identity([]);return t.translate(e,e,[-100,-100,0]),e};var pe=function(t,e,n,i){this.opacity=t?Math.max(0,Math.min(1,t.opacity+(t.placed?e:-e))):i&&n?1:0,this.placed=n};pe.prototype.isHidden=function(){return 0===this.opacity&&!this.placed};var fe=function(t,e,n,i,r){this.text=new pe(t?t.text:null,e,n,r),this.icon=new pe(t?t.icon:null,e,i,r)};fe.prototype.isHidden=function(){return this.text.isHidden()&&this.icon.isHidden()};var Ae=function(t,e,n){this.text=t,this.icon=e,this.skipFade=n},ge=function(){this.invProjMatrix=t.create(),this.viewportMatrix=t.create(),this.circles=[]},me=function(t,e,n,i,r){this.bucketInstanceId=t,this.featureIndex=e,this.sourceLayerIndex=n,this.bucketIndex=i,this.tileID=r},ye=function(t){this.crossSourceCollisions=t,this.maxGroupID=0,this.collisionGroups={}};function _e(e,n,i,r,o){var s=t.getAnchorAlignment(e),a=-(s.horizontalAlign-.5)*n,l=-(s.verticalAlign-.5)*i,c=t.evaluateVariableOffset(e,r);return new t.Point(a+c[0]*o,l+c[1]*o)}function ve(e,n,i,r,o,s){var a=e.x1,l=e.x2,c=e.y1,u=e.y2,h=e.anchorPointX,d=e.anchorPointY,p=new t.Point(n,i);return r&&p._rotate(o?s:-s),{x1:a+p.x,y1:c+p.y,x2:l+p.x,y2:u+p.y,anchorPointX:h,anchorPointY:d}}ye.prototype.get=function(t){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[t]){var e=++this.maxGroupID;this.collisionGroups[t]={ID:e,predicate:function(t){return t.collisionGroupID===e}}}return this.collisionGroups[t]};var be=function(t,e,n,i){this.transform=t.clone(),this.collisionIndex=new he(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=e,this.retainedQueryData={},this.collisionGroups=new ye(n),this.collisionCircleArrays={},this.prevPlacement=i,i&&(i.prevPlacement=void 0),this.placedOrientations={}};function xe(t,e,n,i,r){t.emplaceBack(e?1:0,n?1:0,i||0,r||0),t.emplaceBack(e?1:0,n?1:0,i||0,r||0),t.emplaceBack(e?1:0,n?1:0,i||0,r||0),t.emplaceBack(e?1:0,n?1:0,i||0,r||0)}be.prototype.getBucketParts=function(e,n,i,r){var o=i.getBucket(n),s=i.latestFeatureIndex;if(o&&s&&n.id===o.layerIds[0]){var a=i.collisionBoxArray,l=o.layers[0].layout,c=Math.pow(2,this.transform.zoom-i.tileID.overscaledZ),u=i.tileSize/t.EXTENT,h=this.transform.calculatePosMatrix(i.tileID.toUnwrapped()),d="map"===l.get("text-pitch-alignment"),p="map"===l.get("text-rotation-alignment"),f=de(i,1,this.transform.zoom),A=Jt(h,d,p,this.transform,f),g=null;if(d){var m=Yt(h,d,p,this.transform,f);g=t.multiply([],this.transform.labelPlaneMatrix,m)}this.retainedQueryData[o.bucketInstanceId]=new me(o.bucketInstanceId,s,o.sourceLayerIndex,o.index,i.tileID);var y={bucket:o,layout:l,posMatrix:h,textLabelPlaneMatrix:A,labelToScreenMatrix:g,scale:c,textPixelRatio:u,holdingForFade:i.holdingForFade(),collisionBoxArray:a,partiallyEvaluatedTextSize:t.evaluateSizeForZoom(o.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(o.sourceID)};if(r)for(var _=0,v=o.sortKeyRanges;_<v.length;_+=1){var b=v[_];e.push({sortKey:b.sortKey,symbolInstanceStart:b.symbolInstanceStart,symbolInstanceEnd:b.symbolInstanceEnd,parameters:y})}else e.push({symbolInstanceStart:0,symbolInstanceEnd:o.symbolInstances.length,parameters:y})}},be.prototype.attemptAnchorPlacement=function(t,e,n,i,r,o,s,a,l,c,u,h,d,p,f){var A,g=[h.textOffset0,h.textOffset1],m=_e(t,n,i,g,r),y=this.collisionIndex.placeCollisionBox(ve(e,m.x,m.y,o,s,this.transform.angle),u,a,l,c.predicate);if(!f||0!==this.collisionIndex.placeCollisionBox(ve(f,m.x,m.y,o,s,this.transform.angle),u,a,l,c.predicate).box.length)return y.box.length>0?(this.prevPlacement&&this.prevPlacement.variableOffsets[h.crossTileID]&&this.prevPlacement.placements[h.crossTileID]&&this.prevPlacement.placements[h.crossTileID].text&&(A=this.prevPlacement.variableOffsets[h.crossTileID].anchor),this.variableOffsets[h.crossTileID]={textOffset:g,width:n,height:i,anchor:t,textBoxScale:r,prevAnchor:A},this.markUsedJustification(d,t,h,p),d.allowVerticalPlacement&&(this.markUsedOrientation(d,p,h),this.placedOrientations[h.crossTileID]=p),{shift:m,placedGlyphBoxes:y}):void 0},be.prototype.placeLayerBucketPart=function(e,n,i){var r=this,o=e.parameters,s=o.bucket,a=o.layout,l=o.posMatrix,c=o.textLabelPlaneMatrix,u=o.labelToScreenMatrix,h=o.textPixelRatio,d=o.holdingForFade,p=o.collisionBoxArray,f=o.partiallyEvaluatedTextSize,A=o.collisionGroup,g=a.get("text-optional"),m=a.get("icon-optional"),y=a.get("text-allow-overlap"),_=a.get("icon-allow-overlap"),v="map"===a.get("text-rotation-alignment"),b="map"===a.get("text-pitch-alignment"),x="none"!==a.get("icon-text-fit"),w="viewport-y"===a.get("symbol-z-order"),E=y&&(_||!s.hasIconData()||m),C=_&&(y||!s.hasTextData()||g);!s.collisionArrays&&p&&s.deserializeCollisionBoxes(p);var T=function(e,o){if(!n[e.crossTileID])if(d)r.placements[e.crossTileID]=new Ae(!1,!1,!1);else{var p,w=!1,T=!1,S=!0,P=null,M={box:null,offscreen:null},I={box:null,offscreen:null},B=null,R=null,L=0,O=0,D=0;o.textFeatureIndex?L=o.textFeatureIndex:e.useRuntimeCollisionCircles&&(L=e.featureIndex),o.verticalTextFeatureIndex&&(O=o.verticalTextFeatureIndex);var k=o.textBox;if(k){var F=function(n){var i=t.WritingMode.horizontal;if(s.allowVerticalPlacement&&!n&&r.prevPlacement){var o=r.prevPlacement.placedOrientations[e.crossTileID];o&&(r.placedOrientations[e.crossTileID]=o,r.markUsedOrientation(s,i=o,e))}return i},N=function(n,i){if(s.allowVerticalPlacement&&e.numVerticalGlyphVertices>0&&o.verticalTextBox)for(var r=0,a=s.writingModes;r<a.length&&(a[r]===t.WritingMode.vertical?(M=i(),I=M):M=n(),!(M&&M.box&&M.box.length));r+=1);else M=n()};if(a.get("text-variable-anchor")){var z=a.get("text-variable-anchor");if(r.prevPlacement&&r.prevPlacement.variableOffsets[e.crossTileID]){var U=r.prevPlacement.variableOffsets[e.crossTileID];z.indexOf(U.anchor)>0&&(z=z.filter((function(t){return t!==U.anchor}))).unshift(U.anchor)}var G=function(t,n,i){for(var o=t.x2-t.x1,a=t.y2-t.y1,c=e.textBoxScale,u=x&&!_?n:null,d={box:[],offscreen:!1},p=y?2*z.length:z.length,f=0;f<p;++f){var g=r.attemptAnchorPlacement(z[f%z.length],t,o,a,c,v,b,h,l,A,f>=z.length,e,s,i,u);if(g&&(d=g.placedGlyphBoxes)&&d.box&&d.box.length){w=!0,P=g.shift;break}}return d};N((function(){return G(k,o.iconBox,t.WritingMode.horizontal)}),(function(){var n=o.verticalTextBox;return s.allowVerticalPlacement&&!(M&&M.box&&M.box.length)&&e.numVerticalGlyphVertices>0&&n?G(n,o.verticalIconBox,t.WritingMode.vertical):{box:null,offscreen:null}})),M&&(w=M.box,S=M.offscreen);var V=F(M&&M.box);if(!w&&r.prevPlacement){var j=r.prevPlacement.variableOffsets[e.crossTileID];j&&(r.variableOffsets[e.crossTileID]=j,r.markUsedJustification(s,j.anchor,e,V))}}else{var H=function(t,n){var i=r.collisionIndex.placeCollisionBox(t,y,h,l,A.predicate);return i&&i.box&&i.box.length&&(r.markUsedOrientation(s,n,e),r.placedOrientations[e.crossTileID]=n),i};N((function(){return H(k,t.WritingMode.horizontal)}),(function(){var n=o.verticalTextBox;return s.allowVerticalPlacement&&e.numVerticalGlyphVertices>0&&n?H(n,t.WritingMode.vertical):{box:null,offscreen:null}})),F(M&&M.box&&M.box.length)}}if(w=(p=M)&&p.box&&p.box.length>0,S=p&&p.offscreen,e.useRuntimeCollisionCircles){var W=s.text.placedSymbolArray.get(e.centerJustifiedTextSymbolIndex),q=t.evaluateSizeForFeature(s.textSizeData,f,W),Z=a.get("text-padding");B=r.collisionIndex.placeCollisionCircles(y,W,s.lineVertexArray,s.glyphOffsetArray,q,l,c,u,i,b,A.predicate,e.collisionCircleDiameter,Z),w=y||B.circles.length>0&&!B.collisionDetected,S=S&&B.offscreen}if(o.iconFeatureIndex&&(D=o.iconFeatureIndex),o.iconBox){var X=function(t){var e=x&&P?ve(t,P.x,P.y,v,b,r.transform.angle):t;return r.collisionIndex.placeCollisionBox(e,_,h,l,A.predicate)};T=I&&I.box&&I.box.length&&o.verticalIconBox?(R=X(o.verticalIconBox)).box.length>0:(R=X(o.iconBox)).box.length>0,S=S&&R.offscreen}var K=g||0===e.numHorizontalGlyphVertices&&0===e.numVerticalGlyphVertices,Q=m||0===e.numIconVertices;if(K||Q?Q?K||(T=T&&w):w=T&&w:T=w=T&&w,w&&p&&p.box&&r.collisionIndex.insertCollisionBox(p.box,a.get("text-ignore-placement"),s.bucketInstanceId,I&&I.box&&O?O:L,A.ID),T&&R&&r.collisionIndex.insertCollisionBox(R.box,a.get("icon-ignore-placement"),s.bucketInstanceId,D,A.ID),B&&(w&&r.collisionIndex.insertCollisionCircles(B.circles,a.get("text-ignore-placement"),s.bucketInstanceId,L,A.ID),i)){var J=s.bucketInstanceId,Y=r.collisionCircleArrays[J];void 0===Y&&(Y=r.collisionCircleArrays[J]=new ge);for(var $=0;$<B.circles.length;$+=4)Y.circles.push(B.circles[$+0]),Y.circles.push(B.circles[$+1]),Y.circles.push(B.circles[$+2]),Y.circles.push(B.collisionDetected?1:0)}r.placements[e.crossTileID]=new Ae(w||E,T||C,S||s.justReloaded),n[e.crossTileID]=!0}};if(w)for(var S=s.getSortedSymbolIndexes(this.transform.angle),P=S.length-1;P>=0;--P){var M=S[P];T(s.symbolInstances.get(M),s.collisionArrays[M])}else for(var I=e.symbolInstanceStart;I<e.symbolInstanceEnd;I++)T(s.symbolInstances.get(I),s.collisionArrays[I]);if(i&&s.bucketInstanceId in this.collisionCircleArrays){var B=this.collisionCircleArrays[s.bucketInstanceId];t.invert(B.invProjMatrix,l),B.viewportMatrix=this.collisionIndex.getViewportMatrix()}s.justReloaded=!1},be.prototype.markUsedJustification=function(e,n,i,r){var o;o=r===t.WritingMode.vertical?i.verticalPlacedTextSymbolIndex:{left:i.leftJustifiedTextSymbolIndex,center:i.centerJustifiedTextSymbolIndex,right:i.rightJustifiedTextSymbolIndex}[t.getAnchorJustification(n)];for(var s=0,a=[i.leftJustifiedTextSymbolIndex,i.centerJustifiedTextSymbolIndex,i.rightJustifiedTextSymbolIndex,i.verticalPlacedTextSymbolIndex];s<a.length;s+=1){var l=a[s];l>=0&&(e.text.placedSymbolArray.get(l).crossTileID=o>=0&&l!==o?0:i.crossTileID)}},be.prototype.markUsedOrientation=function(e,n,i){for(var r=n===t.WritingMode.horizontal||n===t.WritingMode.horizontalOnly?n:0,o=n===t.WritingMode.vertical?n:0,s=0,a=[i.leftJustifiedTextSymbolIndex,i.centerJustifiedTextSymbolIndex,i.rightJustifiedTextSymbolIndex];s<a.length;s+=1)e.text.placedSymbolArray.get(a[s]).placedOrientation=r;i.verticalPlacedTextSymbolIndex&&(e.text.placedSymbolArray.get(i.verticalPlacedTextSymbolIndex).placedOrientation=o)},be.prototype.commit=function(t){this.commitTime=t,this.zoomAtLastRecencyCheck=this.transform.zoom;var e=this.prevPlacement,n=!1;this.prevZoomAdjustment=e?e.zoomAdjustment(this.transform.zoom):0;var i=e?e.symbolFadeChange(t):1,r=e?e.opacities:{},o=e?e.variableOffsets:{},s=e?e.placedOrientations:{};for(var a in this.placements){var l=this.placements[a],c=r[a];c?(this.opacities[a]=new fe(c,i,l.text,l.icon),n=n||l.text!==c.text.placed||l.icon!==c.icon.placed):(this.opacities[a]=new fe(null,i,l.text,l.icon,l.skipFade),n=n||l.text||l.icon)}for(var u in r){var h=r[u];if(!this.opacities[u]){var d=new fe(h,i,!1,!1);d.isHidden()||(this.opacities[u]=d,n=n||h.text.placed||h.icon.placed)}}for(var p in o)this.variableOffsets[p]||!this.opacities[p]||this.opacities[p].isHidden()||(this.variableOffsets[p]=o[p]);for(var f in s)this.placedOrientations[f]||!this.opacities[f]||this.opacities[f].isHidden()||(this.placedOrientations[f]=s[f]);n?this.lastPlacementChangeTime=t:"number"!=typeof this.lastPlacementChangeTime&&(this.lastPlacementChangeTime=e?e.lastPlacementChangeTime:t)},be.prototype.updateLayerOpacities=function(t,e){for(var n={},i=0,r=e;i<r.length;i+=1){var o=r[i],s=o.getBucket(t);s&&o.latestFeatureIndex&&t.id===s.layerIds[0]&&this.updateBucketOpacities(s,n,o.collisionBoxArray)}},be.prototype.updateBucketOpacities=function(e,n,i){var r=this;e.hasTextData()&&e.text.opacityVertexArray.clear(),e.hasIconData()&&e.icon.opacityVertexArray.clear(),e.hasIconCollisionBoxData()&&e.iconCollisionBox.collisionVertexArray.clear(),e.hasTextCollisionBoxData()&&e.textCollisionBox.collisionVertexArray.clear();var o=e.layers[0].layout,s=new fe(null,0,!1,!1,!0),a=o.get("text-allow-overlap"),l=o.get("icon-allow-overlap"),c=o.get("text-variable-anchor"),u="map"===o.get("text-rotation-alignment"),h="map"===o.get("text-pitch-alignment"),d="none"!==o.get("icon-text-fit"),p=new fe(null,0,a&&(l||!e.hasIconData()||o.get("icon-optional")),l&&(a||!e.hasTextData()||o.get("text-optional")),!0);!e.collisionArrays&&i&&(e.hasIconCollisionBoxData()||e.hasTextCollisionBoxData())&&e.deserializeCollisionBoxes(i);for(var f=function(t,e,n){for(var i=0;i<e/4;i++)t.opacityVertexArray.emplaceBack(n)},A=function(i){var o=e.symbolInstances.get(i),a=o.numHorizontalGlyphVertices,l=o.numVerticalGlyphVertices,A=o.crossTileID,g=r.opacities[A];n[A]?g=s:g||(r.opacities[A]=g=p),n[A]=!0;var m=o.numIconVertices>0,y=r.placedOrientations[o.crossTileID],_=y===t.WritingMode.vertical,v=y===t.WritingMode.horizontal||y===t.WritingMode.horizontalOnly;if(a>0||l>0){var b=Ie(g.text);f(e.text,a,_?Be:b),f(e.text,l,v?Be:b);var x=g.text.isHidden();[o.rightJustifiedTextSymbolIndex,o.centerJustifiedTextSymbolIndex,o.leftJustifiedTextSymbolIndex].forEach((function(t){t>=0&&(e.text.placedSymbolArray.get(t).hidden=x||_?1:0)})),o.verticalPlacedTextSymbolIndex>=0&&(e.text.placedSymbolArray.get(o.verticalPlacedTextSymbolIndex).hidden=x||v?1:0);var w=r.variableOffsets[o.crossTileID];w&&r.markUsedJustification(e,w.anchor,o,y);var E=r.placedOrientations[o.crossTileID];E&&(r.markUsedJustification(e,"left",o,E),r.markUsedOrientation(e,E,o))}if(m){var C=Ie(g.icon),T=!(d&&o.verticalPlacedIconSymbolIndex&&_);o.placedIconSymbolIndex>=0&&(f(e.icon,o.numIconVertices,T?C:Be),e.icon.placedSymbolArray.get(o.placedIconSymbolIndex).hidden=g.icon.isHidden()),o.verticalPlacedIconSymbolIndex>=0&&(f(e.icon,o.numVerticalIconVertices,T?Be:C),e.icon.placedSymbolArray.get(o.verticalPlacedIconSymbolIndex).hidden=g.icon.isHidden())}if(e.hasIconCollisionBoxData()||e.hasTextCollisionBoxData()){var S=e.collisionArrays[i];if(S){var P=new t.Point(0,0);if(S.textBox||S.verticalTextBox){var M=!0;if(c){var I=r.variableOffsets[A];I?(P=_e(I.anchor,I.width,I.height,I.textOffset,I.textBoxScale),u&&P._rotate(h?r.transform.angle:-r.transform.angle)):M=!1}S.textBox&&xe(e.textCollisionBox.collisionVertexArray,g.text.placed,!M||_,P.x,P.y),S.verticalTextBox&&xe(e.textCollisionBox.collisionVertexArray,g.text.placed,!M||v,P.x,P.y)}var B=Boolean(!v&&S.verticalIconBox);S.iconBox&&xe(e.iconCollisionBox.collisionVertexArray,g.icon.placed,B,d?P.x:0,d?P.y:0),S.verticalIconBox&&xe(e.iconCollisionBox.collisionVertexArray,g.icon.placed,!B,d?P.x:0,d?P.y:0)}}},g=0;g<e.symbolInstances.length;g++)A(g);if(e.sortFeatures(this.transform.angle),this.retainedQueryData[e.bucketInstanceId]&&(this.retainedQueryData[e.bucketInstanceId].featureSortOrder=e.featureSortOrder),e.hasTextData()&&e.text.opacityVertexBuffer&&e.text.opacityVertexBuffer.updateData(e.text.opacityVertexArray),e.hasIconData()&&e.icon.opacityVertexBuffer&&e.icon.opacityVertexBuffer.updateData(e.icon.opacityVertexArray),e.hasIconCollisionBoxData()&&e.iconCollisionBox.collisionVertexBuffer&&e.iconCollisionBox.collisionVertexBuffer.updateData(e.iconCollisionBox.collisionVertexArray),e.hasTextCollisionBoxData()&&e.textCollisionBox.collisionVertexBuffer&&e.textCollisionBox.collisionVertexBuffer.updateData(e.textCollisionBox.collisionVertexArray),e.bucketInstanceId in this.collisionCircleArrays){var m=this.collisionCircleArrays[e.bucketInstanceId];e.placementInvProjMatrix=m.invProjMatrix,e.placementViewportMatrix=m.viewportMatrix,e.collisionCircleArray=m.circles,delete this.collisionCircleArrays[e.bucketInstanceId]}},be.prototype.symbolFadeChange=function(t){return 0===this.fadeDuration?1:(t-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment},be.prototype.zoomAdjustment=function(t){return Math.max(0,(this.transform.zoom-t)/1.5)},be.prototype.hasTransitions=function(t){return this.stale||t-this.lastPlacementChangeTime<this.fadeDuration},be.prototype.stillRecent=function(t,e){var n=this.zoomAtLastRecencyCheck===e?1-this.zoomAdjustment(e):1;return this.zoomAtLastRecencyCheck=e,this.commitTime+this.fadeDuration*n>t},be.prototype.setStale=function(){this.stale=!0};var we=Math.pow(2,25),Ee=Math.pow(2,24),Ce=Math.pow(2,17),Te=Math.pow(2,16),Se=Math.pow(2,9),Pe=Math.pow(2,8),Me=Math.pow(2,1);function Ie(t){if(0===t.opacity&&!t.placed)return 0;if(1===t.opacity&&t.placed)return 4294967295;var e=t.placed?1:0,n=Math.floor(127*t.opacity);return n*we+e*Ee+n*Ce+e*Te+n*Se+e*Pe+n*Me+e}var Be=0,Re=function(t){this._sortAcrossTiles="viewport-y"!==t.layout.get("symbol-z-order")&&void 0!==t.layout.get("symbol-sort-key").constantOr(1),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]};Re.prototype.continuePlacement=function(t,e,n,i,r){for(var o=this._bucketParts;this._currentTileIndex<t.length;)if(e.getBucketParts(o,i,t[this._currentTileIndex],this._sortAcrossTiles),this._currentTileIndex++,r())return!0;for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,o.sort((function(t,e){return t.sortKey-e.sortKey})));this._currentPartIndex<o.length;)if(e.placeLayerBucketPart(o[this._currentPartIndex],this._seenCrossTileIDs,n),this._currentPartIndex++,r())return!0;return!1};var Le=function(t,e,n,i,r,o,s){this.placement=new be(t,r,o,s),this._currentPlacementIndex=e.length-1,this._forceFullPlacement=n,this._showCollisionBoxes=i,this._done=!1};Le.prototype.isDone=function(){return this._done},Le.prototype.continuePlacement=function(e,n,i){for(var r=this,o=t.browser.now(),s=function(){var e=t.browser.now()-o;return!r._forceFullPlacement&&e>2};this._currentPlacementIndex>=0;){var a=n[e[this._currentPlacementIndex]],l=this.placement.collisionIndex.transform.zoom;if("symbol"===a.type&&(!a.minzoom||a.minzoom<=l)&&(!a.maxzoom||a.maxzoom>l)){if(this._inProgressLayer||(this._inProgressLayer=new Re(a)),this._inProgressLayer.continuePlacement(i[a.source],this.placement,this._showCollisionBoxes,a,s))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0},Le.prototype.commit=function(t){return this.placement.commit(t),this.placement};var Oe=512/t.EXTENT/2,De=function(t,e,n){this.tileID=t,this.indexedSymbolInstances={},this.bucketInstanceId=n;for(var i=0;i<e.length;i++){var r=e.get(i),o=r.key;this.indexedSymbolInstances[o]||(this.indexedSymbolInstances[o]=[]),this.indexedSymbolInstances[o].push({crossTileID:r.crossTileID,coord:this.getScaledCoordinates(r,t)})}};De.prototype.getScaledCoordinates=function(e,n){var i=Oe/Math.pow(2,n.canonical.z-this.tileID.canonical.z);return{x:Math.floor((n.canonical.x*t.EXTENT+e.anchorX)*i),y:Math.floor((n.canonical.y*t.EXTENT+e.anchorY)*i)}},De.prototype.findMatches=function(t,e,n){for(var i=this.tileID.canonical.z<e.canonical.z?1:Math.pow(2,this.tileID.canonical.z-e.canonical.z),r=0;r<t.length;r++){var o=t.get(r);if(!o.crossTileID){var s=this.indexedSymbolInstances[o.key];if(s)for(var a=this.getScaledCoordinates(o,e),l=0,c=s;l<c.length;l+=1){var u=c[l];if(Math.abs(u.coord.x-a.x)<=i&&Math.abs(u.coord.y-a.y)<=i&&!n[u.crossTileID]){n[u.crossTileID]=!0,o.crossTileID=u.crossTileID;break}}}}};var ke=function(){this.maxCrossTileID=0};ke.prototype.generate=function(){return++this.maxCrossTileID};var Fe=function(){this.indexes={},this.usedCrossTileIDs={},this.lng=0};Fe.prototype.handleWrapJump=function(t){var e=Math.round((t-this.lng)/360);if(0!==e)for(var n in this.indexes){var i=this.indexes[n],r={};for(var o in i){var s=i[o];s.tileID=s.tileID.unwrapTo(s.tileID.wrap+e),r[s.tileID.key]=s}this.indexes[n]=r}this.lng=t},Fe.prototype.addBucket=function(t,e,n){if(this.indexes[t.overscaledZ]&&this.indexes[t.overscaledZ][t.key]){if(this.indexes[t.overscaledZ][t.key].bucketInstanceId===e.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(t.overscaledZ,this.indexes[t.overscaledZ][t.key])}for(var i=0;i<e.symbolInstances.length;i++)e.symbolInstances.get(i).crossTileID=0;this.usedCrossTileIDs[t.overscaledZ]||(this.usedCrossTileIDs[t.overscaledZ]={});var r=this.usedCrossTileIDs[t.overscaledZ];for(var o in this.indexes){var s=this.indexes[o];if(Number(o)>t.overscaledZ)for(var a in s){var l=s[a];l.tileID.isChildOf(t)&&l.findMatches(e.symbolInstances,t,r)}else{var c=s[t.scaledTo(Number(o)).key];c&&c.findMatches(e.symbolInstances,t,r)}}for(var u=0;u<e.symbolInstances.length;u++){var h=e.symbolInstances.get(u);h.crossTileID||(h.crossTileID=n.generate(),r[h.crossTileID]=!0)}return void 0===this.indexes[t.overscaledZ]&&(this.indexes[t.overscaledZ]={}),this.indexes[t.overscaledZ][t.key]=new De(t,e.symbolInstances,e.bucketInstanceId),!0},Fe.prototype.removeBucketCrossTileIDs=function(t,e){for(var n in e.indexedSymbolInstances)for(var i=0,r=e.indexedSymbolInstances[n];i<r.length;i+=1)delete this.usedCrossTileIDs[t][r[i].crossTileID]},Fe.prototype.removeStaleBuckets=function(t){var e=!1;for(var n in this.indexes){var i=this.indexes[n];for(var r in i)t[i[r].bucketInstanceId]||(this.removeBucketCrossTileIDs(n,i[r]),delete i[r],e=!0)}return e};var Ne=function(){this.layerIndexes={},this.crossTileIDs=new ke,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}};Ne.prototype.addLayer=function(t,e,n){var i=this.layerIndexes[t.id];void 0===i&&(i=this.layerIndexes[t.id]=new Fe);var r=!1,o={};i.handleWrapJump(n);for(var s=0,a=e;s<a.length;s+=1){var l=a[s],c=l.getBucket(t);c&&t.id===c.layerIds[0]&&(c.bucketInstanceId||(c.bucketInstanceId=++this.maxBucketInstanceId),i.addBucket(l.tileID,c,this.crossTileIDs)&&(r=!0),o[c.bucketInstanceId]=!0)}return i.removeStaleBuckets(o)&&(r=!0),r},Ne.prototype.pruneUnusedLayers=function(t){var e={};for(var n in t.forEach((function(t){e[t]=!0})),this.layerIndexes)e[n]||delete this.layerIndexes[n]};var ze=function(e,n){return t.emitValidationErrors(e,n&&n.filter((function(t){return"source.canvas"!==t.identifier})))},Ue=t.pick(Gt,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData"]),Ge=t.pick(Gt,["setCenter","setZoom","setBearing","setPitch"]),Ve=function(){var e={},n=t.styleSpec.$version;for(var i in t.styleSpec.$root){var r,o=t.styleSpec.$root[i];o.required&&null!=(r="version"===i?n:"array"===o.type?[]:{})&&(e[i]=r)}return e}(),je=function(e){function n(i,r){var o=this;void 0===r&&(r={}),e.call(this),this.map=i,this.dispatcher=new E(Nt(),this),this.imageManager=new d,this.imageManager.setEventedParent(this),this.glyphManager=new _(i._requestManager,r.localIdeographFontFamily),this.lineAtlas=new w(256,512),this.crossTileSymbolIndex=new Ne,this._layers={},this._serializedLayers={},this._order=[],this.sourceCaches={},this.zoomHistory=new t.ZoomHistory,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("setReferrer",t.getReferrer());var s=this;this._rtlTextPluginCallback=n.registerForPluginStateChange((function(e){s.dispatcher.broadcast("syncRTLPluginState",{pluginStatus:e.pluginStatus,pluginURL:e.pluginURL},(function(e,n){if(t.triggerPluginCompletionEvent(e),n&&n.every((function(t){return t})))for(var i in s.sourceCaches)s.sourceCaches[i].reload()}))})),this.on("data",(function(t){if("source"===t.dataType&&"metadata"===t.sourceDataType){var e=o.sourceCaches[t.sourceId];if(e){var n=e.getSource();if(n&&n.vectorLayerIds)for(var i in o._layers){var r=o._layers[i];r.source===n.id&&o._validateLayer(r)}}}}))}return e&&(n.__proto__=e),(n.prototype=Object.create(e&&e.prototype)).constructor=n,n.prototype.loadURL=function(e,n){var i=this;void 0===n&&(n={}),this.fire(new t.Event("dataloading",{dataType:"style"}));var r="boolean"==typeof n.validate?n.validate:!t.isMapboxURL(e);e=this.map._requestManager.normalizeStyleURL(e,n.accessToken);var o=this.map._requestManager.transformRequest(e,t.ResourceType.Style);this._request=t.getJSON(o,(function(e,n){i._request=null,e?i.fire(new t.ErrorEvent(e)):n&&i._load(n,r)}))},n.prototype.loadJSON=function(e,n){var i=this;void 0===n&&(n={}),this.fire(new t.Event("dataloading",{dataType:"style"})),this._request=t.browser.frame((function(){i._request=null,i._load(e,!1!==n.validate)}))},n.prototype.loadEmpty=function(){this.fire(new t.Event("dataloading",{dataType:"style"})),this._load(Ve,!1)},n.prototype._load=function(e,n){if(!n||!ze(this,t.validateStyle(e))){for(var i in this._loaded=!0,this.stylesheet=e,e.sources)this.addSource(i,e.sources[i],{validate:!1});e.sprite?this._loadSprite(e.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(e.glyphs);var r=Ut(this.stylesheet.layers);this._order=r.map((function(t){return t.id})),this._layers={},this._serializedLayers={};for(var o=0,s=r;o<s.length;o+=1){var a=s[o];(a=t.createStyleLayer(a)).setEventedParent(this,{layer:{id:a.id}}),this._layers[a.id]=a,this._serializedLayers[a.id]=a.serialize()}this.dispatcher.broadcast("setLayers",this._serializeLayers(this._order)),this.light=new x(this.stylesheet.light),this.fire(new t.Event("data",{dataType:"style"})),this.fire(new t.Event("style.load"))}},n.prototype._loadSprite=function(e){var n=this;this._spriteRequest=function(e,n,i){var r,o,s,a=t.browser.devicePixelRatio>1?"@2x":"",l=t.getJSON(n.transformRequest(n.normalizeSpriteURL(e,a,".json"),t.ResourceType.SpriteJSON),(function(t,e){l=null,s||(s=t,r=e,u())})),c=t.getImage(n.transformRequest(n.normalizeSpriteURL(e,a,".png"),t.ResourceType.SpriteImage),(function(t,e){c=null,s||(s=t,o=e,u())}));function u(){if(s)i(s);else if(r&&o){var e=t.browser.getImageData(o),n={};for(var a in r){var l=r[a],c=l.width,u=l.height,h=l.x,d=l.y,p=l.sdf,f=l.pixelRatio,A=l.stretchX,g=l.stretchY,m=l.content,y=new t.RGBAImage({width:c,height:u});t.RGBAImage.copy(e,y,{x:h,y:d},{x:0,y:0},{width:c,height:u}),n[a]={data:y,pixelRatio:f,sdf:p,stretchX:A,stretchY:g,content:m}}i(null,n)}}return{cancel:function(){l&&(l.cancel(),l=null),c&&(c.cancel(),c=null)}}}(e,this.map._requestManager,(function(e,i){if(n._spriteRequest=null,e)n.fire(new t.ErrorEvent(e));else if(i)for(var r in i)n.imageManager.addImage(r,i[r]);n.imageManager.setLoaded(!0),n._availableImages=n.imageManager.listImages(),n.dispatcher.broadcast("setImages",n._availableImages),n.fire(new t.Event("data",{dataType:"style"}))}))},n.prototype._validateLayer=function(e){var n=this.sourceCaches[e.source];if(n){var i=e.sourceLayer;if(i){var r=n.getSource();("geojson"===r.type||r.vectorLayerIds&&-1===r.vectorLayerIds.indexOf(i))&&this.fire(new t.ErrorEvent(new Error('Source layer "'+i+'" does not exist on source "'+r.id+'" as specified by style layer "'+e.id+'"')))}}},n.prototype.loaded=function(){if(!this._loaded)return!1;if(Object.keys(this._updatedSources).length)return!1;for(var t in this.sourceCaches)if(!this.sourceCaches[t].loaded())return!1;return!!this.imageManager.isLoaded()},n.prototype._serializeLayers=function(t){for(var e=[],n=0,i=t;n<i.length;n+=1){var r=this._layers[i[n]];"custom"!==r.type&&e.push(r.serialize())}return e},n.prototype.hasTransitions=function(){if(this.light&&this.light.hasTransition())return!0;for(var t in this.sourceCaches)if(this.sourceCaches[t].hasTransition())return!0;for(var e in this._layers)if(this._layers[e].hasTransition())return!0;return!1},n.prototype._checkLoaded=function(){if(!this._loaded)throw new Error("Style is not done loading")},n.prototype.update=function(e){if(this._loaded){var n=this._changed;if(this._changed){var i=Object.keys(this._updatedLayers),r=Object.keys(this._removedLayers);for(var o in(i.length||r.length)&&this._updateWorkerLayers(i,r),this._updatedSources){var s=this._updatedSources[o];"reload"===s?this._reloadSource(o):"clear"===s&&this._clearSource(o)}for(var a in this._updateTilesForChangedImages(),this._updatedPaintProps)this._layers[a].updateTransitions(e);this.light.updateTransitions(e),this._resetUpdates()}var l={};for(var c in this.sourceCaches){var u=this.sourceCaches[c];l[c]=u.used,u.used=!1}for(var h=0,d=this._order;h<d.length;h+=1){var p=this._layers[d[h]];p.recalculate(e,this._availableImages),!p.isHidden(e.zoom)&&p.source&&(this.sourceCaches[p.source].used=!0)}for(var f in l){var A=this.sourceCaches[f];l[f]!==A.used&&A.fire(new t.Event("data",{sourceDataType:"visibility",dataType:"source",sourceId:f}))}this.light.recalculate(e),this.z=e.zoom,n&&this.fire(new t.Event("data",{dataType:"style"}))}},n.prototype._updateTilesForChangedImages=function(){var t=Object.keys(this._changedImages);if(t.length){for(var e in this.sourceCaches)this.sourceCaches[e].reloadTilesForDependencies(["icons","patterns"],t);this._changedImages={}}},n.prototype._updateWorkerLayers=function(t,e){this.dispatcher.broadcast("updateLayers",{layers:this._serializeLayers(t),removedIds:e})},n.prototype._resetUpdates=function(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={}},n.prototype.setState=function(e){var n=this;if(this._checkLoaded(),ze(this,t.validateStyle(e)))return!1;(e=t.clone$1(e)).layers=Ut(e.layers);var i=function(e,n){if(!e)return[{command:Gt.setStyle,args:[n]}];var i=[];try{if(!t.deepEqual(e.version,n.version))return[{command:Gt.setStyle,args:[n]}];t.deepEqual(e.center,n.center)||i.push({command:Gt.setCenter,args:[n.center]}),t.deepEqual(e.zoom,n.zoom)||i.push({command:Gt.setZoom,args:[n.zoom]}),t.deepEqual(e.bearing,n.bearing)||i.push({command:Gt.setBearing,args:[n.bearing]}),t.deepEqual(e.pitch,n.pitch)||i.push({command:Gt.setPitch,args:[n.pitch]}),t.deepEqual(e.sprite,n.sprite)||i.push({command:Gt.setSprite,args:[n.sprite]}),t.deepEqual(e.glyphs,n.glyphs)||i.push({command:Gt.setGlyphs,args:[n.glyphs]}),t.deepEqual(e.transition,n.transition)||i.push({command:Gt.setTransition,args:[n.transition]}),t.deepEqual(e.light,n.light)||i.push({command:Gt.setLight,args:[n.light]});var r={},o=[];!function(e,n,i,r){var o;for(o in n=n||{},e=e||{})e.hasOwnProperty(o)&&(n.hasOwnProperty(o)||jt(o,i,r));for(o in n)n.hasOwnProperty(o)&&(e.hasOwnProperty(o)?t.deepEqual(e[o],n[o])||("geojson"===e[o].type&&"geojson"===n[o].type&&Wt(e,n,o)?i.push({command:Gt.setGeoJSONSourceData,args:[o,n[o].data]}):Ht(o,n,i,r)):Vt(o,n,i))}(e.sources,n.sources,o,r);var s=[];e.layers&&e.layers.forEach((function(t){r[t.source]?i.push({command:Gt.removeLayer,args:[t.id]}):s.push(t)})),i=i.concat(o),function(e,n,i){n=n||[];var r,o,s,a,l,c,u,h=(e=e||[]).map(Zt),d=n.map(Zt),p=e.reduce(Xt,{}),f=n.reduce(Xt,{}),A=h.slice(),g=Object.create(null);for(r=0,o=0;r<h.length;r++)f.hasOwnProperty(s=h[r])?o++:(i.push({command:Gt.removeLayer,args:[s]}),A.splice(A.indexOf(s,o),1));for(r=0,o=0;r<d.length;r++)A[A.length-1-r]!==(s=d[d.length-1-r])&&(p.hasOwnProperty(s)?(i.push({command:Gt.removeLayer,args:[s]}),A.splice(A.lastIndexOf(s,A.length-o),1)):o++,i.push({command:Gt.addLayer,args:[f[s],c=A[A.length-r]]}),A.splice(A.length-r,0,s),g[s]=!0);for(r=0;r<d.length;r++)if(a=p[s=d[r]],l=f[s],!g[s]&&!t.deepEqual(a,l))if(t.deepEqual(a.source,l.source)&&t.deepEqual(a["source-layer"],l["source-layer"])&&t.deepEqual(a.type,l.type)){for(u in qt(a.layout,l.layout,i,s,null,Gt.setLayoutProperty),qt(a.paint,l.paint,i,s,null,Gt.setPaintProperty),t.deepEqual(a.filter,l.filter)||i.push({command:Gt.setFilter,args:[s,l.filter]}),t.deepEqual(a.minzoom,l.minzoom)&&t.deepEqual(a.maxzoom,l.maxzoom)||i.push({command:Gt.setLayerZoomRange,args:[s,l.minzoom,l.maxzoom]}),a)a.hasOwnProperty(u)&&"layout"!==u&&"paint"!==u&&"filter"!==u&&"metadata"!==u&&"minzoom"!==u&&"maxzoom"!==u&&(0===u.indexOf("paint.")?qt(a[u],l[u],i,s,u.slice(6),Gt.setPaintProperty):t.deepEqual(a[u],l[u])||i.push({command:Gt.setLayerProperty,args:[s,u,l[u]]}));for(u in l)l.hasOwnProperty(u)&&!a.hasOwnProperty(u)&&"layout"!==u&&"paint"!==u&&"filter"!==u&&"metadata"!==u&&"minzoom"!==u&&"maxzoom"!==u&&(0===u.indexOf("paint.")?qt(a[u],l[u],i,s,u.slice(6),Gt.setPaintProperty):t.deepEqual(a[u],l[u])||i.push({command:Gt.setLayerProperty,args:[s,u,l[u]]}))}else i.push({command:Gt.removeLayer,args:[s]}),c=A[A.lastIndexOf(s)+1],i.push({command:Gt.addLayer,args:[l,c]})}(s,n.layers,i)}catch(t){console.warn("Unable to compute style diff:",t),i=[{command:Gt.setStyle,args:[n]}]}return i}(this.serialize(),e).filter((function(t){return!(t.command in Ge)}));if(0===i.length)return!1;var r=i.filter((function(t){return!(t.command in Ue)}));if(r.length>0)throw new Error("Unimplemented: "+r.map((function(t){return t.command})).join(", ")+".");return i.forEach((function(t){"setTransition"!==t.command&&n[t.command].apply(n,t.args)})),this.stylesheet=e,!0},n.prototype.addImage=function(e,n){if(this.getImage(e))return this.fire(new t.ErrorEvent(new Error("An image with this name already exists.")));this.imageManager.addImage(e,n),this._afterImageUpdated(e)},n.prototype.updateImage=function(t,e){this.imageManager.updateImage(t,e)},n.prototype.getImage=function(t){return this.imageManager.getImage(t)},n.prototype.removeImage=function(e){if(!this.getImage(e))return this.fire(new t.ErrorEvent(new Error("No image with this name exists.")));this.imageManager.removeImage(e),this._afterImageUpdated(e)},n.prototype._afterImageUpdated=function(e){this._availableImages=this.imageManager.listImages(),this._changedImages[e]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new t.Event("data",{dataType:"style"}))},n.prototype.listImages=function(){return this._checkLoaded(),this.imageManager.listImages()},n.prototype.addSource=function(e,n,i){var r=this;if(void 0===i&&(i={}),this._checkLoaded(),void 0!==this.sourceCaches[e])throw new Error("There is already a source with this ID");if(!n.type)throw new Error("The type property must be defined, but only the following properties were given: "+Object.keys(n).join(", ")+".");if(!(["vector","raster","geojson","video","image"].indexOf(n.type)>=0&&this._validate(t.validateStyle.source,"sources."+e,n,null,i))){this.map&&this.map._collectResourceTiming&&(n.collectResourceTiming=!0);var o=this.sourceCaches[e]=new It(e,n,this.dispatcher);o.style=this,o.setEventedParent(this,(function(){return{isSourceLoaded:r.loaded(),source:o.serialize(),sourceId:e}})),o.onAdd(this.map),this._changed=!0}},n.prototype.removeSource=function(e){if(this._checkLoaded(),void 0===this.sourceCaches[e])throw new Error("There is no source with this ID");for(var n in this._layers)if(this._layers[n].source===e)return this.fire(new t.ErrorEvent(new Error('Source "'+e+'" cannot be removed while layer "'+n+'" is using it.')));var i=this.sourceCaches[e];delete this.sourceCaches[e],delete this._updatedSources[e],i.fire(new t.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:e})),i.setEventedParent(null),i.clearTiles(),i.onRemove&&i.onRemove(this.map),this._changed=!0},n.prototype.setGeoJSONSourceData=function(t,e){this._checkLoaded(),this.sourceCaches[t].getSource().setData(e),this._changed=!0},n.prototype.getSource=function(t){return this.sourceCaches[t]&&this.sourceCaches[t].getSource()},n.prototype.addLayer=function(e,n,i){void 0===i&&(i={}),this._checkLoaded();var r=e.id;if(this.getLayer(r))this.fire(new t.ErrorEvent(new Error('Layer with id "'+r+'" already exists on this map')));else{var o;if("custom"===e.type){if(ze(this,t.validateCustomStyleLayer(e)))return;o=t.createStyleLayer(e)}else{if("object"==typeof e.source&&(this.addSource(r,e.source),e=t.clone$1(e),e=t.extend(e,{source:r})),this._validate(t.validateStyle.layer,"layers."+r,e,{arrayIndex:-1},i))return;o=t.createStyleLayer(e),this._validateLayer(o),o.setEventedParent(this,{layer:{id:r}}),this._serializedLayers[o.id]=o.serialize()}var s=n?this._order.indexOf(n):this._order.length;if(n&&-1===s)this.fire(new t.ErrorEvent(new Error('Layer with id "'+n+'" does not exist on this map.')));else{if(this._order.splice(s,0,r),this._layerOrderChanged=!0,this._layers[r]=o,this._removedLayers[r]&&o.source&&"custom"!==o.type){var a=this._removedLayers[r];delete this._removedLayers[r],a.type!==o.type?this._updatedSources[o.source]="clear":(this._updatedSources[o.source]="reload",this.sourceCaches[o.source].pause())}this._updateLayer(o),o.onAdd&&o.onAdd(this.map)}}},n.prototype.moveLayer=function(e,n){if(this._checkLoaded(),this._changed=!0,this._layers[e]){if(e!==n){var i=this._order.indexOf(e);this._order.splice(i,1);var r=n?this._order.indexOf(n):this._order.length;n&&-1===r?this.fire(new t.ErrorEvent(new Error('Layer with id "'+n+'" does not exist on this map.'))):(this._order.splice(r,0,e),this._layerOrderChanged=!0)}}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be moved.")))},n.prototype.removeLayer=function(e){this._checkLoaded();var n=this._layers[e];if(n){n.setEventedParent(null);var i=this._order.indexOf(e);this._order.splice(i,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[e]=n,delete this._layers[e],delete this._serializedLayers[e],delete this._updatedLayers[e],delete this._updatedPaintProps[e],n.onRemove&&n.onRemove(this.map)}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be removed.")))},n.prototype.getLayer=function(t){return this._layers[t]},n.prototype.hasLayer=function(t){return t in this._layers},n.prototype.setLayerZoomRange=function(e,n,i){this._checkLoaded();var r=this.getLayer(e);r?r.minzoom===n&&r.maxzoom===i||(null!=n&&(r.minzoom=n),null!=i&&(r.maxzoom=i),this._updateLayer(r)):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot have zoom extent.")))},n.prototype.setFilter=function(e,n,i){void 0===i&&(i={}),this._checkLoaded();var r=this.getLayer(e);if(r){if(!t.deepEqual(r.filter,n))return null==n?(r.filter=void 0,void this._updateLayer(r)):void(this._validate(t.validateStyle.filter,"layers."+r.id+".filter",n,null,i)||(r.filter=t.clone$1(n),this._updateLayer(r)))}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be filtered.")))},n.prototype.getFilter=function(e){return t.clone$1(this.getLayer(e).filter)},n.prototype.setLayoutProperty=function(e,n,i,r){void 0===r&&(r={}),this._checkLoaded();var o=this.getLayer(e);o?t.deepEqual(o.getLayoutProperty(n),i)||(o.setLayoutProperty(n,i,r),this._updateLayer(o)):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be styled.")))},n.prototype.getLayoutProperty=function(e,n){var i=this.getLayer(e);if(i)return i.getLayoutProperty(n);this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style.")))},n.prototype.setPaintProperty=function(e,n,i,r){void 0===r&&(r={}),this._checkLoaded();var o=this.getLayer(e);o?t.deepEqual(o.getPaintProperty(n),i)||(o.setPaintProperty(n,i,r)&&this._updateLayer(o),this._changed=!0,this._updatedPaintProps[e]=!0):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be styled.")))},n.prototype.getPaintProperty=function(t,e){return this.getLayer(t).getPaintProperty(e)},n.prototype.setFeatureState=function(e,n){this._checkLoaded();var i=e.source,r=e.sourceLayer,o=this.sourceCaches[i];if(void 0!==o){var s=o.getSource().type;"geojson"===s&&r?this.fire(new t.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):"vector"!==s||r?(void 0===e.id&&this.fire(new t.ErrorEvent(new Error("The feature id parameter must be provided."))),o.setFeatureState(r,e.id,n)):this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new t.ErrorEvent(new Error("The source '"+i+"' does not exist in the map's style.")))},n.prototype.removeFeatureState=function(e,n){this._checkLoaded();var i=e.source,r=this.sourceCaches[i];if(void 0!==r){var o=r.getSource().type,s="vector"===o?e.sourceLayer:void 0;"vector"!==o||s?n&&"string"!=typeof e.id&&"number"!=typeof e.id?this.fire(new t.ErrorEvent(new Error("A feature id is required to remove its specific state property."))):r.removeFeatureState(s,e.id,n):this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new t.ErrorEvent(new Error("The source '"+i+"' does not exist in the map's style.")))},n.prototype.getFeatureState=function(e){this._checkLoaded();var n=e.source,i=e.sourceLayer,r=this.sourceCaches[n];if(void 0!==r){if("vector"!==r.getSource().type||i)return void 0===e.id&&this.fire(new t.ErrorEvent(new Error("The feature id parameter must be provided."))),r.getFeatureState(i,e.id);this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new t.ErrorEvent(new Error("The source '"+n+"' does not exist in the map's style.")))},n.prototype.getTransition=function(){return t.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)},n.prototype.serialize=function(){return t.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,sources:t.mapObject(this.sourceCaches,(function(t){return t.serialize()})),layers:this._serializeLayers(this._order)},(function(t){return void 0!==t}))},n.prototype._updateLayer=function(t){this._updatedLayers[t.id]=!0,t.source&&!this._updatedSources[t.source]&&"raster"!==this.sourceCaches[t.source].getSource().type&&(this._updatedSources[t.source]="reload",this.sourceCaches[t.source].pause()),this._changed=!0},n.prototype._flattenAndSortRenderedFeatures=function(t){for(var e=this,n=function(t){return"fill-extrusion"===e._layers[t].type},i={},r=[],o=this._order.length-1;o>=0;o--){var s=this._order[o];if(n(s)){i[s]=o;for(var a=0,l=t;a<l.length;a+=1){var c=l[a][s];if(c)for(var u=0,h=c;u<h.length;u+=1)r.push(h[u])}}}r.sort((function(t,e){return e.intersectionZ-t.intersectionZ}));for(var d=[],p=this._order.length-1;p>=0;p--){var f=this._order[p];if(n(f))for(var A=r.length-1;A>=0;A--){var g=r[A].feature;if(i[g.layer.id]<p)break;d.push(g),r.pop()}else for(var m=0,y=t;m<y.length;m+=1){var _=y[m][f];if(_)for(var v=0,b=_;v<b.length;v+=1)d.push(b[v].feature)}}return d},n.prototype.queryRenderedFeatures=function(e,n,i){n&&n.filter&&this._validate(t.validateStyle.filter,"queryRenderedFeatures.filter",n.filter,null,n);var r={};if(n&&n.layers){if(!Array.isArray(n.layers))return this.fire(new t.ErrorEvent(new Error("parameters.layers must be an Array."))),[];for(var o=0,s=n.layers;o<s.length;o+=1){var a=s[o],l=this._layers[a];if(!l)return this.fire(new t.ErrorEvent(new Error("The layer '"+a+"' does not exist in the map's style and cannot be queried for features."))),[];r[l.source]=!0}}var c=[];for(var u in n.availableImages=this._availableImages,this.sourceCaches)n.layers&&!r[u]||c.push(F(this.sourceCaches[u],this._layers,this._serializedLayers,e,n,i));return this.placement&&c.push(function(t,e,n,i,r,o,s){for(var a={},l=o.queryRenderedSymbols(i),c=[],u=0,h=Object.keys(l).map(Number);u<h.length;u+=1)c.push(s[h[u]]);c.sort(N);for(var d=function(){var n=f[p],i=n.featureIndex.lookupSymbolFeatures(l[n.bucketInstanceId],e,n.bucketIndex,n.sourceLayerIndex,r.filter,r.layers,r.availableImages,t);for(var o in i){var s=a[o]=a[o]||[],c=i[o];c.sort((function(t,e){var i=n.featureSortOrder;if(i){var r=i.indexOf(t.featureIndex);return i.indexOf(e.featureIndex)-r}return e.featureIndex-t.featureIndex}));for(var u=0,h=c;u<h.length;u+=1)s.push(h[u])}},p=0,f=c;p<f.length;p+=1)d();var A=function(e){a[e].forEach((function(i){var r=i.feature,o=n[t[e].source].getFeatureState(r.layer["source-layer"],r.id);r.source=r.layer.source,r.layer["source-layer"]&&(r.sourceLayer=r.layer["source-layer"]),r.state=o}))};for(var g in a)A(g);return a}(this._layers,this._serializedLayers,this.sourceCaches,e,n,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(c)},n.prototype.querySourceFeatures=function(e,n){n&&n.filter&&this._validate(t.validateStyle.filter,"querySourceFeatures.filter",n.filter,null,n);var i=this.sourceCaches[e];return i?function(t,e){for(var n=t.getRenderableIds().map((function(e){return t.getTileByID(e)})),i=[],r={},o=0;o<n.length;o++){var s=n[o],a=s.tileID.canonical.key;r[a]||(r[a]=!0,s.querySourceFeatures(i,e))}return i}(i,n):[]},n.prototype.addSourceType=function(t,e,i){return n.getSourceType(t)?i(new Error('A source type called "'+t+'" already exists.')):(n.setSourceType(t,e),e.workerSourceURL?void this.dispatcher.broadcast("loadWorkerSource",{name:t,url:e.workerSourceURL},i):i(null,null))},n.prototype.getLight=function(){return this.light.getLight()},n.prototype.setLight=function(e,n){void 0===n&&(n={}),this._checkLoaded();var i=this.light.getLight(),r=!1;for(var o in e)if(!t.deepEqual(e[o],i[o])){r=!0;break}if(r){var s={now:t.browser.now(),transition:t.extend({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(e,n),this.light.updateTransitions(s)}},n.prototype._validate=function(e,n,i,r,o){return void 0===o&&(o={}),(!o||!1!==o.validate)&&ze(this,e.call(t.validateStyle,t.extend({key:n,style:this.serialize(),value:i,styleSpec:t.styleSpec},r)))},n.prototype._remove=function(){for(var e in this._request&&(this._request.cancel(),this._request=null),this._spriteRequest&&(this._spriteRequest.cancel(),this._spriteRequest=null),t.evented.off("pluginStateChange",this._rtlTextPluginCallback),this._layers)this._layers[e].setEventedParent(null);for(var n in this.sourceCaches)this.sourceCaches[n].clearTiles(),this.sourceCaches[n].setEventedParent(null);this.imageManager.setEventedParent(null),this.setEventedParent(null),this.dispatcher.remove()},n.prototype._clearSource=function(t){this.sourceCaches[t].clearTiles()},n.prototype._reloadSource=function(t){this.sourceCaches[t].resume(),this.sourceCaches[t].reload()},n.prototype._updateSources=function(t){for(var e in this.sourceCaches)this.sourceCaches[e].update(t)},n.prototype._generateCollisionBoxes=function(){for(var t in this.sourceCaches)this._reloadSource(t)},n.prototype._updatePlacement=function(e,n,i,r,o){void 0===o&&(o=!1);for(var s=!1,a=!1,l={},c=0,u=this._order;c<u.length;c+=1){var h=this._layers[u[c]];if("symbol"===h.type){if(!l[h.source]){var d=this.sourceCaches[h.source];l[h.source]=d.getRenderableIds(!0).map((function(t){return d.getTileByID(t)})).sort((function(t,e){return e.tileID.overscaledZ-t.tileID.overscaledZ||(t.tileID.isLessThan(e.tileID)?-1:1)}))}var p=this.crossTileSymbolIndex.addLayer(h,l[h.source],e.center.lng);s=s||p}}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((o=o||this._layerOrderChanged||0===i)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(t.browser.now(),e.zoom))&&(this.pauseablePlacement=new Le(e,this._order,o,n,i,r,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,l),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(t.browser.now()),a=!0),s&&this.pauseablePlacement.placement.setStale()),a||s)for(var f=0,A=this._order;f<A.length;f+=1){var g=this._layers[A[f]];"symbol"===g.type&&this.placement.updateLayerOpacities(g,l[g.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(t.browser.now())},n.prototype._releaseSymbolFadeTiles=function(){for(var t in this.sourceCaches)this.sourceCaches[t].releaseSymbolFadeTiles()},n.prototype.getImages=function(t,e,n){this.imageManager.getImages(e.icons,n),this._updateTilesForChangedImages();var i=this.sourceCaches[e.source];i&&i.setDependencies(e.tileID.key,e.type,e.icons)},n.prototype.getGlyphs=function(t,e,n){this.glyphManager.getGlyphs(e.stacks,n)},n.prototype.getResource=function(e,n,i){return t.makeRequest(n,i)},n}(t.Evented);je.getSourceType=function(t){return D[t]},je.setSourceType=function(t,e){D[t]=e},je.registerForPluginStateChange=t.registerForPluginStateChange;var He=t.createLayout([{name:"a_pos",type:"Int16",components:2}]),We=yn("#ifdef GL_ES\nprecision mediump float;\n#else\n#if !defined(lowp)\n#define lowp\n#endif\n#if !defined(mediump)\n#define mediump\n#endif\n#if !defined(highp)\n#define highp\n#endif\n#endif","#ifdef GL_ES\nprecision highp float;\n#else\n#if !defined(lowp)\n#define lowp\n#endif\n#if !defined(mediump)\n#define mediump\n#endif\n#if !defined(highp)\n#define highp\n#endif\n#endif\nvec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec2 unpack_opacity(const float packedOpacity) {int intOpacity=int(packedOpacity)/2;return vec2(float(intOpacity)/127.0,mod(packedOpacity,2.0));}vec4 decode_color(const vec2 encodedColor) {return vec4(unpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0\n);}float unpack_mix_vec2(const vec2 packedValue,const float t) {return mix(packedValue[0],packedValue[1],t);}vec4 unpack_mix_color(const vec4 packedColors,const float t) {vec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));vec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));return mix(minColor,maxColor,t);}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const float tile_units_to_pixels,const vec2 pos) {vec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);return (tile_units_to_pixels*pos+offset)/pattern_size;}"),qe=yn("uniform vec4 u_color;uniform float u_opacity;void main() {gl_FragColor=u_color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),Ze=yn("uniform vec2 u_pattern_tl_a;uniform vec2 u_pattern_br_a;uniform vec2 u_pattern_tl_b;uniform vec2 u_pattern_br_b;uniform vec2 u_texsize;uniform float u_mix;uniform float u_opacity;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(u_pattern_tl_a/u_texsize,u_pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(u_pattern_tl_b/u_texsize,u_pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_mix)*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pattern_size_a;uniform vec2 u_pattern_size_b;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_scale_a;uniform float u_scale_b;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_a*u_pattern_size_a,u_tile_units_to_pixels,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_b*u_pattern_size_b,u_tile_units_to_pixels,a_pos);}"),Xe=yn("varying vec3 v_data;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=v_data.xy;float extrude_length=length(extrude);lowp float antialiasblur=v_data.z;float antialiased_blur=-max(blur,antialiasblur);float opacity_t=smoothstep(0.0,antialiased_blur,extrude_length-1.0);float color_t=stroke_width < 0.01 ? 0.0 : smoothstep(antialiased_blur,0.0,extrude_length-radius/(radius+stroke_width));gl_FragColor=opacity_t*mix(color*opacity,stroke_color*stroke_opacity,color_t);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform bool u_scale_with_map;uniform bool u_pitch_with_map;uniform vec2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;attribute vec2 a_pos;varying vec3 v_data;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvoid main(void) {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);if (u_pitch_with_map) {vec2 corner_position=circle_center;if (u_scale_with_map) {corner_position+=extrude*(radius+stroke_width)*u_extrude_scale;} else {vec4 projected_center=u_matrix*vec4(circle_center,0,1);corner_position+=extrude*(radius+stroke_width)*u_extrude_scale*(projected_center.w/u_camera_to_center_distance);}gl_Position=u_matrix*vec4(corner_position,0,1);} else {gl_Position=u_matrix*vec4(circle_center,0,1);if (u_scale_with_map) {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*u_camera_to_center_distance;} else {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*gl_Position.w;}}lowp float antialiasblur=1.0/u_device_pixel_ratio/(radius+stroke_width);v_data=vec3(extrude.x,extrude.y,antialiasblur);}"),Ke=yn("void main() {gl_FragColor=vec4(1.0);}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),Qe=yn("uniform highp float u_intensity;varying vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#define GAUSS_COEF 0.3989422804014327\nvoid main() {\n#pragma mapbox: initialize highp float weight\nfloat d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);gl_FragColor=vec4(val,1.0,1.0,1.0);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;attribute vec2 a_pos;varying vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#pragma mapbox: define mediump float radius\nconst highp float ZERO=1.0/255.0/16.0;\n#define GAUSS_COEF 0.3989422804014327\nvoid main(void) {\n#pragma mapbox: initialize highp float weight\n#pragma mapbox: initialize mediump float radius\nvec2 unscaled_extrude=vec2(mod(a_pos,2.0)*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec4 pos=vec4(floor(a_pos*0.5)+extrude,0,1);gl_Position=u_matrix*pos;}"),Je=yn("uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;varying vec2 v_pos;void main() {float t=texture2D(u_image,v_pos).r;vec4 color=texture2D(u_color_ramp,vec2(t,0.5));gl_FragColor=color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(0.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_world;attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos*u_world,0,1);v_pos.x=a_pos.x;v_pos.y=1.0-a_pos.y;}"),Ye=yn("varying float v_placed;varying float v_notUsed;void main() {float alpha=0.5;gl_FragColor=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {gl_FragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {gl_FragColor*=.1;}}","attribute vec2 a_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;attribute vec2 a_shift;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;varying float v_placed;varying float v_notUsed;void main() {vec4 projectedPoint=u_matrix*vec4(a_anchor_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);gl_Position=u_matrix*vec4(a_pos,0.0,1.0);gl_Position.xy+=(a_extrude+a_shift)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;}"),$e=yn("varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);gl_FragColor=color*alpha*opacity_t;}","attribute vec2 a_pos;attribute float a_radius;attribute vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(mix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;vec3 tilePos=toTilePosition(quadCenterPos);vec4 clipPos=u_matrix*vec4(tilePos,1.0);highp float camera_to_anchor_distance=clipPos.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=collision;gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),tn=yn("uniform highp vec4 u_color;uniform sampler2D u_overlay;varying vec2 v_uv;void main() {vec4 overlay_color=texture2D(u_overlay,v_uv);gl_FragColor=mix(u_color,overlay_color,overlay_color.a);}","attribute vec2 a_pos;varying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=u_matrix*vec4(a_pos*u_overlay_scale,0,1);}"),en=yn("#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_FragColor=color*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);}"),nn=yn("varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=outline_color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}"),rn=yn("uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=mix(color1,color2,u_fade)*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}"),on=yn("uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_fade)*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}"),sn=yn("varying vec4 v_color;void main() {gl_FragColor=v_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec4 v_color;\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define highp vec4 color\nvoid main() {\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize highp vec4 color\nvec3 normal=a_normal_ed.xyz;base=max(0.0,base);height=max(0.0,height);float t=mod(normal.x,2.0);gl_Position=u_matrix*vec4(a_pos,t > 0.0 ? height : base,1);float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;float directional=clamp(dot(normal/16384.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}"),an=yn("uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);gl_FragColor=mixedColor*v_lighting;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec3 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;base=max(0.0,base);height=max(0.0,height);float t=mod(normal.x,2.0);float z=t > 0.0 ? height : base;gl_Position=u_matrix*vec4(a_pos,z,1);vec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0\n? a_pos\n: vec2(edgedistance,z*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}"),ln=yn("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))/pow(2.0,exaggeration+(19.2562-u_zoom));gl_FragColor=clamp(vec4(deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_dimension;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}"),cn=yn("uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent;\n#define PI 3.141592653589793\nvoid main() {vec4 pixel=texture2D(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);gl_FragColor=accent_color*(1.0-shade_color.a)+shade_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;}"),un=yn("uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_linesofar;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}"),hn=yn("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp vec2 v_uv;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture2D(u_image,v_uv);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;attribute float a_uv_x;attribute float a_split_index;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp vec2 v_uv;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}"),dn=yn("uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);gl_FragColor=color*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}"),pn=yn("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;uniform float u_mix;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture2D(u_image,v_tex_a).a;float sdfdist_b=texture2D(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);alpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_patternscale_a;uniform float u_tex_y_a;uniform vec2 u_patternscale_b;uniform float u_tex_y_b;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);v_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);v_width2=vec2(outset,inset);}"),fn=yn("uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;varying vec2 v_pos0;varying vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture2D(u_image0,v_pos0);vec4 color1=texture2D(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(dot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);gl_FragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos0=(((a_texture_pos/8192.0)-0.5)/u_buffer_scale )+0.5;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}"),An=yn("uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nlowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0),0.0,1.0);v_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;v_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));}"),gn=yn("#define SDF_PX 8.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}"),mn=yn("#define SDF_PX 8.0\n#define SDF 1.0\n#define ICON 0.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;varying vec4 v_data0;varying vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\nreturn;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_texsize_icon;varying vec4 v_data0;varying vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}");function yn(t,e){var n=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,i=e.match(/attribute ([\w]+) ([\w]+)/g),r=t.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),o=e.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),s=o?o.concat(r):r,a={};return{fragmentSource:t=t.replace(n,(function(t,e,n,i,r){return a[r]=!0,"define"===e?"\n#ifndef HAS_UNIFORM_u_"+r+"\nvarying "+n+" "+i+" "+r+";\n#else\nuniform "+n+" "+i+" u_"+r+";\n#endif\n":"\n#ifdef HAS_UNIFORM_u_"+r+"\n "+n+" "+i+" "+r+" = u_"+r+";\n#endif\n"})),vertexSource:e=e.replace(n,(function(t,e,n,i,r){var o="float"===i?"vec2":"vec4",s=r.match(/color/)?"color":o;return a[r]?"define"===e?"\n#ifndef HAS_UNIFORM_u_"+r+"\nuniform lowp float u_"+r+"_t;\nattribute "+n+" "+o+" a_"+r+";\nvarying "+n+" "+i+" "+r+";\n#else\nuniform "+n+" "+i+" u_"+r+";\n#endif\n":"vec4"===s?"\n#ifndef HAS_UNIFORM_u_"+r+"\n "+r+" = a_"+r+";\n#else\n "+n+" "+i+" "+r+" = u_"+r+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+r+"\n "+r+" = unpack_mix_"+s+"(a_"+r+", u_"+r+"_t);\n#else\n "+n+" "+i+" "+r+" = u_"+r+";\n#endif\n":"define"===e?"\n#ifndef HAS_UNIFORM_u_"+r+"\nuniform lowp float u_"+r+"_t;\nattribute "+n+" "+o+" a_"+r+";\n#else\nuniform "+n+" "+i+" u_"+r+";\n#endif\n":"vec4"===s?"\n#ifndef HAS_UNIFORM_u_"+r+"\n "+n+" "+i+" "+r+" = a_"+r+";\n#else\n "+n+" "+i+" "+r+" = u_"+r+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+r+"\n "+n+" "+i+" "+r+" = unpack_mix_"+s+"(a_"+r+", u_"+r+"_t);\n#else\n "+n+" "+i+" "+r+" = u_"+r+";\n#endif\n"})),staticAttributes:i,staticUniforms:s}}var _n=Object.freeze({__proto__:null,prelude:We,background:qe,backgroundPattern:Ze,circle:Xe,clippingMask:Ke,heatmap:Qe,heatmapTexture:Je,collisionBox:Ye,collisionCircle:$e,debug:tn,fill:en,fillOutline:nn,fillOutlinePattern:rn,fillPattern:on,fillExtrusion:sn,fillExtrusionPattern:an,hillshadePrepare:ln,hillshade:cn,line:un,lineGradient:hn,linePattern:dn,lineSDF:pn,raster:fn,symbolIcon:An,symbolSDF:gn,symbolTextAndIcon:mn}),vn=function(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null};function bn(t){for(var e=[],n=0;n<t.length;n++)if(null!==t[n]){var i=t[n].split(" ");e.push(i.pop())}return e}vn.prototype.bind=function(t,e,n,i,r,o,s,a){this.context=t;for(var l=this.boundPaintVertexBuffers.length!==i.length,c=0;!l&&c<i.length;c++)this.boundPaintVertexBuffers[c]!==i[c]&&(l=!0);t.extVertexArrayObject&&this.vao&&this.boundProgram===e&&this.boundLayoutVertexBuffer===n&&!l&&this.boundIndexBuffer===r&&this.boundVertexOffset===o&&this.boundDynamicVertexBuffer===s&&this.boundDynamicVertexBuffer2===a?(t.bindVertexArrayOES.set(this.vao),s&&s.bind(),r&&r.dynamicDraw&&r.bind(),a&&a.bind()):this.freshBind(e,n,i,r,o,s,a)},vn.prototype.freshBind=function(t,e,n,i,r,o,s){var a,l=t.numAttributes,c=this.context,u=c.gl;if(c.extVertexArrayObject)this.vao&&this.destroy(),this.vao=c.extVertexArrayObject.createVertexArrayOES(),c.bindVertexArrayOES.set(this.vao),a=0,this.boundProgram=t,this.boundLayoutVertexBuffer=e,this.boundPaintVertexBuffers=n,this.boundIndexBuffer=i,this.boundVertexOffset=r,this.boundDynamicVertexBuffer=o,this.boundDynamicVertexBuffer2=s;else{a=c.currentNumAttributes||0;for(var h=l;h<a;h++)u.disableVertexAttribArray(h)}e.enableAttributes(u,t);for(var d=0,p=n;d<p.length;d+=1)p[d].enableAttributes(u,t);o&&o.enableAttributes(u,t),s&&s.enableAttributes(u,t),e.bind(),e.setVertexAttribPointers(u,t,r);for(var f=0,A=n;f<A.length;f+=1){var g=A[f];g.bind(),g.setVertexAttribPointers(u,t,r)}o&&(o.bind(),o.setVertexAttribPointers(u,t,r)),i&&i.bind(),s&&(s.bind(),s.setVertexAttribPointers(u,t,r)),c.currentNumAttributes=l},vn.prototype.destroy=function(){this.vao&&(this.context.extVertexArrayObject.deleteVertexArrayOES(this.vao),this.vao=null)};var xn=function(t,e,n,i,r,o){var s=t.gl;this.program=s.createProgram();for(var a=bn(n.staticAttributes),l=i?i.getBinderAttributes():[],c=a.concat(l),u=n.staticUniforms?bn(n.staticUniforms):[],h=i?i.getBinderUniforms():[],d=[],p=0,f=u.concat(h);p<f.length;p+=1){var A=f[p];d.indexOf(A)<0&&d.push(A)}var g=i?i.defines():[];o&&g.push("#define OVERDRAW_INSPECTOR;");var m=g.concat(We.fragmentSource,n.fragmentSource).join("\n"),y=g.concat(We.vertexSource,n.vertexSource).join("\n"),_=s.createShader(s.FRAGMENT_SHADER);if(s.isContextLost())this.failedToCreate=!0;else{s.shaderSource(_,m),s.compileShader(_),s.attachShader(this.program,_);var v=s.createShader(s.VERTEX_SHADER);if(s.isContextLost())this.failedToCreate=!0;else{s.shaderSource(v,y),s.compileShader(v),s.attachShader(this.program,v),this.attributes={};var b={};this.numAttributes=c.length;for(var x=0;x<this.numAttributes;x++)c[x]&&(s.bindAttribLocation(this.program,x,c[x]),this.attributes[c[x]]=x);s.linkProgram(this.program),s.deleteShader(v),s.deleteShader(_);for(var w=0;w<d.length;w++){var E=d[w];if(E&&!b[E]){var C=s.getUniformLocation(this.program,E);C&&(b[E]=C)}}this.fixedUniforms=r(t,b),this.binderUniforms=i?i.getUniforms(t,b):[]}}};function wn(t,e,n){var i=1/de(n,1,e.transform.tileZoom),r=Math.pow(2,n.tileID.overscaledZ),o=n.tileSize*Math.pow(2,e.transform.tileZoom)/r,s=o*(n.tileID.canonical.x+n.tileID.wrap*r),a=o*n.tileID.canonical.y;return{u_image:0,u_texsize:n.imageAtlasTexture.size,u_scale:[i,t.fromScale,t.toScale],u_fade:t.t,u_pixel_coord_upper:[s>>16,a>>16],u_pixel_coord_lower:[65535&s,65535&a]}}xn.prototype.draw=function(t,e,n,i,r,o,s,a,l,c,u,h,d,p,f,A){var g,m=t.gl;if(!this.failedToCreate){for(var y in t.program.set(this.program),t.setDepthMode(n),t.setStencilMode(i),t.setColorMode(r),t.setCullFace(o),this.fixedUniforms)this.fixedUniforms[y].set(s[y]);p&&p.setUniforms(t,this.binderUniforms,h,{zoom:d});for(var _=(g={},g[m.LINES]=2,g[m.TRIANGLES]=3,g[m.LINE_STRIP]=1,g)[e],v=0,b=u.get();v<b.length;v+=1){var x=b[v],w=x.vaos||(x.vaos={});(w[a]||(w[a]=new vn)).bind(t,this,l,p?p.getPaintVertexBuffers():[],c,x.vertexOffset,f,A),m.drawElements(e,x.primitiveLength*_,m.UNSIGNED_SHORT,x.primitiveOffset*_*2)}}};var En=function(e,n,i,r){var o=n.style.light,s=o.properties.get("position"),a=[s.x,s.y,s.z],l=t.create$1();"viewport"===o.properties.get("anchor")&&t.fromRotation(l,-n.transform.angle),t.transformMat3(a,a,l);var c=o.properties.get("color");return{u_matrix:e,u_lightpos:a,u_lightintensity:o.properties.get("intensity"),u_lightcolor:[c.r,c.g,c.b],u_vertical_gradient:+i,u_opacity:r}},Cn=function(e,n,i,r,o,s,a){return t.extend(En(e,n,i,r),wn(s,n,a),{u_height_factor:-Math.pow(2,o.overscaledZ)/a.tileSize/8})},Tn=function(t){return{u_matrix:t}},Sn=function(e,n,i,r){return t.extend(Tn(e),wn(i,n,r))},Pn=function(t,e){return{u_matrix:t,u_world:e}},Mn=function(e,n,i,r,o){return t.extend(Sn(e,n,i,r),{u_world:o})},In=function(e,n,i,r){var o,s,a=e.transform;if("map"===r.paint.get("circle-pitch-alignment")){var l=de(i,1,a.zoom);o=!0,s=[l,l]}else o=!1,s=a.pixelsToGLUnits;return{u_camera_to_center_distance:a.cameraToCenterDistance,u_scale_with_map:+("map"===r.paint.get("circle-pitch-scale")),u_matrix:e.translatePosMatrix(n.posMatrix,i,r.paint.get("circle-translate"),r.paint.get("circle-translate-anchor")),u_pitch_with_map:+o,u_device_pixel_ratio:t.browser.devicePixelRatio,u_extrude_scale:s}},Bn=function(t,e,n){var i=de(n,1,e.zoom),r=Math.pow(2,e.zoom-n.tileID.overscaledZ),o=n.tileID.overscaleFactor();return{u_matrix:t,u_camera_to_center_distance:e.cameraToCenterDistance,u_pixels_to_tile_units:i,u_extrude_scale:[e.pixelsToGLUnits[0]/(i*r),e.pixelsToGLUnits[1]/(i*r)],u_overscale_factor:o}},Rn=function(t,e,n){return{u_matrix:t,u_inv_matrix:e,u_camera_to_center_distance:n.cameraToCenterDistance,u_viewport_size:[n.width,n.height]}},Ln=function(t,e,n){return void 0===n&&(n=1),{u_matrix:t,u_color:e,u_overlay:0,u_overlay_scale:n}},On=function(t){return{u_matrix:t}},Dn=function(t,e,n,i){return{u_matrix:t,u_extrude_scale:de(e,1,n),u_intensity:i}},kn=function(e,n,i){var r=e.transform;return{u_matrix:Gn(e,n,i),u_ratio:1/de(n,1,r.zoom),u_device_pixel_ratio:t.browser.devicePixelRatio,u_units_to_pixels:[1/r.pixelsToGLUnits[0],1/r.pixelsToGLUnits[1]]}},Fn=function(e,n,i,r){return t.extend(kn(e,n,i),{u_image:0,u_image_height:r})},Nn=function(e,n,i,r){var o=e.transform,s=Un(n,o);return{u_matrix:Gn(e,n,i),u_texsize:n.imageAtlasTexture.size,u_ratio:1/de(n,1,o.zoom),u_device_pixel_ratio:t.browser.devicePixelRatio,u_image:0,u_scale:[s,r.fromScale,r.toScale],u_fade:r.t,u_units_to_pixels:[1/o.pixelsToGLUnits[0],1/o.pixelsToGLUnits[1]]}},zn=function(e,n,i,r,o){var s=e.lineAtlas,a=Un(n,e.transform),l="round"===i.layout.get("line-cap"),c=s.getDash(r.from,l),u=s.getDash(r.to,l),h=c.width*o.fromScale,d=u.width*o.toScale;return t.extend(kn(e,n,i),{u_patternscale_a:[a/h,-c.height/2],u_patternscale_b:[a/d,-u.height/2],u_sdfgamma:s.width/(256*Math.min(h,d)*t.browser.devicePixelRatio)/2,u_image:0,u_tex_y_a:c.y,u_tex_y_b:u.y,u_mix:o.t})};function Un(t,e){return 1/de(t,1,e.tileZoom)}function Gn(t,e,n){return t.translatePosMatrix(e.tileID.posMatrix,e,n.paint.get("line-translate"),n.paint.get("line-translate-anchor"))}var Vn=function(t,e,n,i,r){return{u_matrix:t,u_tl_parent:e,u_scale_parent:n,u_buffer_scale:1,u_fade_t:i.mix,u_opacity:i.opacity*r.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:r.paint.get("raster-brightness-min"),u_brightness_high:r.paint.get("raster-brightness-max"),u_saturation_factor:(s=r.paint.get("raster-saturation"),s>0?1-1/(1.001-s):-s),u_contrast_factor:(o=r.paint.get("raster-contrast"),o>0?1/(1-o):1+o),u_spin_weights:jn(r.paint.get("raster-hue-rotate"))};var o,s};function jn(t){t*=Math.PI/180;var e=Math.sin(t),n=Math.cos(t);return[(2*n+1)/3,(-Math.sqrt(3)*e-n+1)/3,(Math.sqrt(3)*e-n+1)/3]}var Hn,Wn=function(t,e,n,i,r,o,s,a,l,c){var u=r.transform;return{u_is_size_zoom_constant:+("constant"===t||"source"===t),u_is_size_feature_constant:+("constant"===t||"camera"===t),u_size_t:e?e.uSizeT:0,u_size:e?e.uSize:0,u_camera_to_center_distance:u.cameraToCenterDistance,u_pitch:u.pitch/360*2*Math.PI,u_rotate_symbol:+n,u_aspect_ratio:u.width/u.height,u_fade_change:r.options.fadeDuration?r.symbolFadeChange:1,u_matrix:o,u_label_plane_matrix:s,u_coord_matrix:a,u_is_text:+l,u_pitch_with_map:+i,u_texsize:c,u_texture:0}},qn=function(e,n,i,r,o,s,a,l,c,u,h){var d=o.transform;return t.extend(Wn(e,n,i,r,o,s,a,l,c,u),{u_gamma_scale:r?Math.cos(d._pitch)*d.cameraToCenterDistance:1,u_device_pixel_ratio:t.browser.devicePixelRatio,u_is_halo:+h})},Zn=function(e,n,i,r,o,s,a,l,c,u){return t.extend(qn(e,n,i,r,o,s,a,l,!0,c,!0),{u_texsize_icon:u,u_texture_icon:1})},Xn=function(t,e,n){return{u_matrix:t,u_opacity:e,u_color:n}},Kn=function(e,n,i,r,o,s){return t.extend(function(t,e,n,i){var r=n.imageManager.getPattern(t.from.toString()),o=n.imageManager.getPattern(t.to.toString()),s=n.imageManager.getPixelSize(),a=s.width,l=s.height,c=Math.pow(2,i.tileID.overscaledZ),u=i.tileSize*Math.pow(2,n.transform.tileZoom)/c,h=u*(i.tileID.canonical.x+i.tileID.wrap*c),d=u*i.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:r.tl,u_pattern_br_a:r.br,u_pattern_tl_b:o.tl,u_pattern_br_b:o.br,u_texsize:[a,l],u_mix:e.t,u_pattern_size_a:r.displaySize,u_pattern_size_b:o.displaySize,u_scale_a:e.fromScale,u_scale_b:e.toScale,u_tile_units_to_pixels:1/de(i,1,n.transform.tileZoom),u_pixel_coord_upper:[h>>16,d>>16],u_pixel_coord_lower:[65535&h,65535&d]}}(r,s,i,o),{u_matrix:e,u_opacity:n})},Qn={fillExtrusion:function(e,n){return{u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_lightpos:new t.Uniform3f(e,n.u_lightpos),u_lightintensity:new t.Uniform1f(e,n.u_lightintensity),u_lightcolor:new t.Uniform3f(e,n.u_lightcolor),u_vertical_gradient:new t.Uniform1f(e,n.u_vertical_gradient),u_opacity:new t.Uniform1f(e,n.u_opacity)}},fillExtrusionPattern:function(e,n){return{u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_lightpos:new t.Uniform3f(e,n.u_lightpos),u_lightintensity:new t.Uniform1f(e,n.u_lightintensity),u_lightcolor:new t.Uniform3f(e,n.u_lightcolor),u_vertical_gradient:new t.Uniform1f(e,n.u_vertical_gradient),u_height_factor:new t.Uniform1f(e,n.u_height_factor),u_image:new t.Uniform1i(e,n.u_image),u_texsize:new t.Uniform2f(e,n.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,n.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,n.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,n.u_scale),u_fade:new t.Uniform1f(e,n.u_fade),u_opacity:new t.Uniform1f(e,n.u_opacity)}},fill:function(e,n){return{u_matrix:new t.UniformMatrix4f(e,n.u_matrix)}},fillPattern:function(e,n){return{u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_image:new t.Uniform1i(e,n.u_image),u_texsize:new t.Uniform2f(e,n.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,n.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,n.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,n.u_scale),u_fade:new t.Uniform1f(e,n.u_fade)}},fillOutline:function(e,n){return{u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_world:new t.Uniform2f(e,n.u_world)}},fillOutlinePattern:function(e,n){return{u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_world:new t.Uniform2f(e,n.u_world),u_image:new t.Uniform1i(e,n.u_image),u_texsize:new t.Uniform2f(e,n.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,n.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,n.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,n.u_scale),u_fade:new t.Uniform1f(e,n.u_fade)}},circle:function(e,n){return{u_camera_to_center_distance:new t.Uniform1f(e,n.u_camera_to_center_distance),u_scale_with_map:new t.Uniform1i(e,n.u_scale_with_map),u_pitch_with_map:new t.Uniform1i(e,n.u_pitch_with_map),u_extrude_scale:new t.Uniform2f(e,n.u_extrude_scale),u_device_pixel_ratio:new t.Uniform1f(e,n.u_device_pixel_ratio),u_matrix:new t.UniformMatrix4f(e,n.u_matrix)}},collisionBox:function(e,n){return{u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_camera_to_center_distance:new t.Uniform1f(e,n.u_camera_to_center_distance),u_pixels_to_tile_units:new t.Uniform1f(e,n.u_pixels_to_tile_units),u_extrude_scale:new t.Uniform2f(e,n.u_extrude_scale),u_overscale_factor:new t.Uniform1f(e,n.u_overscale_factor)}},collisionCircle:function(e,n){return{u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_inv_matrix:new t.UniformMatrix4f(e,n.u_inv_matrix),u_camera_to_center_distance:new t.Uniform1f(e,n.u_camera_to_center_distance),u_viewport_size:new t.Uniform2f(e,n.u_viewport_size)}},debug:function(e,n){return{u_color:new t.UniformColor(e,n.u_color),u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_overlay:new t.Uniform1i(e,n.u_overlay),u_overlay_scale:new t.Uniform1f(e,n.u_overlay_scale)}},clippingMask:function(e,n){return{u_matrix:new t.UniformMatrix4f(e,n.u_matrix)}},heatmap:function(e,n){return{u_extrude_scale:new t.Uniform1f(e,n.u_extrude_scale),u_intensity:new t.Uniform1f(e,n.u_intensity),u_matrix:new t.UniformMatrix4f(e,n.u_matrix)}},heatmapTexture:function(e,n){return{u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_world:new t.Uniform2f(e,n.u_world),u_image:new t.Uniform1i(e,n.u_image),u_color_ramp:new t.Uniform1i(e,n.u_color_ramp),u_opacity:new t.Uniform1f(e,n.u_opacity)}},hillshade:function(e,n){return{u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_image:new t.Uniform1i(e,n.u_image),u_latrange:new t.Uniform2f(e,n.u_latrange),u_light:new t.Uniform2f(e,n.u_light),u_shadow:new t.UniformColor(e,n.u_shadow),u_highlight:new t.UniformColor(e,n.u_highlight),u_accent:new t.UniformColor(e,n.u_accent)}},hillshadePrepare:function(e,n){return{u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_image:new t.Uniform1i(e,n.u_image),u_dimension:new t.Uniform2f(e,n.u_dimension),u_zoom:new t.Uniform1f(e,n.u_zoom),u_unpack:new t.Uniform4f(e,n.u_unpack)}},line:function(e,n){return{u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_ratio:new t.Uniform1f(e,n.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,n.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,n.u_units_to_pixels)}},lineGradient:function(e,n){return{u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_ratio:new t.Uniform1f(e,n.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,n.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,n.u_units_to_pixels),u_image:new t.Uniform1i(e,n.u_image),u_image_height:new t.Uniform1f(e,n.u_image_height)}},linePattern:function(e,n){return{u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_texsize:new t.Uniform2f(e,n.u_texsize),u_ratio:new t.Uniform1f(e,n.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,n.u_device_pixel_ratio),u_image:new t.Uniform1i(e,n.u_image),u_units_to_pixels:new t.Uniform2f(e,n.u_units_to_pixels),u_scale:new t.Uniform3f(e,n.u_scale),u_fade:new t.Uniform1f(e,n.u_fade)}},lineSDF:function(e,n){return{u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_ratio:new t.Uniform1f(e,n.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,n.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,n.u_units_to_pixels),u_patternscale_a:new t.Uniform2f(e,n.u_patternscale_a),u_patternscale_b:new t.Uniform2f(e,n.u_patternscale_b),u_sdfgamma:new t.Uniform1f(e,n.u_sdfgamma),u_image:new t.Uniform1i(e,n.u_image),u_tex_y_a:new t.Uniform1f(e,n.u_tex_y_a),u_tex_y_b:new t.Uniform1f(e,n.u_tex_y_b),u_mix:new t.Uniform1f(e,n.u_mix)}},raster:function(e,n){return{u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_tl_parent:new t.Uniform2f(e,n.u_tl_parent),u_scale_parent:new t.Uniform1f(e,n.u_scale_parent),u_buffer_scale:new t.Uniform1f(e,n.u_buffer_scale),u_fade_t:new t.Uniform1f(e,n.u_fade_t),u_opacity:new t.Uniform1f(e,n.u_opacity),u_image0:new t.Uniform1i(e,n.u_image0),u_image1:new t.Uniform1i(e,n.u_image1),u_brightness_low:new t.Uniform1f(e,n.u_brightness_low),u_brightness_high:new t.Uniform1f(e,n.u_brightness_high),u_saturation_factor:new t.Uniform1f(e,n.u_saturation_factor),u_contrast_factor:new t.Uniform1f(e,n.u_contrast_factor),u_spin_weights:new t.Uniform3f(e,n.u_spin_weights)}},symbolIcon:function(e,n){return{u_is_size_zoom_constant:new t.Uniform1i(e,n.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,n.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,n.u_size_t),u_size:new t.Uniform1f(e,n.u_size),u_camera_to_center_distance:new t.Uniform1f(e,n.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,n.u_pitch),u_rotate_symbol:new t.Uniform1i(e,n.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,n.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,n.u_fade_change),u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,n.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,n.u_coord_matrix),u_is_text:new t.Uniform1i(e,n.u_is_text),u_pitch_with_map:new t.Uniform1i(e,n.u_pitch_with_map),u_texsize:new t.Uniform2f(e,n.u_texsize),u_texture:new t.Uniform1i(e,n.u_texture)}},symbolSDF:function(e,n){return{u_is_size_zoom_constant:new t.Uniform1i(e,n.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,n.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,n.u_size_t),u_size:new t.Uniform1f(e,n.u_size),u_camera_to_center_distance:new t.Uniform1f(e,n.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,n.u_pitch),u_rotate_symbol:new t.Uniform1i(e,n.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,n.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,n.u_fade_change),u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,n.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,n.u_coord_matrix),u_is_text:new t.Uniform1i(e,n.u_is_text),u_pitch_with_map:new t.Uniform1i(e,n.u_pitch_with_map),u_texsize:new t.Uniform2f(e,n.u_texsize),u_texture:new t.Uniform1i(e,n.u_texture),u_gamma_scale:new t.Uniform1f(e,n.u_gamma_scale),u_device_pixel_ratio:new t.Uniform1f(e,n.u_device_pixel_ratio),u_is_halo:new t.Uniform1i(e,n.u_is_halo)}},symbolTextAndIcon:function(e,n){return{u_is_size_zoom_constant:new t.Uniform1i(e,n.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,n.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,n.u_size_t),u_size:new t.Uniform1f(e,n.u_size),u_camera_to_center_distance:new t.Uniform1f(e,n.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,n.u_pitch),u_rotate_symbol:new t.Uniform1i(e,n.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,n.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,n.u_fade_change),u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,n.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,n.u_coord_matrix),u_is_text:new t.Uniform1i(e,n.u_is_text),u_pitch_with_map:new t.Uniform1i(e,n.u_pitch_with_map),u_texsize:new t.Uniform2f(e,n.u_texsize),u_texsize_icon:new t.Uniform2f(e,n.u_texsize_icon),u_texture:new t.Uniform1i(e,n.u_texture),u_texture_icon:new t.Uniform1i(e,n.u_texture_icon),u_gamma_scale:new t.Uniform1f(e,n.u_gamma_scale),u_device_pixel_ratio:new t.Uniform1f(e,n.u_device_pixel_ratio),u_is_halo:new t.Uniform1i(e,n.u_is_halo)}},background:function(e,n){return{u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_opacity:new t.Uniform1f(e,n.u_opacity),u_color:new t.UniformColor(e,n.u_color)}},backgroundPattern:function(e,n){return{u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_opacity:new t.Uniform1f(e,n.u_opacity),u_image:new t.Uniform1i(e,n.u_image),u_pattern_tl_a:new t.Uniform2f(e,n.u_pattern_tl_a),u_pattern_br_a:new t.Uniform2f(e,n.u_pattern_br_a),u_pattern_tl_b:new t.Uniform2f(e,n.u_pattern_tl_b),u_pattern_br_b:new t.Uniform2f(e,n.u_pattern_br_b),u_texsize:new t.Uniform2f(e,n.u_texsize),u_mix:new t.Uniform1f(e,n.u_mix),u_pattern_size_a:new t.Uniform2f(e,n.u_pattern_size_a),u_pattern_size_b:new t.Uniform2f(e,n.u_pattern_size_b),u_scale_a:new t.Uniform1f(e,n.u_scale_a),u_scale_b:new t.Uniform1f(e,n.u_scale_b),u_pixel_coord_upper:new t.Uniform2f(e,n.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,n.u_pixel_coord_lower),u_tile_units_to_pixels:new t.Uniform1f(e,n.u_tile_units_to_pixels)}}};function Jn(e,n,i,r,o,s,a){for(var l=e.context,c=l.gl,u=e.useProgram("collisionBox"),h=[],d=0,p=0,f=0;f<r.length;f++){var A=r[f],g=n.getTile(A),m=g.getBucket(i);if(m){var y=A.posMatrix;0===o[0]&&0===o[1]||(y=e.translatePosMatrix(A.posMatrix,g,o,s));var _=a?m.textCollisionBox:m.iconCollisionBox,v=m.collisionCircleArray;if(v.length>0){var b=t.create(),x=y;t.mul(b,m.placementInvProjMatrix,e.transform.glCoordMatrix),t.mul(b,b,m.placementViewportMatrix),h.push({circleArray:v,circleOffset:p,transform:x,invTransform:b}),p=d+=v.length/4}_&&u.draw(l,c.LINES,Ct.disabled,Tt.disabled,e.colorModeForRenderPass(),Pt.disabled,Bn(y,e.transform,g),i.id,_.layoutVertexBuffer,_.indexBuffer,_.segments,null,e.transform.zoom,null,null,_.collisionVertexBuffer)}}if(a&&h.length){var w=e.useProgram("collisionCircle"),E=new t.StructArrayLayout2f1f2i16;E.resize(4*d),E._trim();for(var C=0,T=0,S=h;T<S.length;T+=1)for(var P=S[T],M=0;M<P.circleArray.length/4;M++){var I=4*M,B=P.circleArray[I+0],R=P.circleArray[I+1],L=P.circleArray[I+2],O=P.circleArray[I+3];E.emplace(C++,B,R,L,O,0),E.emplace(C++,B,R,L,O,1),E.emplace(C++,B,R,L,O,2),E.emplace(C++,B,R,L,O,3)}(!Hn||Hn.length<2*d)&&(Hn=function(e){var n=2*e,i=new t.StructArrayLayout3ui6;i.resize(n),i._trim();for(var r=0;r<n;r++){var o=6*r;i.uint16[o+0]=4*r+0,i.uint16[o+1]=4*r+1,i.uint16[o+2]=4*r+2,i.uint16[o+3]=4*r+2,i.uint16[o+4]=4*r+3,i.uint16[o+5]=4*r+0}return i}(d));for(var D=l.createIndexBuffer(Hn,!0),k=l.createVertexBuffer(E,t.collisionCircleLayout.members,!0),F=0,N=h;F<N.length;F+=1){var z=N[F],U=Rn(z.transform,z.invTransform,e.transform);w.draw(l,c.TRIANGLES,Ct.disabled,Tt.disabled,e.colorModeForRenderPass(),Pt.disabled,U,i.id,k,D,t.SegmentVector.simpleSegment(0,2*z.circleOffset,z.circleArray.length,z.circleArray.length/2),null,e.transform.zoom,null,null,null)}k.destroy(),D.destroy()}}var Yn=t.identity(new Float32Array(16));function $n(e,n,i,r,o,s){var a=t.getAnchorAlignment(e),l=-(a.horizontalAlign-.5)*n,c=-(a.verticalAlign-.5)*i,u=t.evaluateVariableOffset(e,r);return new t.Point((l/o+u[0])*s,(c/o+u[1])*s)}function ti(e,n,i,r,o,s,a,l,c,u,h){var d=e.text.placedSymbolArray,p=e.text.dynamicLayoutVertexArray,f=e.icon.dynamicLayoutVertexArray,A={};p.clear();for(var g=0;g<d.length;g++){var m=d.get(g),y=m.hidden||!m.crossTileID||e.allowVerticalPlacement&&!m.placedOrientation?null:r[m.crossTileID];if(y){var _=new t.Point(m.anchorX,m.anchorY),v=$t(_,i?l:a),b=te(s.cameraToCenterDistance,v.signedDistanceFromCamera),x=o.evaluateSizeForFeature(e.textSizeData,u,m)*b/t.ONE_EM;i&&(x*=e.tilePixelRatio/c);for(var w=$n(y.anchor,y.width,y.height,y.textOffset,y.textBoxScale,x),E=i?$t(_.add(w),a).point:v.point.add(n?w.rotate(-s.angle):w),C=e.allowVerticalPlacement&&m.placedOrientation===t.WritingMode.vertical?Math.PI/2:0,T=0;T<m.numGlyphs;T++)t.addDynamicAttributes(p,E,C);h&&m.associatedIconIndex>=0&&(A[m.associatedIconIndex]={shiftedAnchor:E,angle:C})}else ce(m.numGlyphs,p)}if(h){f.clear();for(var S=e.icon.placedSymbolArray,P=0;P<S.length;P++){var M=S.get(P);if(M.hidden)ce(M.numGlyphs,f);else{var I=A[P];if(I)for(var B=0;B<M.numGlyphs;B++)t.addDynamicAttributes(f,I.shiftedAnchor,I.angle);else ce(M.numGlyphs,f)}}e.icon.dynamicLayoutVertexBuffer.updateData(f)}e.text.dynamicLayoutVertexBuffer.updateData(p)}function ei(t,e,n){return n.iconsInText&&e?"symbolTextAndIcon":t?"symbolSDF":"symbolIcon"}function ni(e,n,i,r,o,s,a,l,c,u,h,d){for(var p=e.context,f=p.gl,A=e.transform,g="map"===l,m="map"===c,y=g&&"point"!==i.layout.get("symbol-placement"),_=g&&!m&&!y,v=void 0!==i.layout.get("symbol-sort-key").constantOr(1),b=!1,x=e.depthModeForSublayer(0,Ct.ReadOnly),w=i.layout.get("text-variable-anchor"),E=[],C=0,T=r;C<T.length;C+=1){var S=T[C],P=n.getTile(S),M=P.getBucket(i);if(M){var I=o?M.text:M.icon;if(I&&I.segments.get().length){var B=I.programConfigurations.get(i.id),R=o||M.sdfIcons,L=o?M.textSizeData:M.iconSizeData,O=m||0!==A.pitch,D=e.useProgram(ei(R,o,M),B),k=t.evaluateSizeForZoom(L,A.zoom),F=void 0,N=[0,0],z=void 0,U=void 0,G=null,V=void 0;if(o)z=P.glyphAtlasTexture,U=f.LINEAR,F=P.glyphAtlasTexture.size,M.iconsInText&&(N=P.imageAtlasTexture.size,G=P.imageAtlasTexture,V=O||e.options.rotating||e.options.zooming||"composite"===L.kind||"camera"===L.kind?f.LINEAR:f.NEAREST);else{var j=1!==i.layout.get("icon-size").constantOr(0)||M.iconsNeedLinear;z=P.imageAtlasTexture,U=R||e.options.rotating||e.options.zooming||j||O?f.LINEAR:f.NEAREST,F=P.imageAtlasTexture.size}var H=de(P,1,e.transform.zoom),W=Jt(S.posMatrix,m,g,e.transform,H),q=Yt(S.posMatrix,m,g,e.transform,H),Z=w&&M.hasTextData(),X="none"!==i.layout.get("icon-text-fit")&&Z&&M.hasIconData();y&&ne(M,S.posMatrix,e,o,W,q,m,u);var K=e.translatePosMatrix(S.posMatrix,P,s,a),Q=y||o&&w||X?Yn:W,J=e.translatePosMatrix(q,P,s,a,!0),Y=R&&0!==i.paint.get(o?"text-halo-width":"icon-halo-width").constantOr(1),$={program:D,buffers:I,uniformValues:R?M.iconsInText?Zn(L.kind,k,_,m,e,K,Q,J,F,N):qn(L.kind,k,_,m,e,K,Q,J,o,F,!0):Wn(L.kind,k,_,m,e,K,Q,J,o,F),atlasTexture:z,atlasTextureIcon:G,atlasInterpolation:U,atlasInterpolationIcon:V,isSDF:R,hasHalo:Y};if(v&&M.canOverlap){b=!0;for(var tt=0,et=I.segments.get();tt<et.length;tt+=1){var nt=et[tt];E.push({segments:new t.SegmentVector([nt]),sortKey:nt.sortKey,state:$})}}else E.push({segments:I.segments,sortKey:0,state:$})}}}b&&E.sort((function(t,e){return t.sortKey-e.sortKey}));for(var it=0,rt=E;it<rt.length;it+=1){var ot=rt[it],st=ot.state;if(p.activeTexture.set(f.TEXTURE0),st.atlasTexture.bind(st.atlasInterpolation,f.CLAMP_TO_EDGE),st.atlasTextureIcon&&(p.activeTexture.set(f.TEXTURE1),st.atlasTextureIcon&&st.atlasTextureIcon.bind(st.atlasInterpolationIcon,f.CLAMP_TO_EDGE)),st.isSDF){var at=st.uniformValues;st.hasHalo&&(at.u_is_halo=1,ii(st.buffers,ot.segments,i,e,st.program,x,h,d,at)),at.u_is_halo=0}ii(st.buffers,ot.segments,i,e,st.program,x,h,d,st.uniformValues)}}function ii(t,e,n,i,r,o,s,a,l){var c=i.context;r.draw(c,c.gl.TRIANGLES,o,s,a,Pt.disabled,l,n.id,t.layoutVertexBuffer,t.indexBuffer,e,n.paint,i.transform.zoom,t.programConfigurations.get(n.id),t.dynamicLayoutVertexBuffer,t.opacityVertexBuffer)}function ri(t,e,n,i,r,o,s){var a,l,c,u,h,d=t.context.gl,p=n.paint.get("fill-pattern"),f=p&&p.constantOr(1),A=n.getCrossfadeParameters();s?(l=f&&!n.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",a=d.LINES):(l=f?"fillPattern":"fill",a=d.TRIANGLES);for(var g=0,m=i;g<m.length;g+=1){var y=m[g],_=e.getTile(y);if(!f||_.patternsLoaded()){var v=_.getBucket(n);if(v){var b=v.programConfigurations.get(n.id),x=t.useProgram(l,b);f&&(t.context.activeTexture.set(d.TEXTURE0),_.imageAtlasTexture.bind(d.LINEAR,d.CLAMP_TO_EDGE),b.updatePaintBuffers(A));var w=p.constantOr(null);if(w&&_.imageAtlas){var E=_.imageAtlas,C=E.patternPositions[w.to.toString()],T=E.patternPositions[w.from.toString()];C&&T&&b.setConstantPatternPositions(C,T)}var S=t.translatePosMatrix(y.posMatrix,_,n.paint.get("fill-translate"),n.paint.get("fill-translate-anchor"));if(s){u=v.indexBuffer2,h=v.segments2;var P=[d.drawingBufferWidth,d.drawingBufferHeight];c="fillOutlinePattern"===l&&f?Mn(S,t,A,_,P):Pn(S,P)}else u=v.indexBuffer,h=v.segments,c=f?Sn(S,t,A,_):Tn(S);x.draw(t.context,a,r,t.stencilModeForClipping(y),o,Pt.disabled,c,n.id,v.layoutVertexBuffer,u,h,n.paint,t.transform.zoom,b)}}}}function oi(t,e,n,i,r,o,s){for(var a=t.context,l=a.gl,c=n.paint.get("fill-extrusion-pattern"),u=c.constantOr(1),h=n.getCrossfadeParameters(),d=n.paint.get("fill-extrusion-opacity"),p=0,f=i;p<f.length;p+=1){var A=f[p],g=e.getTile(A),m=g.getBucket(n);if(m){var y=m.programConfigurations.get(n.id),_=t.useProgram(u?"fillExtrusionPattern":"fillExtrusion",y);u&&(t.context.activeTexture.set(l.TEXTURE0),g.imageAtlasTexture.bind(l.LINEAR,l.CLAMP_TO_EDGE),y.updatePaintBuffers(h));var v=c.constantOr(null);if(v&&g.imageAtlas){var b=g.imageAtlas,x=b.patternPositions[v.to.toString()],w=b.patternPositions[v.from.toString()];x&&w&&y.setConstantPatternPositions(x,w)}var E=t.translatePosMatrix(A.posMatrix,g,n.paint.get("fill-extrusion-translate"),n.paint.get("fill-extrusion-translate-anchor")),C=n.paint.get("fill-extrusion-vertical-gradient"),T=u?Cn(E,t,C,d,A,h,g):En(E,t,C,d);_.draw(a,a.gl.TRIANGLES,r,o,s,Pt.backCCW,T,n.id,m.layoutVertexBuffer,m.indexBuffer,m.segments,n.paint,t.transform.zoom,y)}}}function si(e,n,i,r,o,s){var a=e.context,l=a.gl,c=n.fbo;if(c){var u=e.useProgram("hillshade");a.activeTexture.set(l.TEXTURE0),l.bindTexture(l.TEXTURE_2D,c.colorAttachment.get());var h=function(e,n,i){var r=i.paint.get("hillshade-shadow-color"),o=i.paint.get("hillshade-highlight-color"),s=i.paint.get("hillshade-accent-color"),a=i.paint.get("hillshade-illumination-direction")*(Math.PI/180);"viewport"===i.paint.get("hillshade-illumination-anchor")&&(a-=e.transform.angle);var l,c,u,h=!e.options.moving;return{u_matrix:e.transform.calculatePosMatrix(n.tileID.toUnwrapped(),h),u_image:0,u_latrange:(l=n.tileID,c=Math.pow(2,l.canonical.z),u=l.canonical.y,[new t.MercatorCoordinate(0,u/c).toLngLat().lat,new t.MercatorCoordinate(0,(u+1)/c).toLngLat().lat]),u_light:[i.paint.get("hillshade-exaggeration"),a],u_shadow:r,u_highlight:o,u_accent:s}}(e,n,i);u.draw(a,l.TRIANGLES,r,o,s,Pt.disabled,h,i.id,e.rasterBoundsBuffer,e.quadTriangleIndexBuffer,e.rasterBoundsSegments)}}function ai(e,n,i,r,o,s){var a=e.context,l=a.gl,c=n.dem;if(c&&c.data){var u=c.dim,h=c.stride,d=c.getPixels();if(a.activeTexture.set(l.TEXTURE1),a.pixelStoreUnpackPremultiplyAlpha.set(!1),n.demTexture=n.demTexture||e.getTileTexture(h),n.demTexture){var p=n.demTexture;p.update(d,{premultiply:!1}),p.bind(l.NEAREST,l.CLAMP_TO_EDGE)}else n.demTexture=new t.Texture(a,d,l.RGBA,{premultiply:!1}),n.demTexture.bind(l.NEAREST,l.CLAMP_TO_EDGE);a.activeTexture.set(l.TEXTURE0);var f=n.fbo;if(!f){var A=new t.Texture(a,{width:u,height:u,data:null},l.RGBA);A.bind(l.LINEAR,l.CLAMP_TO_EDGE),(f=n.fbo=a.createFramebuffer(u,u,!0)).colorAttachment.set(A.texture)}a.bindFramebuffer.set(f.framebuffer),a.viewport.set([0,0,u,u]),e.useProgram("hillshadePrepare").draw(a,l.TRIANGLES,r,o,s,Pt.disabled,function(e,n){var i=n.stride,r=t.create();return t.ortho(r,0,t.EXTENT,-t.EXTENT,0,0,1),t.translate(r,r,[0,-t.EXTENT,0]),{u_matrix:r,u_image:1,u_dimension:[i,i],u_zoom:e.overscaledZ,u_unpack:n.getUnpackVector()}}(n.tileID,c),i.id,e.rasterBoundsBuffer,e.quadTriangleIndexBuffer,e.rasterBoundsSegments),n.needsHillshadePrepare=!1}}function li(e,n,i,r,o){var s=r.paint.get("raster-fade-duration");if(s>0){var a=t.browser.now(),l=(a-e.timeAdded)/s,c=n?(a-n.timeAdded)/s:-1,u=i.getSource(),h=o.coveringZoomLevel({tileSize:u.tileSize,roundZoom:u.roundZoom}),d=!n||Math.abs(n.tileID.overscaledZ-h)>Math.abs(e.tileID.overscaledZ-h),p=d&&e.refreshedUponExpiration?1:t.clamp(d?l:1-c,0,1);return e.refreshedUponExpiration&&l>=1&&(e.refreshedUponExpiration=!1),n?{opacity:1,mix:1-p}:{opacity:p,mix:0}}return{opacity:1,mix:0}}var ci=new t.Color(1,0,0,1),ui=new t.Color(0,1,0,1),hi=new t.Color(0,0,1,1),di=new t.Color(1,0,1,1),pi=new t.Color(0,1,1,1);function fi(t,e,n,i){gi(t,0,e+n/2,t.transform.width,n,i)}function Ai(t,e,n,i){gi(t,e-n/2,0,n,t.transform.height,i)}function gi(e,n,i,r,o,s){var a=e.context,l=a.gl;l.enable(l.SCISSOR_TEST),l.scissor(n*t.browser.devicePixelRatio,i*t.browser.devicePixelRatio,r*t.browser.devicePixelRatio,o*t.browser.devicePixelRatio),a.clear({color:s}),l.disable(l.SCISSOR_TEST)}function mi(e,n,i){var r=e.context,o=r.gl,s=i.posMatrix,a=e.useProgram("debug"),l=Ct.disabled,c=Tt.disabled,u=e.colorModeForRenderPass();r.activeTexture.set(o.TEXTURE0),e.emptyTexture.bind(o.LINEAR,o.CLAMP_TO_EDGE),a.draw(r,o.LINE_STRIP,l,c,u,Pt.disabled,Ln(s,t.Color.red),"$debug",e.debugBuffer,e.tileBorderIndexBuffer,e.debugSegments);var h=n.getTileByID(i.key).latestRawTileData,d=Math.floor((h&&h.byteLength||0)/1024),p=n.getTile(i).tileSize,f=512/Math.min(p,512)*(i.overscaledZ/e.transform.zoom)*.5,A=i.canonical.toString();i.overscaledZ!==i.canonical.z&&(A+=" => "+i.overscaledZ),function(t,e){t.initDebugOverlayCanvas();var n=t.debugOverlayCanvas,i=t.context.gl,r=t.debugOverlayCanvas.getContext("2d");r.clearRect(0,0,n.width,n.height),r.shadowColor="white",r.shadowBlur=2,r.lineWidth=1.5,r.strokeStyle="white",r.textBaseline="top",r.font="bold 36px Open Sans, sans-serif",r.fillText(e,5,5),r.strokeText(e,5,5),t.debugOverlayTexture.update(n),t.debugOverlayTexture.bind(i.LINEAR,i.CLAMP_TO_EDGE)}(e,A+" "+d+"kb"),a.draw(r,o.TRIANGLES,l,c,St.alphaBlended,Pt.disabled,Ln(s,t.Color.transparent,f),"$debug",e.debugBuffer,e.quadTriangleIndexBuffer,e.debugSegments)}var yi={symbol:function(e,n,i,r,o){if("translucent"===e.renderPass){var s=Tt.disabled,a=e.colorModeForRenderPass();i.layout.get("text-variable-anchor")&&function(e,n,i,r,o,s,a){for(var l=n.transform,c="map"===o,u="map"===s,h=0,d=e;h<d.length;h+=1){var p=d[h],f=r.getTile(p),A=f.getBucket(i);if(A&&A.text&&A.text.segments.get().length){var g=t.evaluateSizeForZoom(A.textSizeData,l.zoom),m=de(f,1,n.transform.zoom),y=Jt(p.posMatrix,u,c,n.transform,m),_="none"!==i.layout.get("icon-text-fit")&&A.hasIconData();if(g){var v=Math.pow(2,l.zoom-f.tileID.overscaledZ);ti(A,c,u,a,t.symbolSize,l,y,p.posMatrix,v,g,_)}}}}(r,e,i,n,i.layout.get("text-rotation-alignment"),i.layout.get("text-pitch-alignment"),o),0!==i.paint.get("icon-opacity").constantOr(1)&&ni(e,n,i,r,!1,i.paint.get("icon-translate"),i.paint.get("icon-translate-anchor"),i.layout.get("icon-rotation-alignment"),i.layout.get("icon-pitch-alignment"),i.layout.get("icon-keep-upright"),s,a),0!==i.paint.get("text-opacity").constantOr(1)&&ni(e,n,i,r,!0,i.paint.get("text-translate"),i.paint.get("text-translate-anchor"),i.layout.get("text-rotation-alignment"),i.layout.get("text-pitch-alignment"),i.layout.get("text-keep-upright"),s,a),n.map.showCollisionBoxes&&(Jn(e,n,i,r,i.paint.get("text-translate"),i.paint.get("text-translate-anchor"),!0),Jn(e,n,i,r,i.paint.get("icon-translate"),i.paint.get("icon-translate-anchor"),!1))}},circle:function(e,n,i,r){if("translucent"===e.renderPass){var o=i.paint.get("circle-opacity"),s=i.paint.get("circle-stroke-width"),a=i.paint.get("circle-stroke-opacity"),l=void 0!==i.layout.get("circle-sort-key").constantOr(1);if(0!==o.constantOr(1)||0!==s.constantOr(1)&&0!==a.constantOr(1)){for(var c=e.context,u=c.gl,h=e.depthModeForSublayer(0,Ct.ReadOnly),d=Tt.disabled,p=e.colorModeForRenderPass(),f=[],A=0;A<r.length;A++){var g=r[A],m=n.getTile(g),y=m.getBucket(i);if(y){var _=y.programConfigurations.get(i.id),v={programConfiguration:_,program:e.useProgram("circle",_),layoutVertexBuffer:y.layoutVertexBuffer,indexBuffer:y.indexBuffer,uniformValues:In(e,g,m,i)};if(l)for(var b=0,x=y.segments.get();b<x.length;b+=1){var w=x[b];f.push({segments:new t.SegmentVector([w]),sortKey:w.sortKey,state:v})}else f.push({segments:y.segments,sortKey:0,state:v})}}l&&f.sort((function(t,e){return t.sortKey-e.sortKey}));for(var E=0,C=f;E<C.length;E+=1){var T=C[E],S=T.state;S.program.draw(c,u.TRIANGLES,h,d,p,Pt.disabled,S.uniformValues,i.id,S.layoutVertexBuffer,S.indexBuffer,T.segments,i.paint,e.transform.zoom,S.programConfiguration)}}}},heatmap:function(e,n,i,r){if(0!==i.paint.get("heatmap-opacity"))if("offscreen"===e.renderPass){var o=e.context,s=o.gl,a=Tt.disabled,l=new St([s.ONE,s.ONE],t.Color.transparent,[!0,!0,!0,!0]);!function(t,e,n){var i=t.gl;t.activeTexture.set(i.TEXTURE1),t.viewport.set([0,0,e.width/4,e.height/4]);var r=n.heatmapFbo;if(r)i.bindTexture(i.TEXTURE_2D,r.colorAttachment.get()),t.bindFramebuffer.set(r.framebuffer);else{var o=i.createTexture();i.bindTexture(i.TEXTURE_2D,o),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,i.LINEAR),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,i.LINEAR),r=n.heatmapFbo=t.createFramebuffer(e.width/4,e.height/4,!1),function(t,e,n,i){var r=t.gl;r.texImage2D(r.TEXTURE_2D,0,r.RGBA,e.width/4,e.height/4,0,r.RGBA,t.extRenderToTextureHalfFloat?t.extTextureHalfFloat.HALF_FLOAT_OES:r.UNSIGNED_BYTE,null),i.colorAttachment.set(n)}(t,e,o,r)}}(o,e,i),o.clear({color:t.Color.transparent});for(var c=0;c<r.length;c++){var u=r[c];if(!n.hasRenderableParent(u)){var h=n.getTile(u),d=h.getBucket(i);if(d){var p=d.programConfigurations.get(i.id);e.useProgram("heatmap",p).draw(o,s.TRIANGLES,Ct.disabled,a,l,Pt.disabled,Dn(u.posMatrix,h,e.transform.zoom,i.paint.get("heatmap-intensity")),i.id,d.layoutVertexBuffer,d.indexBuffer,d.segments,i.paint,e.transform.zoom,p)}}}o.viewport.set([0,0,e.width,e.height])}else"translucent"===e.renderPass&&(e.context.setColorMode(e.colorModeForRenderPass()),function(e,n){var i=e.context,r=i.gl,o=n.heatmapFbo;if(o){i.activeTexture.set(r.TEXTURE0),r.bindTexture(r.TEXTURE_2D,o.colorAttachment.get()),i.activeTexture.set(r.TEXTURE1);var s=n.colorRampTexture;s||(s=n.colorRampTexture=new t.Texture(i,n.colorRamp,r.RGBA)),s.bind(r.LINEAR,r.CLAMP_TO_EDGE),e.useProgram("heatmapTexture").draw(i,r.TRIANGLES,Ct.disabled,Tt.disabled,e.colorModeForRenderPass(),Pt.disabled,function(e,n
2){var i=t.create();t.ortho(i,0,e.width,e.height,0,0,1);var r=e.context.gl;return{u_matrix:i,u_world:[r.drawingBufferWidth,r
vendor: 147,031 bytes, line 2
2.drawingBufferHeight],u_image:0,u_color_ramp:1,u_opacity:n.paint.get("heatmap-opacity")}}(e,n),n.id,e.viewportBuffer,e.quadTriangleIndexBuffer,e.viewportSegments,n.paint,e.transform.zoom)}}(e,i))},line:function(e,n,i,r){if("translucent"===e.renderPass){var o=i.paint.get("line-opacity"),s=i.paint.get("line-width");if(0!==o.constantOr(1)&&0!==s.constantOr(1))for(var a=e.depthModeForSublayer(0,Ct.ReadOnly),l=e.colorModeForRenderPass(),c=i.paint.get("line-dasharray"),u=i.paint.get("line-pattern"),h=u.constantOr(1),d=i.paint.get("line-gradient"),p=i.getCrossfadeParameters(),f=h?"linePattern":c?"lineSDF":d?"lineGradient":"line",A=e.context,g=A.gl,m=!0,y=0,_=r;y<_.length;y+=1){var v=_[y],b=n.getTile(v);if(!h||b.patternsLoaded()){var x=b.getBucket(i);if(x){var w=x.programConfigurations.get(i.id),E=e.context.program.get(),C=e.useProgram(f,w),T=m||C.program!==E,S=u.constantOr(null);if(S&&b.imageAtlas){var P=b.imageAtlas,M=P.patternPositions[S.to.toString()],I=P.patternPositions[S.from.toString()];M&&I&&w.setConstantPatternPositions(M,I)}var B=h?Nn(e,b,i,p):c?zn(e,b,i,c,p):d?Fn(e,b,i,x.lineClipsArray.length):kn(e,b,i);if(h)A.activeTexture.set(g.TEXTURE0),b.imageAtlasTexture.bind(g.LINEAR,g.CLAMP_TO_EDGE),w.updatePaintBuffers(p);else if(c&&(T||e.lineAtlas.dirty))A.activeTexture.set(g.TEXTURE0),e.lineAtlas.bind(A);else if(d){var R=x.gradients[i.id],L=R.texture;if(i.gradientVersion!==R.version){var O=256;if(i.stepInterpolant){var D=n.getSource().maxzoom,k=v.canonical.z===D?Math.ceil(1<<e.transform.maxZoom-v.canonical.z):1;O=t.clamp(t.nextPowerOfTwo(x.maxLineLength/t.EXTENT*1024*k),256,A.maxTextureSize)}R.gradient=t.renderColorRamp({expression:i.gradientExpression(),evaluationKey:"lineProgress",resolution:O,image:R.gradient||void 0,clips:x.lineClipsArray}),R.texture?R.texture.update(R.gradient):R.texture=new t.Texture(A,R.gradient,g.RGBA),R.version=i.gradientVersion,L=R.texture}A.activeTexture.set(g.TEXTURE0),L.bind(i.stepInterpolant?g.NEAREST:g.LINEAR,g.CLAMP_TO_EDGE)}C.draw(A,g.TRIANGLES,a,e.stencilModeForClipping(v),l,Pt.disabled,B,i.id,x.layoutVertexBuffer,x.indexBuffer,x.segments,i.paint,e.transform.zoom,w,x.layoutVertexBuffer2),m=!1}}}}},fill:function(e,n,i,r){var o=i.paint.get("fill-color"),s=i.paint.get("fill-opacity");if(0!==s.constantOr(1)){var a=e.colorModeForRenderPass(),l=i.paint.get("fill-pattern"),c=e.opaquePassEnabledForLayer()&&!l.constantOr(1)&&1===o.constantOr(t.Color.transparent).a&&1===s.constantOr(0)?"opaque":"translucent";if(e.renderPass===c){var u=e.depthModeForSublayer(1,"opaque"===e.renderPass?Ct.ReadWrite:Ct.ReadOnly);ri(e,n,i,r,u,a,!1)}if("translucent"===e.renderPass&&i.paint.get("fill-antialias")){var h=e.depthModeForSublayer(i.getPaintProperty("fill-outline-color")?2:0,Ct.ReadOnly);ri(e,n,i,r,h,a,!0)}}},"fill-extrusion":function(t,e,n,i){var r=n.paint.get("fill-extrusion-opacity");if(0!==r&&"translucent"===t.renderPass){var o=new Ct(t.context.gl.LEQUAL,Ct.ReadWrite,t.depthRangeFor3D);if(1!==r||n.paint.get("fill-extrusion-pattern").constantOr(1))oi(t,e,n,i,o,Tt.disabled,St.disabled),oi(t,e,n,i,o,t.stencilModeFor3D(),t.colorModeForRenderPass());else{var s=t.colorModeForRenderPass();oi(t,e,n,i,o,Tt.disabled,s)}}},hillshade:function(t,e,n,i){if("offscreen"===t.renderPass||"translucent"===t.renderPass){for(var r=t.context,o=t.depthModeForSublayer(0,Ct.ReadOnly),s=t.colorModeForRenderPass(),a="translucent"===t.renderPass?t.stencilConfigForOverlap(i):[{},i],l=a[0],c=0,u=a[1];c<u.length;c+=1){var h=u[c],d=e.getTile(h);d.needsHillshadePrepare&&"offscreen"===t.renderPass?ai(t,d,n,o,Tt.disabled,s):"translucent"===t.renderPass&&si(t,d,n,o,l[h.overscaledZ],s)}r.viewport.set([0,0,t.width,t.height])}},raster:function(t,e,n,i){if("translucent"===t.renderPass&&0!==n.paint.get("raster-opacity")&&i.length)for(var r=t.context,o=r.gl,s=e.getSource(),a=t.useProgram("raster"),l=t.colorModeForRenderPass(),c=s instanceof R?[{},i]:t.stencilConfigForOverlap(i),u=c[0],h=c[1],d=h[h.length-1].overscaledZ,p=!t.options.moving,f=0,A=h;f<A.length;f+=1){var g=A[f],m=t.depthModeForSublayer(g.overscaledZ-d,1===n.paint.get("raster-opacity")?Ct.ReadWrite:Ct.ReadOnly,o.LESS),y=e.getTile(g),_=t.transform.calculatePosMatrix(g.toUnwrapped(),p);y.registerFadeDuration(n.paint.get("raster-fade-duration"));var v=e.findLoadedParent(g,0),b=li(y,v,e,n,t.transform),x=void 0,w=void 0,E="nearest"===n.paint.get("raster-resampling")?o.NEAREST:o.LINEAR;r.activeTexture.set(o.TEXTURE0),y.texture.bind(E,o.CLAMP_TO_EDGE,o.LINEAR_MIPMAP_NEAREST),r.activeTexture.set(o.TEXTURE1),v?(v.texture.bind(E,o.CLAMP_TO_EDGE,o.LINEAR_MIPMAP_NEAREST),x=Math.pow(2,v.tileID.overscaledZ-y.tileID.overscaledZ),w=[y.tileID.canonical.x*x%1,y.tileID.canonical.y*x%1]):y.texture.bind(E,o.CLAMP_TO_EDGE,o.LINEAR_MIPMAP_NEAREST);var C=Vn(_,w||[0,0],x||1,b,n);s instanceof R?a.draw(r,o.TRIANGLES,m,Tt.disabled,l,Pt.disabled,C,n.id,s.boundsBuffer,t.quadTriangleIndexBuffer,s.boundsSegments):a.draw(r,o.TRIANGLES,m,u[g.overscaledZ],l,Pt.disabled,C,n.id,t.rasterBoundsBuffer,t.quadTriangleIndexBuffer,t.rasterBoundsSegments)}},background:function(t,e,n){var i=n.paint.get("background-color"),r=n.paint.get("background-opacity");if(0!==r){var o=t.context,s=o.gl,a=t.transform,l=a.tileSize,c=n.paint.get("background-pattern");if(!t.isPatternMissing(c)){var u=!c&&1===i.a&&1===r&&t.opaquePassEnabledForLayer()?"opaque":"translucent";if(t.renderPass===u){var h=Tt.disabled,d=t.depthModeForSublayer(0,"opaque"===u?Ct.ReadWrite:Ct.ReadOnly),p=t.colorModeForRenderPass(),f=t.useProgram(c?"backgroundPattern":"background"),A=a.coveringTiles({tileSize:l});c&&(o.activeTexture.set(s.TEXTURE0),t.imageManager.bind(t.context));for(var g=n.getCrossfadeParameters(),m=0,y=A;m<y.length;m+=1){var _=y[m],v=t.transform.calculatePosMatrix(_.toUnwrapped()),b=c?Kn(v,r,t,c,{tileID:_,tileSize:l},g):Xn(v,r,i);f.draw(o,s.TRIANGLES,d,h,p,Pt.disabled,b,n.id,t.tileExtentBuffer,t.quadTriangleIndexBuffer,t.tileExtentSegments)}}}}},debug:function(t,e,n){for(var i=0;i<n.length;i++)mi(t,e,n[i])},custom:function(t,e,n){var i=t.context,r=n.implementation;if("offscreen"===t.renderPass){var o=r.prerender;o&&(t.setCustomLayerDefaults(),i.setColorMode(t.colorModeForRenderPass()),o.call(r,i.gl,t.transform.customLayerMatrix()),i.setDirty(),t.setBaseState())}else if("translucent"===t.renderPass){t.setCustomLayerDefaults(),i.setColorMode(t.colorModeForRenderPass()),i.setStencilMode(Tt.disabled);var s="3d"===r.renderingMode?new Ct(t.context.gl.LEQUAL,Ct.ReadWrite,t.depthRangeFor3D):t.depthModeForSublayer(0,Ct.ReadOnly);i.setDepthMode(s),r.render(i.gl,t.transform.customLayerMatrix()),i.setDirty(),t.setBaseState(),i.bindFramebuffer.set(null)}}},_i=function(t,e){this.context=new Mt(t),this.transform=e,this._tileTextures={},this.setup(),this.numSublayers=It.maxUnderzooming+It.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new Ne,this.gpuTimers={}};_i.prototype.resize=function(e,n){if(this.width=e*t.browser.devicePixelRatio,this.height=n*t.browser.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(var i=0,r=this.style._order;i<r.length;i+=1)this.style._layers[r[i]].resize()},_i.prototype.setup=function(){var e=this.context,n=new t.StructArrayLayout2i4;n.emplaceBack(0,0),n.emplaceBack(t.EXTENT,0),n.emplaceBack(0,t.EXTENT),n.emplaceBack(t.EXTENT,t.EXTENT),this.tileExtentBuffer=e.createVertexBuffer(n,He.members),this.tileExtentSegments=t.SegmentVector.simpleSegment(0,0,4,2);var i=new t.StructArrayLayout2i4;i.emplaceBack(0,0),i.emplaceBack(t.EXTENT,0),i.emplaceBack(0,t.EXTENT),i.emplaceBack(t.EXTENT,t.EXTENT),this.debugBuffer=e.createVertexBuffer(i,He.members),this.debugSegments=t.SegmentVector.simpleSegment(0,0,4,5);var r=new t.StructArrayLayout4i8;r.emplaceBack(0,0,0,0),r.emplaceBack(t.EXTENT,0,t.EXTENT,0),r.emplaceBack(0,t.EXTENT,0,t.EXTENT),r.emplaceBack(t.EXTENT,t.EXTENT,t.EXTENT,t.EXTENT),this.rasterBoundsBuffer=e.createVertexBuffer(r,B.members),this.rasterBoundsSegments=t.SegmentVector.simpleSegment(0,0,4,2);var o=new t.StructArrayLayout2i4;o.emplaceBack(0,0),o.emplaceBack(1,0),o.emplaceBack(0,1),o.emplaceBack(1,1),this.viewportBuffer=e.createVertexBuffer(o,He.members),this.viewportSegments=t.SegmentVector.simpleSegment(0,0,4,2);var s=new t.StructArrayLayout1ui2;s.emplaceBack(0),s.emplaceBack(1),s.emplaceBack(3),s.emplaceBack(2),s.emplaceBack(0),this.tileBorderIndexBuffer=e.createIndexBuffer(s);var a=new t.StructArrayLayout3ui6;a.emplaceBack(0,1,2),a.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=e.createIndexBuffer(a),this.emptyTexture=new t.Texture(e,{width:1,height:1,data:new Uint8Array([0,0,0,0])},e.gl.RGBA);var l=this.context.gl;this.stencilClearMode=new Tt({func:l.ALWAYS,mask:0},0,255,l.ZERO,l.ZERO,l.ZERO)},_i.prototype.clearStencil=function(){var e=this.context,n=e.gl;this.nextStencilID=1,this.currentStencilSource=void 0;var i=t.create();t.ortho(i,0,this.width,this.height,0,0,1),t.scale(i,i,[n.drawingBufferWidth,n.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(e,n.TRIANGLES,Ct.disabled,this.stencilClearMode,St.disabled,Pt.disabled,On(i),"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)},_i.prototype._renderTileClippingMasks=function(t,e){if(this.currentStencilSource!==t.source&&t.isTileClipped()&&e&&e.length){this.currentStencilSource=t.source;var n=this.context,i=n.gl;this.nextStencilID+e.length>256&&this.clearStencil(),n.setColorMode(St.disabled),n.setDepthMode(Ct.disabled);var r=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(var o=0,s=e;o<s.length;o+=1){var a=s[o],l=this._tileClippingMaskIDs[a.key]=this.nextStencilID++;r.draw(n,i.TRIANGLES,Ct.disabled,new Tt({func:i.ALWAYS,mask:0},l,255,i.KEEP,i.KEEP,i.REPLACE),St.disabled,Pt.disabled,On(a.posMatrix),"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}},_i.prototype.stencilModeFor3D=function(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();var t=this.nextStencilID++,e=this.context.gl;return new Tt({func:e.NOTEQUAL,mask:255},t,255,e.KEEP,e.KEEP,e.REPLACE)},_i.prototype.stencilModeForClipping=function(t){var e=this.context.gl;return new Tt({func:e.EQUAL,mask:255},this._tileClippingMaskIDs[t.key],0,e.KEEP,e.KEEP,e.REPLACE)},_i.prototype.stencilConfigForOverlap=function(t){var e,n=this.context.gl,i=t.sort((function(t,e){return e.overscaledZ-t.overscaledZ})),r=i[i.length-1].overscaledZ,o=i[0].overscaledZ-r+1;if(o>1){this.currentStencilSource=void 0,this.nextStencilID+o>256&&this.clearStencil();for(var s={},a=0;a<o;a++)s[a+r]=new Tt({func:n.GEQUAL,mask:255},a+this.nextStencilID,255,n.KEEP,n.KEEP,n.REPLACE);return this.nextStencilID+=o,[s,i]}return[(e={},e[r]=Tt.disabled,e),i]},_i.prototype.colorModeForRenderPass=function(){var e=this.context.gl;return this._showOverdrawInspector?new St([e.CONSTANT_COLOR,e.ONE],new t.Color(1/8,1/8,1/8,0),[!0,!0,!0,!0]):"opaque"===this.renderPass?St.unblended:St.alphaBlended},_i.prototype.depthModeForSublayer=function(t,e,n){if(!this.opaquePassEnabledForLayer())return Ct.disabled;var i=1-((1+this.currentLayer)*this.numSublayers+t)*this.depthEpsilon;return new Ct(n||this.context.gl.LEQUAL,e,[i,i])},_i.prototype.opaquePassEnabledForLayer=function(){return this.currentLayer<this.opaquePassCutoff},_i.prototype.render=function(e,n){var i=this;this.style=e,this.options=n,this.lineAtlas=e.lineAtlas,this.imageManager=e.imageManager,this.glyphManager=e.glyphManager,this.symbolFadeChange=e.placement.symbolFadeChange(t.browser.now()),this.imageManager.beginFrame();var r=this.style._order,o=this.style.sourceCaches;for(var s in o){var a=o[s];a.used&&a.prepare(this.context)}var l,c,u={},h={},d={};for(var p in o){var f=o[p];u[p]=f.getVisibleCoordinates(),h[p]=u[p].slice().reverse(),d[p]=f.getVisibleCoordinates(!0).reverse()}this.opaquePassCutoff=1/0;for(var A=0;A<r.length;A++)if(this.style._layers[r[A]].is3D()){this.opaquePassCutoff=A;break}this.renderPass="offscreen";for(var g=0,m=r;g<m.length;g+=1){var y=this.style._layers[m[g]];if(y.hasOffscreenPass()&&!y.isHidden(this.transform.zoom)){var _=h[y.source];("custom"===y.type||_.length)&&this.renderLayer(this,o[y.source],y,_)}}for(this.context.bindFramebuffer.set(null),this.context.clear({color:n.showOverdrawInspector?t.Color.black:t.Color.transparent,depth:1}),this.clearStencil(),this._showOverdrawInspector=n.showOverdrawInspector,this.depthRangeFor3D=[0,1-(e._order.length+2)*this.numSublayers*this.depthEpsilon],this.renderPass="opaque",this.currentLayer=r.length-1;this.currentLayer>=0;this.currentLayer--){var v=this.style._layers[r[this.currentLayer]],b=o[v.source],x=u[v.source];this._renderTileClippingMasks(v,x),this.renderLayer(this,b,v,x)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer<r.length;this.currentLayer++){var w=this.style._layers[r[this.currentLayer]],E=o[w.source],C=("symbol"===w.type?d:h)[w.source];this._renderTileClippingMasks(w,u[w.source]),this.renderLayer(this,E,w,C)}this.options.showTileBoundaries&&(t.values(this.style._layers).forEach((function(t){t.source&&!t.isHidden(i.transform.zoom)&&(t.source!==(c&&c.id)&&(c=i.style.sourceCaches[t.source]),(!l||l.getSource().maxzoom<c.getSource().maxzoom)&&(l=c))})),l&&yi.debug(this,l,l.getVisibleCoordinates())),this.options.showPadding&&function(t){var e=t.transform.padding;fi(t,t.transform.height-(e.top||0),3,ci),fi(t,e.bottom||0,3,ui),Ai(t,e.left||0,3,hi),Ai(t,t.transform.width-(e.right||0),3,di);var n=t.transform.centerPoint;!function(t,e,n,i){gi(t,e-1,n-10,2,20,i),gi(t,e-10,n-1,20,2,i)}(t,n.x,t.transform.height-n.y,pi)}(this),this.context.setDefault()},_i.prototype.renderLayer=function(t,e,n,i){n.isHidden(this.transform.zoom)||("background"===n.type||"custom"===n.type||i.length)&&(this.id=n.id,this.gpuTimingStart(n),yi[n.type](t,e,n,i,this.style.placement.variableOffsets),this.gpuTimingEnd())},_i.prototype.gpuTimingStart=function(t){if(this.options.gpuTiming){var e=this.context.extTimerQuery,n=this.gpuTimers[t.id];n||(n=this.gpuTimers[t.id]={calls:0,cpuTime:0,query:e.createQueryEXT()}),n.calls++,e.beginQueryEXT(e.TIME_ELAPSED_EXT,n.query)}},_i.prototype.gpuTimingEnd=function(){if(this.options.gpuTiming){var t=this.context.extTimerQuery;t.endQueryEXT(t.TIME_ELAPSED_EXT)}},_i.prototype.collectGpuTimers=function(){var t=this.gpuTimers;return this.gpuTimers={},t},_i.prototype.queryGpuTimers=function(t){var e={};for(var n in t){var i=t[n],r=this.context.extTimerQuery,o=r.getQueryObjectEXT(i.query,r.QUERY_RESULT_EXT)/1e6;r.deleteQueryEXT(i.query),e[n]=o}return e},_i.prototype.translatePosMatrix=function(e,n,i,r,o){if(!i[0]&&!i[1])return e;var s=o?"map"===r?this.transform.angle:0:"viewport"===r?-this.transform.angle:0;if(s){var a=Math.sin(s),l=Math.cos(s);i=[i[0]*l-i[1]*a,i[0]*a+i[1]*l]}var c=[o?i[0]:de(n,i[0],this.transform.zoom),o?i[1]:de(n,i[1],this.transform.zoom),0],u=new Float32Array(16);return t.translate(u,e,c),u},_i.prototype.saveTileTexture=function(t){var e=this._tileTextures[t.size[0]];e?e.push(t):this._tileTextures[t.size[0]]=[t]},_i.prototype.getTileTexture=function(t){var e=this._tileTextures[t];return e&&e.length>0?e.pop():null},_i.prototype.isPatternMissing=function(t){if(!t)return!1;if(!t.from||!t.to)return!0;var e=this.imageManager.getPattern(t.from.toString()),n=this.imageManager.getPattern(t.to.toString());return!e||!n},_i.prototype.useProgram=function(t,e){this.cache=this.cache||{};var n=""+t+(e?e.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"");return this.cache[n]||(this.cache[n]=new xn(this.context,t,_n[t],e,Qn[t],this._showOverdrawInspector)),this.cache[n]},_i.prototype.setCustomLayerDefaults=function(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()},_i.prototype.setBaseState=function(){var t=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(t.FUNC_ADD)},_i.prototype.initDebugOverlayCanvas=function(){null==this.debugOverlayCanvas&&(this.debugOverlayCanvas=t.window.document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new t.Texture(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))},_i.prototype.destroy=function(){this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy()};var vi=function(t,e){this.points=t,this.planes=e};vi.fromInvProjectionMatrix=function(e,n,i){var r=Math.pow(2,i),o=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]].map((function(n){return t.transformMat4([],n,e)})).map((function(e){return t.scale$1([],e,1/e[3]/n*r)})),s=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map((function(e){var n=t.sub([],o[e[0]],o[e[1]]),i=t.sub([],o[e[2]],o[e[1]]),r=t.normalize([],t.cross([],n,i)),s=-t.dot(r,o[e[1]]);return r.concat(s)}));return new vi(o,s)};var bi=function(e,n){this.min=e,this.max=n,this.center=t.scale$2([],t.add([],this.min,this.max),.5)};bi.prototype.quadrant=function(e){for(var n=[e%2==0,e<2],i=t.clone$2(this.min),r=t.clone$2(this.max),o=0;o<n.length;o++)i[o]=n[o]?this.min[o]:this.center[o],r[o]=n[o]?this.center[o]:this.max[o];return r[2]=this.max[2],new bi(i,r)},bi.prototype.distanceX=function(t){return Math.max(Math.min(this.max[0],t[0]),this.min[0])-t[0]},bi.prototype.distanceY=function(t){return Math.max(Math.min(this.max[1],t[1]),this.min[1])-t[1]},bi.prototype.intersects=function(e){for(var n=[[this.min[0],this.min[1],0,1],[this.max[0],this.min[1],0,1],[this.max[0],this.max[1],0,1],[this.min[0],this.max[1],0,1]],i=!0,r=0;r<e.planes.length;r++){for(var o=e.planes[r],s=0,a=0;a<n.length;a++)s+=t.dot$1(o,n[a])>=0;if(0===s)return 0;s!==n.length&&(i=!1)}if(i)return 2;for(var l=0;l<3;l++){for(var c=Number.MAX_VALUE,u=-Number.MAX_VALUE,h=0;h<e.points.length;h++){var d=e.points[h][l]-this.min[l];c=Math.min(c,d),u=Math.max(u,d)}if(u<0||c>this.max[l]-this.min[l])return 0}return 1};var xi=function(t,e,n,i){if(void 0===t&&(t=0),void 0===e&&(e=0),void 0===n&&(n=0),void 0===i&&(i=0),isNaN(t)||t<0||isNaN(e)||e<0||isNaN(n)||n<0||isNaN(i)||i<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=t,this.bottom=e,this.left=n,this.right=i};xi.prototype.interpolate=function(e,n,i){return null!=n.top&&null!=e.top&&(this.top=t.number(e.top,n.top,i)),null!=n.bottom&&null!=e.bottom&&(this.bottom=t.number(e.bottom,n.bottom,i)),null!=n.left&&null!=e.left&&(this.left=t.number(e.left,n.left,i)),null!=n.right&&null!=e.right&&(this.right=t.number(e.right,n.right,i)),this},xi.prototype.getCenter=function(e,n){var i=t.clamp((this.left+e-this.right)/2,0,e),r=t.clamp((this.top+n-this.bottom)/2,0,n);return new t.Point(i,r)},xi.prototype.equals=function(t){return this.top===t.top&&this.bottom===t.bottom&&this.left===t.left&&this.right===t.right},xi.prototype.clone=function(){return new xi(this.top,this.bottom,this.left,this.right)},xi.prototype.toJSON=function(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}};var wi=function(e,n,i,r,o){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=void 0===o||o,this._minZoom=e||0,this._maxZoom=n||22,this._minPitch=null==i?0:i,this._maxPitch=null==r?60:r,this.setMaxBounds(),this.width=0,this.height=0,this._center=new t.LngLat(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new xi,this._posMatrixCache={},this._alignedPosMatrixCache={}},Ei={minZoom:{configurable:!0},maxZoom:{configurable:!0},minPitch:{configurable:!0},maxPitch:{configurable:!0},renderWorldCopies:{configurable:!0},worldSize:{configurable:!0},centerOffset:{configurable:!0},size:{configurable:!0},bearing:{configurable:!0},pitch:{configurable:!0},fov:{configurable:!0},zoom:{configurable:!0},center:{configurable:!0},padding:{configurable:!0},centerPoint:{configurable:!0},unmodified:{configurable:!0},point:{configurable:!0}};wi.prototype.clone=function(){var t=new wi(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return t.tileSize=this.tileSize,t.latRange=this.latRange,t.width=this.width,t.height=this.height,t._center=this._center,t.zoom=this.zoom,t.angle=this.angle,t._fov=this._fov,t._pitch=this._pitch,t._unmodified=this._unmodified,t._edgeInsets=this._edgeInsets.clone(),t._calcMatrices(),t},Ei.minZoom.get=function(){return this._minZoom},Ei.minZoom.set=function(t){this._minZoom!==t&&(this._minZoom=t,this.zoom=Math.max(this.zoom,t))},Ei.maxZoom.get=function(){return this._maxZoom},Ei.maxZoom.set=function(t){this._maxZoom!==t&&(this._maxZoom=t,this.zoom=Math.min(this.zoom,t))},Ei.minPitch.get=function(){return this._minPitch},Ei.minPitch.set=function(t){this._minPitch!==t&&(this._minPitch=t,this.pitch=Math.max(this.pitch,t))},Ei.maxPitch.get=function(){return this._maxPitch},Ei.maxPitch.set=function(t){this._maxPitch!==t&&(this._maxPitch=t,this.pitch=Math.min(this.pitch,t))},Ei.renderWorldCopies.get=function(){return this._renderWorldCopies},Ei.renderWorldCopies.set=function(t){void 0===t?t=!0:null===t&&(t=!1),this._renderWorldCopies=t},Ei.worldSize.get=function(){return this.tileSize*this.scale},Ei.centerOffset.get=function(){return this.centerPoint._sub(this.size._div(2))},Ei.size.get=function(){return new t.Point(this.width,this.height)},Ei.bearing.get=function(){return-this.angle/Math.PI*180},Ei.bearing.set=function(e){var n=-t.wrap(e,-180,180)*Math.PI/180;this.angle!==n&&(this._unmodified=!1,this.angle=n,this._calcMatrices(),this.rotationMatrix=t.create$2(),t.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},Ei.pitch.get=function(){return this._pitch/Math.PI*180},Ei.pitch.set=function(e){var n=t.clamp(e,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==n&&(this._unmodified=!1,this._pitch=n,this._calcMatrices())},Ei.fov.get=function(){return this._fov/Math.PI*180},Ei.fov.set=function(t){t=Math.max(.01,Math.min(60,t)),this._fov!==t&&(this._unmodified=!1,this._fov=t/180*Math.PI,this._calcMatrices())},Ei.zoom.get=function(){return this._zoom},Ei.zoom.set=function(t){var e=Math.min(Math.max(t,this.minZoom),this.maxZoom);this._zoom!==e&&(this._unmodified=!1,this._zoom=e,this.scale=this.zoomScale(e),this.tileZoom=Math.floor(e),this.zoomFraction=e-this.tileZoom,this._constrain(),this._calcMatrices())},Ei.center.get=function(){return this._center},Ei.center.set=function(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this._constrain(),this._calcMatrices())},Ei.padding.get=function(){return this._edgeInsets.toJSON()},Ei.padding.set=function(t){this._edgeInsets.equals(t)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,t,1),this._calcMatrices())},Ei.centerPoint.get=function(){return this._edgeInsets.getCenter(this.width,this.height)},wi.prototype.isPaddingEqual=function(t){return this._edgeInsets.equals(t)},wi.prototype.interpolatePadding=function(t,e,n){this._unmodified=!1,this._edgeInsets.interpolate(t,e,n),this._constrain(),this._calcMatrices()},wi.prototype.coveringZoomLevel=function(t){var e=(t.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/t.tileSize));return Math.max(0,e)},wi.prototype.getVisibleUnwrappedCoordinates=function(e){var n=[new t.UnwrappedTileID(0,e)];if(this._renderWorldCopies)for(var i=this.pointCoordinate(new t.Point(0,0)),r=this.pointCoordinate(new t.Point(this.width,0)),o=this.pointCoordinate(new t.Point(this.width,this.height)),s=this.pointCoordinate(new t.Point(0,this.height)),a=Math.floor(Math.min(i.x,r.x,o.x,s.x)),l=Math.floor(Math.max(i.x,r.x,o.x,s.x)),c=a-1;c<=l+1;c++)0!==c&&n.push(new t.UnwrappedTileID(c,e));return n},wi.prototype.coveringTiles=function(e){var n=this.coveringZoomLevel(e),i=n;if(void 0!==e.minzoom&&n<e.minzoom)return[];void 0!==e.maxzoom&&n>e.maxzoom&&(n=e.maxzoom);var r=t.MercatorCoordinate.fromLngLat(this.center),o=Math.pow(2,n),s=[o*r.x,o*r.y,0],a=vi.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,n),l=e.minzoom||0;this.pitch<=60&&this._edgeInsets.top<.1&&(l=n);var c=function(t){return{aabb:new bi([t*o,0,0],[(t+1)*o,o,0]),zoom:0,x:0,y:0,wrap:t,fullyVisible:!1}},u=[],h=[],d=n,p=e.reparseOverscaled?i:n;if(this._renderWorldCopies)for(var f=1;f<=3;f++)u.push(c(-f)),u.push(c(f));for(u.push(c(0));u.length>0;){var A=u.pop(),g=A.x,m=A.y,y=A.fullyVisible;if(!y){var _=A.aabb.intersects(a);if(0===_)continue;y=2===_}var v=A.aabb.distanceX(s),b=A.aabb.distanceY(s),x=Math.max(Math.abs(v),Math.abs(b));if(A.zoom===d||x>3+(1<<d-A.zoom)-2&&A.zoom>=l)h.push({tileID:new t.OverscaledTileID(A.zoom===d?p:A.zoom,A.wrap,A.zoom,g,m),distanceSq:t.sqrLen([s[0]-.5-g,s[1]-.5-m])});else for(var w=0;w<4;w++){var E=(g<<1)+w%2,C=(m<<1)+(w>>1);u.push({aabb:A.aabb.quadrant(w),zoom:A.zoom+1,x:E,y:C,wrap:A.wrap,fullyVisible:y})}}return h.sort((function(t,e){return t.distanceSq-e.distanceSq})).map((function(t){return t.tileID}))},wi.prototype.resize=function(t,e){this.width=t,this.height=e,this.pixelsToGLUnits=[2/t,-2/e],this._constrain(),this._calcMatrices()},Ei.unmodified.get=function(){return this._unmodified},wi.prototype.zoomScale=function(t){return Math.pow(2,t)},wi.prototype.scaleZoom=function(t){return Math.log(t)/Math.LN2},wi.prototype.project=function(e){var n=t.clamp(e.lat,-this.maxValidLatitude,this.maxValidLatitude);return new t.Point(t.mercatorXfromLng(e.lng)*this.worldSize,t.mercatorYfromLat(n)*this.worldSize)},wi.prototype.unproject=function(e){return new t.MercatorCoordinate(e.x/this.worldSize,e.y/this.worldSize).toLngLat()},Ei.point.get=function(){return this.project(this.center)},wi.prototype.setLocationAtPoint=function(e,n){var i=this.pointCoordinate(n),r=this.pointCoordinate(this.centerPoint),o=this.locationCoordinate(e),s=new t.MercatorCoordinate(o.x-(i.x-r.x),o.y-(i.y-r.y));this.center=this.coordinateLocation(s),this._renderWorldCopies&&(this.center=this.center.wrap())},wi.prototype.locationPoint=function(t){return this.coordinatePoint(this.locationCoordinate(t))},wi.prototype.pointLocation=function(t){return this.coordinateLocation(this.pointCoordinate(t))},wi.prototype.locationCoordinate=function(e){return t.MercatorCoordinate.fromLngLat(e)},wi.prototype.coordinateLocation=function(t){return t.toLngLat()},wi.prototype.pointCoordinate=function(e){var n=[e.x,e.y,0,1],i=[e.x,e.y,1,1];t.transformMat4(n,n,this.pixelMatrixInverse),t.transformMat4(i,i,this.pixelMatrixInverse);var r=n[3],o=i[3],s=n[1]/r,a=i[1]/o,l=n[2]/r,c=i[2]/o,u=l===c?0:(0-l)/(c-l);return new t.MercatorCoordinate(t.number(n[0]/r,i[0]/o,u)/this.worldSize,t.number(s,a,u)/this.worldSize)},wi.prototype.coordinatePoint=function(e){var n=[e.x*this.worldSize,e.y*this.worldSize,0,1];return t.transformMat4(n,n,this.pixelMatrix),new t.Point(n[0]/n[3],n[1]/n[3])},wi.prototype.getBounds=function(){return(new t.LngLatBounds).extend(this.pointLocation(new t.Point(0,0))).extend(this.pointLocation(new t.Point(this.width,0))).extend(this.pointLocation(new t.Point(this.width,this.height))).extend(this.pointLocation(new t.Point(0,this.height)))},wi.prototype.getMaxBounds=function(){return this.latRange&&2===this.latRange.length&&this.lngRange&&2===this.lngRange.length?new t.LngLatBounds([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null},wi.prototype.setMaxBounds=function(t){t?(this.lngRange=[t.getWest(),t.getEast()],this.latRange=[t.getSouth(),t.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-this.maxValidLatitude,this.maxValidLatitude])},wi.prototype.calculatePosMatrix=function(e,n){void 0===n&&(n=!1);var i=e.key,r=n?this._alignedPosMatrixCache:this._posMatrixCache;if(r[i])return r[i];var o=e.canonical,s=this.worldSize/this.zoomScale(o.z),a=o.x+Math.pow(2,o.z)*e.wrap,l=t.identity(new Float64Array(16));return t.translate(l,l,[a*s,o.y*s,0]),t.scale(l,l,[s/t.EXTENT,s/t.EXTENT,1]),t.multiply(l,n?this.alignedProjMatrix:this.projMatrix,l),r[i]=new Float32Array(l),r[i]},wi.prototype.customLayerMatrix=function(){return this.mercatorMatrix.slice()},wi.prototype._constrain=function(){if(this.center&&this.width&&this.height&&!this._constraining){this._constraining=!0;var e,n,i,r,o=-90,s=90,a=-180,l=180,c=this.size,u=this._unmodified;if(this.latRange){var h=this.latRange;o=t.mercatorYfromLat(h[1])*this.worldSize,e=(s=t.mercatorYfromLat(h[0])*this.worldSize)-o<c.y?c.y/(s-o):0}if(this.lngRange){var d=this.lngRange;a=t.mercatorXfromLng(d[0])*this.worldSize,n=(l=t.mercatorXfromLng(d[1])*this.worldSize)-a<c.x?c.x/(l-a):0}var p=this.point,f=Math.max(n||0,e||0);if(f)return this.center=this.unproject(new t.Point(n?(l+a)/2:p.x,e?(s+o)/2:p.y)),this.zoom+=this.scaleZoom(f),this._unmodified=u,void(this._constraining=!1);if(this.latRange){var A=p.y,g=c.y/2;A-g<o&&(r=o+g),A+g>s&&(r=s-g)}if(this.lngRange){var m=p.x,y=c.x/2;m-y<a&&(i=a+y),m+y>l&&(i=l-y)}void 0===i&&void 0===r||(this.center=this.unproject(new t.Point(void 0!==i?i:p.x,void 0!==r?r:p.y))),this._unmodified=u,this._constraining=!1}},wi.prototype._calcMatrices=function(){if(this.height){var e=this.centerOffset;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height;var n=Math.PI/2+this._pitch,i=this._fov*(.5+e.y/this.height),r=Math.sin(i)*this.cameraToCenterDistance/Math.sin(t.clamp(Math.PI-n-i,.01,Math.PI-.01)),o=this.point,s=o.x,a=o.y,l=1.01*(Math.cos(Math.PI/2-this._pitch)*r+this.cameraToCenterDistance),c=this.height/50,u=new Float64Array(16);t.perspective(u,this._fov,this.width/this.height,c,l),u[8]=2*-e.x/this.width,u[9]=2*e.y/this.height,t.scale(u,u,[1,-1,1]),t.translate(u,u,[0,0,-this.cameraToCenterDistance]),t.rotateX(u,u,this._pitch),t.rotateZ(u,u,this.angle),t.translate(u,u,[-s,-a,0]),this.mercatorMatrix=t.scale([],u,[this.worldSize,this.worldSize,this.worldSize]),t.scale(u,u,[1,1,t.mercatorZfromAltitude(1,this.center.lat)*this.worldSize,1]),this.projMatrix=u,this.invProjMatrix=t.invert([],this.projMatrix);var h=this.width%2/2,d=this.height%2/2,p=Math.cos(this.angle),f=Math.sin(this.angle),A=s-Math.round(s)+p*h+f*d,g=a-Math.round(a)+p*d+f*h,m=new Float64Array(u);if(t.translate(m,m,[A>.5?A-1:A,g>.5?g-1:g,0]),this.alignedProjMatrix=m,u=t.create(),t.scale(u,u,[this.width/2,-this.height/2,1]),t.translate(u,u,[1,-1,0]),this.labelPlaneMatrix=u,u=t.create(),t.scale(u,u,[1,-1,1]),t.translate(u,u,[-1,-1,0]),t.scale(u,u,[2/this.width,2/this.height,1]),this.glCoordMatrix=u,this.pixelMatrix=t.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),!(u=t.invert(new Float64Array(16),this.pixelMatrix)))throw new Error("failed to invert matrix");this.pixelMatrixInverse=u,this._posMatrixCache={},this._alignedPosMatrixCache={}}},wi.prototype.maxPitchScaleFactor=function(){if(!this.pixelMatrixInverse)return 1;var e=this.pointCoordinate(new t.Point(0,0)),n=[e.x*this.worldSize,e.y*this.worldSize,0,1];return t.transformMat4(n,n,this.pixelMatrix)[3]/this.cameraToCenterDistance},wi.prototype.getCameraPoint=function(){var e=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new t.Point(0,e))},wi.prototype.getCameraQueryGeometry=function(e){var n=this.getCameraPoint();if(1===e.length)return[e[0],n];for(var i=n.x,r=n.y,o=n.x,s=n.y,a=0,l=e;a<l.length;a+=1){var c=l[a];i=Math.min(i,c.x),r=Math.min(r,c.y),o=Math.max(o,c.x),s=Math.max(s,c.y)}return[new t.Point(i,r),new t.Point(o,r),new t.Point(o,s),new t.Point(i,s),new t.Point(i,r)]},Object.defineProperties(wi.prototype,Ei);var Ci=function(e){var n,i,r,o;this._hashName=e&&encodeURIComponent(e),t.bindAll(["_getCurrentHash","_onHashChange","_updateHash"],this),this._updateHash=(n=this._updateHashUnthrottled.bind(this),i=!1,r=null,o=function(){r=null,i&&(n(),r=setTimeout(o,300),i=!1)},function(){return i=!0,r||o(),r})};Ci.prototype.addTo=function(e){return this._map=e,t.window.addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this},Ci.prototype.remove=function(){return t.window.removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),delete this._map,this},Ci.prototype.getHashString=function(e){var n=this._map.getCenter(),i=Math.round(100*this._map.getZoom())/100,r=Math.ceil((i*Math.LN2+Math.log(512/360/.5))/Math.LN10),o=Math.pow(10,r),s=Math.round(n.lng*o)/o,a=Math.round(n.lat*o)/o,l=this._map.getBearing(),c=this._map.getPitch(),u="";if(u+=e?"/"+s+"/"+a+"/"+i:i+"/"+a+"/"+s,(l||c)&&(u+="/"+Math.round(10*l)/10),c&&(u+="/"+Math.round(c)),this._hashName){var h=this._hashName,d=!1,p=t.window.location.hash.slice(1).split("&").map((function(t){var e=t.split("=")[0];return e===h?(d=!0,e+"="+u):t})).filter((function(t){return t}));return d||p.push(h+"="+u),"#"+p.join("&")}return"#"+u},Ci.prototype._getCurrentHash=function(){var e,n=this,i=t.window.location.hash.replace("#","");return this._hashName?(i.split("&").map((function(t){return t.split("=")})).forEach((function(t){t[0]===n._hashName&&(e=t)})),(e&&e[1]||"").split("/")):i.split("/")},Ci.prototype._onHashChange=function(){var t=this._getCurrentHash();if(t.length>=3&&!t.some((function(t){return isNaN(t)}))){var e=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(t[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+t[2],+t[1]],zoom:+t[0],bearing:e,pitch:+(t[4]||0)}),!0}return!1},Ci.prototype._updateHashUnthrottled=function(){var e=t.window.location.href.replace(/(#.+)?$/,this.getHashString());try{t.window.history.replaceState(t.window.history.state,null,e)}catch(t){}};var Ti={linearity:.3,easing:t.bezier(0,0,.3,1)},Si=t.extend({deceleration:2500,maxSpeed:1400},Ti),Pi=t.extend({deceleration:20,maxSpeed:1400},Ti),Mi=t.extend({deceleration:1e3,maxSpeed:360},Ti),Ii=t.extend({deceleration:1e3,maxSpeed:90},Ti),Bi=function(t){this._map=t,this.clear()};function Ri(t,e){(!t.duration||t.duration<e.duration)&&(t.duration=e.duration,t.easing=e.easing)}function Li(e,n,i){var r=i.maxSpeed,o=i.linearity,s=i.deceleration,a=t.clamp(e*o/(n/1e3),-r,r),l=Math.abs(a)/(s*o);return{easing:i.easing,duration:1e3*l,amount:a*(l/2)}}Bi.prototype.clear=function(){this._inertiaBuffer=[]},Bi.prototype.record=function(e){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:t.browser.now(),settings:e})},Bi.prototype._drainInertiaBuffer=function(){for(var e=this._inertiaBuffer,n=t.browser.now();e.length>0&&n-e[0].time>160;)e.shift()},Bi.prototype._onMoveEnd=function(e){if(this._drainInertiaBuffer(),!(this._inertiaBuffer.length<2)){for(var n={zoom:0,bearing:0,pitch:0,pan:new t.Point(0,0),pinchAround:void 0,around:void 0},i=0,r=this._inertiaBuffer;i<r.length;i+=1){var o=r[i].settings;n.zoom+=o.zoomDelta||0,n.bearing+=o.bearingDelta||0,n.pitch+=o.pitchDelta||0,o.panDelta&&n.pan._add(o.panDelta),o.around&&(n.around=o.around),o.pinchAround&&(n.pinchAround=o.pinchAround)}var s=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,a={};if(n.pan.mag()){var l=Li(n.pan.mag(),s,t.extend({},Si,e||{}));a.offset=n.pan.mult(l.amount/n.pan.mag()),a.center=this._map.transform.center,Ri(a,l)}if(n.zoom){var c=Li(n.zoom,s,Pi);a.zoom=this._map.transform.zoom+c.amount,Ri(a,c)}if(n.bearing){var u=Li(n.bearing,s,Mi);a.bearing=this._map.transform.bearing+t.clamp(u.amount,-179,179),Ri(a,u)}if(n.pitch){var h=Li(n.pitch,s,Ii);a.pitch=this._map.transform.pitch+h.amount,Ri(a,h)}if(a.zoom||a.bearing){var d=void 0===n.pinchAround?n.around:n.pinchAround;a.around=d?this._map.unproject(d):this._map.getCenter()}return this.clear(),t.extend(a,{noMoveStart:!0})}};var Oi=function(e){function i(i,r,o,s){void 0===s&&(s={});var a=n.mousePos(r.getCanvasContainer(),o),l=r.unproject(a);e.call(this,i,t.extend({point:a,lngLat:l,originalEvent:o},s)),this._defaultPrevented=!1,this.target=r}e&&(i.__proto__=e),(i.prototype=Object.create(e&&e.prototype)).constructor=i;var r={defaultPrevented:{configurable:!0}};return i.prototype.preventDefault=function(){this._defaultPrevented=!0},r.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(i.prototype,r),i}(t.Event),Di=function(e){function i(i,r,o){var s="touchend"===i?o.changedTouches:o.touches,a=n.touchPos(r.getCanvasContainer(),s),l=a.map((function(t){return r.unproject(t)})),c=a.reduce((function(t,e,n,i){return t.add(e.div(i.length))}),new t.Point(0,0)),u=r.unproject(c);e.call(this,i,{points:a,point:c,lngLats:l,lngLat:u,originalEvent:o}),this._defaultPrevented=!1}e&&(i.__proto__=e),(i.prototype=Object.create(e&&e.prototype)).constructor=i;var r={defaultPrevented:{configurable:!0}};return i.prototype.preventDefault=function(){this._defaultPrevented=!0},r.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(i.prototype,r),i}(t.Event),ki=function(t){function e(e,n,i){t.call(this,e,{originalEvent:i}),this._defaultPrevented=!1}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={defaultPrevented:{configurable:!0}};return e.prototype.preventDefault=function(){this._defaultPrevented=!0},n.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(e.prototype,n),e}(t.Event),Fi=function(t,e){this._map=t,this._clickTolerance=e.clickTolerance};Fi.prototype.reset=function(){delete this._mousedownPos},Fi.prototype.wheel=function(t){return this._firePreventable(new ki(t.type,this._map,t))},Fi.prototype.mousedown=function(t,e){return this._mousedownPos=e,this._firePreventable(new Oi(t.type,this._map,t))},Fi.prototype.mouseup=function(t){this._map.fire(new Oi(t.type,this._map,t))},Fi.prototype.click=function(t,e){this._mousedownPos&&this._mousedownPos.dist(e)>=this._clickTolerance||this._map.fire(new Oi(t.type,this._map,t))},Fi.prototype.dblclick=function(t){return this._firePreventable(new Oi(t.type,this._map,t))},Fi.prototype.mouseover=function(t){this._map.fire(new Oi(t.type,this._map,t))},Fi.prototype.mouseout=function(t){this._map.fire(new Oi(t.type,this._map,t))},Fi.prototype.touchstart=function(t){return this._firePreventable(new Di(t.type,this._map,t))},Fi.prototype.touchmove=function(t){this._map.fire(new Di(t.type,this._map,t))},Fi.prototype.touchend=function(t){this._map.fire(new Di(t.type,this._map,t))},Fi.prototype.touchcancel=function(t){this._map.fire(new Di(t.type,this._map,t))},Fi.prototype._firePreventable=function(t){if(this._map.fire(t),t.defaultPrevented)return{}},Fi.prototype.isEnabled=function(){return!0},Fi.prototype.isActive=function(){return!1},Fi.prototype.enable=function(){},Fi.prototype.disable=function(){};var Ni=function(t){this._map=t};Ni.prototype.reset=function(){this._delayContextMenu=!1,delete this._contextMenuEvent},Ni.prototype.mousemove=function(t){this._map.fire(new Oi(t.type,this._map,t))},Ni.prototype.mousedown=function(){this._delayContextMenu=!0},Ni.prototype.mouseup=function(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Oi("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)},Ni.prototype.contextmenu=function(t){this._delayContextMenu?this._contextMenuEvent=t:this._map.fire(new Oi(t.type,this._map,t)),this._map.listens("contextmenu")&&t.preventDefault()},Ni.prototype.isEnabled=function(){return!0},Ni.prototype.isActive=function(){return!1},Ni.prototype.enable=function(){},Ni.prototype.disable=function(){};var zi=function(t,e){this._map=t,this._el=t.getCanvasContainer(),this._container=t.getContainer(),this._clickTolerance=e.clickTolerance||1};function Ui(t,e){for(var n={},i=0;i<t.length;i++)n[t[i].identifier]=e[i];return n}zi.prototype.isEnabled=function(){return!!this._enabled},zi.prototype.isActive=function(){return!!this._active},zi.prototype.enable=function(){this.isEnabled()||(this._enabled=!0)},zi.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},zi.prototype.mousedown=function(t,e){this.isEnabled()&&t.shiftKey&&0===t.button&&(n.disableDrag(),this._startPos=this._lastPos=e,this._active=!0)},zi.prototype.mousemoveWindow=function(t,e){if(this._active){var i=e;if(!(this._lastPos.equals(i)||!this._box&&i.dist(this._startPos)<this._clickTolerance)){var r=this._startPos;this._lastPos=i,this._box||(this._box=n.create("div","mapboxgl-boxzoom",this._container),this._container.classList.add("mapboxgl-crosshair"),this._fireEvent("boxzoomstart",t));var o=Math.min(r.x,i.x),s=Math.max(r.x,i.x),a=Math.min(r.y,i.y),l=Math.max(r.y,i.y);n.setTransform(this._box,"translate("+o+"px,"+a+"px)"),this._box.style.width=s-o+"px",this._box.style.height=l-a+"px"}}},zi.prototype.mouseupWindow=function(e,i){var r=this;if(this._active&&0===e.button){var o=this._startPos,s=i;if(this.reset(),n.suppressClick(),o.x!==s.x||o.y!==s.y)return this._map.fire(new t.Event("boxzoomend",{originalEvent:e})),{cameraAnimation:function(t){return t.fitScreenCoordinates(o,s,r._map.getBearing(),{linear:!0})}};this._fireEvent("boxzoomcancel",e)}},zi.prototype.keydown=function(t){this._active&&27===t.keyCode&&(this.reset(),this._fireEvent("boxzoomcancel",t))},zi.prototype.blur=function(){this.reset()},zi.prototype.reset=function(){this._active=!1,this._container.classList.remove("mapboxgl-crosshair"),this._box&&(n.remove(this._box),this._box=null),n.enableDrag(),delete this._startPos,delete this._lastPos},zi.prototype._fireEvent=function(e,n){return this._map.fire(new t.Event(e,{originalEvent:n}))};var Gi=function(t){this.reset(),this.numTouches=t.numTouches};Gi.prototype.reset=function(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1},Gi.prototype.touchstart=function(e,n,i){(this.centroid||i.length>this.numTouches)&&(this.aborted=!0),this.aborted||(void 0===this.startTime&&(this.startTime=e.timeStamp),i.length===this.numTouches&&(this.centroid=function(e){for(var n=new t.Point(0,0),i=0,r=e;i<r.length;i+=1)n._add(r[i]);return n.div(e.length)}(n),this.touches=Ui(i,n)))},Gi.prototype.touchmove=function(t,e,n){if(!this.aborted&&this.centroid){var i=Ui(n,e);for(var r in this.touches){var o=i[r];(!o||o.dist(this.touches[r])>30)&&(this.aborted=!0)}}},Gi.prototype.touchend=function(t,e,n){if((!this.centroid||t.timeStamp-this.startTime>500)&&(this.aborted=!0),0===n.length){var i=!this.aborted&&this.centroid;if(this.reset(),i)return i}};var Vi=function(t){this.singleTap=new Gi(t),this.numTaps=t.numTaps,this.reset()};Vi.prototype.reset=function(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()},Vi.prototype.touchstart=function(t,e,n){this.singleTap.touchstart(t,e,n)},Vi.prototype.touchmove=function(t,e,n){this.singleTap.touchmove(t,e,n)},Vi.prototype.touchend=function(t,e,n){var i=this.singleTap.touchend(t,e,n);if(i){var r=t.timeStamp-this.lastTime<500,o=!this.lastTap||this.lastTap.dist(i)<30;if(r&&o||this.reset(),this.count++,this.lastTime=t.timeStamp,this.lastTap=i,this.count===this.numTaps)return this.reset(),i}};var ji=function(){this._zoomIn=new Vi({numTouches:1,numTaps:2}),this._zoomOut=new Vi({numTouches:2,numTaps:1}),this.reset()};ji.prototype.reset=function(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()},ji.prototype.touchstart=function(t,e,n){this._zoomIn.touchstart(t,e,n),this._zoomOut.touchstart(t,e,n)},ji.prototype.touchmove=function(t,e,n){this._zoomIn.touchmove(t,e,n),this._zoomOut.touchmove(t,e,n)},ji.prototype.touchend=function(t,e,n){var i=this,r=this._zoomIn.touchend(t,e,n),o=this._zoomOut.touchend(t,e,n);return r?(this._active=!0,t.preventDefault(),setTimeout((function(){return i.reset()}),0),{cameraAnimation:function(e){return e.easeTo({duration:300,zoom:e.getZoom()+1,around:e.unproject(r)},{originalEvent:t})}}):o?(this._active=!0,t.preventDefault(),setTimeout((function(){return i.reset()}),0),{cameraAnimation:function(e){return e.easeTo({duration:300,zoom:e.getZoom()-1,around:e.unproject(o)},{originalEvent:t})}}):void 0},ji.prototype.touchcancel=function(){this.reset()},ji.prototype.enable=function(){this._enabled=!0},ji.prototype.disable=function(){this._enabled=!1,this.reset()},ji.prototype.isEnabled=function(){return this._enabled},ji.prototype.isActive=function(){return this._active};var Hi={0:1,2:2},Wi=function(t){this.reset(),this._clickTolerance=t.clickTolerance||1};Wi.prototype.blur=function(){this.reset()},Wi.prototype.reset=function(){this._active=!1,this._moved=!1,delete this._lastPoint,delete this._eventButton},Wi.prototype._correctButton=function(t,e){return!1},Wi.prototype._move=function(t,e){return{}},Wi.prototype.mousedown=function(t,e){if(!this._lastPoint){var i=n.mouseButton(t);this._correctButton(t,i)&&(this._lastPoint=e,this._eventButton=i)}},Wi.prototype.mousemoveWindow=function(t,e){var n=this._lastPoint;if(n)if(t.preventDefault(),function(t,e){var n=Hi[e];return void 0===t.buttons||(t.buttons&n)!==n}(t,this._eventButton))this.reset();else if(this._moved||!(e.dist(n)<this._clickTolerance))return this._moved=!0,this._lastPoint=e,this._move(n,e)},Wi.prototype.mouseupWindow=function(t){this._lastPoint&&n.mouseButton(t)===this._eventButton&&(this._moved&&n.suppressClick(),this.reset())},Wi.prototype.enable=function(){this._enabled=!0},Wi.prototype.disable=function(){this._enabled=!1,this.reset()},Wi.prototype.isEnabled=function(){return this._enabled},Wi.prototype.isActive=function(){return this._active};var qi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.mousedown=function(e,n){t.prototype.mousedown.call(this,e,n),this._lastPoint&&(this._active=!0)},e.prototype._correctButton=function(t,e){return 0===e&&!t.ctrlKey},e.prototype._move=function(t,e){return{around:e,panDelta:e.sub(t)}},e}(Wi),Zi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._correctButton=function(t,e){return 0===e&&t.ctrlKey||2===e},e.prototype._move=function(t,e){var n=.8*(e.x-t.x);if(n)return this._active=!0,{bearingDelta:n}},e.prototype.contextmenu=function(t){t.preventDefault()},e}(Wi),Xi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._correctButton=function(t,e){return 0===e&&t.ctrlKey||2===e},e.prototype._move=function(t,e){var n=-.5*(e.y-t.y);if(n)return this._active=!0,{pitchDelta:n}},e.prototype.contextmenu=function(t){t.preventDefault()},e}(Wi),Ki=function(t){this._minTouches=1,this._clickTolerance=t.clickTolerance||1,this.reset()};Ki.prototype.reset=function(){this._active=!1,this._touches={},this._sum=new t.Point(0,0)},Ki.prototype.touchstart=function(t,e,n){return this._calculateTransform(t,e,n)},Ki.prototype.touchmove=function(t,e,n){if(this._active&&!(n.length<this._minTouches))return t.preventDefault(),this._calculateTransform(t,e,n)},Ki.prototype.touchend=function(t,e,n){this._calculateTransform(t,e,n),this._active&&n.length<this._minTouches&&this.reset()},Ki.prototype.touchcancel=function(){this.reset()},Ki.prototype._calculateTransform=function(e,n,i){i.length>0&&(this._active=!0);var r=Ui(i,n),o=new t.Point(0,0),s=new t.Point(0,0),a=0;for(var l in r){var c=r[l],u=this._touches[l];u&&(o._add(c),s._add(c.sub(u)),a++,r[l]=c)}if(this._touches=r,!(a<this._minTouches)&&s.mag()){var h=s.div(a);if(this._sum._add(h),!(this._sum.mag()<this._clickTolerance))return{around:o.div(a),panDelta:h}}},Ki.prototype.enable=function(){this._enabled=!0},Ki.prototype.disable=function(){this._enabled=!1,this.reset()},Ki.prototype.isEnabled=function(){return this._enabled},Ki.prototype.isActive=function(){return this._active};var Qi=function(){this.reset()};function Ji(t,e,n){for(var i=0;i<t.length;i++)if(t[i].identifier===n)return e[i]}function Yi(t,e){return Math.log(t/e)/Math.LN2}Qi.prototype.reset=function(){this._active=!1,delete this._firstTwoTouches},Qi.prototype._start=function(t){},Qi.prototype._move=function(t,e,n){return{}},Qi.prototype.touchstart=function(t,e,n){this._firstTwoTouches||n.length<2||(this._firstTwoTouches=[n[0].identifier,n[1].identifier],this._start([e[0],e[1]]))},Qi.prototype.touchmove=function(t,e,n){if(this._firstTwoTouches){t.preventDefault();var i=this._firstTwoTouches,r=i[1],o=Ji(n,e,i[0]),s=Ji(n,e,r);if(o&&s){var a=this._aroundCenter?null:o.add(s).div(2);return this._move([o,s],a,t)}}},Qi.prototype.touchend=function(t,e,i){if(this._firstTwoTouches){var r=this._firstTwoTouches,o=r[1],s=Ji(i,e,r[0]),a=Ji(i,e,o);s&&a||(this._active&&n.suppressClick(),this.reset())}},Qi.prototype.touchcancel=function(){this.reset()},Qi.prototype.enable=function(t){this._enabled=!0,this._aroundCenter=!!t&&"center"===t.around},Qi.prototype.disable=function(){this._enabled=!1,this.reset()},Qi.prototype.isEnabled=function(){return this._enabled},Qi.prototype.isActive=function(){return this._active};var $i=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.reset=function(){t.prototype.reset.call(this),delete this._distance,delete this._startDistance},e.prototype._start=function(t){this._startDistance=this._distance=t[0].dist(t[1])},e.prototype._move=function(t,e){var n=this._distance;if(this._distance=t[0].dist(t[1]),this._active||!(Math.abs(Yi(this._distance,this._startDistance))<.1))return this._active=!0,{zoomDelta:Yi(this._distance,n),pinchAround:e}},e}(Qi);function tr(t,e){return 180*t.angleWith(e)/Math.PI}var er=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.reset=function(){t.prototype.reset.call(this),delete this._minDiameter,delete this._startVector,delete this._vector},e.prototype._start=function(t){this._startVector=this._vector=t[0].sub(t[1]),this._minDiameter=t[0].dist(t[1])},e.prototype._move=function(t,e){var n=this._vector;if(this._vector=t[0].sub(t[1]),this._active||!this._isBelowThreshold(this._vector))return this._active=!0,{bearingDelta:tr(this._vector,n),pinchAround:e}},e.prototype._isBelowThreshold=function(t){this._minDiameter=Math.min(this._minDiameter,t.mag());var e=25/(Math.PI*this._minDiameter)*360,n=tr(t,this._startVector);return Math.abs(n)<e},e}(Qi);function nr(t){return Math.abs(t.y)>Math.abs(t.x)}var ir=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.reset=function(){t.prototype.reset.call(this),this._valid=void 0,delete this._firstMove,delete this._lastPoints},e.prototype._start=function(t){this._lastPoints=t,nr(t[0].sub(t[1]))&&(this._valid=!1)},e.prototype._move=function(t,e,n){var i=t[0].sub(this._lastPoints[0]),r=t[1].sub(this._lastPoints[1]);if(this._valid=this.gestureBeginsVertically(i,r,n.timeStamp),this._valid)return this._lastPoints=t,this._active=!0,{pitchDelta:(i.y+r.y)/2*-.5}},e.prototype.gestureBeginsVertically=function(t,e,n){if(void 0!==this._valid)return this._valid;var i=t.mag()>=2,r=e.mag()>=2;if(i||r){if(!i||!r)return void 0===this._firstMove&&(this._firstMove=n),n-this._firstMove<100&&void 0;var o=t.y>0==e.y>0;return nr(t)&&nr(e)&&o}},e}(Qi),rr={panStep:100,bearingStep:15,pitchStep:10},or=function(){var t=rr;this._panStep=t.panStep,this._bearingStep=t.bearingStep,this._pitchStep=t.pitchStep,this._rotationDisabled=!1};function sr(t){return t*(2-t)}or.prototype.blur=function(){this.reset()},or.prototype.reset=function(){this._active=!1},or.prototype.keydown=function(t){var e=this;if(!(t.altKey||t.ctrlKey||t.metaKey)){var n=0,i=0,r=0,o=0,s=0;switch(t.keyCode){case 61:case 107:case 171:case 187:n=1;break;case 189:case 109:case 173:n=-1;break;case 37:t.shiftKey?i=-1:(t.preventDefault(),o=-1);break;case 39:t.shiftKey?i=1:(t.preventDefault(),o=1);break;case 38:t.shiftKey?r=1:(t.preventDefault(),s=-1);break;case 40:t.shiftKey?r=-1:(t.preventDefault(),s=1);break;default:return}return this._rotationDisabled&&(i=0,r=0),{cameraAnimation:function(a){var l=a.getZoom();a.easeTo({duration:300,easeId:"keyboardHandler",easing:sr,zoom:n?Math.round(l)+n*(t.shiftKey?2:1):l,bearing:a.getBearing()+i*e._bearingStep,pitch:a.getPitch()+r*e._pitchStep,offset:[-o*e._panStep,-s*e._panStep],center:a.getCenter()},{originalEvent:t})}}}},or.prototype.enable=function(){this._enabled=!0},or.prototype.disable=function(){this._enabled=!1,this.reset()},or.prototype.isEnabled=function(){return this._enabled},or.prototype.isActive=function(){return this._active},or.prototype.disableRotation=function(){this._rotationDisabled=!0},or.prototype.enableRotation=function(){this._rotationDisabled=!1};var ar=function(e,n){this._map=e,this._el=e.getCanvasContainer(),this._handler=n,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=1/450,t.bindAll(["_onTimeout"],this)};ar.prototype.setZoomRate=function(t){this._defaultZoomRate=t},ar.prototype.setWheelZoomRate=function(t){this._wheelZoomRate=t},ar.prototype.isEnabled=function(){return!!this._enabled},ar.prototype.isActive=function(){return!!this._active||void 0!==this._finishTimeout},ar.prototype.isZooming=function(){return!!this._zooming},ar.prototype.enable=function(t){this.isEnabled()||(this._enabled=!0,this._aroundCenter=t&&"center"===t.around)},ar.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},ar.prototype.wheel=function(e){if(this.isEnabled()){var n=e.deltaMode===t.window.WheelEvent.DOM_DELTA_LINE?40*e.deltaY:e.deltaY,i=t.browser.now(),r=i-(this._lastWheelEventTime||0);this._lastWheelEventTime=i,0!==n&&n%4.000244140625==0?this._type="wheel":0!==n&&Math.abs(n)<4?this._type="trackpad":r>400?(this._type=null,this._lastValue=n,this._timeout=setTimeout(this._onTimeout,40,e)):this._type||(this._type=Math.abs(r*n)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,n+=this._lastValue)),e.shiftKey&&n&&(n/=4),this._type&&(this._lastWheelEvent=e,this._delta-=n,this._active||this._start(e)),e.preventDefault()}},ar.prototype._onTimeout=function(t){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(t)},ar.prototype._start=function(e){if(this._delta){this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);var i=n.mousePos(this._el,e);this._around=t.LngLat.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(i)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}},ar.prototype.renderFrame=function(){var e=this;if(this._frameId&&(this._frameId=null,this.isActive())){var n=this._map.transform;if(0!==this._delta){var i="wheel"===this._type&&Math.abs(this._delta)>4.000244140625?this._wheelZoomRate:this._defaultZoomRate,r=2/(1+Math.exp(-Math.abs(this._delta*i)));this._delta<0&&0!==r&&(r=1/r);var o="number"==typeof this._targetZoom?n.zoomScale(this._targetZoom):n.scale;this._targetZoom=Math.min(n.maxZoom,Math.max(n.minZoom,n.scaleZoom(o*r))),"wheel"===this._type&&(this._startZoom=n.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}var s,a="number"==typeof this._targetZoom?this._targetZoom:n.zoom,l=this._startZoom,c=this._easing,u=!1;if("wheel"===this._type&&l&&c){var h=Math.min((t.browser.now()-this._lastWheelEventTime)/200,1),d=c(h);s=t.number(l,a,d),h<1?this._frameId||(this._frameId=!0):u=!0}else s=a,u=!0;return this._active=!0,u&&(this._active=!1,this._finishTimeout=setTimeout((function(){e._zooming=!1,e._handler._triggerRenderFrame(),delete e._targetZoom,delete e._finishTimeout}),200)),{noInertia:!0,needsRenderFrame:!u,zoomDelta:s-n.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}},ar.prototype._smoothOutEasing=function(e){var n=t.ease;if(this._prevEase){var i=this._prevEase,r=(t.browser.now()-i.start)/i.duration,o=i.easing(r+.01)-i.easing(r),s=.27/Math.sqrt(o*o+1e-4)*.01,a=Math.sqrt(.0729-s*s);n=t.bezier(s,a,.25,1)}return this._prevEase={start:t.browser.now(),duration:e,easing:n},n},ar.prototype.blur=function(){this.reset()},ar.prototype.reset=function(){this._active=!1};var lr=function(t,e){this._clickZoom=t,this._tapZoom=e};lr.prototype.enable=function(){this._clickZoom.enable(),this._tapZoom.enable()},lr.prototype.disable=function(){this._clickZoom.disable(),this._tapZoom.disable()},lr.prototype.isEnabled=function(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()},lr.prototype.isActive=function(){return this._clickZoom.isActive()||this._tapZoom.isActive()};var cr=function(){this.reset()};cr.prototype.reset=function(){this._active=!1},cr.prototype.blur=function(){this.reset()},cr.prototype.dblclick=function(t,e){return t.preventDefault(),{cameraAnimation:function(n){n.easeTo({duration:300,zoom:n.getZoom()+(t.shiftKey?-1:1),around:n.unproject(e)},{originalEvent:t})}}},cr.prototype.enable=function(){this._enabled=!0},cr.prototype.disable=function(){this._enabled=!1,this.reset()},cr.prototype.isEnabled=function(){return this._enabled},cr.prototype.isActive=function(){return this._active};var ur=function(){this._tap=new Vi({numTouches:1,numTaps:1}),this.reset()};ur.prototype.reset=function(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,this._tap.reset()},ur.prototype.touchstart=function(t,e,n){this._swipePoint||(this._tapTime&&t.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?n.length>0&&(this._swipePoint=e[0],this._swipeTouch=n[0].identifier):this._tap.touchstart(t,e,n))},ur.prototype.touchmove=function(t,e,n){if(this._tapTime){if(this._swipePoint){if(n[0].identifier!==this._swipeTouch)return;var i=e[0],r=i.y-this._swipePoint.y;return this._swipePoint=i,t.preventDefault(),this._active=!0,{zoomDelta:r/128}}}else this._tap.touchmove(t,e,n)},ur.prototype.touchend=function(t,e,n){this._tapTime?this._swipePoint&&0===n.length&&this.reset():this._tap.touchend(t,e,n)&&(this._tapTime=t.timeStamp)},ur.prototype.touchcancel=function(){this.reset()},ur.prototype.enable=function(){this._enabled=!0},ur.prototype.disable=function(){this._enabled=!1,this.reset()},ur.prototype.isEnabled=function(){return this._enabled},ur.prototype.isActive=function(){return this._active};var hr=function(t,e,n){this._el=t,this._mousePan=e,this._touchPan=n};hr.prototype.enable=function(t){this._inertiaOptions=t||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("mapboxgl-touch-drag-pan")},hr.prototype.disable=function(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("mapboxgl-touch-drag-pan")},hr.prototype.isEnabled=function(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()},hr.prototype.isActive=function(){return this._mousePan.isActive()||this._touchPan.isActive()};var dr=function(t,e,n){this._pitchWithRotate=t.pitchWithRotate,this._mouseRotate=e,this._mousePitch=n};dr.prototype.enable=function(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()},dr.prototype.disable=function(){this._mouseRotate.disable(),this._mousePitch.disable()},dr.prototype.isEnabled=function(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())},dr.prototype.isActive=function(){return this._mouseRotate.isActive()||this._mousePitch.isActive()};var pr=function(t,e,n,i){this._el=t,this._touchZoom=e,this._touchRotate=n,this._tapDragZoom=i,this._rotationDisabled=!1,this._enabled=!0};pr.prototype.enable=function(t){this._touchZoom.enable(t),this._rotationDisabled||this._touchRotate.enable(t),this._tapDragZoom.enable(),this._el.classList.add("mapboxgl-touch-zoom-rotate")},pr.prototype.disable=function(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("mapboxgl-touch-zoom-rotate")},pr.prototype.isEnabled=function(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()},pr.prototype.isActive=function(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()},pr.prototype.disableRotation=function(){this._rotationDisabled=!0,this._touchRotate.disable()},pr.prototype.enableRotation=function(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()};var fr=function(t){return t.zoom||t.drag||t.pitch||t.rotate},Ar=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(t.Event);function gr(t){return t.panDelta&&t.panDelta.mag()||t.zoomDelta||t.bearingDelta||t.pitchDelta}var mr=function(e,i){this._map=e,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Bi(e),this._bearingSnap=i.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(i),t.bindAll(["handleEvent","handleWindowEvent"],this);var r=this._el;this._listeners=[[r,"touchstart",{passive:!0}],[r,"touchmove",{passive:!1}],[r,"touchend",void 0],[r,"touchcancel",void 0],[r,"mousedown",void 0],[r,"mousemove",void 0],[r,"mouseup",void 0],[t.window.document,"mousemove",{capture:!0}],[t.window.document,"mouseup",void 0],[r,"mouseover",void 0],[r,"mouseout",void 0],[r,"dblclick",void 0],[r,"click",void 0],[r,"keydown",{capture:!1}],[r,"keyup",void 0],[r,"wheel",{passive:!1}],[r,"contextmenu",void 0],[t.window,"blur",void 0]];for(var o=0,s=this._listeners;o<s.length;o+=1){var a=s[o],l=a[0];n.addEventListener(l,a[1],l===t.window.document?this.handleWindowEvent:this.handleEvent,a[2])}};mr.prototype.destroy=function(){for(var e=0,i=this._listeners;e<i.length;e+=1){var r=i[e],o=r[0];n.removeEventListener(o,r[1],o===t.window.document?this.handleWindowEvent:this.handleEvent,r[2])}},mr.prototype._addDefaultHandlers=function(t){var e=this._map,n=e.getCanvasContainer();this._add("mapEvent",new Fi(e,t));var i=e.boxZoom=new zi(e,t);this._add("boxZoom",i);var r=new ji,o=new cr;e.doubleClickZoom=new lr(o,r),this._add("tapZoom",r),this._add("clickZoom",o);var s=new ur;this._add("tapDragZoom",s);var a=e.touchPitch=new ir;this._add("touchPitch",a);var l=new Zi(t),c=new Xi(t);e.dragRotate=new dr(t,l,c),this._add("mouseRotate",l,["mousePitch"]),this._add("mousePitch",c,["mouseRotate"]);var u=new qi(t),h=new Ki(t);e.dragPan=new hr(n,u,h),this._add("mousePan",u),this._add("touchPan",h,["touchZoom","touchRotate"]);var d=new er,p=new $i;e.touchZoomRotate=new pr(n,p,d,s),this._add("touchRotate",d,["touchPan","touchZoom"]),this._add("touchZoom",p,["touchPan","touchRotate"]);var f=e.scrollZoom=new ar(e,this);this._add("scrollZoom",f,["mousePan"]);var A=e.keyboard=new or;this._add("keyboard",A),this._add("blockableMapEvent",new Ni(e));for(var g=0,m=["boxZoom","doubleClickZoom","tapDragZoom","touchPitch","dragRotate","dragPan","touchZoomRotate","scrollZoom","keyboard"];g<m.length;g+=1){var y=m[g];t.interactive&&t[y]&&e[y].enable(t[y])}},mr.prototype._add=function(t,e,n){this._handlers.push({handlerName:t,handler:e,allowed:n}),this._handlersById[t]=e},mr.prototype.stop=function(t){if(!this._updatingCamera){for(var e=0,n=this._handlers;e<n.length;e+=1)n[e].handler.reset();this._inertia.clear(),this._fireEvents({},{},t),this._changes=[]}},mr.prototype.isActive=function(){for(var t=0,e=this._handlers;t<e.length;t+=1)if(e[t].handler.isActive())return!0;return!1},mr.prototype.isZooming=function(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()},mr.prototype.isRotating=function(){return!!this._eventsInProgress.rotate},mr.prototype.isMoving=function(){return Boolean(fr(this._eventsInProgress))||this.isZooming()},mr.prototype._blockedByActive=function(t,e,n){for(var i in t)if(i!==n&&(!e||e.indexOf(i)<0))return!0;return!1},mr.prototype.handleWindowEvent=function(t){this.handleEvent(t,t.type+"Window")},mr.prototype._getMapTouches=function(t){for(var e=[],n=0,i=t;n<i.length;n+=1){var r=i[n];this._el.contains(r.target)&&e.push(r)}return e},mr.prototype.handleEvent=function(t,e){this._updatingCamera=!0;for(var i="renderFrame"===t.type?void 0:t,r={needsRenderFrame:!1},o={},s={},a=t.touches?this._getMapTouches(t.touches):void 0,l=a?n.touchPos(this._el,a):n.mousePos(this._el,t),c=0,u=this._handlers;c<u.length;c+=1){var h=u[c],d=h.handlerName,p=h.handler,f=h.allowed;if(p.isEnabled()){var A=void 0;this._blockedByActive(s,f,d)?p.reset():p[e||t.type]&&(A=p[e||t.type](t,l,a),this.mergeHandlerResult(r,o,A,d,i),A&&A.needsRenderFrame&&this._triggerRenderFrame()),(A||p.isActive())&&(s[d]=p)}}var g={};for(var m in this._previousActiveHandlers)s[m]||(g[m]=i);this._previousActiveHandlers=s,(Object.keys(g).length||gr(r))&&(this._changes.push([r,o,g]),this._triggerRenderFrame()),(Object.keys(s).length||gr(r))&&this._map._stop(!0),this._updatingCamera=!1;var y=r.cameraAnimation;y&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],y(this._map))},mr.prototype.mergeHandlerResult=function(e,n,i,r,o){if(i){t.extend(e,i);var s={handlerName:r,originalEvent:i.originalEvent||o};void 0!==i.zoomDelta&&(n.zoom=s),void 0!==i.panDelta&&(n.drag=s),void 0!==i.pitchDelta&&(n.pitch=s),void 0!==i.bearingDelta&&(n.rotate=s)}},mr.prototype._applyChanges=function(){for(var e={},n={},i={},r=0,o=this._changes;r<o.length;r+=1){var s=o[r],a=s[0],l=s[1],c=s[2];a.panDelta&&(e.panDelta=(e.panDelta||new t.Point(0,0))._add(a.panDelta)),a.zoomDelta&&(e.zoomDelta=(e.zoomDelta||0)+a.zoomDelta),a.bearingDelta&&(e.bearingDelta=(e.bearingDelta||0)+a.bearingDelta),a.pitchDelta&&(e.pitchDelta=(e.pitchDelta||0)+a.pitchDelta),void 0!==a.around&&(e.around=a.around),void 0!==a.pinchAround&&(e.pinchAround=a.pinchAround),a.noInertia&&(e.noInertia=a.noInertia),t.extend(n,l),t.extend(i,c)}this._updateMapTransform(e,n,i),this._changes=[]},mr.prototype._updateMapTransform=function(t,e,n){var i=this._map,r=i.transform;if(!gr(t))return this._fireEvents(e,n,!0);var o=t.panDelta,s=t.zoomDelta,a=t.bearingDelta,l=t.pitchDelta,c=t.around,u=t.pinchAround;void 0!==u&&(c=u),i._stop(!0),c=c||i.transform.centerPoint;var h=r.pointLocation(o?c.sub(o):c);a&&(r.bearing+=a),l&&(r.pitch+=l),s&&(r.zoom+=s),r.setLocationAtPoint(h,c),this._map._update(),t.noInertia||this._inertia.record(t),this._fireEvents(e,n,!0)},mr.prototype._fireEvents=function(e,n,i){var r=this,o=fr(this._eventsInProgress),s=fr(e),a={};for(var l in e)this._eventsInProgress[l]||(a[l+"start"]=e[l].originalEvent),this._eventsInProgress[l]=e[l];for(var c in!o&&s&&this._fireEvent("movestart",s.originalEvent),a)this._fireEvent(c,a[c]);for(var u in s&&this._fireEvent("move",s.originalEvent),e)this._fireEvent(u,e[u].originalEvent);var h,d={};for(var p in this._eventsInProgress){var f=this._eventsInProgress[p],A=f.handlerName,g=f.originalEvent;this._handlersById[A].isActive()||(delete this._eventsInProgress[p],d[p+"end"]=h=n[A]||g)}for(var m in d)this._fireEvent(m,d[m]);var y=fr(this._eventsInProgress);if(i&&(o||s)&&!y){this._updatingCamera=!0;var _=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),v=function(t){return 0!==t&&-r._bearingSnap<t&&t<r._bearingSnap};_?(v(_.bearing||this._map.getBearing())&&(_.bearing=0),this._map.easeTo(_,{originalEvent:h})):(this._map.fire(new t.Event("moveend",{originalEvent:h})),v(this._map.getBearing())&&this._map.resetNorth()),this._updatingCamera=!1}},mr.prototype._fireEvent=function(e,n){this._map.fire(new t.Event(e,n?{originalEvent:n}:{}))},mr.prototype._requestFrame=function(){var t=this;return this._map.triggerRepaint(),this._map._renderTaskQueue.add((function(e){delete t._frameId,t.handleEvent(new Ar("renderFrame",{timeStamp:e})),t._applyChanges()}))},mr.prototype._triggerRenderFrame=function(){void 0===this._frameId&&(this._frameId=this._requestFrame())};var yr=function(e){function n(n,i){e.call(this),this._moving=!1,this._zooming=!1,this.transform=n,this._bearingSnap=i.bearingSnap,t.bindAll(["_renderFrameCallback"],this)}return e&&(n.__proto__=e),(n.prototype=Object.create(e&&e.prototype)).constructor=n,n.prototype.getCenter=function(){return new t.LngLat(this.transform.center.lng,this.transform.center.lat)},n.prototype.setCenter=function(t,e){return this.jumpTo({center:t},e)},n.prototype.panBy=function(e,n,i){return e=t.Point.convert(e).mult(-1),this.panTo(this.transform.center,t.extend({offset:e},n),i)},n.prototype.panTo=function(e,n,i){return this.easeTo(t.extend({center:e},n),i)},n.prototype.getZoom=function(){return this.transform.zoom},n.prototype.setZoom=function(t,e){return this.jumpTo({zoom:t},e),this},n.prototype.zoomTo=function(e,n,i){return this.easeTo(t.extend({zoom:e},n),i)},n.prototype.zoomIn=function(t,e){return this.zoomTo(this.getZoom()+1,t,e),this},n.prototype.zoomOut=function(t,e){return this.zoomTo(this.getZoom()-1,t,e),this},n.prototype.getBearing=function(){return this.transform.bearing},n.prototype.setBearing=function(t,e){return this.jumpTo({bearing:t},e),this},n.prototype.getPadding=function(){return this.transform.padding},n.prototype.setPadding=function(t,e){return this.jumpTo({padding:t},e),this},n.prototype.rotateTo=function(e,n,i){return this.easeTo(t.extend({bearing:e},n),i)},n.prototype.resetNorth=function(e,n){return this.rotateTo(0,t.extend({duration:1e3},e),n),this},n.prototype.resetNorthPitch=function(e,n){return this.easeTo(t.extend({bearing:0,pitch:0,duration:1e3},e),n),this},n.prototype.snapToNorth=function(t,e){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(t,e):this},n.prototype.getPitch=function(){return this.transform.pitch},n.prototype.setPitch=function(t,e){return this.jumpTo({pitch:t},e),this},n.prototype.cameraForBounds=function(e,n){e=t.LngLatBounds.convert(e);var i=n&&n.bearing||0;return this._cameraForBoxAndBearing(e.getNorthWest(),e.getSouthEast(),i,n)},n.prototype._cameraForBoxAndBearing=function(e,n,i,r){var o={top:0,bottom:0,right:0,left:0};if("number"==typeof(r=t.extend({padding:o,offset:[0,0],maxZoom:this.transform.maxZoom},r)).padding){var s=r.padding;r.padding={top:s,bottom:s,right:s,left:s}}r.padding=t.extend(o,r.padding);var a=this.transform,l=a.padding,c=a.project(t.LngLat.convert(e)),u=a.project(t.LngLat.convert(n)),h=c.rotate(-i*Math.PI/180),d=u.rotate(-i*Math.PI/180),p=new t.Point(Math.max(h.x,d.x),Math.max(h.y,d.y)),f=new t.Point(Math.min(h.x,d.x),Math.min(h.y,d.y)),A=p.sub(f),g=(a.width-(l.left+l.right+r.padding.left+r.padding.right))/A.x,m=(a.height-(l.top+l.bottom+r.padding.top+r.padding.bottom))/A.y;if(!(m<0||g<0)){var y=Math.min(a.scaleZoom(a.scale*Math.min(g,m)),r.maxZoom),_="number"==typeof r.offset.x?new t.Point(r.offset.x,r.offset.y):t.Point.convert(r.offset),v=new t.Point((r.padding.left-r.padding.right)/2,(r.padding.top-r.padding.bottom)/2).rotate(i*Math.PI/180),b=_.add(v).mult(a.scale/a.zoomScale(y));return{center:a.unproject(c.add(u).div(2).sub(b)),zoom:y,bearing:i}}t.warnOnce("Map cannot fit within canvas with the given bounds, padding, and/or offset.")},n.prototype.fitBounds=function(t,e,n){return this._fitInternal(this.cameraForBounds(t,e),e,n)},n.prototype.fitScreenCoordinates=function(e,n,i,r,o){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.pointLocation(t.Point.convert(e)),this.transform.pointLocation(t.Point.convert(n)),i,r),r,o)},n.prototype._fitInternal=function(e,n,i){return e?(delete(n=t.extend(e,n)).padding,n.linear?this.easeTo(n,i):this.flyTo(n,i)):this},n.prototype.jumpTo=function(e,n){this.stop();var i=this.transform,r=!1,o=!1,s=!1;return"zoom"in e&&i.zoom!==+e.zoom&&(r=!0,i.zoom=+e.zoom),void 0!==e.center&&(i.center=t.LngLat.convert(e.center)),"bearing"in e&&i.bearing!==+e.bearing&&(o=!0,i.bearing=+e.bearing),"pitch"in e&&i.pitch!==+e.pitch&&(s=!0,i.pitch=+e.pitch),null==e.padding||i.isPaddingEqual(e.padding)||(i.padding=e.padding),this.fire(new t.Event("movestart",n)).fire(new t.Event("move",n)),r&&this.fire(new t.Event("zoomstart",n)).fire(new t.Event("zoom",n)).fire(new t.Event("zoomend",n)),o&&this.fire(new t.Event("rotatestart",n)).fire(new t.Event("rotate",n)).fire(new t.Event("rotateend",n)),s&&this.fire(new t.Event("pitchstart",n)).fire(new t.Event("pitch",n)).fire(new t.Event("pitchend",n)),this.fire(new t.Event("moveend",n))},n.prototype.easeTo=function(e,n){var i=this;this._stop(!1,e.easeId),(!1===(e=t.extend({offset:[0,0],duration:500,easing:t.ease},e)).animate||!e.essential&&t.browser.prefersReducedMotion)&&(e.duration=0);var r=this.transform,o=this.getZoom(),s=this.getBearing(),a=this.getPitch(),l=this.getPadding(),c="zoom"in e?+e.zoom:o,u="bearing"in e?this._normalizeBearing(e.bearing,s):s,h="pitch"in e?+e.pitch:a,d="padding"in e?e.padding:r.padding,p=t.Point.convert(e.offset),f=r.centerPoint.add(p),A=r.pointLocation(f),g=t.LngLat.convert(e.center||A);this._normalizeCenter(g);var m,y,_=r.project(A),v=r.project(g).sub(_),b=r.zoomScale(c-o);e.around&&(m=t.LngLat.convert(e.around),y=r.locationPoint(m));var x={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=this._zooming||c!==o,this._rotating=this._rotating||s!==u,this._pitching=this._pitching||h!==a,this._padding=!r.isPaddingEqual(d),this._easeId=e.easeId,this._prepareEase(n,e.noMoveStart,x),this._ease((function(e){if(i._zooming&&(r.zoom=t.number(o,c,e)),i._rotating&&(r.bearing=t.number(s,u,e)),i._pitching&&(r.pitch=t.number(a,h,e)),i._padding&&(r.interpolatePadding(l,d,e),f=r.centerPoint.add(p)),m)r.setLocationAtPoint(m,y);else{var A=r.zoomScale(r.zoom-o),g=c>o?Math.min(2,b):Math.max(.5,b),x=Math.pow(g,1-e),w=r.unproject(_.add(v.mult(e*x)).mult(A));r.setLocationAtPoint(r.renderWorldCopies?w.wrap():w,f)}i._fireMoveEvents(n)}),(function(t){i._afterEase(n,t)}),e),this},n.prototype._prepareEase=function(e,n,i){void 0===i&&(i={}),this._moving=!0,n||i.moving||this.fire(new t.Event("movestart",e)),this._zooming&&!i.zooming&&this.fire(new t.Event("zoomstart",e)),this._rotating&&!i.rotating&&this.fire(new t.Event("rotatestart",e)),this._pitching&&!i.pitching&&this.fire(new t.Event("pitchstart",e))},n.prototype._fireMoveEvents=function(e){this.fire(new t.Event("move",e)),this._zooming&&this.fire(new t.Event("zoom",e)),this._rotating&&this.fire(new t.Event("rotate",e)),this._pitching&&this.fire(new t.Event("pitch",e))},n.prototype._afterEase=function(e,n){if(!this._easeId||!n||this._easeId!==n){delete this._easeId;var i=this._zooming,r=this._rotating,o=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,i&&this.fire(new t.Event("zoomend",e)),r&&this.fire(new t.Event("rotateend",e)),o&&this.fire(new t.Event("pitchend",e)),this.fire(new t.Event("moveend",e))}},n.prototype.flyTo=function(e,n){var i=this;if(!e.essential&&t.browser.prefersReducedMotion){var r=t.pick(e,["center","zoom","bearing","pitch","around"]);return this.jumpTo(r,n)}this.stop(),e=t.extend({offset:[0,0],speed:1.2,curve:1.42,easing:t.ease},e);var o=this.transform,s=this.getZoom(),a=this.getBearing(),l=this.getPitch(),c=this.getPadding(),u="zoom"in e?t.clamp(+e.zoom,o.minZoom,o.maxZoom):s,h="bearing"in e?this._normalizeBearing(e.bearing,a):a,d="pitch"in e?+e.pitch:l,p="padding"in e?e.padding:o.padding,f=o.zoomScale(u-s),A=t.Point.convert(e.offset),g=o.centerPoint.add(A),m=o.pointLocation(g),y=t.LngLat.convert(e.center||m);this._normalizeCenter(y);var _=o.project(m),v=o.project(y).sub(_),b=e.curve,x=Math.max(o.width,o.height),w=x/f,E=v.mag();if("minZoom"in e){var C=t.clamp(Math.min(e.minZoom,s,u),o.minZoom,o.maxZoom),T=x/o.zoomScale(C-s);b=Math.sqrt(T/E*2)}var S=b*b;function P(t){var e=(w*w-x*x+(t?-1:1)*S*S*E*E)/(2*(t?w:x)*S*E);return Math.log(Math.sqrt(e*e+1)-e)}function M(t){return(Math.exp(t)-Math.exp(-t))/2}function I(t){return(Math.exp(t)+Math.exp(-t))/2}var B=P(0),R=function(t){return I(B)/I(B+b*t)},L=function(t){return x*((I(B)*(M(e=B+b*t)/I(e))-M(B))/S)/E;var e},O=(P(1)-B)/b;if(Math.abs(E)<1e-6||!isFinite(O)){if(Math.abs(x-w)<1e-6)return this.easeTo(e,n);var D=w<x?-1:1;O=Math.abs(Math.log(w/x))/b,L=function(){return 0},R=function(t){return Math.exp(D*b*t)}}return e.duration="duration"in e?+e.duration:1e3*O/("screenSpeed"in e?+e.screenSpeed/b:+e.speed),e.maxDuration&&e.duration>e.maxDuration&&(e.duration=0),this._zooming=!0,this._rotating=a!==h,this._pitching=d!==l,this._padding=!o.isPaddingEqual(p),this._prepareEase(n,!1),this._ease((function(e){var r=e*O,f=1/R(r);o.zoom=1===e?u:s+o.scaleZoom(f),i._rotating&&(o.bearing=t.number(a,h,e)),i._pitching&&(o.pitch=t.number(l,d,e)),i._padding&&(o.interpolatePadding(c,p,e),g=o.centerPoint.add(A));var m=1===e?y:o.unproject(_.add(v.mult(L(r))).mult(f));o.setLocationAtPoint(o.renderWorldCopies?m.wrap():m,g),i._fireMoveEvents(n)}),(function(){return i._afterEase(n)}),e),this},n.prototype.isEasing=function(){return!!this._easeFrameId},n.prototype.stop=function(){return this._stop()},n.prototype._stop=function(t,e){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){var n=this._onEaseEnd;delete this._onEaseEnd,n.call(this,e)}if(!t){var i=this.handlers;i&&i.stop(!1)}return this},n.prototype._ease=function(e,n,i){!1===i.animate||0===i.duration?(e(1),n()):(this._easeStart=t.browser.now(),this._easeOptions=i,this._onEaseFrame=e,this._onEaseEnd=n,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))},n.prototype._renderFrameCallback=function(){var e=Math.min((t.browser.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(e)),e<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},n.prototype._normalizeBearing=function(e,n){e=t.wrap(e,-180,180);var i=Math.abs(e-n);return Math.abs(e-360-n)<i&&(e-=360),Math.abs(e+360-n)<i&&(e+=360),e},n.prototype._normalizeCenter=function(t){var e=this.transform;if(e.renderWorldCopies&&!e.lngRange){var n=t.lng-e.center.lng;t.lng+=n>180?-360:n<-180?360:0}},n}(t.Evented),_r=function(e){void 0===e&&(e={}),this.options=e,t.bindAll(["_toggleAttribution","_updateEditLink","_updateData","_updateCompact"],this)};_r.prototype.getDefaultPosition=function(){return"bottom-right"},_r.prototype.onAdd=function(t){var e=this.options&&this.options.compact;return this._map=t,this._container=n.create("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._compactButton=n.create("button","mapboxgl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=n.create("div","mapboxgl-ctrl-attrib-inner",this._container),this._innerContainer.setAttribute("role","list"),e&&this._container.classList.add("mapboxgl-compact"),this._updateAttributions(),this._updateEditLink(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("moveend",this._updateEditLink),void 0===e&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container},_r.prototype.onRemove=function(){n.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("moveend",this._updateEditLink),this._map.off("resize",this._updateCompact),this._map=void 0,this._attribHTML=void 0},_r.prototype._setElementTitle=function(t,e){var n=this._map._getUIString("AttributionControl."+e);t.title=n,t.setAttribute("aria-label",n)},_r.prototype._toggleAttribution=function(){this._container.classList.contains("mapboxgl-compact-show")?(this._container.classList.remove("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-pressed","false")):(this._container.classList.add("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-pressed","true"))},_r.prototype._updateEditLink=function(){var e=this._editLink;e||(e=this._editLink=this._container.querySelector(".mapbox-improve-map"));var n=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||t.config.ACCESS_TOKEN}];if(e){var i=n.reduce((function(t,e,i){return e.value&&(t+=e.key+"="+e.value+(i<n.length-1?"&":"")),t}),"?");e.href=t.config.FEEDBACK_URL+"/"+i+(this._map._hash?this._map._hash.getHashString(!0):""),e.rel="noopener nofollow",this._setElementTitle(e,"MapFeedback")}},_r.prototype._updateData=function(t){!t||"metadata"!==t.sourceDataType&&"visibility"!==t.sourceDataType&&"style"!==t.dataType||(this._updateAttributions(),this._updateEditLink())},_r.prototype._updateAttributions=function(){if(this._map.style){var t=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?t=t.concat(this.options.customAttribution.map((function(t){return"string"!=typeof t?"":t}))):"string"==typeof this.options.customAttribution&&t.push(this.options.customAttribution)),this._map.style.stylesheet){var e=this._map.style.stylesheet;this.styleOwner=e.owner,this.styleId=e.id}var n=this._map.style.sourceCaches;for(var i in n){var r=n[i];if(r.used){var o=r.getSource();o.attribution&&t.indexOf(o.attribution)<0&&t.push(o.attribution)}}t.sort((function(t,e){return t.length-e.length}));var s=(t=t.filter((function(e,n){for(var i=n+1;i<t.length;i++)if(t[i].indexOf(e)>=0)return!1;return!0}))).join(" | ");s!==this._attribHTML&&(this._attribHTML=s,t.length?(this._innerContainer.innerHTML=s,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null)}},_r.prototype._updateCompact=function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact","mapboxgl-compact-show")};var vr=function(){t.bindAll(["_updateLogo"],this),t.bindAll(["_updateCompact"],this)};vr.prototype.onAdd=function(t){this._map=t,this._container=n.create("div","mapboxgl-ctrl");var e=n.create("a","mapboxgl-ctrl-logo");return e.target="_blank",e.rel="noopener nofollow",e.href="https://www.mapbox.com/",e.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),e.setAttribute("rel","noopener nofollow"),this._container.appendChild(e),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container},vr.prototype.onRemove=function(){n.remove(this._container),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)},vr.prototype.getDefaultPosition=function(){return"bottom-left"},vr.prototype._updateLogo=function(t){t&&"metadata"!==t.sourceDataType||(this._container.style.display=this._logoRequired()?"block":"none")},vr.prototype._logoRequired=function(){if(this._map.style){var t=this._map.style.sourceCaches;for(var e in t)if(t[e].getSource().mapbox_logo)return!0;return!1}},vr.prototype._updateCompact=function(){var t=this._container.children;if(t.length){var e=t[0];this._map.getCanvasContainer().offsetWidth<250?e.classList.add("mapboxgl-compact"):e.classList.remove("mapboxgl-compact")}};var br=function(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1};br.prototype.add=function(t){var e=++this._id;return this._queue.push({callback:t,id:e,cancelled:!1}),e},br.prototype.remove=function(t){for(var e=this._currentlyRunning,n=0,i=e?this._queue.concat(e):this._queue;n<i.length;n+=1){var r=i[n];if(r.id===t)return void(r.cancelled=!0)}},br.prototype.run=function(t){void 0===t&&(t=0);var e=this._currentlyRunning=this._queue;this._queue=[];for(var n=0,i=e;n<i.length;n+=1){var r=i[n];if(!r.cancelled&&(r.callback(t),this._cleared))break}this._cleared=!1,this._currentlyRunning=!1},br.prototype.clear=function(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]};var xr={"AttributionControl.ToggleAttribution":"Toggle attribution","AttributionControl.MapFeedback":"Map feedback","FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"Mapbox logo","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","ScaleControl.Feet":"ft","ScaleControl.Meters":"m","ScaleControl.Kilometers":"km","ScaleControl.Miles":"mi","ScaleControl.NauticalMiles":"nm"},wr=t.window.HTMLImageElement,Er=t.window.HTMLElement,Cr=t.window.ImageBitmap,Tr={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:60,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,bearingSnap:7,clickTolerance:3,pitchWithRotate:!0,hash:!1,attributionControl:!0,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,renderWorldCopies:!0,refreshExpiredTiles:!0,maxTileCacheSize:null,localIdeographFontFamily:"sans-serif",transformRequest:null,accessToken:null,fadeDuration:300,crossSourceCollisions:!0},Sr=function(i){function r(e){var n=this;if(null!=(e=t.extend({},Tr,e)).minZoom&&null!=e.maxZoom&&e.minZoom>e.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(null!=e.minPitch&&null!=e.maxPitch&&e.minPitch>e.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(null!=e.minPitch&&e.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(null!=e.maxPitch&&e.maxPitch>60)throw new Error("maxPitch must be less than or equal to 60");var r=new wi(e.minZoom,e.maxZoom,e.minPitch,e.maxPitch,e.renderWorldCopies);if(i.call(this,r,e),this._interactive=e.interactive,this._maxTileCacheSize=e.maxTileCacheSize,this._failIfMajorPerformanceCaveat=e.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=e.preserveDrawingBuffer,this._antialias=e.antialias,this._trackResize=e.trackResize,this._bearingSnap=e.bearingSnap,this._refreshExpiredTiles=e.refreshExpiredTiles,this._fadeDuration=e.fadeDuration,this._crossSourceCollisions=e.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=e.collectResourceTiming,this._renderTaskQueue=new br,this._controls=[],this._mapId=t.uniqueId(),this._locale=t.extend({},xr,e.locale),this._clickTolerance=e.clickTolerance,this._requestManager=new t.RequestManager(e.transformRequest,e.accessToken),"string"==typeof e.container){if(this._container=t.window.document.getElementById(e.container),!this._container)throw new Error("Container '"+e.container+"' not found.")}else{if(!(e.container instanceof Er))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=e.container}if(e.maxBounds&&this.setMaxBounds(e.maxBounds),t.bindAll(["_onWindowOnline","_onWindowResize","_onMapScroll","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),void 0===this.painter)throw new Error("Failed to initialize WebGL.");this.on("move",(function(){return n._update(!1)})),this.on("moveend",(function(){return n._update(!1)})),this.on("zoom",(function(){return n._update(!0)})),void 0!==t.window&&(t.window.addEventListener("online",this._onWindowOnline,!1),t.window.addEventListener("resize",this._onWindowResize,!1),t.window.addEventListener("orientationchange",this._onWindowResize,!1)),this.handlers=new mr(this,e),this._hash=e.hash&&new Ci("string"==typeof e.hash&&e.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:e.center,zoom:e.zoom,bearing:e.bearing,pitch:e.pitch}),e.bounds&&(this.resize(),this.fitBounds(e.bounds,t.extend({},e.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=e.localIdeographFontFamily,e.style&&this.setStyle(e.style,{localIdeographFontFamily:e.localIdeographFontFamily}),e.attributionControl&&this.addControl(new _r({customAttribution:e.customAttribution})),this.addControl(new vr,e.logoPosition),this.on("style.load",(function(){n.transform.unmodified&&n.jumpTo(n.style.stylesheet)})),this.on("data",(function(e){n._update("style"===e.dataType),n.fire(new t.Event(e.dataType+"data",e))})),this.on("dataloading",(function(e){n.fire(new t.Event(e.dataType+"dataloading",e))}))}i&&(r.__proto__=i),(r.prototype=Object.create(i&&i.prototype)).constructor=r;var o={showTileBoundaries:{configurable:!0},showPadding:{configurable:!0},showCollisionBoxes:{configurable:!0},showOverdrawInspector:{configurable:!0},repaint:{configurable:!0},vertices:{configurable:!0},version:{configurable:!0}};return r.prototype._getMapId=function(){return this._mapId},r.prototype.addControl=function(e,n){if(void 0===n&&(n=e.getDefaultPosition?e.getDefaultPosition():"top-right"),!e||!e.onAdd)return this.fire(new t.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));var i=e.onAdd(this);this._controls.push(e);var r=this._controlPositions[n];return-1!==n.indexOf("bottom")?r.insertBefore(i,r.firstChild):r.appendChild(i),this},r.prototype.removeControl=function(e){if(!e||!e.onRemove)return this.fire(new t.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));var n=this._controls.indexOf(e);return n>-1&&this._controls.splice(n,1),e.onRemove(this),this},r.prototype.hasControl=function(t){return this._controls.indexOf(t)>-1},r.prototype.resize=function(e){var n=this._containerDimensions(),i=n[0],r=n[1];if(i===this.transform.width&&r===this.transform.height)return this;this._resizeCanvas(i,r),this.transform.resize(i,r),this.painter.resize(i,r);var o=!this._moving;return o&&this.fire(new t.Event("movestart",e)).fire(new t.Event("move",e)),this.fire(new t.Event("resize",e)),o&&this.fire(new t.Event("moveend",e)),this},r.prototype.getBounds=function(){return this.transform.getBounds()},r.prototype.getMaxBounds=function(){return this.transform.getMaxBounds()},r.prototype.setMaxBounds=function(e){return this.transform.setMaxBounds(t.LngLatBounds.convert(e)),this._update()},r.prototype.setMinZoom=function(t){if((t=null==t?-2:t)>=-2&&t<=this.transform.maxZoom)return this.transform.minZoom=t,this._update(),this.getZoom()<t&&this.setZoom(t),this;throw new Error("minZoom must be between -2 and the current maxZoom, inclusive")},r.prototype.getMinZoom=function(){return this.transform.minZoom},r.prototype.setMaxZoom=function(t){if((t=null==t?22:t)>=this.transform.minZoom)return this.transform.maxZoom=t,this._update(),this.getZoom()>t&&this.setZoom(t),this;throw new Error("maxZoom must be greater than the current minZoom")},r.prototype.getMaxZoom=function(){return this.transform.maxZoom},r.prototype.setMinPitch=function(t){if((t=null==t?0:t)<0)throw new Error("minPitch must be greater than or equal to 0");if(t>=0&&t<=this.transform.maxPitch)return this.transform.minPitch=t,this._update(),this.getPitch()<t&&this.setPitch(t),this;throw new Error("minPitch must be between 0 and the current maxPitch, inclusive")},r.prototype.getMinPitch=function(){return this.transform.minPitch},r.prototype.setMaxPitch=function(t){if((t=null==t?60:t)>60)throw new Error("maxPitch must be less than or equal to 60");if(t>=this.transform.minPitch)return this.transform.maxPitch=t,this._update(),this.getPitch()>t&&this.setPitch(t),this;throw new Error("maxPitch must be greater than the current minPitch")},r.prototype.getMaxPitch=function(){return this.transform.maxPitch},r.prototype.getRenderWorldCopies=function(){return this.transform.renderWorldCopies},r.prototype.setRenderWorldCopies=function(t){return this.transform.renderWorldCopies=t,this._update()},r.prototype.project=function(e){return this.transform.locationPoint(t.LngLat.convert(e))},r.prototype.unproject=function(e){return this.transform.pointLocation(t.Point.convert(e))},r.prototype.isMoving=function(){return this._moving||this.handlers.isMoving()},r.prototype.isZooming=function(){return this._zooming||this.handlers.isZooming()},r.prototype.isRotating=function(){return this._rotating||this.handlers.isRotating()},r.prototype._createDelegatedListener=function(t,e,n){var i,r=this;if("mouseenter"===t||"mouseover"===t){var o=!1;return{layer:e,listener:n,delegates:{mousemove:function(i){var s=r.getLayer(e)?r.queryRenderedFeatures(i.point,{layers:[e]}):[];s.length?o||(o=!0,n.call(r,new Oi(t,r,i.originalEvent,{features:s}))):o=!1},mouseout:function(){o=!1}}}}if("mouseleave"===t||"mouseout"===t){var s=!1;return{layer:e,listener:n,delegates:{mousemove:function(i){(r.getLayer(e)?r.queryRenderedFeatures(i.point,{layers:[e]}):[]).length?s=!0:s&&(s=!1,n.call(r,new Oi(t,r,i.originalEvent)))},mouseout:function(e){s&&(s=!1,n.call(r,new Oi(t,r,e.originalEvent)))}}}}return{layer:e,listener:n,delegates:(i={},i[t]=function(t){var i=r.getLayer(e)?r.queryRenderedFeatures(t.point,{layers:[e]}):[];i.length&&(t.features=i,n.call(r,t),delete t.features)},i)}},r.prototype.on=function(t,e,n){if(void 0===n)return i.prototype.on.call(this,t,e);var r=this._createDelegatedListener(t,e,n);for(var o in this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[t]=this._delegatedListeners[t]||[],this._delegatedListeners[t].push(r),r.delegates)this.on(o,r.delegates[o]);return this},r.prototype.once=function(t,e,n){if(void 0===n)return i.prototype.once.call(this,t,e);var r=this._createDelegatedListener(t,e,n);for(var o in r.delegates)this.once(o,r.delegates[o]);return this},r.prototype.off=function(t,e,n){var r=this;return void 0===n?i.prototype.off.call(this,t,e):(this._delegatedListeners&&this._delegatedListeners[t]&&function(i){for(var o=i[t],s=0;s<o.length;s++){var a=o[s];if(a.layer===e&&a.listener===n){for(var l in a.delegates)r.off(l,a.delegates[l]);return o.splice(s,1),r}}}(this._delegatedListeners),this)},r.prototype.queryRenderedFeatures=function(e,n){if(!this.style)return[];var i;if(void 0!==n||void 0===e||e instanceof t.Point||Array.isArray(e)||(n=e,e=void 0),n=n||{},(e=e||[[0,0],[this.transform.width,this.transform.height]])instanceof t.Point||"number"==typeof e[0])i=[t.Point.convert(e)];else{var r=t.Point.convert(e[0]),o=t.Point.convert(e[1]);i=[r,new t.Point(o.x,r.y),o,new t.Point(r.x,o.y),r]}return this.style.queryRenderedFeatures(i,n,this.transform)},r.prototype.querySourceFeatures=function(t,e){return this.style.querySourceFeatures(t,e)},r.prototype.setStyle=function(e,n){return!1!==(n=t.extend({},{localIdeographFontFamily:this._localIdeographFontFamily},n)).diff&&n.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&e?(this._diffStyle(e,n),this):(this._localIdeographFontFamily=n.localIdeographFontFamily,this._updateStyle(e,n))},r.prototype._getUIString=function(t){var e=this._locale[t];if(null==e)throw new Error("Missing UI string '"+t+"'");return e},r.prototype._updateStyle=function(t,e){return this.style&&(this.style.setEventedParent(null),this.style._remove()),t?(this.style=new je(this,e||{}),this.style.setEventedParent(this,{style:this.style}),"string"==typeof t?this.style.loadURL(t):this.style.loadJSON(t),this):(delete this.style,this)},r.prototype._lazyInitEmptyStyle=function(){this.style||(this.style=new je(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())},r.prototype._diffStyle=function(e,n){var i=this;if("string"==typeof e){var r=this._requestManager.normalizeStyleURL(e),o=this._requestManager.transformRequest(r,t.ResourceType.Style);t.getJSON(o,(function(e,r){e?i.fire(new t.ErrorEvent(e)):r&&i._updateDiff(r,n)}))}else"object"==typeof e&&this._updateDiff(e,n)},r.prototype._updateDiff=function(e,n){try{this.style.setState(e)&&this._update(!0)}catch(i){t.warnOnce("Unable to perform style diff: "+(i.message||i.error||i)+". Rebuilding the style from scratch."),this._updateStyle(e,n)}},r.prototype.getStyle=function(){if(this.style)return this.style.serialize()},r.prototype.isStyleLoaded=function(){return this.style?this.style.loaded():t.warnOnce("There is no style added to the map.")},r.prototype.addSource=function(t,e){return this._lazyInitEmptyStyle(),this.style.addSource(t,e),this._update(!0)},r.prototype.isSourceLoaded=function(e){var n=this.style&&this.style.sourceCaches[e];if(void 0!==n)return n.loaded();this.fire(new t.ErrorEvent(new Error("There is no source with ID '"+e+"'")))},r.prototype.areTilesLoaded=function(){var t=this.style&&this.style.sourceCaches;for(var e in t){var n=t[e]._tiles;for(var i in n){var r=n[i];if("loaded"!==r.state&&"errored"!==r.state)return!1}}return!0},r.prototype.addSourceType=function(t,e,n){return this._lazyInitEmptyStyle(),this.style.addSourceType(t,e,n)},r.prototype.removeSource=function(t){return this.style.removeSource(t),this._update(!0)},r.prototype.getSource=function(t){return this.style.getSource(t)},r.prototype.addImage=function(e,n,i){void 0===i&&(i={});var r=i.pixelRatio;void 0===r&&(r=1);var o=i.sdf;void 0===o&&(o=!1);var s=i.stretchX,a=i.stretchY,l=i.content;if(this._lazyInitEmptyStyle(),n instanceof wr||Cr&&n instanceof Cr){var c=t.browser.getImageData(n);this.style.addImage(e,{data:new t.RGBAImage({width:c.width,height:c.height},c.data),pixelRatio:r,stretchX:s,stretchY:a,content:l,sdf:o,version:0})}else{if(void 0===n.width||void 0===n.height)return this.fire(new t.ErrorEvent(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));var u=n;this.style.addImage(e,{data:new t.RGBAImage({width:n.width,height:n.height},new Uint8Array(n.data)),pixelRatio:r,stretchX:s,stretchY:a,content:l,sdf:o,version:0,userImage:u}),u.onAdd&&u.onAdd(this,e)}},r.prototype.updateImage=function(e,n){var i=this.style.getImage(e);if(!i)return this.fire(new t.ErrorEvent(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));var r=n instanceof wr||Cr&&n instanceof Cr?t.browser.getImageData(n):n,o=r.width,s=r.height,a=r.data;return void 0===o||void 0===s?this.fire(new t.ErrorEvent(new Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`"))):o!==i.data.width||s!==i.data.height?this.fire(new t.ErrorEvent(new Error("The width and height of the updated image must be that same as the previous version of the image"))):(i.data.replace(a,!(n instanceof wr||Cr&&n instanceof Cr)),void this.style.updateImage(e,i))},r.prototype.hasImage=function(e){return e?!!this.style.getImage(e):(this.fire(new t.ErrorEvent(new Error("Missing required image id"))),!1)},r.prototype.removeImage=function(t){this.style.removeImage(t)},r.prototype.loadImage=function(e,n){t.getImage(this._requestManager.transformRequest(e,t.ResourceType.Image),n)},r.prototype.listImages=function(){return this.style.listImages()},r.prototype.addLayer=function(t,e){return this._lazyInitEmptyStyle(),this.style.addLayer(t,e),this._update(!0)},r.prototype.moveLayer=function(t,e){return this.style.moveLayer(t,e),this._update(!0)},r.prototype.removeLayer=function(t){return this.style.removeLayer(t),this._update(!0)},r.prototype.getLayer=function(t){return this.style.getLayer(t)},r.prototype.setLayerZoomRange=function(t,e,n){return this.style.setLayerZoomRange(t,e,n),this._update(!0)},r.prototype.setFilter=function(t,e,n){return void 0===n&&(n={}),this.style.setFilter(t,e,n),this._update(!0)},r.prototype.getFilter=function(t){return this.style.getFilter(t)},r.prototype.setPaintProperty=function(t,e,n,i){return void 0===i&&(i={}),this.style.setPaintProperty(t,e,n,i),this._update(!0)},r.prototype.getPaintProperty=function(t,e){return this.style.getPaintProperty(t,e)},r.prototype.setLayoutProperty=function(t,e,n,i){return void 0===i&&(i={}),this.style.setLayoutProperty(t,e,n,i),this._update(!0)},r.prototype.getLayoutProperty=function(t,e){return this.style.getLayoutProperty(t,e)},r.prototype.setLight=function(t,e){return void 0===e&&(e={}),this._lazyInitEmptyStyle(),this.style.setLight(t,e),this._update(!0)},r.prototype.getLight=function(){return this.style.getLight()},r.prototype.setFeatureState=function(t,e){return this.style.setFeatureState(t,e),this._update()},r.prototype.removeFeatureState=function(t,e){return this.style.removeFeatureState(t,e),this._update()},r.prototype.getFeatureState=function(t){return this.style.getFeatureState(t)},r.prototype.getContainer=function(){return this._container},r.prototype.getCanvasContainer=function(){return this._canvasContainer},r.prototype.getCanvas=function(){return this._canvas},r.prototype._containerDimensions=function(){var t=0,e=0;return this._container&&(t=this._container.clientWidth||400,e=this._container.clientHeight||300),[t,e]},r.prototype._detectMissingCSS=function(){"rgb(250, 128, 114)"!==t.window.getComputedStyle(this._missingCSSCanary).getPropertyValue("background-color")&&t.warnOnce("This page appears to be missing CSS declarations for Mapbox GL JS, which may cause the map to display incorrectly. Please ensure your page includes mapbox-gl.css, as described in https://www.mapbox.com/mapbox-gl-js/api/.")},r.prototype._setupContainer=function(){var t=this._container;t.classList.add("mapboxgl-map"),(this._missingCSSCanary=n.create("div","mapboxgl-canary",t)).style.visibility="hidden",this._detectMissingCSS();var e=this._canvasContainer=n.create("div","mapboxgl-canvas-container",t);this._interactive&&e.classList.add("mapboxgl-interactive"),this._canvas=n.create("canvas","mapboxgl-canvas",e),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex","0"),this._canvas.setAttribute("aria-label","Map"),this._canvas.setAttribute("role","region");var i=this._containerDimensions();this._resizeCanvas(i[0],i[1]);var r=this._controlContainer=n.create("div","mapboxgl-control-container",t),o=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach((function(t){o[t]=n.create("div","mapboxgl-ctrl-"+t,r)})),this._container.addEventListener("scroll",this._onMapScroll,!1)},r.prototype._resizeCanvas=function(e,n){var i=t.browser.devicePixelRatio||1;this._canvas.width=i*e,this._canvas.height=i*n,this._canvas.style.width=e+"px",this._canvas.style.height=n+"px"},r.prototype._setupPainter=function(){var n=t.extend({},e.webGLContextAttributes,{failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1}),i=this._canvas.getContext("webgl",n)||this._canvas.getContext("experimental-webgl",n);i?(this.painter=new _i(i,this.transform),t.webpSupported.testSupport(i)):this.fire(new t.ErrorEvent(new Error("Failed to initialize WebGL")))},r.prototype._contextLost=function(e){e.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new t.Event("webglcontextlost",{originalEvent:e}))},r.prototype._contextRestored=function(e){this._setupPainter(),this.resize(),this._update(),this.fire(new t.Event("webglcontextrestored",{originalEvent:e}))},r.prototype._onMapScroll=function(t){if(t.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},r.prototype.loaded=function(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()},r.prototype._update=function(t){return this.style?(this._styleDirty=this._styleDirty||t,this._sourcesDirty=!0,this.triggerRepaint(),this):this},r.prototype._requestRenderFrame=function(t){return this._update(),this._renderTaskQueue.add(t)},r.prototype._cancelRenderFrame=function(t){this._renderTaskQueue.remove(t)},r.prototype._render=function(e){var n,i=this,r=0,o=this.painter.context.extTimerQuery;if(this.listens("gpu-timing-frame")&&(n=o.createQueryEXT(),o.beginQueryEXT(o.TIME_ELAPSED_EXT,n),r=t.browser.now()),this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(e),!this._removed){var s=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;var a=this.transform.zoom,l=t.browser.now();this.style.zoomHistory.update(a,l);var c=new t.EvaluationParameters(a,{now:l,fadeDuration:this._fadeDuration,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),u=c.crossFadingFactor();1===u&&u===this._crossFadingFactor||(s=!0,this._crossFadingFactor=u),this.style.update(c)}if(this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,this._fadeDuration,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:this._fadeDuration,showPadding:this.showPadding,gpuTiming:!!this.listens("gpu-timing-layer")}),this.fire(new t.Event("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire(new t.Event("load"))),this.style&&(this.style.hasTransitions()||s)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles(),this.listens("gpu-timing-frame")){var h=t.browser.now()-r;o.endQueryEXT(o.TIME_ELAPSED_EXT,n),setTimeout((function(){var e=o.getQueryObjectEXT(n,o.QUERY_RESULT_EXT)/1e6;o.deleteQueryEXT(n),i.fire(new t.Event("gpu-timing-frame",{cpuTime:h,gpuTime:e}))}),50)}if(this.listens("gpu-timing-layer")){var d=this.painter.collectGpuTimers();setTimeout((function(){var e=i.painter.queryGpuTimers(d);i.fire(new t.Event("gpu-timing-layer",{layerTimes:e}))}),50)}var p=this._sourcesDirty||this._styleDirty||this._placementDirty;return p||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new t.Event("idle")),!this._loaded||this._fullyLoaded||p||(this._fullyLoaded=!0),this}},r.prototype.remove=function(){this._hash&&this._hash.remove();for(var e=0,n=this._controls;e<n.length;e+=1)n[e].onRemove(this);this._controls=[],this._frame&&(this._frame.cancel(),this._frame=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),void 0!==t.window&&(t.window.removeEventListener("resize",this._onWindowResize,!1),t.window.removeEventListener("orientationchange",this._onWindowResize,!1),t.window.removeEventListener("online",this._onWindowOnline,!1));var i=this.painter.context.gl.getExtension("WEBGL_lose_context");i&&i.loseContext(),Pr(this._canvasContainer),Pr(this._controlContainer),Pr(this._missingCSSCanary),this._container.classList.remove("mapboxgl-map"),this._removed=!0,this.fire(new t.Event("remove"))},r.prototype.triggerRepaint=function(){var e=this;this.style&&!this._frame&&(this._frame=t.browser.frame((function(t){e._frame=null,e._render(t)})))},r.prototype._onWindowOnline=function(){this._update()},r.prototype._onWindowResize=function(t){this._trackResize&&this.resize({originalEvent:t})._update()},o.showTileBoundaries.get=function(){return!!this._showTileBoundaries},o.showTileBoundaries.set=function(t){this._showTileBoundaries!==t&&(this._showTileBoundaries=t,this._update())},o.showPadding.get=function(){return!!this._showPadding},o.showPadding.set=function(t){this._showPadding!==t&&(this._showPadding=t,this._update())},o.showCollisionBoxes.get=function(){return!!this._showCollisionBoxes},o.showCollisionBoxes.set=function(t){this._showCollisionBoxes!==t&&(this._showCollisionBoxes=t,t?this.style._generateCollisionBoxes():this._update())},o.showOverdrawInspector.get=function(){return!!this._showOverdrawInspector},o.showOverdrawInspector.set=function(t){this._showOverdrawInspector!==t&&(this._showOverdrawInspector=t,this._update())},o.repaint.get=function(){return!!this._repaint},o.repaint.set=function(t){this._repaint!==t&&(this._repaint=t,this.triggerRepaint())},o.vertices.get=function(){return!!this._vertices},o.vertices.set=function(t){this._vertices=t,this._update()},r.prototype._setCacheLimits=function(e,n){t.setCacheLimits(e,n)},o.version.get=function(){return t.version},Object.defineProperties(r.prototype,o),r}(yr);function Pr(t){t.parentNode&&t.parentNode.removeChild(t)}var Mr={showCompass:!0,showZoom:!0,visualizePitch:!1},Ir=function(e){var i=this;this.options=t.extend({},Mr,e),this._container=n.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._container.addEventListener("contextmenu",(function(t){return t.preventDefault()})),this.options.showZoom&&(t.bindAll(["_setButtonTitle","_updateZoomButtons"],this),this._zoomInButton=this._createButton("mapboxgl-ctrl-zoom-in",(function(t){return i._map.zoomIn({},{originalEvent:t})})),n.create("span","mapboxgl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden",!0),this._zoomOutButton=this._createButton("mapboxgl-ctrl-zoom-out",(function(t){return i._map.zoomOut({},{originalEvent:t})})),n.create("span","mapboxgl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden",!0)),this.options.showCompass&&(t.bindAll(["_rotateCompassArrow"],this),this._compass=this._createButton("mapboxgl-ctrl-compass",(function(t){i.options.visualizePitch?i._map.resetNorthPitch({},{originalEvent:t}):i._map.resetNorth({},{originalEvent:t})})),this._compassIcon=n.create("span","mapboxgl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden",!0))};Ir.prototype._updateZoomButtons=function(){var t=this._map.getZoom(),e=t===this._map.getMaxZoom(),n=t===this._map.getMinZoom();this._zoomInButton.disabled=e,this._zoomOutButton.disabled=n,this._zoomInButton.setAttribute("aria-disabled",e.toString()),this._zoomOutButton.setAttribute("aria-disabled",n.toString())},Ir.prototype._rotateCompassArrow=function(){var t=this.options.visualizePitch?"scale("+1/Math.pow(Math.cos(this._map.transform.pitch*(Math.PI/180)),.5)+") rotateX("+this._map.transform.pitch+"deg) rotateZ("+this._map.transform.angle*(180/Math.PI)+"deg)":"rotate("+this._map.transform.angle*(180/Math.PI)+"deg)";this._compassIcon.style.transform=t},Ir.prototype.onAdd=function(t){return this._map=t,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),this._map.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&this._map.on("pitch",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new Br(this._map,this._compass,this.options.visualizePitch)),this._container},Ir.prototype.onRemove=function(){n.remove(this._container),this.options.showZoom&&this._map.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off("pitch",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map},Ir.prototype._createButton=function(t,e){var i=n.create("button",t,this._container);return i.type="button",i.addEventListener("click",e),i},Ir.prototype._setButtonTitle=function(t,e){var n=this._map._getUIString("NavigationControl."+e);t.title=n,t.setAttribute("aria-label",n)};var Br=function(e,i,r){void 0===r&&(r=!1),this._clickTolerance=10,this.element=i,this.mouseRotate=new Zi({clickTolerance:e.dragRotate._mouseRotate._clickTolerance}),this.map=e,r&&(this.mousePitch=new Xi({clickTolerance:e.dragRotate._mousePitch._clickTolerance})),t.bindAll(["mousedown","mousemove","mouseup","touchstart","touchmove","touchend","reset"],this),n.addEventListener(i,"mousedown",this.mousedown),n.addEventListener(i,"touchstart",this.touchstart,{passive:!1}),n.addEventListener(i,"touchmove",this.touchmove),n.addEventListener(i,"touchend",this.touchend),n.addEventListener(i,"touchcancel",this.reset)};function Rr(e,n,i){if(e=new t.LngLat(e.lng,e.lat),n){var r=new t.LngLat(e.lng-360,e.lat),o=new t.LngLat(e.lng+360,e.lat),s=i.locationPoint(e).distSqr(n);i.locationPoint(r).distSqr(n)<s?e=r:i.locationPoint(o).distSqr(n)<s&&(e=o)}for(;Math.abs(e.lng-i.center.lng)>180;){var a=i.locationPoint(e);if(a.x>=0&&a.y>=0&&a.x<=i.width&&a.y<=i.height)break;e.lng>i.center.lng?e.lng-=360:e.lng+=360}return e}Br.prototype.down=function(t,e){this.mouseRotate.mousedown(t,e),this.mousePitch&&this.mousePitch.mousedown(t,e),n.disableDrag()},Br.prototype.move=function(t,e){var n=this.map,i=this.mouseRotate.mousemoveWindow(t,e);if(i&&i.bearingDelta&&n.setBearing(n.getBearing()+i.bearingDelta),this.mousePitch){var r=this.mousePitch.mousemoveWindow(t,e);r&&r.pitchDelta&&n.setPitch(n.getPitch()+r.pitchDelta)}},Br.prototype.off=function(){var t=this.element;n.removeEventListener(t,"mousedown",this.mousedown),n.removeEventListener(t,"touchstart",this.touchstart,{passive:!1}),n.removeEventListener(t,"touchmove",this.touchmove),n.removeEventListener(t,"touchend",this.touchend),n.removeEventListener(t,"touchcancel",this.reset),this.offTemp()},Br.prototype.offTemp=function(){n.enableDrag(),n.removeEventListener(t.window,"mousemove",this.mousemove),n.removeEventListener(t.window,"mouseup",this.mouseup)},Br.prototype.mousedown=function(e){this.down(t.extend({},e,{ctrlKey:!0,preventDefault:function(){return e.preventDefault()}}),n.mousePos(this.element,e)),n.addEventListener(t.window,"mousemove",this.mousemove),n.addEventListener(t.window,"mouseup",this.mouseup)},Br.prototype.mousemove=function(t){this.move(t,n.mousePos(this.element,t))},Br.prototype.mouseup=function(t){this.mouseRotate.mouseupWindow(t),this.mousePitch&&this.mousePitch.mouseupWindow(t),this.offTemp()},Br.prototype.touchstart=function(t){1!==t.targetTouches.length?this.reset():(this._startPos=this._lastPos=n.touchPos(this.element,t.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:function(){return t.preventDefault()}},this._startPos))},Br.prototype.touchmove=function(t){1!==t.targetTouches.length?this.reset():(this._lastPos=n.touchPos(this.element,t.targetTouches)[0],this.move({preventDefault:function(){return t.preventDefault()}},this._lastPos))},Br.prototype.touchend=function(t){0===t.targetTouches.length&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)<this._clickTolerance&&this.element.click(),this.reset()},Br.prototype.reset=function(){this.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()};var Lr={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};function Or(t,e,n){var i=t.classList;for(var r in Lr)i.remove("mapboxgl-"+n+"-anchor-"+r);i.add("mapboxgl-"+n+"-anchor-"+e)}var Dr,kr=function(e){function i(i,r){if(e.call(this),(i instanceof t.window.HTMLElement||r)&&(i=t.extend({element:i},r)),t.bindAll(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress"],this),this._anchor=i&&i.anchor||"center",this._color=i&&i.color||"#3FB1CE",this._scale=i&&i.scale||1,this._draggable=i&&i.draggable||!1,this._clickTolerance=i&&i.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=i&&i.rotation||0,this._rotationAlignment=i&&i.rotationAlignment||"auto",this._pitchAlignment=i&&i.pitchAlignment&&"auto"!==i.pitchAlignment?i.pitchAlignment:this._rotationAlignment,i&&i.element)this._element=i.element,this._offset=t.Point.convert(i&&i.offset||[0,0]);else{this._defaultMarker=!0,this._element=n.create("div"),this._element.setAttribute("aria-label","Map marker");var o=n.createNS("http://www.w3.org/2000/svg","svg");o.setAttributeNS(null,"display","block"),o.setAttributeNS(null,"height","41px"),o.setAttributeNS(null,"width","27px"),o.setAttributeNS(null,"viewBox","0 0 27 41");var s=n.createNS("http://www.w3.org/2000/svg","g");s.setAttributeNS(null,"stroke","none"),s.setAttributeNS(null,"stroke-width","1"),s.setAttributeNS(null,"fill","none"),s.setAttributeNS(null,"fill-rule","evenodd");var a=n.createNS("http://www.w3.org/2000/svg","g");a.setAttributeNS(null,"fill-rule","nonzero");var l=n.createNS("http://www.w3.org/2000/svg","g");l.setAttributeNS(null,"transform","translate(3.0, 29.0)"),l.setAttributeNS(null,"fill","#000000");for(var c=0,u=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}];c<u.length;c+=1){var h=u[c],d=n.createNS("http://www.w3.org/2000/svg","ellipse");d.setAttributeNS(null,"opacity","0.04"),d.setAttributeNS(null,"cx","10.5"),d.setAttributeNS(null,"cy","5.80029008"),d.setAttributeNS(null,"rx",h.rx),d.setAttributeNS(null,"ry",h.ry),l.appendChild(d)}var p=n.createNS("http://www.w3.org/2000/svg","g");p.setAttributeNS(null,"fill",this._color);var f=n.createNS("http://www.w3.org/2000/svg","path");f.setAttributeNS(null,"d","M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z"),p.appendChild(f);var A=n.createNS("http://www.w3.org/2000/svg","g");A.setAttributeNS(null,"opacity","0.25"),A.setAttributeNS(null,"fill","#000000");var g=n.createNS("http://www.w3.org/2000/svg","path");g.setAttributeNS(null,"d","M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z"),A.appendChild(g);var m=n.createNS("http://www.w3.org/2000/svg","g");m.setAttributeNS(null,"transform","translate(6.0, 7.0)"),m.setAttributeNS(null,"fill","#FFFFFF");var y=n.createNS("http://www.w3.org/2000/svg","g");y.setAttributeNS(null,"transform","translate(8.0, 8.0)");var _=n.createNS("http://www.w3.org/2000/svg","circle");_.setAttributeNS(null,"fill","#000000"),_.setAttributeNS(null,"opacity","0.25"),_.setAttributeNS(null,"cx","5.5"),_.setAttributeNS(null,"cy","5.5"),_.setAttributeNS(null,"r","5.4999962");var v=n.createNS("http://www.w3.org/2000/svg","circle");v.setAttributeNS(null,"fill","#FFFFFF"),v.setAttributeNS(null,"cx","5.5"),v.setAttributeNS(null,"cy","5.5"),v.setAttributeNS(null,"r","5.4999962"),y.appendChild(_),y.appendChild(v),a.appendChild(l),a.appendChild(p),a.appendChild(A),a.appendChild(m),a.appendChild(y),o.appendChild(a),o.setAttributeNS(null,"height",41*this._scale+"px"),o.setAttributeNS(null,"width",27*this._scale+"px"),this._element.appendChild(o),this._offset=t.Point.convert(i&&i.offset||[0,-14])}this._element.classList.add("mapboxgl-marker"),this._element.addEventListener("dragstart",(function(t){t.preventDefault()})),this._element.addEventListener("mousedown",(function(t){t.preventDefault()})),Or(this._element,this._anchor,"marker"),this._popup=null}return e&&(i.__proto__=e),(i.prototype=Object.create(e&&e.prototype)).constructor=i,i.prototype.addTo=function(t){return this.remove(),this._map=t,t.getCanvasContainer().appendChild(this._element),t.on("move",this._update),t.on("moveend",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this},i.prototype.remove=function(){return this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler),this._map.off("mouseup",this._onUp),this._map.off("touchend",this._onUp),this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),delete this._map),n.remove(this._element),this._popup&&this._popup.remove(),this},i.prototype.getLngLat=function(){return this._lngLat},i.prototype.setLngLat=function(e){return this._lngLat=t.LngLat.convert(e),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this},i.prototype.getElement=function(){return this._element},i.prototype.setPopup=function(t){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),t){if(!("offset"in t.options)){var e=Math.sqrt(Math.pow(13.5,2)/2);t.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[e,-1*(24.6+e)],"bottom-right":[-e,-1*(24.6+e)],left:[13.5,-24.6],right:[-13.5,-24.6]}:this._offset}this._popup=t,this._lngLat&&this._popup.setLngLat(this._lngLat),this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this},i.prototype._onKeyPress=function(t){var e=t.code,n=t.charCode||t.keyCode;"Space"!==e&&"Enter"!==e&&32!==n&&13!==n||this.togglePopup()},i.prototype._onMapClick=function(t){var e=t.originalEvent.target,n=this._element;this._popup&&(e===n||n.contains(e))&&this.togglePopup()},i.prototype.getPopup=function(){return this._popup},i.prototype.togglePopup=function(){var t=this._popup;return t?(t.isOpen()?t.remove():t.addTo(this._map),this):this},i.prototype._update=function(t){if(this._map){this._map.transform.renderWorldCopies&&(this._lngLat=Rr(this._lngLat,this._pos,this._map.transform)),this._pos=this._map.project(this._lngLat)._add(this._offset);var e="";"viewport"===this._rotationAlignment||"auto"===this._rotationAlignment?e="rotateZ("+this._rotation+"deg)":"map"===this._rotationAlignment&&(e="rotateZ("+(this._rotation-this._map.getBearing())+"deg)");var i="";"viewport"===this._pitchAlignment||"auto"===this._pitchAlignment?i="rotateX(0deg)":"map"===this._pitchAlignment&&(i="rotateX("+this._map.getPitch()+"deg)"),t&&"moveend"!==t.type||(this._pos=this._pos.round()),n.setTransform(this._element,Lr[this._anchor]+" translate("+this._pos.x+"px, "+this._pos.y+"px) "+i+" "+e)}},i.prototype.getOffset=function(){return this._offset},i.prototype.setOffset=function(e){return this._offset=t.Point.convert(e),this._update(),this},i.prototype._onMove=function(e){if(!this._isDragging){var n=this._clickTolerance||this._map._clickTolerance;this._isDragging=e.point.dist(this._pointerdownPos)>=n}this._isDragging&&(this._pos=e.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none","pending"===this._state&&(this._state="active",this.fire(new t.Event("dragstart"))),this.fire(new t.Event("drag")))},i.prototype._onUp=function(){this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),"active"===this._state&&this.fire(new t.Event("dragend")),this._state="inactive"},i.prototype._addDragHandler=function(t){this._element.contains(t.originalEvent.target)&&(t.preventDefault(),this._positionDelta=t.point.sub(this._pos).add(this._offset),this._pointerdownPos=t.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},i.prototype.setDraggable=function(t){return this._draggable=!!t,this._map&&(t?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this},i.prototype.isDraggable=function(){return this._draggable},i.prototype.setRotation=function(t){return this._rotation=t||0,this._update(),this},i.prototype.getRotation=function(){return this._rotation},i.prototype.setRotationAlignment=function(t){return this._rotationAlignment=t||"auto",this._update(),this},i.prototype.getRotationAlignment=function(){return this._rotationAlignment},i.prototype.setPitchAlignment=function(t){return this._pitchAlignment=t&&"auto"!==t?t:this._rotationAlignment,this._update(),this},i.prototype.getPitchAlignment=function(){return this._pitchAlignment},i}(t.Evented),Fr={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},Nr=0,zr=!1,Ur=function(e){function i(n){e.call(this),this.options=t.extend({},Fr,n),t.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker"],this)}return e&&(i.__proto__=e),(i.prototype=Object.create(e&&e.prototype)).constructor=i,i.prototype.onAdd=function(e){var i;return this._map=e,this._container=n.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),i=this._setupUI,void 0!==Dr?i(Dr):void 0!==t.window.navigator.permissions?t.window.navigator.permissions.query({name:"geolocation"}).then((function(t){i(Dr="denied"!==t.state)})):i(Dr=!!t.window.navigator.geolocation),this._container},i.prototype.onRemove=function(){void 0!==this._geolocationWatchID&&(t.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),n.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,Nr=0,zr=!1},i.prototype._isOutOfMapMaxBounds=function(t){var e=this._map.getMaxBounds(),n=t.coords;return e&&(n.longitude<e.getWest()||n.longitude>e.getEast()||n.latitude<e.getSouth()||n.latitude>e.getNorth())},i.prototype._setErrorState=function(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting")}},i.prototype._onSuccess=function(e){if(this._map){if(this._isOutOfMapMaxBounds(e))return this._setErrorState(),this.fire(new t.Event("outofmaxbounds",e)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=e,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background")}this.options.showUserLocation&&"OFF"!==this._watchState&&this._updateMarker(e),this.options.trackUserLocation&&"ACTIVE_LOCK"!==this._watchState||this._updateCamera(e),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire(new t.Event("geolocate",e)),this._finish()}},i.prototype._updateCamera=function(e){var n=new t.LngLat(e.coords.longitude,e.coords.latitude),i=e.coords.accuracy,r=this._map.getBearing(),o=t.extend({bearing:r},this.options.fitBoundsOptions);this._map.fitBounds(n.toBounds(i),o,{geolocateSource:!0})},i.prototype._updateMarker=function(e){if(e){var n=new t.LngLat(e.coords.longitude,e.coords.latitude);this._accuracyCircleMarker.setLngLat(n).addTo(this._map),this._userLocationDotMarker.setLngLat(n).addTo(this._map),this._accuracy=e.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},i.prototype._updateCircleRadius=function(){var t=this._map._container.clientHeight/2,e=this._map.unproject([0,t]),n=this._map.unproject([1,t]),i=e.distanceTo(n),r=Math.ceil(2*this._accuracy/i);this._circleElement.style.width=r+"px",this._circleElement.style.height=r+"px"},i.prototype._onZoom=function(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},i.prototype._onError=function(e){if(this._map){if(this.options.trackUserLocation)if(1===e.code){this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;var n=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=n,this._geolocateButton.setAttribute("aria-label",n),void 0!==this._geolocationWatchID&&this._clearWatch()}else{if(3===e.code&&zr)return;this._setErrorState()}"OFF"!==this._watchState&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new t.Event("error",e)),this._finish()}},i.prototype._finish=function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},i.prototype._setupUI=function(e){var i=this;if(this._container.addEventListener("contextmenu",(function(t){return t.preventDefault()})),this._geolocateButton=n.create("button","mapboxgl-ctrl-geolocate",this._container),n.create("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden",!0),this._geolocateButton.type="button",!1===e){t.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");var r=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=r,this._geolocateButton.setAttribute("aria-label",r)}else{var o=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=o,this._geolocateButton.setAttribute("aria-label",o)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=n.create("div","mapboxgl-user-location-dot"),this._userLocationDotMarker=new kr(this._dotElement),this._circleElement=n.create("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new kr({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",(function(e){e.geolocateSource||"ACTIVE_LOCK"!==i._watchState||e.originalEvent&&"resize"===e.originalEvent.type||(i._watchState="BACKGROUND",i._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),i._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),i.fire(new t.Event("trackuserlocationend")))}))},i.prototype.trigger=function(){if(!this._setup)return t.warnOnce("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new t.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":Nr--,zr=!1,this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this.fire(new t.Event("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new t.Event("trackuserlocationstart"))}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error")}if("OFF"===this._watchState&&void 0!==this._geolocationWatchID)this._clearWatch();else if(void 0===this._geolocationWatchID){var e;this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),++Nr>1?(e={maximumAge:6e5,timeout:0},zr=!0):(e=this.options.positionOptions,zr=!1),this._geolocationWatchID=t.window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,e)}}else t.window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0},i.prototype._clearWatch=function(){t.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)},i}(t.Evented),Gr={maxWidth:100,unit:"metric"},Vr=function(e){this.options=t.extend({},Gr,e),t.bindAll(["_onMove","setUnit"],this)};function jr(t,e,n){var i=n&&n.maxWidth||100,r=t._container.clientHeight/2,o=t.unproject([0,r]),s=t.unproject([i,r]),a=o.distanceTo(s);if(n&&"imperial"===n.unit){var l=3.2808*a;l>5280?Hr(e,i,l/5280,t._getUIString("ScaleControl.Miles")):Hr(e,i,l,t._getUIString("ScaleControl.Feet"))}else n&&"nautical"===n.unit?Hr(e,i,a/1852,t._getUIString("ScaleControl.NauticalMiles")):a>=1e3?Hr(e,i,a/1e3,t._getUIString("ScaleControl.Kilometers")):Hr(e,i,a,t._getUIString("ScaleControl.Meters"))}function Hr(t,e,n,i){var r,o,s,a=(r=n,(o=Math.pow(10,(""+Math.floor(r)).length-1))*(s=(s=r/o)>=10?10:s>=5?5:s>=3?3:s>=2?2:s>=1?1:function(t){var e=Math.pow(10,Math.ceil(-Math.log(t)/Math.LN10));return Math.round(t*e)/e}(s)));t.style.width=e*(a/n)+"px",t.innerHTML=a+" "+i}Vr.prototype.getDefaultPosition=function(){return"bottom-left"},Vr.prototype._onMove=function(){jr(this._map,this._container,this.options)},Vr.prototype.onAdd=function(t){return this._map=t,this._container=n.create("div","mapboxgl-ctrl mapboxgl-ctrl-scale",t.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container},Vr.prototype.onRemove=function(){n.remove(this._container),this._map.off("move",this._onMove),this._map=void 0},Vr.prototype.setUnit=function(t){this.options.unit=t,jr(this._map,this._container,this.options)};var Wr=function(e){this._fullscreen=!1,e&&e.container&&(e.container instanceof t.window.HTMLElement?this._container=e.container:t.warnOnce("Full screen control 'container' must be a DOM element.")),t.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in t.window.document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in t.window.document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in t.window.document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in t.window.document&&(this._fullscreenchange="MSFullscreenChange")};Wr.prototype.onAdd=function(e){return this._map=e,this._container||(this._container=this._map.getContainer()),this._controlContainer=n.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",t.warnOnce("This device does not support fullscreen mode.")),this._controlContainer},Wr.prototype.onRemove=function(){n.remove(this._controlContainer),this._map=null,t.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)},Wr.prototype._checkFullscreenSupport=function(){return!!(t.window.document.fullscreenEnabled||t.window.document.mozFullScreenEnabled||t.window.document.msFullscreenEnabled||t.window.document.webkitFullscreenEnabled)},Wr.prototype._setupUI=function(){var e=this._fullscreenButton=n.create("button","mapboxgl-ctrl-fullscreen",this._controlContainer);n.create("span","mapboxgl-ctrl-icon",e).setAttribute("aria-hidden",!0),e.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),t.window.document.addEventListener(this._fullscreenchange,this._changeIcon)},Wr.prototype._updateTitle=function(){var t=this._getTitle();this._fullscreenButton.setAttribute("aria-label",t),this._fullscreenButton.title=t},Wr.prototype._getTitle=function(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")},Wr.prototype._isFullscreen=function(){return this._fullscreen},Wr.prototype._changeIcon=function(){(t.window.document.fullscreenElement||t.window.document.mozFullScreenElement||t.window.document.webkitFullscreenElement||t.window.document.msFullscreenElement)===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())},Wr.prototype._onClickFullscreen=function(){this._isFullscreen()?t.window.document.exitFullscreen?t.window.document.exitFullscreen():t.window.document.mozCancelFullScreen?t.window.document.mozCancelFullScreen():t.window.document.msExitFullscreen?t.window.document.msExitFullscreen():t.window.document.webkitCancelFullScreen&&t.window.document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()};var qr={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},Zr=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", "),Xr=function(e){function i(n){e.call(this),this.options=t.extend(Object.create(qr),n),t.bindAll(["_update","_onClose","remove","_onMouseMove","_onMouseUp","_onDrag"],this)}return e&&(i.__proto__=e),(i.prototype=Object.create(e&&e.prototype)).constructor=i,i.prototype.addTo=function(e){return this._map&&this.remove(),this._map=e,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")):this._map.on("move",this._update),this.fire(new t.Event("open")),this},i.prototype.isOpen=function(){return!!this._map},i.prototype.remove=function(){return this._content&&n.remove(this._content),this._container&&(n.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),delete this._map),this.fire(new t.Event("close")),this},i.prototype.getLngLat=function(){return this._lngLat},i.prototype.setLngLat=function(e){return this._lngLat=t.LngLat.convert(e),this._pos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.remove("mapboxgl-track-pointer")),this},i.prototype.trackPointer=function(){return this._trackPointer=!0,this._pos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")),this},i.prototype.getElement=function(){return this._container},i.prototype.setText=function(e){return this.setDOMContent(t.window.document.createTextNode(e))},i.prototype.setHTML=function(e){var n,i=t.window.document.createDocumentFragment(),r=t.window.document.createElement("body");for(r.innerHTML=e;n=r.firstChild;)i.appendChild(n);return this.setDOMContent(i)},i.prototype.getMaxWidth=function(){return this._container&&this._container.style.maxWidth},i.prototype.setMaxWidth=function(t){return this.options.maxWidth=t,this._update(),this},i.prototype.setDOMContent=function(t){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=n.create("div","mapboxgl-popup-content",this._container);return this._content.appendChild(t),this._createCloseButton(),this._update(),this._focusFirstElement(),this},i.prototype.addClassName=function(t){this._container&&this._container.classList.add(t)},i.prototype.removeClassName=function(t){this._container&&this._container.classList.remove(t)},i.prototype.setOffset=function(t){return this.options.offset=t,this._update(),this},i.prototype.toggleClassName=function(t){if(this._container)return this._container.classList.toggle(t)},i.prototype._createCloseButton=function(){this.options.closeButton&&(this._closeButton=n.create("button","mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))},i.prototype._onMouseUp=function(t){this._update(t.point)},i.prototype._onMouseMove=function(t){this._update(t.point)},i.prototype._onDrag=function(t){this._update(t.point)},i.prototype._update=function(e){var i=this;if(this._map&&(this._lngLat||this._trackPointer)&&this._content&&(this._container||(this._container=n.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=n.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className&&this.options.className.split(" ").forEach((function(t){return i._container.classList.add(t)})),this._trackPointer&&this._container.classList.add("mapboxgl-popup-track-pointer")),this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._map.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=Rr(this._lngLat,this._pos,this._map.transform)),!this._trackPointer||e)){var r=this._pos=this._trackPointer&&e?e:this._map.project(this._lngLat),o=this.options.anchor,s=function e(n){if(n){if("number"==typeof n){var i=Math.round(Math.sqrt(.5*Math.pow(n,2)));return{center:new t.Point(0,0),top:new t.Point(0,n),"top-left":new t.Point(i,i),"top-right":new t.Point(-i,i),bottom:new t.Point(0,-n),"bottom-left":new t.Point(i,-i),"bottom-right":new t.Point(-i,-i),left:new t.Point(n,0),right:new t.Point(-n,0)}}if(n instanceof t.Point||Array.isArray(n)){var r=t.Point.convert(n);return{center:r,top:r,"top-left":r,"top-right":r,bottom:r,"bottom-left":r,"bottom-right":r,left:r,right:r}}return{center:t.Point.convert(n.center||[0,0]),top:t.Point.convert(n.top||[0,0]),"top-left":t.Point.convert(n["top-left"]||[0,0]),"top-right":t.Point.convert(n["top-right"]||[0,0]),bottom:t.Point.convert(n.bottom||[0,0]),"bottom-left":t.Point.convert(n["bottom-left"]||[0,0]),"bottom-right":t.Point.convert(n["bottom-right"]||[0,0]),left:t.Point.convert(n.left||[0,0]),right:t.Point.convert(n.right||[0,0])}}return e(new t.Point(0,0))}(this.options.offset);if(!o){var a,l=this._container.offsetWidth,c=this._container.offsetHeight;a=r.y+s.bottom.y<c?["top"]:r.y>this._map.transform.height-c?["bottom"]:[],r.x<l/2?a.push("left"):r.x>this._map.transform.width-l/2&&a.push("right"),o=0===a.length?"bottom":a.join("-")}var u=r.add(s[o]).round();n.setTransform(this._container,Lr[o]+" translate("+u.x+"px,"+u.y+"px)"),Or(this._container,o,"popup")}},i.prototype._focusFirstElement=function(){if(this.options.focusAfterOpen&&this._container){var t=this._container.querySelector(Zr);t&&t.focus()}},i.prototype._onClose=function(){this.remove()},i}(t.Evented),Kr={version:t.version,supported:e,setRTLTextPlugin:t.setRTLTextPlugin,getRTLTextPluginStatus:t.getRTLTextPluginStatus,Map:Sr,NavigationControl:Ir,GeolocateControl:Ur,AttributionControl:_r,ScaleControl:Vr,FullscreenControl:Wr,Popup:Xr,Marker:kr,Style:je,LngLat:t.LngLat,LngLatBounds:t.LngLatBounds,Point:t.Point,MercatorCoordinate:t.MercatorCoordinate,Evented:t.Evented,config:t.config,prewarm:function(){Nt().acquire(Ot)},clearPrewarmedResources:function(){var t=kt;t&&(t.isPreloaded()&&1===t.numActive()?(t.release(Ot),kt=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))},get accessToken(){return t.config.ACCESS_TOKEN},set accessToken(e){t.config.ACCESS_TOKEN=e},get baseApiUrl(){return t.config.API_URL},set baseApiUrl(e){t.config.API_URL=e},get workerCount(){return Dt.workerCount},set workerCount(t){Dt.workerCount=t},get maxParallelImageRequests(){return t.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(e){t.config.MAX_PARALLEL_IMAGE_REQUESTS=e},clearStorage:function(e){t.clearTileCache(e)},workerUrl:""};return Kr})),n}()},
267594:(t,e,n)=>{"use strict";n.d(e,{E:()=>V});var i=n(92494
vendor: 11,534 bytes, line 2
2);const r={mousedown:1,mousemove:2,mouseup:4};!function(t){const e=t.prototype.handler;t.prototype.handler=function(t){const n=this.store;t.button>0&&"pointerdown"===t.type&&(function(t,e){for(let n=0;n<t.length;n++)if(e(t[n]))return!0;return!1}(n,(e=>e.pointerId===t.pointerId))||n.push(t)),e.call(this,t)}}(i.PointerEventInput),i.MouseInput.prototype.handler=function(t){let e=r[t.type];1&e&&t.button>=0&&(this.pressed=!0),2&e&&0===t.which&&(e=4),this.pressed&&(4&e&&(this.pressed=!1),this.callback(this.manager,e,{pointers:[t],changedPointers:[t],pointerType:"mouse",srcEvent:t}))};const o=i.Manager,s=i;class a{constructor(t,e,n){this.element=t,this.callback=e,this.options={enable:!0,...n}}}const l=s?[[s.Pan,{event:"tripan",pointers:3,threshold:0,enable:!1}],[s.Rotate,{enable:!1}],[s.Pinch,{enable:!1}],[s.Swipe,{enable:!1}],[s.Pan,{threshold:0,enable:!1}],[s.Press,{enable:!1}],[s.Tap,{event:"doubletap",taps:2,enable:!1}],[s.Tap,{event:"anytap",enable:!1}],[s.Tap,{enable:!1}]]:null,c={tripan:["rotate","pinch","pan"],rotate:["pinch"],pinch:["pan"],pan:["press","doubletap","anytap","tap"],doubletap:["anytap"],anytap:["tap"]},u={doubletap:["tap"]},h={pointerdown:"pointerdown",pointermove:"pointermove",pointerup:"pointerup",touchstart:"pointerdown",touchmove:"pointermove",touchend:"pointerup",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup"},d={KEY_EVENTS:["keydown","keyup"],MOUSE_EVENTS:["mousedown","mousemove","mouseup","mouseover","mouseout","mouseleave"],WHEEL_EVENTS:["wheel","mousewheel"]},p={tap:"tap",anytap:"anytap",doubletap:"doubletap",press:"press",pinch:"pinch",pinchin:"pinch",pinchout:"pinch",pinchstart:"pinch",pinchmove:"pinch",pinchend:"pinch",pinchcancel:"pinch",rotate:"rotate",rotatestart:"rotate",rotatemove:"rotate",rotateend:"rotate",rotatecancel:"rotate",tripan:"tripan",tripanstart:"tripan",tripanmove:"tripan",tripanup:"tripan",tripandown:"tripan",tripanleft:"tripan",tripanright:"tripan",tripanend:"tripan",tripancancel:"tripan",pan:"pan",panstart:"pan",panmove:"pan",panup:"pan",pandown:"pan",panleft:"pan",panright:"pan",panend:"pan",pancancel:"pan",swipe:"swipe",swipeleft:"swipe",swiperight:"swipe",swipeup:"swipe",swipedown:"swipe"},f={click:"tap",anyclick:"anytap",dblclick:"doubletap",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup",mouseover:"pointerover",mouseout:"pointerout",mouseleave:"pointerleave"},A="undefined"!==typeof navigator&&navigator.userAgent?navigator.userAgent.toLowerCase():"",g="undefined"!==typeof window?window:n.g;"undefined"!==typeof n.g?n.g:window,"undefined"!==typeof document&&document;let m=!1;try{const t={get passive(){return m=!0,!0}};g.addEventListener("test",null,t),g.removeEventListener("test",null)}catch(j){m=!1}const y=-1!==A.indexOf("firefox"),{WHEEL_EVENTS:_}=d,v="wheel",b=4.000244140625;class x extends a{constructor(t,e,n){super(t,e,n),this.handleEvent=t=>{if(!this.options.enable)return;let e=t.deltaY;g.WheelEvent&&(y&&t.deltaMode===g.WheelEvent.DOM_DELTA_PIXEL&&(e/=g.devicePixelRatio),t.deltaMode===g.WheelEvent.DOM_DELTA_LINE&&(e*=40)),0!==e&&e%b===0&&(e=Math.floor(e/b)),t.shiftKey&&e&&(e*=.25),this.callback({type:v,center:{x:t.clientX,y:t.clientY},delta:-e,srcEvent:t,pointerType:"mouse",target:t.target})},this.events=(this.options.events||[]).concat(_),this.events.forEach((e=>t.addEventListener(e,this.handleEvent,!!m&&{passive:!1})))}destroy(){this.events.forEach((t=>this.element.removeEventListener(t,this.handleEvent)))}enableEventType(t,e){t===v&&(this.options.enable=e)}}const{MOUSE_EVENTS:w}=d,E="pointermove",C="pointerover",T="pointerout",S="pointerenter",P="pointerleave";class M extends a{constructor(t,e,n){super(t,e,n),this.handleEvent=t=>{this.handleOverEvent(t),this.handleOutEvent(t),this.handleEnterEvent(t),this.handleLeaveEvent(t),this.handleMoveEvent(t)},this.pressed=!1;const{enable:i}=this.options;this.enableMoveEvent=i,this.enableLeaveEvent=i,this.enableEnterEvent=i,this.enableOutEvent=i,this.enableOverEvent=i,this.events=(this.options.events||[]).concat(w),this.events.forEach((e=>t.addEventListener(e,this.handleEvent)))}destroy(){this.events.forEach((t=>this.element.removeEventListener(t,this.handleEvent)))}enableEventType(t,e){t===E&&(this.enableMoveEvent=e),t===C&&(this.enableOverEvent=e),t===T&&(this.enableOutEvent=e),t===S&&(this.enableEnterEvent=e),t===P&&(this.enableLeaveEvent=e)}handleOverEvent(t){this.enableOverEvent&&"mouseover"===t.type&&this._emit(C,t)}handleOutEvent(t){this.enableOutEvent&&"mouseout"===t.type&&this._emit(T,t)}handleEnterEvent(t){this.enableEnterEvent&&"mouseenter"===t.type&&this._emit(S,t)}handleLeaveEvent(t){this.enableLeaveEvent&&"mouseleave"===t.type&&this._emit(P,t)}handleMoveEvent(t){if(this.enableMoveEvent)switch(t.type){case"mousedown":t.button>=0&&(this.pressed=!0);break;case"mousemove":0===t.which&&(this.pressed=!1),this.pressed||this._emit(E,t);break;case"mouseup":this.pressed=!1}}_emit(t,e){this.callback({type:t,center:{x:e.clientX,y:e.clientY},srcEvent:e,pointerType:"mouse",target:e.target})}}const{KEY_EVENTS:I}=d,B="keydown",R="keyup";class L extends a{constructor(t,e,n){super(t,e,n),this.handleEvent=t=>{const e=t.target||t.srcElement;"INPUT"===e.tagName&&"text"===e.type||"TEXTAREA"===e.tagName||(this.enableDownEvent&&"keydown"===t.type&&this.callback({type:B,srcEvent:t,key:t.key,target:t.target}),this.enableUpEvent&&"keyup"===t.type&&this.callback({type:R,srcEvent:t,key:t.key,target:t.target}))},this.enableDownEvent=this.options.enable,this.enableUpEvent=this.options.enable,this.events=(this.options.events||[]).concat(I),t.tabIndex=this.options.tabIndex||0,t.style.outline="none",this.events.forEach((e=>t.addEventListener(e,this.handleEvent)))}destroy(){this.events.forEach((t=>this.element.removeEventListener(t,this.handleEvent)))}enableEventType(t,e){t===B&&(this.enableDownEvent=e),t===R&&(this.enableUpEvent=e)}}const O="contextmenu";class D extends a{constructor(t,e,n){super(t,e,n),this.handleEvent=t=>{this.options.enable&&this.callback({type:O,center:{x:t.clientX,y:t.clientY},srcEvent:t,pointerType:"mouse",target:t.target})},t.addEventListener("contextmenu",this.handleEvent)}destroy(){this.element.removeEventListener("contextmenu",this.handleEvent)}enableEventType(t,e){t===O&&(this.options.enable=e)}}const k={pointerdown:1,pointermove:2,pointerup:4,mousedown:1,mousemove:2,mouseup:4};function F(t){const e=k[t.srcEvent.type];if(!e)return null;const{buttons:n,button:i,which:r}=t.srcEvent;let o=!1,s=!1,a=!1;return 4===e||2===e&&!Number.isFinite(n)?(o=1===r,s=2===r,a=3===r):2===e?(o=Boolean(1&n),s=Boolean(4&n),a=Boolean(2&n)):1===e&&(o=0===i,s=1===i,a=2===i),{leftButton:o,middleButton:s,rightButton:a}}function N(t,e){const n=t.center;if(!n)return null;const i=e.getBoundingClientRect(),r=i.width/e.offsetWidth||1,o=i.height/e.offsetHeight||1;return{center:n,offsetCenter:{x:(n.x-i.left-e.clientLeft)/r,y:(n.y-i.top-e.clientTop)/o}}}const z={srcElement:"root",priority:0};class U{constructor(t){this.handleEvent=t=>{if(this.isEmpty())return;const e=this._normalizeEvent(t);let n=t.srcEvent.target;for(;n&&n!==e.rootElement;){if(this._emit(e,n),e.handled)return;n=n.parentNode}this._emit(e,"root")},this.eventManager=t,this.handlers=[],this.handlersByElement=new Map,this._active=!1}isEmpty(){return!this._active}add(t,e,n){let i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=arguments.length>4&&void 0!==arguments[4]&&arguments[4];const{handlers:o,handlersByElement:s}=this;let a=z;"string"===typeof n||n&&n.addEventListener?a={...z,srcElement:n}:n&&(a={...z,...n});let l=s.get(a.srcElement);l||(l=[],s.set(a.srcElement,l));const c={type:t,handler:e,srcElement:a.srcElement,priority:a.priority};i&&(c.once=!0),r&&(c.passive=!0),o.push(c),this._active=this._active||!c.passive;let u=l.length-1;for(;u>=0&&!(l[u].priority>=c.priority);)u--;l.splice(u+1,0,c)}remove(t,e){const{handlers:n,handlersByElement:i}=this;for(let r=n.length-1;r>=0;r--){const o=n[r];if(o.type===t&&o.handler===e){n.splice(r,1);const t=i.get(o.srcElement);t.splice(t.indexOf(o),1),0===t.length&&i.delete(o.srcElement)}}this._active=n.some((t=>!t.passive))}_emit(t,e){const n=this.handlersByElement.get(e);if(n){let e=!1;const i=()=>{t.handled=!0},r=()=>{t.handled=!0,e=!0},o=[];for(let s=0;s<n.length;s++){const{type:a,handler:l,once:c}=n[s];if(l({...t,type:a,stopPropagation:i,stopImmediatePropagation:r}),c&&o.push(n[s]),e)break}for(let t=0;t<o.length;t++){const{type:e,handler:n}=o[t];this.remove(e,n)}}}_normalizeEvent(t){const e=this.eventManager.getElement();return{...t,...F(t),...N(t,e),preventDefault:()=>{t.srcEvent.preventDefault()},stopImmediatePropagation:null,stopPropagation:null,handled:!1,rootElement:e}}}const G={events:null,recognizers:null,recognizerOptions:{},Manager:o,touchAction:"none",tabIndex:0};class V{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1?arguments[1]:void 0;this._onBasicInput=t=>{const{srcEvent:e}=t,n=h[e.type];n&&this.manager.emit(n,t)},this._onOtherEvent=t=>{this.manager.emit(t.type,t)},this.options={...G,...e},this.events=new Map,this.setElement(t);const{events:n}=this.options;n&&this.on(n)}getElement(){return this.element}setElement(t){if(this.element&&this.destroy(),this.element=t,!t)return;const{options:e}=this,n=e.Manager;this.manager=new n(t,{touchAction:e.touchAction,recognizers:e.recognizers||l}).on("hammer.input",this._onBasicInput),e.recognizers||Object.keys(c).forEach((t=>{const e=this.manager.get(t);e&&c[t].forEach((t=>{e.recognizeWith(t)}))}));for(const i in e.recognizerOptions){const t=this.manager.get(i);if(t){const n=e.recognizerOptions[i];delete n.enable,t.set(n)}}this.wheelInput=new x(t,this._onOtherEvent,{enable:!1}),this.moveInput=new M(t,this._onOtherEvent,{enable:!1}),this.keyInput=new L(t,this._onOtherEvent,{enable:!1,tabIndex:e.tabIndex}),this.contextmenuInput=new D(t,this._onOtherEvent,{enable:!1});for(const[i,r]of this.events)r.isEmpty()||(this._toggleRecognizer(r.recognizerName,!0),this.manager.on(i,r.handleEvent))}destroy(){this.element&&(this.wheelInput.destroy(),this.moveInput.destroy(),this.keyInput.destroy(),this.contextmenuInput.destroy(),this.manager.destroy(),this.wheelInput=null,this.moveInput=null,this.keyInput=null,this.contextmenuInput=null,this.manager=null,this.element=null)}on(t,e,n){this._addEventHandler(t,e,n,!1)}once(t,e,n){this._addEventHandler(t,e,n,!0)}watch(t,e,n){this._addEventHandler(t,e,n,!1,!0)}off(t,e){this._removeEventHandler(t,e)}_toggleRecognizer(t,e){const{manager:n}=this;if(!n)return;const i=n.get(t);if(i&&i.options.enable!==e){i.set({enable:e});const r=u[t];r&&!this.options.recognizers&&r.forEach((r=>{const o=n.get(r);e?(o.requireFailure(t),i.dropRequireFailure(r)):o.dropRequireFailure(t)}))}this.wheelInput.enableEventType(t,e),this.moveInput.enableEventType(t,e),this.keyInput.enableEventType(t,e),this.contextmenuInput.enableEventType(t,e)}_addEventHandler(t,e,n,i,r){if("string"!==typeof t){n=e;for(const e in t)this._addEventHandler(e,t[e],n,i,r);return}const{manager:o,events:s}=this,a=f[t]||t;let l=s.get(a);l||(l=new U(this),s.set(a,l),l.recognizerName=p[a]||a,o&&o.on(a,l.handleEvent)),l.add(t,e,n,i,r),l.isEmpty()||this._toggleRecognizer(l.recognizerName,!0)}_removeEventHandler(t,e){if("string"!==typeof t){for(const e in t)this._removeEventHandler(e,t[e]);return}const{events:n}=this,i=f[t]||t,r=n.get(i);if(r&&(r.remove(t,e),r.isEmpty())){const{recognizerName:t}=r;let e=!1;for(const i of n.values())if(i.recognizerName===t&&!i.isEmpty()){e=!0;break}e||this._toggleRecognizer(t,!1)}}}},
215361:(t,e,n)=>{"use strict";t.exports=r;var i=n(712
vendor: 10,054 bytes, line 2
21);function r(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}r.Varint=0,r.Fixed64=1,r.Bytes=2,r.Fixed32=5;var o=4294967296,s=1/o,a="undefined"===typeof TextDecoder?null:new TextDecoder("utf8");function l(t){return t.type===r.Bytes?t.readVarint()+t.pos:t.pos+1}function c(t,e,n){return n?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function u(t,e,n){var i=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));n.realloc(i);for(var r=n.pos-1;r>=t;r--)n.buf[r+i]=n.buf[r]}function h(t,e){for(var n=0;n<t.length;n++)e.writeVarint(t[n])}function d(t,e){for(var n=0;n<t.length;n++)e.writeSVarint(t[n])}function p(t,e){for(var n=0;n<t.length;n++)e.writeFloat(t[n])}function f(t,e){for(var n=0;n<t.length;n++)e.writeDouble(t[n])}function A(t,e){for(var n=0;n<t.length;n++)e.writeBoolean(t[n])}function g(t,e){for(var n=0;n<t.length;n++)e.writeFixed32(t[n])}function m(t,e){for(var n=0;n<t.length;n++)e.writeSFixed32(t[n])}function y(t,e){for(var n=0;n<t.length;n++)e.writeFixed64(t[n])}function _(t,e){for(var n=0;n<t.length;n++)e.writeSFixed64(t[n])}function v(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+16777216*t[e+3]}function b(t,e,n){t[n]=e,t[n+1]=e>>>8,t[n+2]=e>>>16,t[n+3]=e>>>24}function x(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}r.prototype={destroy:function(){this.buf=null},readFields:function(t,e,n){for(n=n||this.length;this.pos<n;){var i=this.readVarint(),r=i>>3,o=this.pos;this.type=7&i,t(r,e,this),this.pos===o&&this.skip(i)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=v(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=x(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=v(this.buf,this.pos)+v(this.buf,this.pos+4)*o;return this.pos+=8,t},readSFixed64:function(){var t=v(this.buf,this.pos)+x(this.buf,this.pos+4)*o;return this.pos+=8,t},readFloat:function(){var t=i.read(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=i.read(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,n,i=this.buf;return e=127&(n=i[this.pos++]),n<128?e:(e|=(127&(n=i[this.pos++]))<<7,n<128?e:(e|=(127&(n=i[this.pos++]))<<14,n<128?e:(e|=(127&(n=i[this.pos++]))<<21,n<128?e:function(t,e,n){var i,r,o=n.buf;if(r=o[n.pos++],i=(112&r)>>4,r<128)return c(t,i,e);if(r=o[n.pos++],i|=(127&r)<<3,r<128)return c(t,i,e);if(r=o[n.pos++],i|=(127&r)<<10,r<128)return c(t,i,e);if(r=o[n.pos++],i|=(127&r)<<17,r<128)return c(t,i,e);if(r=o[n.pos++],i|=(127&r)<<24,r<128)return c(t,i,e);if(r=o[n.pos++],i|=(1&r)<<31,r<128)return c(t,i,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(n=i[this.pos]))<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2===1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=12&&a?function(t,e,n){return a.decode(t.subarray(e,n))}(this.buf,e,t):function(t,e,n){var i="",r=e;for(;r<n;){var o,s,a,l=t[r],c=null,u=l>239?4:l>223?3:l>191?2:1;if(r+u>n)break;1===u?l<128&&(c=l):2===u?128===(192&(o=t[r+1]))&&(c=(31&l)<<6|63&o)<=127&&(c=null):3===u?(o=t[r+1],s=t[r+2],128===(192&o)&&128===(192&s)&&((c=(15&l)<<12|(63&o)<<6|63&s)<=2047||c>=55296&&c<=57343)&&(c=null)):4===u&&(o=t[r+1],s=t[r+2],a=t[r+3],128===(192&o)&&128===(192&s)&&128===(192&a)&&((c=(15&l)<<18|(63&o)<<12|(63&s)<<6|63&a)<=65535||c>=1114112)&&(c=null)),null===c?(c=65533,u=1):c>65535&&(c-=65536,i+=String.fromCharCode(c>>>10&1023|55296),c=56320|1023&c),i+=String.fromCharCode(c),r+=u}return i}(this.buf,e,t)},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){if(this.type!==r.Bytes)return t.push(this.readVarint(e));var n=l(this);for(t=t||[];this.pos<n;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){if(this.type!==r.Bytes)return t.push(this.readSVarint());var e=l(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==r.Bytes)return t.push(this.readBoolean());var e=l(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==r.Bytes)return t.push(this.readFloat());var e=l(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==r.Bytes)return t.push(this.readDouble());var e=l(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==r.Bytes)return t.push(this.readFixed32());var e=l(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==r.Bytes)return t.push(this.readSFixed32());var e=l(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==r.Bytes)return t.push(this.readFixed64());var e=l(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==r.Bytes)return t.push(this.readSFixed64());var e=l(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=7&t;if(e===r.Varint)for(;this.buf[this.pos++]>127;);else if(e===r.Bytes)this.pos=this.readVarint()+this.pos;else if(e===r.Fixed32)this.pos+=4;else{if(e!==r.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e<this.pos+t;)e*=2;if(e!==this.length){var n=new Uint8Array(e);n.set(this.buf),this.buf=n,this.length=e}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(t){this.realloc(4),b(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),b(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),b(this.buf,-1&t,this.pos),b(this.buf,Math.floor(t*s),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),b(this.buf,-1&t,this.pos),b(this.buf,Math.floor(t*s),this.pos+4),this.pos+=8},writeVarint:function(t){(t=+t||0)>268435455||t<0?function(t,e){var n,i;t>=0?(n=t%4294967296|0,i=t/4294967296|0):(i=~(-t/4294967296),4294967295^(n=~(-t%4294967296))?n=n+1|0:(n=0,i=i+1|0));if(t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),function(t,e,n){n.buf[n.pos++]=127&t|128,t>>>=7,n.buf[n.pos++]=127&t|128,t>>>=7,n.buf[n.pos++]=127&t|128,t>>>=7,n.buf[n.pos++]=127&t|128,t>>>=7,n.buf[n.pos]=127&t}(n,0,e),function(t,e){var n=(7&t)<<4;if(e.buf[e.pos++]|=n|((t>>>=3)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;e.buf[e.pos++]=127&t}(i,e)}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))))},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t),this.realloc(4*t.length),this.pos++;var e=this.pos;this.pos=function(t,e,n){for(var i,r,o=0;o<e.length;o++){if((i=e.charCodeAt(o))>55295&&i<57344){if(!r){i>56319||o+1===e.length?(t[n++]=239,t[n++]=191,t[n++]=189):r=i;continue}if(i<56320){t[n++]=239,t[n++]=191,t[n++]=189,r=i;continue}i=r-55296<<10|i-56320|65536,r=null}else r&&(t[n++]=239,t[n++]=191,t[n++]=189,r=null);i<128?t[n++]=i:(i<2048?t[n++]=i>>6|192:(i<65536?t[n++]=i>>12|224:(t[n++]=i>>18|240,t[n++]=i>>12&63|128),t[n++]=i>>6&63|128),t[n++]=63&i|128)}return n}(this.buf,t,this.pos);var n=this.pos-e;n>=128&&u(e,n,this),this.pos=e-1,this.writeVarint(n),this.pos+=n},writeFloat:function(t){this.realloc(4),i.write(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),i.write(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var n=0;n<e;n++)this.buf[this.pos++]=t[n]},writeRawMessage:function(t,e){this.pos++;var n=this.pos;t(e,this);var i=this.pos-n;i>=128&&u(n,i,this),this.pos=n-1,this.writeVarint(i),this.pos+=i},writeMessage:function(t,e,n){this.writeTag(t,r.Bytes),this.writeRawMessage(e,n)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,h,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,d,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,A,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,p,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,f,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,g,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,m,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,y,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,_,e)},writeBytesField:function(t,e){this.writeTag(t,r.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,r.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,r.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,r.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,r.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,r.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,r.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,r.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,r.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,r.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}}},8
23614:(t,e,n)=>{"use strict";n.d(e,{wZ:()=>Jt,ov:()=>wi,b:()=>le});var i=n(68102),r=n(94300),o=n(41705),s=n(58878),a=n(29830),l=n(97850
vendor: 20,771 bytes, line 2
2),c=1e-6,u="undefined"!==typeof Float32Array?Float32Array:Array;Math.random;Math.PI;Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});!function(){var t=function(){var t=new u(4);return u!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}()}();function h(t,e){const n=function(t,e,n){var i=e[0],r=e[1],o=e[2],s=e[3];return t[0]=n[0]*i+n[4]*r+n[8]*o+n[12]*s,t[1]=n[1]*i+n[5]*r+n[9]*o+n[13]*s,t[2]=n[2]*i+n[6]*r+n[10]*o+n[14]*s,t[3]=n[3]*i+n[7]*r+n[11]*o+n[15]*s,t}([],e,t);var i,r,o;return i=n,r=n,o=1/n[3],i[0]=r[0]*o,i[1]=r[1]*o,i[2]=r[2]*o,i[3]=r[3]*o,n}function d(t,e){const n=t%e;return n<0?e+n:n}function p(t,e,n){return t<e?e:t>n?n:t}const f=Math.log2||function(t){return Math.log(t)*Math.LOG2E};function A(t,e,n){var i=e[0],r=e[1],o=e[2],s=e[3],a=e[4],l=e[5],c=e[6],u=e[7],h=e[8],d=e[9],p=e[10],f=e[11],A=e[12],g=e[13],m=e[14],y=e[15],_=n[0],v=n[1],b=n[2],x=n[3];return t[0]=_*i+v*a+b*h+x*A,t[1]=_*r+v*l+b*d+x*g,t[2]=_*o+v*c+b*p+x*m,t[3]=_*s+v*u+b*f+x*y,_=n[4],v=n[5],b=n[6],x=n[7],t[4]=_*i+v*a+b*h+x*A,t[5]=_*r+v*l+b*d+x*g,t[6]=_*o+v*c+b*p+x*m,t[7]=_*s+v*u+b*f+x*y,_=n[8],v=n[9],b=n[10],x=n[11],t[8]=_*i+v*a+b*h+x*A,t[9]=_*r+v*l+b*d+x*g,t[10]=_*o+v*c+b*p+x*m,t[11]=_*s+v*u+b*f+x*y,_=n[12],v=n[13],b=n[14],x=n[15],t[12]=_*i+v*a+b*h+x*A,t[13]=_*r+v*l+b*d+x*g,t[14]=_*o+v*c+b*p+x*m,t[15]=_*s+v*u+b*f+x*y,t}function g(t,e,n){var i,r,o,s,a,l,c,u,h,d,p,f,A=n[0],g=n[1],m=n[2];return e===t?(t[12]=e[0]*A+e[4]*g+e[8]*m+e[12],t[13]=e[1]*A+e[5]*g+e[9]*m+e[13],t[14]=e[2]*A+e[6]*g+e[10]*m+e[14],t[15]=e[3]*A+e[7]*g+e[11]*m+e[15]):(i=e[0],r=e[1],o=e[2],s=e[3],a=e[4],l=e[5],c=e[6],u=e[7],h=e[8],d=e[9],p=e[10],f=e[11],t[0]=i,t[1]=r,t[2]=o,t[3]=s,t[4]=a,t[5]=l,t[6]=c,t[7]=u,t[8]=h,t[9]=d,t[10]=p,t[11]=f,t[12]=i*A+a*g+h*m+e[12],t[13]=r*A+l*g+d*m+e[13],t[14]=o*A+c*g+p*m+e[14],t[15]=s*A+u*g+f*m+e[15]),t}function m(t,e,n){var i=n[0],r=n[1],o=n[2];return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t[3]=e[3]*i,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*o,t[9]=e[9]*o,t[10]=e[10]*o,t[11]=e[11]*o,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}var y=function(t,e,n,i,r){var o,s=1/Math.tan(e/2);return t[0]=s/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=s,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=r&&r!==1/0?(o=1/(i-r),t[10]=(r+i)*o,t[14]=2*r*i*o):(t[10]=-1,t[14]=-2*i),t};function _(t,e){var n=t[0],i=t[1],r=t[2],o=t[3],s=t[4],a=t[5],l=t[6],u=t[7],h=t[8],d=t[9],p=t[10],f=t[11],A=t[12],g=t[13],m=t[14],y=t[15],_=e[0],v=e[1],b=e[2],x=e[3],w=e[4],E=e[5],C=e[6],T=e[7],S=e[8],P=e[9],M=e[10],I=e[11],B=e[12],R=e[13],L=e[14],O=e[15];return Math.abs(n-_)<=c*Math.max(1,Math.abs(n),Math.abs(_))&&Math.abs(i-v)<=c*Math.max(1,Math.abs(i),Math.abs(v))&&Math.abs(r-b)<=c*Math.max(1,Math.abs(r),Math.abs(b))&&Math.abs(o-x)<=c*Math.max(1,Math.abs(o),Math.abs(x))&&Math.abs(s-w)<=c*Math.max(1,Math.abs(s),Math.abs(w))&&Math.abs(a-E)<=c*Math.max(1,Math.abs(a),Math.abs(E))&&Math.abs(l-C)<=c*Math.max(1,Math.abs(l),Math.abs(C))&&Math.abs(u-T)<=c*Math.max(1,Math.abs(u),Math.abs(T))&&Math.abs(h-S)<=c*Math.max(1,Math.abs(h),Math.abs(S))&&Math.abs(d-P)<=c*Math.max(1,Math.abs(d),Math.abs(P))&&Math.abs(p-M)<=c*Math.max(1,Math.abs(p),Math.abs(M))&&Math.abs(f-I)<=c*Math.max(1,Math.abs(f),Math.abs(I))&&Math.abs(A-B)<=c*Math.max(1,Math.abs(A),Math.abs(B))&&Math.abs(g-R)<=c*Math.max(1,Math.abs(g),Math.abs(R))&&Math.abs(m-L)<=c*Math.max(1,Math.abs(m),Math.abs(L))&&Math.abs(y-O)<=c*Math.max(1,Math.abs(y),Math.abs(O))}function v(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t}function b(t){var e=t[0],n=t[1];return Math.hypot(e,n)}function x(t,e,n,i){var r=e[0],o=e[1];return t[0]=r+i*(n[0]-r),t[1]=o+i*(n[1]-o),t}var w=function(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t};!function(){var t=function(){var t=new u(2);return u!=Float32Array&&(t[0]=0,t[1]=0),t}()}();var E=function(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t[2]=e[2]*n[2],t};!function(){var t=function(){var t=new u(3);return u!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}()}();function C(t,e){if(!t)throw new Error(e||"@math.gl/web-mercator: assertion failed.")}const T=Math.PI,S=T/4,P=T/180,M=180/T,I=512,B=4003e4,R=85.051129,L=1.5;function O(t){return Math.pow(2,t)}function D(t){return f(t)}function k(t){const[e,n]=t;C(Number.isFinite(e)),C(Number.isFinite(n)&&n>=-90&&n<=90,"invalid latitude");const i=n*P;return[I*(e*P+T)/(2*T),I*(T+Math.log(Math.tan(S+.5*i)))/(2*T)]}function F(t){const[e,n]=t,i=e/I*(2*T)-T,r=2*(Math.atan(Math.exp(n/I*(2*T)-T))-S);return[i*M,r*M]}function N(t){const{latitude:e,longitude:n,highPrecision:i=!1}=t;C(Number.isFinite(e)&&Number.isFinite(n));const r=I,o=Math.cos(e*P),s=r/360,a=s/o,l=r/B/o,c={unitsPerMeter:[l,l,l],metersPerUnit:[1/l,1/l,1/l],unitsPerDegree:[s,a,l],degreesPerUnit:[1/s,1/a,1/l]};if(i){const t=P*Math.tan(e*P)/o,n=s*t/2,i=r/B*t,u=i/a*l;c.unitsPerDegree2=[0,n,i],c.unitsPerMeter2=[u,0,u]}return c}function z(t){const{height:e,pitch:n,bearing:i,altitude:r,scale:o,center:s}=t,a=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];g(a,a,[0,0,-r]),function(t,e,n){var i=Math.sin(n),r=Math.cos(n),o=e[4],s=e[5],a=e[6],l=e[7],c=e[8],u=e[9],h=e[10],d=e[11];e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=o*r+c*i,t[5]=s*r+u*i,t[6]=a*r+h*i,t[7]=l*r+d*i,t[8]=c*r-o*i,t[9]=u*r-s*i,t[10]=h*r-a*i,t[11]=d*r-l*i}(a,a,-n*P),function(t,e,n){var i=Math.sin(n),r=Math.cos(n),o=e[0],s=e[1],a=e[2],l=e[3],c=e[4],u=e[5],h=e[6],d=e[7];e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*r+c*i,t[1]=s*r+u*i,t[2]=a*r+h*i,t[3]=l*r+d*i,t[4]=c*r-o*i,t[5]=u*r-s*i,t[6]=h*r-a*i,t[7]=d*r-l*i}(a,a,i*P);const l=o/e;var c,u;return m(a,a,[l,l,l]),s&&g(a,a,((c=[])[0]=-(u=s)[0],c[1]=-u[1],c[2]=-u[2],c)),a}function U(t){const{fov:e,aspect:n,near:i,far:r}=function(t){const{width:e,height:n,altitude:i,pitch:r=0,offset:o,center:s,scale:a,nearZMultiplier:l=1,farZMultiplier:c=1}=t;let{fovy:u=G(L)}=t;void 0!==i&&(u=G(i));const h=u*P,d=r*P,f=V(u);let A=f;s&&(A+=s[2]*a/Math.cos(d)/n);const g=h*(.5+(o?o[1]:0)/n),m=Math.sin(g)*A/Math.sin(p(Math.PI/2-d-g,.01,Math.PI-.01)),y=Math.sin(d)*m+A,_=10*A;return{fov:h,aspect:e/n,focalDistance:f,near:l,far:Math.min(y*c,_)}}(t);return y([],e,n,i,r)}function G(t){return 2*Math.atan(.5/t)*M}function V(t){return.5/Math.tan(.5*t*P)}function j(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const[i,r,o]=t;if(C(Number.isFinite(i)&&Number.isFinite(r),"invalid pixel coordinate"),Number.isFinite(o)){return h(e,[i,r,o,1])}const s=h(e,[i,r,0,1]),a=h(e,[i,r,1,1]),l=s[2],c=a[2];return x([],s,a,l===c?0:((n||0)-l)/(c-l))}function H(t){const{width:e,height:n,bounds:i,minExtent:r=0,maxZoom:o=24,offset:s=[0,0]}=t,[[a,l],[c,u]]=i,h=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if("number"===typeof t)return{top:t,bottom:t,left:t,right:t};return C(Number.isFinite(t.top)&&Number.isFinite(t.bottom)&&Number.isFinite(t.left)&&Number.isFinite(t.right)),t}(t.padding),d=k([a,p(u,-85.051129,R)]),A=k([c,p(l,-85.051129,R)]),g=[Math.max(Math.abs(A[0]-d[0]),r),Math.max(Math.abs(A[1]-d[1]),r)],m=[e-h.left-h.right-2*Math.abs(s[0]),n-h.top-h.bottom-2*Math.abs(s[1])];C(m[0]>0&&m[1]>0);const y=m[0]/g[0],_=m[1]/g[1],v=(h.right-h.left)/2/y,b=(h.top-h.bottom)/2/_,x=F([(A[0]+d[0])/2+v,(A[1]+d[1])/2+b]),w=Math.min(o,f(Math.abs(Math.min(y,_))));return C(Number.isFinite(w)),{longitude:x[0],latitude:x[1],zoom:w}}const W=Math.PI/180;function q(t,e,n){const{pixelUnprojectionMatrix:i}=t,r=h(i,[e,0,1,1]),o=h(i,[e,t.height,1,1]),s=F(x([],r,o,(n*t.distanceScales.unitsPerMeter[2]-r[2])/(o[2]-r[2])));return s.push(n),s}class Z{constructor(){var t=this;let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{width:1,height:1};(0,o.A)(this,"latitude",void 0),(0,o.A)(this,"longitude",void 0),(0,o.A)(this,"zoom",void 0),(0,o.A)(this,"pitch",void 0),(0,o.A)(this,"bearing",void 0),(0,o.A)(this,"altitude",void 0),(0,o.A)(this,"fovy",void 0),(0,o.A)(this,"meterOffset",void 0),(0,o.A)(this,"center",void 0),(0,o.A)(this,"width",void 0),(0,o.A)(this,"height",void 0),(0,o.A)(this,"scale",void 0),(0,o.A)(this,"distanceScales",void 0),(0,o.A)(this,"viewMatrix",void 0),(0,o.A)(this,"projectionMatrix",void 0),(0,o.A)(this,"viewProjectionMatrix",void 0),(0,o.A)(this,"pixelProjectionMatrix",void 0),(0,o.A)(this,"pixelUnprojectionMatrix",void 0),(0,o.A)(this,"equals",(t=>t instanceof Z&&(t.width===this.width&&t.height===this.height&&_(t.projectionMatrix,this.projectionMatrix)&&_(t.viewMatrix,this.viewMatrix)))),(0,o.A)(this,"project",(function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{topLeft:i=!0}=n,r=function(t,e){const[n,i,r=0]=t;return C(Number.isFinite(n)&&Number.isFinite(i)&&Number.isFinite(r)),h(e,[n,i,r,1])}(t.projectPosition(e),t.pixelProjectionMatrix),[o,s]=r,a=i?s:t.height-s;return 2===e.length?[o,a]:[o,a,r[2]]})),(0,o.A)(this,"unproject",(function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{topLeft:i=!0,targetZ:r}=n,[o,s,a]=e,l=i?s:t.height-s,c=r&&r*t.distanceScales.unitsPerMeter[2],u=j([o,l,a],t.pixelUnprojectionMatrix,c),[h,d,p]=t.unprojectPosition(u);return Number.isFinite(a)?[h,d,p]:Number.isFinite(r)?[h,d,r]:[h,d]})),(0,o.A)(this,"projectPosition",(t=>{const[e,n]=k(t);return[e,n,(t[2]||0)*this.distanceScales.unitsPerMeter[2]]})),(0,o.A)(this,"unprojectPosition",(t=>{const[e,n]=F(t);return[e,n,(t[2]||0)*this.distanceScales.metersPerUnit[2]]}));let{width:n,height:i,altitude:r=null,fovy:s=null}=e;const{latitude:a=0,longitude:l=0,zoom:c=0,pitch:u=0,bearing:d=0,position:p=null,nearZMultiplier:f=.02,farZMultiplier:A=1.01}=e;n=n||1,i=i||1,null===s&&null===r?(r=L,s=G(r)):null===s?s=G(r):null===r&&(r=V(s));const g=O(c);r=Math.max(.75,r);const m=N({longitude:l,latitude:a}),y=k([l,a]);var v,b,x;y.push(0),p&&(v=y,b=y,x=E([],p,m.unitsPerMeter),v[0]=b[0]+x[0],v[1]=b[1]+x[1],v[2]=b[2]+x[2]),this.projectionMatrix=U({width:n,height:i,scale:g,center:y,pitch:u,fovy:s,nearZMultiplier:f,farZMultiplier:A}),this.viewMatrix=z({height:i,scale:g,center:y,pitch:u,bearing:d,altitude:r}),this.width=n,this.height=i,this.scale=g,this.latitude=a,this.longitude=l,this.zoom=c,this.pitch=u,this.bearing=d,this.altitude=r,this.fovy=s,this.center=y,this.meterOffset=p||[0,0,0],this.distanceScales=m,this._initMatrices(),Object.freeze(this)}_initMatrices(){const{width:t,height:e,projectionMatrix:n,viewMatrix:i}=this,r=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];A(r,r,n),A(r,r,i),this.viewProjectionMatrix=r;const o=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];m(o,o,[t/2,-e/2,1]),g(o,o,[1,-1,0]),A(o,o,r);const s=function(t,e){var n=e[0],i=e[1],r=e[2],o=e[3],s=e[4],a=e[5],l=e[6],c=e[7],u=e[8],h=e[9],d=e[10],p=e[11],f=e[12],A=e[13],g=e[14],m=e[15],y=n*a-i*s,_=n*l-r*s,v=n*c-o*s,b=i*l-r*a,x=i*c-o*a,w=r*c-o*l,E=u*A-h*f,C=u*g-d*f,T=u*m-p*f,S=h*g-d*A,P=h*m-p*A,M=d*m-p*g,I=y*M-_*P+v*S+b*T-x*C+w*E;return I?(I=1/I,t[0]=(a*M-l*P+c*S)*I,t[1]=(r*P-i*M-o*S)*I,t[2]=(A*w-g*x+m*b)*I,t[3]=(d*x-h*w-p*b)*I,t[4]=(l*T-s*M-c*C)*I,t[5]=(n*M-r*T+o*C)*I,t[6]=(g*v-f*w-m*_)*I,t[7]=(u*w-d*v+p*_)*I,t[8]=(s*P-a*T+c*E)*I,t[9]=(i*T-n*P-o*E)*I,t[10]=(f*x-A*v+m*y)*I,t[11]=(h*v-u*x-p*y)*I,t[12]=(a*C-s*S-l*E)*I,t[13]=(n*S-i*C+r*E)*I,t[14]=(A*_-f*b-g*y)*I,t[15]=(u*b-h*_+d*y)*I,t):null}([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],o);if(!s)throw new Error("Pixel project matrix not invertible");this.pixelProjectionMatrix=o,this.pixelUnprojectionMatrix=s}projectFlat(t){return k(t)}unprojectFlat(t){return F(t)}getMapCenterByLngLatPosition(t){let{lngLat:e,pos:n}=t;const i=j(n,this.pixelUnprojectionMatrix),r=v([],k(e),((o=[])[0]=-(s=i)[0],o[1]=-s[1],o));var o,s;return F(v([],this.center,r))}fitBounds(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{width:n,height:i}=this,{longitude:r,latitude:o,zoom:s}=H(Object.assign({width:n,height:i,bounds:t},e));return new Z({width:n,height:i,longitude:r,latitude:o,zoom:s})}getBounds(t){const e=this.getBoundingRegion(t),n=Math.min(...e.map((t=>t[0]))),i=Math.max(...e.map((t=>t[0])));return[[n,Math.min(...e.map((t=>t[1])))],[i,Math.max(...e.map((t=>t[1])))]]}getBoundingRegion(){return function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const{width:n,height:i,unproject:r}=t,o={targetZ:e},s=r([0,i],o),a=r([n,i],o);let l,c;return(t.fovy?.5*t.fovy*W:Math.atan(.5/t.altitude))>(90-t.pitch)*W-.01?(l=q(t,0,e),c=q(t,n,e)):(l=r([0,0],o),c=r([n,0],o)),[s,a,c,l]}(this,(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).z||0)}getLocationAtPoint(t){let{lngLat:e,pos:n}=t;return this.getMapCenterByLngLatPosition({lngLat:e,pos:n})}}const X=.01,K=["longitude","latitude","zoom"],Q={curve:1.414,speed:1.2};function J(t,e,n){const i=(n=Object.assign({},Q,n)).curve,r=t.zoom,o=[t.longitude,t.latitude],s=O(r),a=e.zoom,l=[e.longitude,e.latitude],c=O(a-r),u=k(o),h=k(l),d=w([],h,u),p=Math.max(t.width,t.height),f=p/c,A=b(d)*s,g=Math.max(A,X),m=i*i,y=(f*f-p*p+m*m*g*g)/(2*p*m*g),_=(f*f-p*p-m*m*g*g)/(2*f*m*g),v=Math.log(Math.sqrt(y*y+1)-y),x=Math.log(Math.sqrt(_*_+1)-_);return{startZoom:r,startCenterXY:u,uDelta:d,w0:p,u1:A,S:(x-v)/i,rho:i,rho2:m,r0:v,r1:x}}var Y=function(){if("undefined"!==typeof Map)return Map;function t(t,e){var n=-1;return t.some((function(t,i){return t[0]===e&&(n=i,!0)})),n}return function(){function e(){this.__entries__=[]}return Object.defineProperty(e.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),e.prototype.get=function(e){var n=t(this.__entries__,e),i=this.__entries__[n];return i&&i[1]},e.prototype.set=function(e,n){var i=t(this.__entries__,e);~i?this.__entries__[i][1]=n:this.__entries__.push([e,n])},e.prototype.delete=function(e){var n=this.__entries__,i=t(n,e);~i&&n.splice(i,1)},e.prototype.has=function(e){return!!~t(this.__entries__,e)},e.prototype.clear=function(){this.__entries__.splice(0)},e.prototype.forEach=function(t,e){void 0===e&&(e=null);for(var n=0,i=this.__entries__;n<i.length;n++){var r=i[n];t.call(e,r[1],r[0])}},e}()}(),$="undefined"!==typeof window&&"undefined"!==typeof document&&window.document===document,tt="undefined"!==typeof n.g&&n.g.Math===Math?n.g:"undefined"!==typeof self&&self.Math===Math?self:"undefined"!==typeof window&&window.Math===Math?window:Function("return this")(),et="function"===typeof requestAnimationFrame?requestAnimationFrame.bind(tt):function(t){return setTimeout((function(){return t(Date.now())}),1e3/60)};var nt=["top","right","bottom","left","width","height","size","weight"],it="undefined"!==typeof MutationObserver,rt=function(){function t(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=function(t,e){var n=!1,i=!1,r=0;function o(){n&&(n=!1,t()),i&&a()}function s(){et(o)}function a(){var t=Date.now();if(n){if(t-r<2)return;i=!0}else n=!0,i=!1,setTimeout(s,e);r=t}return a}(this.refresh.bind(this),20)}return t.prototype.addObserver=function(t){~this.observers_.indexOf(t)||this.observers_.push(t),this.connected_||this.connect_()},t.prototype.removeObserver=function(t){var e=this.observers_,n=e.indexOf(t);~n&&e.splice(n,1),!e.length&&this.connected_&&this.disconnect_()},t.prototype.refresh=function(){this.updateObservers_()&&this.refresh()},t.prototype.updateObservers_=function(){var t=this.observers_.filter((function(t){return t.gatherActive(),t.hasActive()}));return t.forEach((function(t){return t.broadcastActive()})),t.length>0},t.prototype.connect_=function(){$&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),it?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},t.prototype.disconnect_=function(){$&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},t.prototype.onTransitionEnd_=function(t){var e=t.propertyName,n=void 0===e?"":e;nt.some((function(t){return!!~n.indexOf(t)}))&&this.refresh()},t.getInstance=function(){return this.instance_||(this.instance_=new t),this.instance_},t.instance_=null,t}(),ot=function(t,e){for(var n=0,i=Object.keys(e);n<i.length;n++){var r=i[n];Object.defineProperty(t,r,{value:e[r],enumerable:!1,writable:!1,configurable:!0})}return t},st=function(t){return t&&t.ownerDocument&&t.ownerDocument.defaultView||tt},at=pt(0,0,0,0);function lt(t){return parseFloat(t)||0}function ct(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return e.reduce((function(e,n){return e+lt(t["border-"+n+"-width"])}),0)}function ut(t){var e=t.clientWidth,n=t.clientHeight;if(!e&&!n)return at;var i=st(t).getComputedStyle(t),r=function(t){for(var e={},n=0,i=["top","right","bottom","left"];n<i.length;n++){var r=i[n],o=t["padding-"+r];e[r]=lt(o)}return e}(i),o=r.left+r.right,s=r.top+r.bottom,a=lt(i.width),l=lt(i.height);if("border-box"===i.boxSizing&&(Math.round(a+o)!==e&&(a-=ct(i,"left","right")+o),Math.round(l+s)!==n&&(l-=ct(i,"top","bottom")+s)),!function(t){return t===st(t).document.documentElement}(t)){var c=Math.round(a+o)-e,u=Math.round(l+s)-n;1!==Math.abs(c)&&(a-=c),1!==Math.abs(u)&&(l-=u)}return pt(r.left,r.top,a,l)}var ht="undefined"!==typeof SVGGraphicsElement?function(t){return t instanceof st(t).SVGGraphicsElement}:function(t){return t instanceof st(t).SVGElement&&"function"===typeof t.getBBox};function dt(t){return $?ht(t)?function(t){var e=t.getBBox();return pt(0,0,e.width,e.height)}(t):ut(t):at}function pt(t,e,n,i){return{x:t,y:e,width:n,height:i}}var ft=function(){function t(t){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=pt(0,0,0,0),this.target=t}return t.prototype.isActive=function(){var t=dt(this.target);return this.contentRect_=t,t.width!==this.broadcastWidth||t.height!==this.broadcastHeight},t.prototype.broadcastRect=function(){var t=this.contentRect_;return this.broadcastWidth=t.width,this.broadcastHeight=t.height,t},t}(),At=function(t,e){var n=function(t){var e=t.x,n=t.y,i=t.width,r=t.height,o="undefined"!==typeof DOMRectReadOnly?DOMRectReadOnly:Object,s=Object.create(o.prototype);return ot(s,{x:e,y:n,width:i,height:r,top:n,right:e+i,bottom:r+n,left:e}),s}(e);ot(this,{target:t,contentRect:n})},gt=function(){function t(t,e,n){if(this.activeObservations_=[],this.observations_=new Y,"function"!==typeof t)throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=t,this.controller_=e,this.callbackCtx_=n}return t.prototype.observe=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!==typeof Element&&Element instanceof Object){if(!(t instanceof st(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var e=this.observations_;e.has(t)||(e.set(t,new ft(t)),this.controller_.addObserver(this),this.controller_.refresh())}},t.prototype.unobserve=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!==typeof Element&&Element instanceof Object){if(!(t instanceof st(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var e=this.observations_;e.has(t)&&(e.delete(t),e.size||this.controller_.removeObserver(this))}},t.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},t.prototype.gatherActive=function(){var t=this;this.clearActive(),this.observations_.forEach((function(e){e.isActive()&&t.activeObservations_.push(e)}))},t.prototype.broadcastActive=function(){if(this.hasActive()){var t=this.callbackCtx_,e=this.activeObservations_.map((function(t){return new At(t.target,t.broadcastRect())}));this.callback_.call(t,e,t),this.clearActive()}},t.prototype.clearActive=function(){this.activeObservations_.splice(0)},t.prototype.hasActive=function(){return this.activeObservations_.length>0},t}(),mt="undefined"!==typeof WeakMap?new WeakMap:new Y,yt=function t(e){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=rt.getInstance(),i=new gt(e,n,this);mt.set(this,i)};["observe","unobserve","disconnect"].forEach((function(t){yt.prototype[t]=function(){var e;return(e=mt.get(this))[t].apply(e,arguments)}}));const _t="undefined"!==typeof tt.ResizeObserver?tt.ResizeObserver:yt;var vt=n(
292099),bt=n(48183
vendor: 8,627 bytes, line 2
2),xt=("undefined"!==typeof window?window:n.g,"undefined"!==typeof n.g?n.g:window,"undefined"!==typeof document?document:{});function wt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function Et(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?wt(Object(n),!0).forEach((function(e){(0,o.A)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):wt(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Ct(t,e){var n;if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"===typeof t)return Tt(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Tt(t,e)}(t))||e&&t&&"number"===typeof t.length){n&&(t=n);var i=0,r=function(){};return{s:r,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,a=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return s=t.done,t},e:function(t){a=!0,o=t},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw o}}}}function Tt(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}var St=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function Pt(t){if(!t)return null;if("string"===typeof t)return t;t.toJS&&(t=t.toJS());var e,n={},i=Ct(t.layers);try{for(i.s();!(e=i.n()).done;){var r=e.value;n[r.id]=r}}catch(s){i.e(s)}finally{i.f()}var o=t.layers.map((function(t){var e=n[t.ref],i=null;if("interactive"in t&&delete(i=Et({},t)).interactive,e){delete(i=i||Et({},t)).ref;var r,o=Ct(St);try{for(o.s();!(r=o.n()).done;){var a=r.value;a in e&&(i[a]=e[a])}}catch(s){o.e(s)}finally{o.f()}}return i||t}));return Et(Et({},t),{},{layers:o})}var Mt={container:a.object,gl:a.object,mapboxApiAccessToken:a.string,mapboxApiUrl:a.string,attributionControl:a.bool,preserveDrawingBuffer:a.bool,reuseMaps:a.bool,transformRequest:a.func,mapOptions:a.object,mapStyle:a.oneOfType([a.string,a.object]),preventStyleDiffing:a.bool,visible:a.bool,asyncRender:a.bool,onLoad:a.func,onError:a.func,width:a.number,height:a.number,viewState:a.object,longitude:a.number,latitude:a.number,zoom:a.number,bearing:a.number,pitch:a.number,altitude:a.number},It={container:xt.body,mapboxApiAccessToken:function(){var t=null;if("undefined"!==typeof window&&window.location){var e=window.location.search.match(/access_token=([^&\/]*)/);t=e&&e[1]}t||"undefined"===typeof process||(t=t||{NODE_ENV:"production",PUBLIC_URL:".",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.MapboxAccessToken||{NODE_ENV:"production",PUBLIC_URL:".",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.REACT_APP_MAPBOX_ACCESS_TOKEN);return t||"no-token"}(),mapboxApiUrl:"https://api.mapbox.com",preserveDrawingBuffer:!1,attributionControl:!0,reuseMaps:!1,mapOptions:{},mapStyle:"mapbox://styles/mapbox/light-v8",preventStyleDiffing:!1,visible:!0,asyncRender:!1,onLoad:function(){},onError:function(t){t&&console.error(t.error)},width:0,height:0,longitude:0,latitude:0,zoom:0,bearing:0,pitch:0,altitude:1.5};function Bt(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"component";t.debug&&a.checkPropTypes(Mt,t,"prop",e)}var Rt=function(){function t(e){var n=this;if((0,vt.A)(this,t),(0,o.A)(this,"props",It),(0,o.A)(this,"width",0),(0,o.A)(this,"height",0),(0,o.A)(this,"_fireLoadEvent",(function(){n.props.onLoad({type:"load",target:n._map})})),(0,o.A)(this,"_handleError",(function(t){n.props.onError(t)})),!e.mapboxgl)throw new Error("Mapbox not available");this.mapboxgl=e.mapboxgl,t.initialized||(t.initialized=!0,this._checkStyleSheet(this.mapboxgl.version)),this._initialize(e)}return(0,bt.A)(t,[{key:"finalize",value:function(){return this._destroy(),this}},{key:"setProps",value:function(t){return this._update(this.props,t),this}},{key:"redraw",value:function(){var t=this._map;t.style&&(t._frame&&(t._frame.cancel(),t._frame=null),t._render())}},{key:"getMap",value:function(){return this._map}},{key:"_reuse",value:function(e){this._map=t.savedMap;var n=this._map.getContainer(),i=e.container;for(i.classList.add("mapboxgl-map");n.childNodes.length>0;)i.appendChild(n.childNodes[0]);this._map._container=i,t.savedMap=null,e.mapStyle&&this._map.setStyle(Pt(e.mapStyle),{diff:!1}),this._map.isStyleLoaded()?this._fireLoadEvent():this._map.once("styledata",this._fireLoadEvent)}},{key:"_create",value:function(e){if(e.reuseMaps&&t.savedMap)this._reuse(e);else{if(e.gl){var n=HTMLCanvasElement.prototype.getContext;HTMLCanvasElement.prototype.getContext=function(){return HTMLCanvasElement.prototype.getContext=n,e.gl}}var i={container:e.container,center:[0,0],zoom:8,pitch:0,bearing:0,maxZoom:24,style:Pt(e.mapStyle),interactive:!1,trackResize:!1,attributionControl:e.attributionControl,preserveDrawingBuffer:e.preserveDrawingBuffer};e.transformRequest&&(i.transformRequest=e.transformRequest),this._map=new this.mapboxgl.Map(Object.assign({},i,e.mapOptions)),this._map.once("load",this._fireLoadEvent),this._map.on("error",this._handleError)}return this}},{key:"_destroy",value:function(){this._map&&(this.props.reuseMaps&&!t.savedMap?(t.savedMap=this._map,this._map.off("load",this._fireLoadEvent),this._map.off("error",this._handleError),this._map.off("styledata",this._fireLoadEvent)):this._map.remove(),this._map=null)}},{key:"_initialize",value:function(t){var e=this;Bt(t=Object.assign({},It,t),"Mapbox"),this.mapboxgl.accessToken=t.mapboxApiAccessToken||It.mapboxApiAccessToken,this.mapboxgl.baseApiUrl=t.mapboxApiUrl,this._create(t);var n=t.container;Object.defineProperty(n,"offsetWidth",{configurable:!0,get:function(){return e.width}}),Object.defineProperty(n,"clientWidth",{configurable:!0,get:function(){return e.width}}),Object.defineProperty(n,"offsetHeight",{configurable:!0,get:function(){return e.height}}),Object.defineProperty(n,"clientHeight",{configurable:!0,get:function(){return e.height}});var i=this._map.getCanvas();i&&(i.style.outline="none"),this._updateMapViewport({},t),this._updateMapSize({},t),this.props=t}},{key:"_update",value:function(t,e){if(this._map){Bt(e=Object.assign({},this.props,e),"Mapbox");var n=this._updateMapViewport(t,e),i=this._updateMapSize(t,e);this._updateMapStyle(t,e),e.asyncRender||!n&&!i||this.redraw(),this.props=e}}},{key:"_updateMapStyle",value:function(t,e){t.mapStyle!==e.mapStyle&&this._map.setStyle(Pt(e.mapStyle),{diff:!e.preventStyleDiffing})}},{key:"_updateMapSize",value:function(t,e){var n=t.width!==e.width||t.height!==e.height;return n&&(this.width=e.width,this.height=e.height,this._map.resize()),n}},{key:"_updateMapViewport",value:function(t,e){var n=this._getViewState(t),i=this._getViewState(e),r=i.latitude!==n.latitude||i.longitude!==n.longitude||i.zoom!==n.zoom||i.pitch!==n.pitch||i.bearing!==n.bearing||i.altitude!==n.altitude;return r&&(this._map.jumpTo(this._viewStateToMapboxProps(i)),i.altitude!==n.altitude&&(this._map.transform.altitude=i.altitude)),r}},{key:"_getViewState",value:function(t){var e=t.viewState||t,n=e.longitude,i=e.latitude,r=e.zoom,o=e.pitch,s=void 0===o?0:o,a=e.bearing,l=void 0===a?0:a,c=e.altitude;return{longitude:n,latitude:i,zoom:r,pitch:s,bearing:l,altitude:void 0===c?1.5:c}}},{key:"_checkStyleSheet",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"0.47.0";if("undefined"!==typeof xt)try{var e=xt.createElement("div");if(e.className="mapboxgl-map",e.style.display="none",xt.body.appendChild(e),!("static"!==window.getComputedStyle(e).position)){var n=xt.createElement("link");n.setAttribute("rel","stylesheet"),n.setAttribute("type","text/css"),n.setAttribute("href","https://api.tiles.mapbox.com/mapbox-gl-js/v".concat(t,"/mapbox-gl.css")),xt.head.appendChild(n)}}catch(i){}}},{key:"_viewStateToMapboxProps",value:function(t){return{center:[t.longitude,t.latitude],zoom:t.zoom,bearing:t.bearing,pitch:t.pitch}}}]),t}();(0,o.A)(Rt,"initialized",!1),(0,o.A)(Rt,"propTypes",Mt),(0,o.A)(Rt,"defaultProps",It),(0,o.A)(Rt,"savedMap",null);var Lt=n(
223524
vendor: 12,498 bytes, line 2
2),Ot=n.n(Lt);function Dt(t){return Array.isArray(t)||ArrayBuffer.isView(t)}function kt(t,e){if(t===e)return!0;if(Dt(t)&&Dt(e)){if(t.length!==e.length)return!1;for(var n=0;n<t.length;++n)if(!kt(t[n],e[n]))return!1;return!0}return Math.abs(t-e)<=1e-7}function Ft(t,e,n){return Math.max(e,Math.min(n,t))}function Nt(t,e,n){return Dt(t)?t.map((function(t,i){return Nt(t,e[i],n)})):n*e+(1-n)*t}function zt(t,e){if(!t)throw new Error(e||"react-map-gl: assertion failed.")}function Ut(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function Gt(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Ut(Object(n),!0).forEach((function(e){(0,o.A)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ut(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var Vt={minZoom:0,maxZoom:24,minPitch:0,maxPitch:60},jt=0,Ht=0,Wt=1.5,qt=function(){function t(e){var n=e.width,i=e.height,r=e.latitude,o=e.longitude,s=e.zoom,a=e.bearing,l=void 0===a?Ht:a,c=e.pitch,u=void 0===c?jt:c,h=e.altitude,d=void 0===h?Wt:h,p=e.maxZoom,f=void 0===p?Vt.maxZoom:p,A=e.minZoom,g=void 0===A?Vt.minZoom:A,m=e.maxPitch,y=void 0===m?Vt.maxPitch:m,_=e.minPitch,v=void 0===_?Vt.minPitch:_,b=e.transitionDuration,x=e.transitionEasing,w=e.transitionInterpolator,E=e.transitionInterruption,C=e.startPanLngLat,T=e.startZoomLngLat,S=e.startRotatePos,P=e.startBearing,M=e.startPitch,I=e.startZoom;(0,vt.A)(this,t),zt(Number.isFinite(n),"`width` must be supplied"),zt(Number.isFinite(i),"`height` must be supplied"),zt(Number.isFinite(o),"`longitude` must be supplied"),zt(Number.isFinite(r),"`latitude` must be supplied"),zt(Number.isFinite(s),"`zoom` must be supplied"),this._viewportProps=this._applyConstraints({width:n,height:i,latitude:r,longitude:o,zoom:s,bearing:l,pitch:u,altitude:d,maxZoom:f,minZoom:g,maxPitch:y,minPitch:v,transitionDuration:b,transitionEasing:x,transitionInterpolator:w,transitionInterruption:E}),this._state={startPanLngLat:C,startZoomLngLat:T,startRotatePos:S,startBearing:P,startPitch:M,startZoom:I}}return(0,bt.A)(t,[{key:"getViewportProps",value:function(){return this._viewportProps}},{key:"getState",value:function(){return this._state}},{key:"panStart",value:function(t){var e=t.pos;return this._getUpdatedMapState({startPanLngLat:this._unproject(e)})}},{key:"pan",value:function(t){var e=t.pos,n=t.startPos,i=this._state.startPanLngLat||this._unproject(n);if(!i)return this;var r=this._calculateNewLngLat({startPanLngLat:i,pos:e}),o=(0,l.A)(r,2),s=o[0],a=o[1];return this._getUpdatedMapState({longitude:s,latitude:a})}},{key:"panEnd",value:function(){return this._getUpdatedMapState({startPanLngLat:null})}},{key:"rotateStart",value:function(t){var e=t.pos;return this._getUpdatedMapState({startRotatePos:e,startBearing:this._viewportProps.bearing,startPitch:this._viewportProps.pitch})}},{key:"rotate",value:function(t){var e,n=t.pos,i=t.deltaAngleX,r=void 0===i?0:i,o=t.deltaAngleY,s=void 0===o?0:o,a=this._state,l=a.startRotatePos,c=a.startBearing,u=a.startPitch;return Number.isFinite(c)&&Number.isFinite(u)?(e=n?this._calculateNewPitchAndBearing(Gt(Gt({},this._getRotationParams(n,l)),{},{startBearing:c,startPitch:u})):{bearing:c+r,pitch:u+s},this._getUpdatedMapState(e)):this}},{key:"rotateEnd",value:function(){return this._getUpdatedMapState({startBearing:null,startPitch:null})}},{key:"zoomStart",value:function(t){var e=t.pos;return this._getUpdatedMapState({startZoomLngLat:this._unproject(e),startZoom:this._viewportProps.zoom})}},{key:"zoom",value:function(t){var e=t.pos,n=t.startPos,i=t.scale;zt(i>0,"`scale` must be a positive number");var r=this._state,o=r.startZoom,s=r.startZoomLngLat;Number.isFinite(o)||(o=this._viewportProps.zoom,s=this._unproject(n)||this._unproject(e)),zt(s,"`startZoomLngLat` prop is required for zoom behavior to calculate where to position the map.");var a=this._calculateNewZoom({scale:i,startZoom:o||0}),c=new Z(Object.assign({},this._viewportProps,{zoom:a})).getMapCenterByLngLatPosition({lngLat:s,pos:e}),u=(0,l.A)(c,2),h=u[0],d=u[1];return this._getUpdatedMapState({zoom:a,longitude:h,latitude:d})}},{key:"zoomEnd",value:function(){return this._getUpdatedMapState({startZoomLngLat:null,startZoom:null})}},{key:"_getUpdatedMapState",value:function(e){return new t(Object.assign({},this._viewportProps,this._state,e))}},{key:"_applyConstraints",value:function(t){var e=t.maxZoom,n=t.minZoom,i=t.zoom;t.zoom=Ft(i,n,e);var r=t.maxPitch,o=t.minPitch,s=t.pitch;return t.pitch=Ft(s,o,r),Object.assign(t,function(t){const{width:e,height:n,pitch:i=0}=t;let{longitude:r,latitude:o,zoom:s,bearing:a=0}=t;(r<-180||r>180)&&(r=d(r+180,360)-180),(a<-180||a>180)&&(a=d(a+180,360)-180);const l=f(n/512);if(s<=l)s=l,o=0;else{const t=n/2/Math.pow(2,s),e=F([0,t])[1];if(o<e)o=e;else{const e=F([0,512-t])[1];o>e&&(o=e)}}return{width:e,height:n,longitude:r,latitude:o,zoom:s,pitch:i,bearing:a}}(t)),t}},{key:"_unproject",value:function(t){var e=new Z(this._viewportProps);return t&&e.unproject(t)}},{key:"_calculateNewLngLat",value:function(t){var e=t.startPanLngLat,n=t.pos;return new Z(this._viewportProps).getMapCenterByLngLatPosition({lngLat:e,pos:n})}},{key:"_calculateNewZoom",value:function(t){var e=t.scale,n=t.startZoom,i=this._viewportProps,r=i.maxZoom,o=i.minZoom;return Ft(n+Math.log2(e),o,r)}},{key:"_calculateNewPitchAndBearing",value:function(t){var e=t.deltaScaleX,n=t.deltaScaleY,i=t.startBearing,r=t.startPitch;n=Ft(n,-1,1);var o=this._viewportProps,s=o.minPitch,a=o.maxPitch,l=r;return n>0?l=r+n*(a-r):n<0&&(l=r-n*(s-r)),{pitch:l,bearing:i+180*e}}},{key:"_getRotationParams",value:function(t,e){var n=t[0]-e[0],i=t[1]-e[1],r=t[1],o=e[1],s=this._viewportProps,a=s.width,l=s.height,c=n/a,u=0;return i>0?Math.abs(l-o)>5&&(u=i/(o-l)*1.2):i<0&&o>5&&(u=1-r/o),{deltaScaleX:c,deltaScaleY:u=Math.min(1,Math.max(-1,u))}}}]),t}();function Zt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function Xt(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Zt(Object(n),!0).forEach((function(e){(0,o.A)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Zt(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var Kt=(0,s.createContext)({viewport:null,map:null,container:null,onViewportChange:null,onViewStateChange:null,eventManager:null}),Qt=Kt.Provider;Kt.Provider=function(t){var e=t.value,n=t.children,i=(0,s.useState)(null),r=(0,l.A)(i,2),o=r[0],a=r[1],c=(0,s.useContext)(Kt);return e=Xt(Xt({setMap:a},c),{},{map:c&&c.map||o},e),s.createElement(Qt,{value:e},n)};const Jt=Kt;const Yt="undefined"!==typeof window?s.useLayoutEffect:s.useEffect;function $t(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function te(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?$t(Object(n),!0).forEach((function(e){(0,o.A)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):$t(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var ee="A valid API access token is required to use Mapbox data";function ne(t){var e=t.props,n=t.width,i=t.height;return new Z(te(te(te({},e),e.viewState),{},{width:n,height:i}))}var ie={position:"absolute",width:"100%",height:"100%",overflow:"hidden"},re=Object.assign({},Rt.propTypes,{width:a.oneOfType([a.number,a.string]),height:a.oneOfType([a.number,a.string]),onResize:a.func,disableTokenWarning:a.bool,visible:a.bool,className:a.string,style:a.object,visibilityConstraints:a.object}),oe=Object.assign({},Rt.defaultProps,{disableTokenWarning:!1,visible:!0,onResize:function(){},className:"",style:null,visibilityConstraints:Vt});function se(){return s.createElement("div",{key:"warning",id:"no-token-warning",style:{position:"absolute",left:0,top:0}},s.createElement("h3",{key:"header"},ee),s.createElement("div",{key:"text"},"For information on setting up your basemap, read"),s.createElement("a",{key:"link",href:"https://visgl.github.io/react-map-gl/docs/get-started/mapbox-tokens"},"Note on Map Tokens"))}var ae=(0,s.forwardRef)((function(t,e){var n=(0,s.useState)(!0),i=(0,l.A)(n,2),r=i[0],o=i[1],a=(0,s.useState)({width:0,height:0}),c=(0,l.A)(a,2),u=c[0],h=c[1],d=(0,s.useRef)(null),p=(0,s.useRef)(null),f=(0,s.useRef)(null),A=(0,s.useRef)(null),g=(0,s.useContext)(Jt);Yt((function(){if(ae.supported()){var e=new Rt(te(te(te({},t),u),{},{mapboxgl:Ot(),container:p.current,onError:function(e){401===(e.error&&e.error.status||e.status)&&r&&(console.error(ee),o(!1)),t.onError(e)}}));d.current=e,g&&g.setMap&&g.setMap(e.getMap());var n=new _t((function(e){if(e[0].contentRect){var n=e[0].contentRect,i=n.width,r=n.height;h({width:i,height:r}),t.onResize({width:i,height:r})}}));return n.observe(f.current),function(){e.finalize(),d.current=null,n.disconnect()}}}),[]),Yt((function(){d.current&&d.current.setProps(te(te({},t),u))}));var m=d.current&&d.current.getMap();(0,s.useImperativeHandle)(e,(function(){return function(t){return{getMap:function(){return t.current&&t.current.getMap()},queryRenderedFeatures:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=t.current&&t.current.getMap();return i&&i.queryRenderedFeatures(e,n)}}}(d)}),[]);var y=(0,s.useCallback)((function(t){var e=t.target;e===A.current&&e.scrollTo(0,0)}),[]),_=m&&s.createElement(Qt,{value:te(te({},g),{},{viewport:g.viewport||ne(te({map:m,props:t},u)),map:m,container:g.container||f.current})},s.createElement("div",{key:"map-overlays",className:"overlays",ref:A,style:ie,onScroll:y},t.children)),v=t.className,b=t.width,x=t.height,w=t.style,E=t.visibilityConstraints,C=Object.assign({position:"relative"},w,{width:b,height:x}),T=t.visible&&function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Vt;for(var i in n){var r=i.slice(0,3),o=(e=i.slice(3))[0].toLowerCase()+e.slice(1);if("min"===r&&t[o]<n[i])return!1;if("max"===r&&t[o]>n[i])return!1}return!0}(t.viewState||t,E),S=Object.assign({},ie,{visibility:T?"inherit":"hidden"});return s.createElement("div",{key:"map-container",ref:f,style:C},s.createElement("div",{key:"map-mapbox",ref:p,style:S,className:v}),_,!r&&!t.disableTokenWarning&&s.createElement(se,null))}));ae.supported=function(){return Ot()&&Ot().supported()},ae.propTypes=re,ae.defaultProps=oe;const le=ae;function ce(t,e){var n;if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"===typeof t)return ue(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ue(t,e)}(t))||e&&t&&"number"===typeof t.length){n&&(t=n);var i=0,r=function(){};return{s:r,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,a=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return s=t.done,t},e:function(t){a=!0,o=t},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw o}}}}function ue(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}var he=function(){function t(){(0,vt.A)(this,t),(0,o.A)(this,"propNames",[])}return(0,bt.A)(t,[{key:"arePropsEqual",value:function(t,e){var n,i=ce(this.propNames||[]);try{for(i.s();!(n=i.n()).done;){var r=n.value;if(!kt(t[r],e[r]))return!1}}catch(o){i.e(o)}finally{i.f()}return!0}},{key:"initializeProps",value:function(t,e){return{start:t,end:e}}},{key:"interpolateProps",value:function(t,e,n){zt(!1,"interpolateProps is not implemented")}},{key:"getDuration",value:function(t,e){return e.transitionDuration}}]),t}(),de=n(
vendor: 9,762 bytes, line 2
272367),pe=n(50171),fe=n(42912),Ae=n(74572),ge={longitude:1,bearing:1};function me(t){return Number.isFinite(t)||Array.isArray(t)}function ye(t,e,n){return function(t){return t in ge}(t)&&Math.abs(n-e)>180&&(n=n<0?n+360:n-360),n}function _e(t,e){var n;if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"===typeof t)return ve(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ve(t,e)}(t))||e&&t&&"number"===typeof t.length){n&&(t=n);var i=0,r=function(){};return{s:r,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,a=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return s=t.done,t},e:function(t){a=!0,o=t},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw o}}}}function ve(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}function be(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=(0,Ae.A)(t);if(e){var r=(0,Ae.A)(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return(0,fe.A)(this,n)}}var xe=["longitude","latitude","zoom","bearing","pitch"],we=["latitude","longitude","zoom","width","height"],Ee=["bearing","pitch"],Ce={speed:1.2,curve:1.414};!function(t){(0,pe.A)(n,t);var e=be(n);function n(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,vt.A)(this,n),t=e.call(this),(0,o.A)((0,de.A)(t),"propNames",xe),t.props=Object.assign({},Ce,i),t}(0,bt.A)(n,[{key:"initializeProps",value:function(t,e){var n,i={},r={},o=_e(we);try{for(o.s();!(n=o.n()).done;){var s=n.value,a=t[s],l=e[s];zt(me(a)&&me(l),"".concat(s," must be supplied for transition")),i[s]=a,r[s]=ye(s,a,l)}}catch(f){o.e(f)}finally{o.f()}var c,u=_e(Ee);try{for(u.s();!(c=u.n()).done;){var h=c.value,d=t[h]||0,p=e[h]||0;i[h]=d,r[h]=ye(h,d,p)}}catch(f){u.e(f)}finally{u.f()}return{start:i,end:r}}},{key:"interpolateProps",value:function(t,e,n){var i,r=function(t,e,n,i){const{startZoom:r,startCenterXY:o,uDelta:s,w0:a,u1:l,S:c,rho:u,rho2:h,r0:d}=J(t,e,i);if(l<X){const i={};for(const r of K){const o=t[r],s=e[r];i[r]=(p=n)*s+(1-p)*o}return i}var p;const f=n*c,A=Math.cosh(d)/Math.cosh(d+u*f),g=a*((Math.cosh(d)*Math.tanh(d+u*f)-Math.sinh(d))/h)/l,m=r+D(1/A),y=(x=g,(_=[])[0]=(b=s)[0]*x,_[1]=b[1]*x,_);var _,b,x;v(y,y,o);const w=F(y);return{longitude:w[0],latitude:w[1],zoom:m}}(t,e,n,this.props),o=_e(Ee);try{for(o.s();!(i=o.n()).done;){var s=i.value;r[s]=Nt(t[s],e[s],n)}}catch(a){o.e(a)}finally{o.f()}return r}},{key:"getDuration",value:function(t,e){var n=e.transitionDuration;return"auto"===n&&(n=function(t,e,n){const i={...Q,...n},{screenSpeed:r,speed:o,maxDuration:s}=i,{S:a,rho:l}=J(t,e,i),c=1e3*a;let u;return u=Number.isFinite(r)?c/(r/l):c/o,Number.isFinite(s)&&u>s?0:u}(t,e,this.props)),n}}])}(he);function Te(t,e){var n;if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"===typeof t)return Se(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Se(t,e)}(t))||e&&t&&"number"===typeof t.length){n&&(t=n);var i=0,r=function(){};return{s:r,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,a=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return s=t.done,t},e:function(t){a=!0,o=t},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw o}}}}function Se(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}function Pe(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=(0,Ae.A)(t);if(e){var r=(0,Ae.A)(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return(0,fe.A)(this,n)}}var Me=["longitude","latitude","zoom","bearing","pitch"],Ie=function(t){(0,pe.A)(n,t);var e=Pe(n);function n(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,vt.A)(this,n),t=e.call(this),Array.isArray(i)&&(i={transitionProps:i}),t.propNames=i.transitionProps||Me,i.around&&(t.around=i.around),t}return(0,bt.A)(n,[{key:"initializeProps",value:function(t,e){var n={},i={};if(this.around){n.around=this.around;var r=new Z(t).unproject(this.around);Object.assign(i,e,{around:new Z(e).project(r),aroundLngLat:r})}var o,s=Te(this.propNames);try{for(s.s();!(o=s.n()).done;){var a=o.value,l=t[a],c=e[a];zt(me(l)&&me(c),"".concat(a," must be supplied for transition")),n[a]=l,i[a]=ye(a,l,c)}}catch(u){s.e(u)}finally{s.f()}return{start:n,end:i}}},{key:"interpolateProps",value:function(t,e,n){var i,r={},o=Te(this.propNames);try{for(o.s();!(i=o.n()).done;){var s=i.value;r[s]=Nt(t[s],e[s],n)}}catch(d){o.e(d)}finally{o.f()}if(e.around){var a=new Z(Object.assign({},e,r)).getMapCenterByLngLatPosition({lngLat:e.aroundLngLat,pos:Nt(t.around,e.around,n)}),c=(0,l.A)(a,2),u=c[0],h=c[1];r.longitude=u,r.latitude=h}return r}}]),n}(he),Be=function(){};var Re=1,Le=2,Oe=3,De=4,ke={transitionDuration:0,transitionEasing:function(t){return t},transitionInterpolator:new Ie,transitionInterruption:Re,onTransitionStart:Be,onTransitionInterrupt:Be,onTransitionEnd:Be},Fe=function(){function t(){var e=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,vt.A)(this,t),(0,o.A)(this,"_animationFrame",null),(0,o.A)(this,"_onTransitionFrame",(function(){e._animationFrame=requestAnimationFrame(e._onTransitionFrame),e._updateViewport()})),this.props=null,this.onViewportChange=n.onViewportChange||Be,this.onStateChange=n.onStateChange||Be,this.time=n.getTime||Date.now}return(0,bt.A)(t,[{key:"getViewportInTransition",value:function(){return this._animationFrame?this.state.propsInTransition:null}},{key:"processViewportChange",value:function(t){var e=this.props;if(this.props=t,!e||this._shouldIgnoreViewportChange(e,t))return!1;if(this._isTransitionEnabled(t)){var n=Object.assign({},e),i=Object.assign({},t);if(this._isTransitionInProgress()&&(e.onTransitionInterrupt(),this.state.interruption===Le?Object.assign(n,this.state.endProps):Object.assign(n,this.state.propsInTransition),this.state.interruption===De)){var r=this.time(),o=(r-this.state.startTime)/this.state.duration;i.transitionDuration=this.state.duration-(r-this.state.startTime),i.transitionEasing=function(t,e){var n=t(e);return function(i){return 1/(1-n)*(t(i*(1-e)+e)-n)}}(this.state.easing,o),i.transitionInterpolator=n.transitionInterpolator}return i.onTransitionStart(),this._triggerTransition(n,i),!0}return this._isTransitionInProgress()&&(e.onTransitionInterrupt(),this._endTransition()),!1}},{key:"_isTransitionInProgress",value:function(){return Boolean(this._animationFrame)}},{key:"_isTransitionEnabled",value:function(t){var e=t.transitionDuration,n=t.transitionInterpolator;return(e>0||"auto"===e)&&Boolean(n)}},{key:"_isUpdateDueToCurrentTransition",value:function(t){return!!this.state.propsInTransition&&this.state.interpolator.arePropsEqual(t,this.state.propsInTransition)}},{key:"_shouldIgnoreViewportChange",value:function(t,e){return!t||(this._isTransitionInProgress()?this.state.interruption===Oe||this._isUpdateDueToCurrentTransition(e):!this._isTransitionEnabled(e)||e.transitionInterpolator.arePropsEqual(t,e))}},{key:"_triggerTransition",value:function(t,e){zt(this._isTransitionEnabled(e)),this._animationFrame&&cancelAnimationFrame(this._animationFrame);var n=e.transitionInterpolator,i=n.getDuration?n.getDuration(t,e):e.transitionDuration;if(0!==i){var r=e.transitionInterpolator.initializeProps(t,e),o={inTransition:!0,isZooming:t.zoom!==e.zoom,isPanning:t.longitude!==e.longitude||t.latitude!==e.latitude,isRotating:t.bearing!==e.bearing||t.pitch!==e.pitch};this.state={duration:i,easing:e.transitionEasing,interpolator:e.transitionInterpolator,interruption:e.transitionInterruption,startTime:this.time(),startProps:r.start,endProps:r.end,animation:null,propsInTransition:{}},this._onTransitionFrame(),this.onStateChange(o)}}},{key:"_endTransition",value:function(){this._animationFrame&&(cancelAnimationFrame(this._animationFrame),this._animationFrame=null),this.onStateChange({inTransition:!1,isZooming:!1,isPanning:!1,isRotating:!1})}},{key:"_updateViewport",value:function(){var t=this.time(),e=this.state,n=e.startTime,i=e.duration,r=e.easing,o=e.interpolator,s=e.startProps,a=e.endProps,l=!1,c=(t-n)/i;c>=1&&(c=1,l=!0),c=r(c);var u=o.interpolateProps(s,a,c),h=new qt(Object.assign({},this.props,u));this.state.propsInTransition=h.getViewportProps(),this.onViewportChange(this.state.propsInTransition,this.props),l&&(this._endTransition(),this.props.onTransitionEnd())}}]),t}();(0,o.A)(Fe,"defaultProps",ke);var Ne=n(67594
vendor: 16,606 bytes, line 2
2);function ze(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function Ue(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ze(Object(n),!0).forEach((function(e){(0,o.A)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ze(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var Ge={transitionDuration:0},Ve={transitionDuration:300,transitionEasing:function(t){return t},transitionInterpolator:new Ie,transitionInterruption:Re},je=300,He=function(t){return 1-(1-t)*(1-t)},We=["wheel"],qe=["panstart","panmove","panend"],Ze=["pinchstart","pinchmove","pinchend"],Xe=["tripanstart","tripanmove","tripanend"],Ke=["doubletap"],Qe=["keydown"],Je=function(){function t(){var e=this;(0,vt.A)(this,t),(0,o.A)(this,"events",[]),(0,o.A)(this,"scrollZoom",!0),(0,o.A)(this,"dragPan",!0),(0,o.A)(this,"dragRotate",!0),(0,o.A)(this,"doubleClickZoom",!0),(0,o.A)(this,"touchZoom",!0),(0,o.A)(this,"touchRotate",!1),(0,o.A)(this,"keyboard",!0),(0,o.A)(this,"_interactionState",{isDragging:!1}),(0,o.A)(this,"_events",{}),(0,o.A)(this,"_setInteractionState",(function(t){Object.assign(e._interactionState,t),e.onStateChange&&e.onStateChange(e._interactionState)})),(0,o.A)(this,"_onTransition",(function(t,n){e.onViewportChange(t,e._interactionState,n)})),this.handleEvent=this.handleEvent.bind(this),this._transitionManager=new Fe({onViewportChange:this._onTransition,onStateChange:this._setInteractionState})}return(0,bt.A)(t,[{key:"handleEvent",value:function(t){this.mapState=this.getMapState();var e=this._eventStartBlocked;switch(t.type){case"panstart":return!e&&this._onPanStart(t);case"panmove":return this._onPan(t);case"panend":return this._onPanEnd(t);case"pinchstart":return!e&&this._onPinchStart(t);case"pinchmove":return this._onPinch(t);case"pinchend":return this._onPinchEnd(t);case"tripanstart":return!e&&this._onTriplePanStart(t);case"tripanmove":return this._onTriplePan(t);case"tripanend":return this._onTriplePanEnd(t);case"doubletap":return this._onDoubleTap(t);case"wheel":return this._onWheel(t);case"keydown":return this._onKeyDown(t);default:return!1}}},{key:"getCenter",value:function(t){var e=t.offsetCenter;return[e.x,e.y]}},{key:"isFunctionKeyPressed",value:function(t){var e=t.srcEvent;return Boolean(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}},{key:"blockEvents",value:function(t){var e=this,n=setTimeout((function(){e._eventStartBlocked===n&&(e._eventStartBlocked=null)}),t);this._eventStartBlocked=n}},{key:"updateViewport",value:function(t,e,n){var i=this.mapState instanceof qt?this.mapState.getViewportProps():this.mapState,r=Ue(Ue({},t.getViewportProps()),e),o=Object.keys(r).some((function(t){return i[t]!==r[t]}));this._state=t.getState(),this._setInteractionState(n),o&&this.onViewportChange(r,this._interactionState,i)}},{key:"getMapState",value:function(t){return new qt(Ue(Ue(Ue({},this.mapStateProps),this._state),t))}},{key:"isDragging",value:function(){return this._interactionState.isDragging}},{key:"setOptions",value:function(t){var e=t.onViewportChange,n=t.onStateChange,i=t.eventManager,r=void 0===i?this.eventManager:i,o=t.isInteractive,s=void 0===o||o,a=t.scrollZoom,l=void 0===a?this.scrollZoom:a,c=t.dragPan,u=void 0===c?this.dragPan:c,h=t.dragRotate,d=void 0===h?this.dragRotate:h,p=t.doubleClickZoom,f=void 0===p?this.doubleClickZoom:p,A=t.touchZoom,g=void 0===A?this.touchZoom:A,m=t.touchRotate,y=void 0===m?this.touchRotate:m,_=t.keyboard,v=void 0===_?this.keyboard:_;this.onViewportChange=e,this.onStateChange=n;var b=this.mapStateProps||{},x=b.height!==t.height||b.width!==t.width;this.mapStateProps=t,x&&(this.mapState=b,this.updateViewport(new qt(t))),this._transitionManager.processViewportChange(t),this.eventManager!==r&&(this.eventManager=r,this._events={},this.toggleEvents(this.events,!0)),this.toggleEvents(We,s&&Boolean(l)),this.toggleEvents(qe,s&&Boolean(u||d)),this.toggleEvents(Ze,s&&Boolean(g||y)),this.toggleEvents(Xe,s&&Boolean(y)),this.toggleEvents(Ke,s&&Boolean(f)),this.toggleEvents(Qe,s&&Boolean(v)),this.scrollZoom=l,this.dragPan=u,this.dragRotate=d,this.doubleClickZoom=f,this.touchZoom=g,this.touchRotate=y,this.keyboard=v}},{key:"toggleEvents",value:function(t,e){var n=this;this.eventManager&&t.forEach((function(t){n._events[t]!==e&&(n._events[t]=e,e?n.eventManager.on(t,n.handleEvent):n.eventManager.off(t,n.handleEvent))}))}},{key:"_onPanStart",value:function(t){var e=this.getCenter(t);this._panRotate=this.isFunctionKeyPressed(t)||t.rightButton;var n=this._panRotate?this.mapState.rotateStart({pos:e}):this.mapState.panStart({pos:e});return this.updateViewport(n,Ge,{isDragging:!0}),!0}},{key:"_onPan",value:function(t){return!!this.isDragging()&&(this._panRotate?this._onPanRotate(t):this._onPanMove(t))}},{key:"_onPanEnd",value:function(t){return!!this.isDragging()&&(this._panRotate?this._onPanRotateEnd(t):this._onPanMoveEnd(t))}},{key:"_onPanMove",value:function(t){if(!this.dragPan)return!1;var e=this.getCenter(t),n=this.mapState.pan({pos:e});return this.updateViewport(n,Ge,{isPanning:!0}),!0}},{key:"_onPanMoveEnd",value:function(t){if(this.dragPan){var e=this.dragPan.inertia,n=void 0===e?je:e;if(n&&t.velocity){var i=this.getCenter(t),r=[i[0]+t.velocityX*n/2,i[1]+t.velocityY*n/2],o=this.mapState.pan({pos:r}).panEnd();return this.updateViewport(o,Ue(Ue({},Ve),{},{transitionDuration:n,transitionEasing:He}),{isDragging:!1,isPanning:!0}),!0}}var s=this.mapState.panEnd();return this.updateViewport(s,null,{isDragging:!1,isPanning:!1}),!0}},{key:"_onPanRotate",value:function(t){if(!this.dragRotate)return!1;var e=this.getCenter(t),n=this.mapState.rotate({pos:e});return this.updateViewport(n,Ge,{isRotating:!0}),!0}},{key:"_onPanRotateEnd",value:function(t){if(this.dragRotate){var e=this.dragRotate.inertia,n=void 0===e?je:e;if(n&&t.velocity){var i=this.getCenter(t),r=[i[0]+t.velocityX*n/2,i[1]+t.velocityY*n/2],o=this.mapState.rotate({pos:r}).rotateEnd();return this.updateViewport(o,Ue(Ue({},Ve),{},{transitionDuration:n,transitionEasing:He}),{isDragging:!1,isRotating:!0}),!0}}var s=this.mapState.panEnd();return this.updateViewport(s,null,{isDragging:!1,isRotating:!1}),!0}},{key:"_onWheel",value:function(t){if(!this.scrollZoom)return!1;var e=this.scrollZoom,n=e.speed,i=void 0===n?.01:n,r=e.smooth,o=void 0!==r&&r;t.preventDefault();var s=this.getCenter(t),a=t.delta,l=2/(1+Math.exp(-Math.abs(a*i)));a<0&&0!==l&&(l=1/l);var c=this.mapState.zoom({pos:s,scale:l});return c.getViewportProps().zoom!==this.mapStateProps.zoom&&(this.updateViewport(c,Ue(Ue({},Ve),{},{transitionInterpolator:new Ie({around:s}),transitionDuration:o?250:1}),{isPanning:!0,isZooming:!0}),!0)}},{key:"_onPinchStart",value:function(t){var e=this.getCenter(t),n=this.mapState.zoomStart({pos:e}).rotateStart({pos:e});return this._startPinchRotation=t.rotation,this._lastPinchEvent=t,this.updateViewport(n,Ge,{isDragging:!0}),!0}},{key:"_onPinch",value:function(t){if(!this.isDragging())return!1;if(!this.touchZoom&&!this.touchRotate)return!1;var e=this.mapState;if(this.touchZoom){var n=t.scale,i=this.getCenter(t);e=e.zoom({pos:i,scale:n})}if(this.touchRotate){var r=t.rotation;e=e.rotate({deltaAngleX:this._startPinchRotation-r})}return this.updateViewport(e,Ge,{isDragging:!0,isPanning:Boolean(this.touchZoom),isZooming:Boolean(this.touchZoom),isRotating:Boolean(this.touchRotate)}),this._lastPinchEvent=t,!0}},{key:"_onPinchEnd",value:function(t){if(!this.isDragging())return!1;if(this.touchZoom){var e=this.touchZoom.inertia,n=void 0===e?je:e,i=this._lastPinchEvent;if(n&&i&&t.scale!==i.scale){var r=this.getCenter(t),o=this.mapState.rotateEnd(),s=Math.log2(t.scale),a=(s-Math.log2(i.scale))/(t.deltaTime-i.deltaTime),l=Math.pow(2,s+a*n/2);return o=o.zoom({pos:r,scale:l}).zoomEnd(),this.updateViewport(o,Ue(Ue({},Ve),{},{transitionInterpolator:new Ie({around:r}),transitionDuration:n,transitionEasing:He}),{isDragging:!1,isPanning:Boolean(this.touchZoom),isZooming:Boolean(this.touchZoom),isRotating:!1}),this.blockEvents(n),!0}}var c=this.mapState.zoomEnd().rotateEnd();return this._state.startPinchRotation=0,this.updateViewport(c,null,{isDragging:!1,isPanning:!1,isZooming:!1,isRotating:!1}),this._startPinchRotation=null,this._lastPinchEvent=null,!0}},{key:"_onTriplePanStart",value:function(t){var e=this.getCenter(t),n=this.mapState.rotateStart({pos:e});return this.updateViewport(n,Ge,{isDragging:!0}),!0}},{key:"_onTriplePan",value:function(t){if(!this.isDragging())return!1;if(!this.touchRotate)return!1;var e=this.getCenter(t);e[0]-=t.deltaX;var n=this.mapState.rotate({pos:e});return this.updateViewport(n,Ge,{isRotating:!0}),!0}},{key:"_onTriplePanEnd",value:function(t){if(!this.isDragging())return!1;if(this.touchRotate){var e=this.touchRotate.inertia,n=void 0===e?je:e;if(n&&t.velocityY){var i=this.getCenter(t),r=[i[0],i[1]+=t.velocityY*n/2],o=this.mapState.rotate({pos:r});return this.updateViewport(o,Ue(Ue({},Ve),{},{transitionDuration:n,transitionEasing:He}),{isDragging:!1,isRotating:!0}),this.blockEvents(n),!1}}var s=this.mapState.rotateEnd();return this.updateViewport(s,null,{isDragging:!1,isRotating:!1}),!0}},{key:"_onDoubleTap",value:function(t){if(!this.doubleClickZoom)return!1;var e=this.getCenter(t),n=this.isFunctionKeyPressed(t),i=this.mapState.zoom({pos:e,scale:n?.5:2});return this.updateViewport(i,Object.assign({},Ve,{transitionInterpolator:new Ie({around:e})}),{isZooming:!0}),!0}},{key:"_onKeyDown",value:function(t){if(!this.keyboard)return!1;var e,n=this.isFunctionKeyPressed(t),i=this.keyboard,r=i.zoomSpeed,o=void 0===r?2:r,s=i.moveSpeed,a=void 0===s?100:s,l=i.rotateSpeedX,c=void 0===l?15:l,u=i.rotateSpeedY,h=void 0===u?10:u,d=this.mapStateProps;switch(t.srcEvent.keyCode){case 189:e=n?this.getMapState({zoom:d.zoom-Math.log2(o)-1}):this.getMapState({zoom:d.zoom-Math.log2(o)});break;case 187:e=n?this.getMapState({zoom:d.zoom+Math.log2(o)+1}):this.getMapState({zoom:d.zoom+Math.log2(o)});break;case 37:e=n?this.getMapState({bearing:d.bearing-c}):this.mapState.pan({pos:[a,0],startPos:[0,0]});break;case 39:e=n?this.getMapState({bearing:d.bearing+c}):this.mapState.pan({pos:[-a,0],startPos:[0,0]});break;case 38:e=n?this.getMapState({pitch:d.pitch+h}):this.mapState.pan({pos:[0,a],startPos:[0,0]});break;case 40:e=n?this.getMapState({pitch:d.pitch-h}):this.mapState.pan({pos:[0,-a],startPos:[0,0]});break;default:return!1}return this.updateViewport(e,Ve)}}]),t}();function Ye(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function $e(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Ye(Object(n),!0).forEach((function(e){(0,o.A)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ye(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var tn=Object.assign({},le.propTypes,{maxZoom:a.number,minZoom:a.number,maxPitch:a.number,minPitch:a.number,onViewStateChange:a.func,onViewportChange:a.func,onInteractionStateChange:a.func,transitionDuration:a.oneOfType([a.number,a.string]),transitionInterpolator:a.object,transitionInterruption:a.number,transitionEasing:a.func,onTransitionStart:a.func,onTransitionInterrupt:a.func,onTransitionEnd:a.func,scrollZoom:a.oneOfType([a.bool,a.object]),dragPan:a.oneOfType([a.bool,a.object]),dragRotate:a.oneOfType([a.bool,a.object]),doubleClickZoom:a.bool,touchZoom:a.oneOfType([a.bool,a.object]),touchRotate:a.oneOfType([a.bool,a.object]),keyboard:a.oneOfType([a.bool,a.object]),onHover:a.func,onClick:a.func,onDblClick:a.func,onContextMenu:a.func,onMouseDown:a.func,onMouseMove:a.func,onMouseUp:a.func,onTouchStart:a.func,onTouchMove:a.func,onTouchEnd:a.func,onMouseEnter:a.func,onMouseLeave:a.func,onMouseOut:a.func,onWheel:a.func,touchAction:a.string,eventRecognizerOptions:a.object,clickRadius:a.number,interactiveLayerIds:a.array,getCursor:a.func,controller:a.instanceOf(Je)}),en=Object.assign({},le.defaultProps,Vt,Fe.defaultProps,{onViewStateChange:null,onViewportChange:null,onClick:null,onNativeClick:null,onHover:null,onContextMenu:function(t){return t.preventDefault()},scrollZoom:!0,dragPan:!0,dragRotate:!0,doubleClickZoom:!0,touchZoom:!0,touchRotate:!1,keyboard:!0,touchAction:"none",eventRecognizerOptions:{},clickRadius:0,getCursor:function(t){var e=t.isDragging,n=t.isHovering;return e?"grabbing":n?"pointer":"grab"}});function nn(t){if(t.lngLat||!t.offsetCenter)return t;var e=t.offsetCenter,n=e.x,i=e.y;if(!Number.isFinite(n)||!Number.isFinite(i))return t;var r=[n,i];return t.point=r,t.lngLat=this.viewport.unproject(r),t}function rn(t){var e=this.map;if(!e||!t)return null;var n={},i=this.props.clickRadius;this.props.interactiveLayerIds&&(n.layers=this.props.interactiveLayerIds);try{return e.queryRenderedFeatures(i?[[t[0]-i,t[1]+i],[t[0]+i,t[1]-i]]:t,n)}catch(r){return null}}function on(t,e){var n=this.props[t];n&&n(nn.call(this,e))}function sn(t){on.call(this,"touch"===t.pointerType?"onTouchStart":"onMouseDown",t)}function an(t){on.call(this,"touch"===t.pointerType?"onTouchEnd":"onMouseUp",t)}function ln(t){if(on.call(this,"touch"===t.pointerType?"onTouchMove":"onMouseMove",t),!this.state.isDragging){var e,n=this.props,i=n.onHover,r=n.interactiveLayerIds;t=nn.call(this,t),(r||i)&&(e=rn.call(this,t.point));var o=Boolean(r&&e&&e.length>0),s=o&&!this.state.isHovering,a=!o&&this.state.isHovering;(i||s)&&(t.features=e,i&&i(t)),s&&on.call(this,"onMouseEnter",t),a&&on.call(this,"onMouseLeave",t),(s||a)&&this.setState({isHovering:o})}}function cn(t){var e=this.props,n=e.onClick,i=e.onNativeClick,r=e.onDblClick,o=e.doubleClickZoom,s=[],a=r||o;switch(t.type){case"anyclick":s.push(i),a||s.push(n);break;case"click":a&&s.push(n)}(s=s.filter(Boolean)).length&&((t=nn.call(this,t)).features=rn.call(this,t.point),s.forEach((function(e){return e(t)})))}var un=(0,s.forwardRef)((function(t,e){var n=(0,s.useContext)(Jt),o=(0,s.useMemo)((function(){return t.controller||new Je}),[]),a=(0,s.useMemo)((function(){return new Ne.E(null,{touchAction:t.touchAction,recognizerOptions:t.eventRecognizerOptions})}),[]),l=(0,s.useRef)(null),c=(0,s.useRef)(null),u=(0,s.useRef)({width:0,height:0,state:{isHovering:!1,isDragging:!1}}).current;u.props=t,u.map=c.current&&c.current.getMap(),u.setState=function(e){u.state=$e($e({},u.state),e),l.current.style.cursor=t.getCursor(u.state)};var h,d,p=!0,f=function(t,e,n){if(p)h=[t,e,n];else{var i=u.props,r=i.onViewStateChange,o=i.onViewportChange;r&&r({viewState:t,interactionState:e,oldViewState:n}),o&&o(t,e,n)}};(0,s.useImperativeHandle)(e,(function(){return function(t){return{getMap:t.current&&t.current.getMap,queryRenderedFeatures:t.current&&t.current.queryRenderedFeatures}}(c)}),[]);var A=(0,s.useMemo)((function(){return $e($e({},n),{},{eventManager:a,container:n.container||l.current})}),[n,l.current]);A.onViewportChange=f,A.viewport=n.viewport||ne(u),u.viewport=A.viewport;var g=function(t){var e=t.isDragging,n=void 0!==e&&e;if(n!==u.state.isDragging&&u.setState({isDragging:n}),p)d=t;else{var i=u.props.onInteractionStateChange;i&&i(t)}},m=function(){u.width&&u.height&&o.setOptions($e($e($e({},u.props),u.props.viewState),{},{isInteractive:Boolean(u.props.onViewStateChange||u.props.onViewportChange),onViewportChange:f,onStateChange:g,eventManager:a,width:u.width,height:u.height}))};(0,s.useEffect)((function(){return a.setElement(l.current),a.on({pointerdown:sn.bind(u),pointermove:ln.bind(u),pointerup:an.bind(u),pointerleave:on.bind(u,"onMouseOut"),click:cn.bind(u),anyclick:cn.bind(u),dblclick:on.bind(u,"onDblClick"),wheel:on.bind(u,"onWheel"),contextmenu:on.bind(u,"onContextMenu")}),function(){a.destroy()}}),[]),Yt((function(){h&&f.apply(void 0,(0,r.A)(h)),d&&g(d)})),m();var y=t.width,_=t.height,v=t.style,b=t.getCursor,x=(0,s.useMemo)((function(){return $e($e({position:"relative"},v),{},{width:y,height:_,cursor:b(u.state)})}),[v,y,_,b,u.state]);return h&&u._child||(u._child=s.createElement(Qt,{value:A},s.createElement("div",{key:"event-canvas",ref:l,style:x},s.createElement(le,(0,i.A)({},t,{width:"100%",height:"100%",style:null,onResize:function(t){var e=t.width,n=t.height;u.width=e,u.height=n,m(),u.props.onResize({width:e,height:n})},ref:c}))))),p=!1,u._child}));un.supported=le.supported,un.propTypes=tn,un.defaultProps=en;var hn=n(
vendor: 2,468 bytes, line 2
240694);function dn(t,e){if(t===e)return!0;if(!t||!e)return!1;if(Array.isArray(t)){if(!Array.isArray(e)||t.length!==e.length)return!1;for(var n=0;n<t.length;n++)if(!dn(t[n],e[n]))return!1;return!0}if(Array.isArray(e))return!1;if("object"===(0,hn.A)(t)&&"object"===(0,hn.A)(e)){var i=Object.keys(t),r=Object.keys(e);if(i.length!==r.length)return!1;for(var o=0,s=i;o<s.length;o++){var a=s[o];if(!e.hasOwnProperty(a))return!1;if(!dn(t[a],e[a]))return!1}return!0}return!1}function pn(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}var fn={type:a.string.isRequired,id:a.string},An=0;function gn(t,e,n){if(t&&t.style&&t.style._loaded){var i=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?pn(Object(n),!0).forEach((function(e){(0,o.A)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):pn(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},n);return delete i.id,delete i.children,t.addSource(e,i),t.getSource(e)}return null}function mn(t){var e=(0,s.useContext)(Jt),n=(0,s.useRef)({id:t.id,type:t.type}),i=(0,s.useState)(0),r=(0,l.A)(i,2)[1],o=(0,s.useMemo)((function(){return t.id||"jsx-source-".concat(An++)}),[]),a=e.map;(0,s.useEffect)((function(){if(a){var t=function(){return r((function(t){return t+1}))};return a.on("styledata",t),function(){a.off("styledata",t),requestAnimationFrame((function(){a.style&&a.style._loaded&&a.getSource(o)&&a.removeSource(o)}))}}}),[a,o]);var c=a&&a.style&&a.getSource(o);return c?function(t,e,n){zt(e.id===n.id,"source id changed"),zt(e.type===n.type,"source type changed");var i="",r=0;for(var o in e)"children"===o||"id"===o||dn(n[o],e[o])||(i=o,r++);if(r){var s=e.type;if("geojson"===s)t.setData(e.data);else if("image"===s)t.updateImage({url:e.url,coordinates:e.coordinates});else if("canvas"!==s&&"video"!==s||1!==r||"coordinates"!==i)if("vector"===s&&t.setUrl)switch(i){case"url":t.setUrl(e.url);break;case"tiles":t.setTiles(e.tiles)}else console.warn("Unable to update <Source> prop: ".concat(i));else t.setCoordinates(e.coordinates)}}(c,t,n.current):c=gn(a,o,t),n.current=t,c&&s.Children.map(t.children,(function(t){return t&&(0,s.cloneElement)(t,{source:o})}))||null}mn.propTypes=fn;var yn=n(81515
vendor: 26,843 bytes, line 2
2);function _n(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function vn(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?_n(Object(n),!0).forEach((function(e){(0,o.A)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):_n(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var bn={type:a.oneOf(["fill","line","symbol","circle","fill-extrusion","raster","background","heatmap","hillshade"]).isRequired,id:a.string,source:a.string,beforeId:a.string};function xn(t,e,n,i){zt(n.id===i.id,"layer id changed"),zt(n.type===i.type,"layer type changed");try{!function(t,e,n,i){var r=n.layout,o=void 0===r?{}:r,s=n.paint,a=void 0===s?{}:s,l=n.filter,c=n.minzoom,u=n.maxzoom,h=n.beforeId,d=(0,yn.A)(n,["layout","paint","filter","minzoom","maxzoom","beforeId"]);if(h!==i.beforeId&&t.moveLayer(e,h),o!==i.layout){var p=i.layout||{};for(var f in o)dn(o[f],p[f])||t.setLayoutProperty(e,f,o[f]);for(var A in p)o.hasOwnProperty(A)||t.setLayoutProperty(e,A,void 0)}if(a!==i.paint){var g=i.paint||{};for(var m in a)dn(a[m],g[m])||t.setPaintProperty(e,m,a[m]);for(var y in g)a.hasOwnProperty(y)||t.setPaintProperty(e,y,void 0)}for(var _ in dn(l,i.filter)||t.setFilter(e,l),c===i.minzoom&&u===i.maxzoom||t.setLayerZoomRange(e,c,u),d)dn(d[_],i[_])||t.setLayerProperty(e,_,d[_])}(t,e,n,i)}catch(r){console.warn(r)}}var wn=0;function En(t){var e=(0,s.useContext)(Jt),n=(0,s.useRef)({id:t.id,type:t.type}),i=(0,s.useState)(0),r=(0,l.A)(i,2)[1],o=(0,s.useMemo)((function(){return t.id||"jsx-layer-".concat(wn++)}),[]),a=e.map;return(0,s.useEffect)((function(){if(a){var t=function(){return r((function(t){return t+1}))};return a.on("styledata",t),function(){a.off("styledata",t),a.style&&a.style._loaded&&a.removeLayer(o)}}}),[a]),a&&a.style&&a.getLayer(o)?xn(a,o,t,n.current):function(t,e,n){if(t.style&&t.style._loaded){var i=vn(vn({},n),{},{id:e});delete i.beforeId,t.addLayer(i,n.beforeId)}}(a,o,t),n.current=t,null}En.propTypes=bn;var Cn={captureScroll:!1,captureDrag:!0,captureClick:!0,captureDoubleClick:!0,capturePointerMove:!1},Tn={captureScroll:a.bool,captureDrag:a.bool,captureClick:a.bool,captureDoubleClick:a.bool,capturePointerMove:a.bool};function Sn(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=(0,s.useContext)(Jt),n=(0,s.useRef)(null),i=(0,s.useRef)({props:t,state:{},context:e,containerRef:n}).current;return i.props=t,i.context=e,(0,s.useEffect)((function(){return function(t){var e=t.containerRef.current,n=t.context.eventManager;if(e&&n){var i={wheel:function(e){var n=t.props;n.captureScroll&&e.stopPropagation(),n.onScroll&&n.onScroll(e,t)},panstart:function(e){var n=t.props;n.captureDrag&&e.stopPropagation(),n.onDragStart&&n.onDragStart(e,t)},anyclick:function(e){var n=t.props;n.captureClick&&e.stopPropagation(),n.onNativeClick&&n.onNativeClick(e,t)},click:function(e){var n=t.props;n.captureClick&&e.stopPropagation(),n.onClick&&n.onClick(e,t)},dblclick:function(e){var n=t.props;n.captureDoubleClick&&e.stopPropagation(),n.onDoubleClick&&n.onDoubleClick(e,t)},pointermove:function(e){var n=t.props;n.capturePointerMove&&e.stopPropagation(),n.onPointerMove&&n.onPointerMove(e,t)}};return n.watch(i,e),function(){n.off(i)}}}(i)}),[e.eventManager]),i}function Pn(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=(0,Ae.A)(t);if(e){var r=(0,Ae.A)(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return(0,fe.A)(this,n)}}function Mn(t){var e=t.instance,n=Sn(t),i=n.context,r=n.containerRef;return e._context=i,e._containerRef=r,e._render()}var In=function(t){(0,pe.A)(n,t);var e=Pn(n);function n(){var t;(0,vt.A)(this,n);for(var i=arguments.length,r=new Array(i),a=0;a<i;a++)r[a]=arguments[a];return t=e.call.apply(e,[this].concat(r)),(0,o.A)((0,de.A)(t),"_context",{}),(0,o.A)((0,de.A)(t),"_containerRef",(0,s.createRef)()),(0,o.A)((0,de.A)(t),"_onScroll",(function(t){})),(0,o.A)((0,de.A)(t),"_onDragStart",(function(t){})),(0,o.A)((0,de.A)(t),"_onDblClick",(function(t){})),(0,o.A)((0,de.A)(t),"_onClick",(function(t){})),(0,o.A)((0,de.A)(t),"_onPointerMove",(function(t){})),t}return(0,bt.A)(n,[{key:"_render",value:function(){throw new Error("_render() not implemented")}},{key:"render",value:function(){return s.createElement(Mn,(0,i.A)({instance:this},this.props,{onScroll:this._onScroll,onDragStart:this._onDragStart,onDblClick:this._onDblClick,onClick:this._onClick,onPointerMove:this._onPointerMove}))}}]),n}(s.PureComponent);function Bn(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function Rn(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Bn(Object(n),!0).forEach((function(e){(0,o.A)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Bn(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}(0,o.A)(In,"propTypes",Tn),(0,o.A)(In,"defaultProps",Cn);var Ln=Object.assign({},Tn,{draggable:a.bool,onDrag:a.func,onDragEnd:a.func,onDragStart:a.func,offsetLeft:a.number,offsetTop:a.number}),On=Object.assign({},Cn,{draggable:!1,offsetLeft:0,offsetTop:0});function Dn(t){var e=t.offsetCenter;return[e.x,e.y]}function kn(t,e,n,i){var r=t[0]+e[0]-n.offsetLeft,o=t[1]+e[1]-n.offsetTop;return i.viewport.unproject([r,o])}function Fn(t,e){var n=e.props,i=e.callbacks,r=e.state,o=e.context,s=e.containerRef;if(n.draggable){t.stopPropagation();var a=Dn(t),l=function(t,e){var n=t.center,i=n.x,r=n.y;if(e){var o=e.getBoundingClientRect();return[o.left-i,o.top-r]}return null}(t,s.current);if(r.setDragPos(a),r.setDragOffset(l),i.onDragStart&&l){var c=Object.assign({},t);c.lngLat=kn(a,l,n,o),i.onDragStart(c)}}}function Nn(t){var e=t.context.eventManager;if(e&&t.state.dragPos){var n={panmove:function(e){return function(t,e){var n=e.props,i=e.callbacks,r=e.state,o=e.context;t.stopPropagation();var s=Dn(t);r.setDragPos(s);var a=r.dragOffset;if(i.onDrag&&a){var l=Object.assign({},t);l.lngLat=kn(s,a,n,o),i.onDrag(l)}}(e,t)},panend:function(e){return function(t,e){var n=e.props,i=e.callbacks,r=e.state,o=e.context;t.stopPropagation();var s=r.dragPos,a=r.dragOffset;if(r.setDragPos(null),r.setDragOffset(null),i.onDragEnd&&s&&a){var l=Object.assign({},t);l.lngLat=kn(s,a,n,o),i.onDragEnd(l)}}(e,t)},pancancel:function(e){return function(t,e){var n=e.state;t.stopPropagation(),n.setDragPos(null),n.setDragOffset(null)}(e,t)}};return e.watch(n),function(){e.off(n)}}}var zn="undefined"!==typeof window&&window.devicePixelRatio||1,Un=function(t){return Math.round(t*zn)/zn},Gn=function(t,e){if(null===t)return e;var n="x"===(arguments.length>2&&void 0!==arguments[2]?arguments[2]:"x")?t.offsetWidth:t.offsetHeight;return Un(e/100*n)/n*100};function Vn(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}var jn=Object.assign({},Ln,{className:a.string,longitude:a.number.isRequired,latitude:a.number.isRequired,style:a.object}),Hn=Object.assign({},On,{className:""});function Wn(t){var e=function(t){var e=(0,s.useState)(null),n=(0,l.A)(e,2),i=n[0],r=n[1],o=(0,s.useState)(null),a=(0,l.A)(o,2),c=a[0],u=a[1],h=Sn(Rn(Rn({},t),{},{onDragStart:Fn}));return h.callbacks=t,h.state.dragPos=i,h.state.setDragPos=r,h.state.dragOffset=c,h.state.setDragOffset=u,(0,s.useEffect)((function(){return Nn(h)}),[h.context.eventManager,Boolean(i)]),h}(t),n=e.state,i=e.containerRef,r=t.children,a=t.className,c=t.draggable,u=t.style,h=n.dragPos,d=function(t){var e=t.props,n=t.state,i=t.context,r=e.longitude,o=e.latitude,s=e.offsetLeft,a=e.offsetTop,c=n.dragPos,u=n.dragOffset;if(c&&u)return[c[0]+u[0],c[1]+u[1]];var h=i.viewport.project([r,o]),d=(0,l.A)(h,2),p=d[0],f=d[1];return[p+=s,f+=a]}(e),p=(0,l.A)(d,2),f=p[0],A=p[1],g="translate(".concat(Un(f),"px, ").concat(Un(A),"px)"),m=c?h?"grabbing":"grab":"auto",y=(0,s.useMemo)((function(){var t=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Vn(Object(n),!0).forEach((function(e){(0,o.A)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Vn(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({position:"absolute",left:0,top:0,transform:g,cursor:m},u);return s.createElement("div",{className:"mapboxgl-marker ".concat(a),ref:e.containerRef,style:t},r)}),[r,a]),_=i.current;return _&&(_.style.transform=g,_.style.cursor=m),y}Wn.defaultProps=Hn,Wn.propTypes=jn;s.memo(Wn);var qn={top:{x:.5,y:0},"top-left":{x:0,y:0},"top-right":{x:1,y:0},bottom:{x:.5,y:1},"bottom-left":{x:0,y:1},"bottom-right":{x:1,y:1},left:{x:0,y:.5},right:{x:1,y:.5}},Zn=Object.keys(qn);var Xn=Object.assign({},Tn,{className:a.string,longitude:a.number.isRequired,latitude:a.number.isRequired,altitude:a.number,offsetLeft:a.number,offsetTop:a.number,tipSize:a.number,closeButton:a.bool,closeOnClick:a.bool,anchor:a.oneOf(Object.keys(qn)),dynamicPosition:a.bool,sortByDepth:a.bool,onClose:a.func}),Kn=Object.assign({},Cn,{className:"",altitude:0,offsetLeft:0,offsetTop:0,tipSize:10,anchor:"bottom",dynamicPosition:!0,sortByDepth:!1,closeButton:!0,closeOnClick:!0,onClose:function(){}});function Qn(t,e,n,i){var r=(0,l.A)(i,2),o=r[0],s=r[1],a=t.anchor,c=t.dynamicPosition,u=t.tipSize;return n&&c?function(t){var e=t.x,n=t.y,i=t.width,r=t.height,o=t.selfWidth,s=t.selfHeight,a=t.anchor,l=t.padding,c=void 0===l?0:l,u=qn[a],h=u.x,d=u.y,p=n-d*s,f=p+s,A=Math.max(0,c-p)+Math.max(0,f-r+c);if(A>0){var g=d,m=A;for(d=0;d<=1;d+=.5)f=(p=n-d*s)+s,(A=Math.max(0,c-p)+Math.max(0,f-r+c))<m&&(m=A,g=d);d=g}var y=.5;.5===d&&(h=Math.floor(h),y=1);var _=e-h*o,v=_+o,b=Math.max(0,c-_)+Math.max(0,v-i+c);if(b>0){var x=h,w=b;for(h=0;h<=1;h+=y)v=(_=e-h*o)+o,(b=Math.max(0,c-_)+Math.max(0,v-i+c))<w&&(w=b,x=h);h=x}return Zn.find((function(t){var e=qn[t];return e.x===h&&e.y===d}))||a}({x:o,y:s,anchor:a,padding:u,width:e.width,height:e.height,selfWidth:n.clientWidth,selfHeight:n.clientHeight}):a}function Jn(t){var e=(0,s.useRef)(null),n=Sn(t),i=n.context,r=n.containerRef,o=(0,s.useState)(!1),a=(0,l.A)(o,2)[1];(0,s.useEffect)((function(){a(!0)}),[e.current]),(0,s.useEffect)((function(){if(i.eventManager&&t.closeOnClick){var e=function(){return n.props.onClose()};return i.eventManager.on("anyclick",e),function(){i.eventManager.off("anyclick",e)}}}),[i.eventManager,t.closeOnClick]);var c=i.viewport,u=t.className,h=t.longitude,d=t.latitude,p=t.altitude,f=t.tipSize,A=t.closeButton,g=t.children,m=c.project([h,d,p]),y=Qn(t,c,e.current,m),_=function(t,e,n,i,r){var o=(0,l.A)(i,3),s=o[0],a=o[1],c=o[2],u=t.offsetLeft,h=t.offsetTop,d=t.sortByDepth,p=qn[r],f=s+u,A=a+h,g=Gn(n,100*-p.x),m=Gn(n,100*-p.y,"y"),y={position:"absolute",transform:"\n translate(".concat(g,"%, ").concat(m,"%)\n translate(").concat(Un(f),"px, ").concat(Un(A),"px)\n "),display:void 0,zIndex:void 0};return d?(c>1||c<-1||s<0||s>e.width||a<0||a>e.height?y.display="none":y.zIndex=Math.floor((1-c)/2*1e5),y):y}(t,c,r.current,m,y),v=(0,s.useCallback)((function(t){n.props.onClose();var e=n.context.eventManager;e&&e.once("click",(function(t){return t.stopPropagation()}),t.target)}),[]);return s.createElement("div",{className:"mapboxgl-popup mapboxgl-popup-anchor-".concat(y," ").concat(u),style:_,ref:r},s.createElement("div",{key:"tip",className:"mapboxgl-popup-tip",style:{borderWidth:f}}),s.createElement("div",{key:"content",ref:e,className:"mapboxgl-popup-content"},A&&s.createElement("button",{key:"close-button",className:"mapboxgl-popup-close-button",type:"button",onClick:v},"\xd7"),g))}Jn.propTypes=Xn,Jn.defaultProps=Kn;s.memo(Jn);function Yn(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}var $n=Object.assign({},Tn,{toggleLabel:a.string,className:a.string,style:a.object,compact:a.bool,customAttribution:a.oneOfType([a.string,a.arrayOf(a.string)])}),ti=Object.assign({},Cn,{className:"",toggleLabel:"Toggle Attribution"});function ei(t){var e=Sn(t),n=e.context,i=e.containerRef,r=(0,s.useRef)(null),a=(0,s.useState)(!1),c=(0,l.A)(a,2),u=c[0],h=c[1];(0,s.useEffect)((function(){var e;return n.map&&(e=function(t,e,n,i){var r=new(Ot().AttributionControl)(t);return r._map=e,r._container=n,r._innerContainer=i,r._updateAttributions(),r._updateEditLink(),e.on("styledata",r._updateData),e.on("sourcedata",r._updateData),r}({customAttribution:t.customAttribution},n.map,i.current,r.current)),function(){return e&&function(t){t._map.off("styledata",t._updateData),t._map.off("sourcedata",t._updateData)}(e)}}),[n.map]);var d=void 0===t.compact?n.viewport.width<=640:t.compact;(0,s.useEffect)((function(){!d&&u&&h(!1)}),[d]);var p=(0,s.useCallback)((function(){return h((function(t){return!t}))}),[]),f=(0,s.useMemo)((function(){return function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Yn(Object(n),!0).forEach((function(e){(0,o.A)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Yn(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({position:"absolute"},t.style)}),[t.style]);return s.createElement("div",{style:f,className:t.className},s.createElement("div",{ref:i,"aria-pressed":u,className:"mapboxgl-ctrl mapboxgl-ctrl-attrib ".concat(d?"mapboxgl-compact":""," ").concat(u?"mapboxgl-compact-show":"")},s.createElement("button",{type:"button",className:"mapboxgl-ctrl-attrib-button",title:t.toggleLabel,onClick:p}),s.createElement("div",{ref:r,className:"mapboxgl-ctrl-attrib-inner",role:"list"})))}ei.propTypes=$n,ei.defaultProps=ti;s.memo(ei);function ni(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}var ii=Object.assign({},Tn,{className:a.string,style:a.object,container:a.object,label:a.string}),ri=Object.assign({},Cn,{className:"",container:null,label:"Toggle fullscreen"});function oi(t){var e=Sn(t),n=e.context,i=e.containerRef,r=(0,s.useState)(!1),a=(0,l.A)(r,2),c=a[0],u=a[1],h=(0,s.useState)(!1),d=(0,l.A)(h,2),p=d[0],f=d[1],A=(0,s.useState)(null),g=(0,l.A)(A,2),m=g[0],y=g[1];(0,s.useEffect)((function(){var t=new(Ot().FullscreenControl);y(t),f(t._checkFullscreenSupport());var e=function(){var e=!t._fullscreen;t._fullscreen=e,u(e)};return xt.addEventListener(t._fullscreenchange,e),function(){xt.removeEventListener(t._fullscreenchange,e)}}),[]);var _=(0,s.useMemo)((function(){return function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ni(Object(n),!0).forEach((function(e){(0,o.A)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ni(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({position:"absolute"},t.style)}),[t.style]);if(!p)return null;var v=t.className,b=t.label,x=c?"shrink":"fullscreen";return s.createElement("div",{style:_,className:v},s.createElement("div",{className:"mapboxgl-ctrl mapboxgl-ctrl-group",ref:i},s.createElement("button",{key:x,className:"mapboxgl-ctrl-icon mapboxgl-ctrl-".concat(x),type:"button",title:b,onClick:function(){m&&(m._container=t.container||n.container,m._onClickFullscreen())}},s.createElement("span",{className:"mapboxgl-ctrl-icon","aria-hidden":"true"}))))}oi.propTypes=ii,oi.defaultProps=ri;s.memo(oi);var si;function ai(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}var li=function(){},ci=Object.assign({},Tn,{className:a.string,style:a.object,label:a.string,disabledLabel:a.string,auto:a.bool,positionOptions:a.object,fitBoundsOptions:a.object,trackUserLocation:a.bool,showUserLocation:a.bool,showAccuracyCircle:a.bool,showUserHeading:a.bool,onViewStateChange:a.func,onViewportChange:a.func,onGeolocate:a.func}),ui=Object.assign({},Cn,{className:"",label:"Find My Location",disabledLabel:"Location Not Available",auto:!1,positionOptions:{enableHighAccuracy:!1,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showUserLocation:!0,showUserHeading:!1,showAccuracyCircle:!0,onGeolocate:function(){}});function hi(t,e){var n=e.context,i=e.props,r=function(t){var e=new(Ot().LngLat)(t.coords.longitude,t.coords.latitude),n=t.coords.accuracy,i=e.toBounds(n);return[[i._ne.lng,i._ne.lat],[i._sw.lng,i._sw.lat]]}(t),o=n.viewport.fitBounds(r,i.fitBoundsOptions),s=o.longitude,a=o.latitude,l=o.zoom,c=Object.assign({},n.viewport,{longitude:s,latitude:a,zoom:l}),u=new qt(c),h=Object.assign({},u.getViewportProps(),Ve),d=i.onViewportChange||n.onViewportChange||li;(i.onViewStateChange||n.onViewStateChange||li)({viewState:h}),d(h)}function di(t){var e=Sn(t),n=e.context,i=e.containerRef,r=(0,s.useRef)(null),a=(0,s.useState)(null),c=(0,l.A)(a,2),u=c[0],h=c[1],d=(0,s.useState)(!1),p=(0,l.A)(d,2),f=p[0],A=p[1];(0,s.useEffect)((function(){var i;return n.map&&(void 0!==si?Promise.resolve(si):void 0!==window.navigator.permissions?window.navigator.permissions.query({name:"geolocation"}).then((function(t){return si="denied"!==t.state})):(si=Boolean(window.navigator.geolocation),Promise.resolve(si))).then((function(o){A(o),r.current&&(i=function(t,e,n){var i=new(Ot().GeolocateControl)(e);i._container=xt.createElement("div"),i._map={on:function(){},_getUIString:function(){return""}},i._setupUI(!0),i._map=t.map,i._geolocateButton=n;var r=t.eventManager;return i.options.trackUserLocation&&r&&r.on("panstart",(function(){"ACTIVE_LOCK"===i._watchState&&(i._watchState="BACKGROUND",n.classList.add("mapboxgl-ctrl-geolocate-background"),n.classList.remove("mapboxgl-ctrl-geolocate-active"))})),i.on("geolocate",e.onGeolocate),i}(n,t,r.current),i._updateCamera=function(t){return hi(t,e)},h(i))})),function(){i&&i._clearWatch()}}),[n.map]);var g=(0,s.useCallback)((function(){u&&(u.options=e.props,u.trigger())}),[u]);(0,s.useEffect)((function(){t.auto&&g()}),[u,t.auto]),(0,s.useEffect)((function(){u&&u._onZoom()}),[n.viewport.zoom]);var m=t.className,y=t.label,_=t.disabledLabel,v=t.trackUserLocation,b=(0,s.useMemo)((function(){return function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ai(Object(n),!0).forEach((function(e){(0,o.A)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ai(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({position:"absolute"},t.style)}),[t.style]);return s.createElement("div",{style:b,className:m},s.createElement("div",{key:"geolocate-control",className:"mapboxgl-ctrl mapboxgl-ctrl-group",ref:i},s.createElement("button",{key:"geolocate",className:"mapboxgl-ctrl-icon mapboxgl-ctrl-geolocate",ref:r,disabled:!f,"aria-pressed":!v,type:"button",title:f?y:_,"aria-label":f?y:_,onClick:g},s.createElement("span",{className:"mapboxgl-ctrl-icon","aria-hidden":"true"}))))}di.propTypes=ci,di.defaultProps=ui;s.memo(di);function pi(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}var fi=function(){},Ai=Object.assign({},Tn,{className:a.string,style:a.object,onViewStateChange:a.func,onViewportChange:a.func,showCompass:a.bool,showZoom:a.bool,zoomInLabel:a.string,zoomOutLabel:a.string,compassLabel:a.string}),gi=Object.assign({},Cn,{className:"",showCompass:!0,showZoom:!0,zoomInLabel:"Zoom In",zoomOutLabel:"Zoom Out",compassLabel:"Reset North"}),mi=1,yi=2;function _i(t){return function(t,e){for(var n=(t||"").split(".").map(Number),i=(e||"").split(".").map(Number),r=0;r<3;r++){var o=n[r]||0,s=i[r]||0;if(o<s)return-1;if(o>s)return 1}return 0}(t,"1.6.0")>=0?yi:mi}function vi(t,e,n){var i=t.viewport,r=new qt(Object.assign({},i,n)),o=Object.assign({},r.getViewportProps(),Ve),s=e.onViewportChange||t.onViewportChange||fi;(e.onViewStateChange||t.onViewStateChange||fi)({viewState:o}),s(o)}function bi(t,e,n,i){return s.createElement("button",{key:t,className:"mapboxgl-ctrl-icon mapboxgl-ctrl-".concat(t),type:"button",title:e,onClick:n},i||s.createElement("span",{className:"mapboxgl-ctrl-icon","aria-hidden":"true"}))}function xi(t){var e=Sn(t),n=e.context,i=e.containerRef,r=t.className,a=t.showCompass,l=t.showZoom,c=t.zoomInLabel,u=t.zoomOutLabel,h=t.compassLabel,d=(0,s.useMemo)((function(){return function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?pi(Object(n),!0).forEach((function(e){(0,o.A)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):pi(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({position:"absolute"},t.style)}),[t.style]);return s.createElement("div",{style:d,className:r},s.createElement("div",{className:"mapboxgl-ctrl mapboxgl-ctrl-group",ref:i},l&&bi("zoom-in",c,(function(){vi(n,t,{zoom:n.viewport.zoom+1})})),l&&bi("zoom-out",u,(function(){vi(n,t,{zoom:n.viewport.zoom-1})})),a&&bi("compass",h,(function(){vi(n,t,{bearing:0,pitch:0})}),function(t){var e=(0,s.useMemo)((function(){return t.map?_i(t.map.version):yi}),[t.map]),n=t.viewport.bearing,i={transform:"rotate(".concat(-n,"deg)")};return e===yi?s.createElement("span",{className:"mapboxgl-ctrl-icon","aria-hidden":"true",style:i}):s.createElement("span",{className:"mapboxgl-ctrl-compass-arrow",style:i})}(n))))}xi.propTypes=Ai,xi.defaultProps=gi;const wi=s.memo(xi);function Ei(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}var Ci=Object.assign({},Tn,{className:a.string,style:a.object,maxWidth:a.number,unit:a.oneOf(["imperial","metric","nautical"])}),Ti=Object.assign({},Cn,{className:"",maxWidth:100,unit:"metric"});function Si(t){var e=Sn(t),n=e.context,i=e.containerRef,r=(0,s.useState)(null),a=(0,l.A)(r,2),c=a[0],u=a[1];(0,s.useEffect)((function(){if(n.map){var t=new(Ot().ScaleControl);t._map=n.map,t._container=i.current,u(t)}}),[n.map]),c&&(c.options=t,c._onMove&&c._onMove());var h=(0,s.useMemo)((function(){return function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Ei(Object(n),!0).forEach((function(e){(0,o.A)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ei(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({position:"absolute"},t.style)}),[t.style]);return s.createElement("div",{style:h,className:t.className},s.createElement("div",{ref:i,className:"mapboxgl-ctrl mapboxgl-ctrl-scale"}))}Si.propTypes=Ci,Si.defaultProps=Ti;s.memo(Si);var Pi="undefined"!==typeof window&&window.devicePixelRatio||1,Mi=Object.assign({},Tn,{redraw:a.func.isRequired});function Ii(t){var e=Sn(t),n=e.context,i=e.containerRef,r=(0,s.useState)(null),o=(0,l.A)(r,2),a=o[0],c=o[1];(0,s.useEffect)((function(){c(i.current.getContext("2d"))}),[]);var u=n.viewport,h=n.isDragging;return a&&(a.save(),a.scale(Pi,Pi),t.redraw({width:u.width,height:u.height,ctx:a,isDragging:h,project:u.project,unproject:u.unproject}),a.restore()),s.createElement("canvas",{ref:i,width:u.width*Pi,height:u.height*Pi,style:{width:"".concat(u.width,"px"),height:"".concat(u.height,"px"),position:"absolute",left:0,top:0}})}Ii.propTypes=Mi,Ii.defaultProps={captureScroll:!1,captureDrag:!1,captureClick:!1,captureDoubleClick:!1,capturePointerMove:!1};function Bi(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}var Ri=Object.assign({},Tn,{redraw:a.func.isRequired,style:a.object});function Li(t){var e=Sn(t),n=e.context,i=e.containerRef,r=n.viewport,a=n.isDragging,l=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Bi(Object(n),!0).forEach((function(e){(0,o.A)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Bi(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({position:"absolute",left:0,top:0,width:r.width,height:r.height},t.style);return s.createElement("div",{ref:i,style:l},t.redraw({width:r.width,height:r.height,isDragging:a,project:r.project,unproject:r.unproject}))}Li.propTypes=Ri,Li.defaultProps={captureScroll:!1,captureDrag:!1,captureClick:!1,captureDoubleClick:!1,capturePointerMove:!1};function Oi(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}var Di=Object.assign({},Tn,{redraw:a.func.isRequired,style:a.object});function ki(t){var e=Sn(t),n=e.context,i=e.containerRef,r=n.viewport,a=n.isDragging,l=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Oi(Object(n),!0).forEach((function(e){(0,o.A)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Oi(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({position:"absolute",left:0,top:0},t.style);return s.createElement("svg",{width:r.width,height:r.height,ref:i,style:l},t.redraw({width:r.width,height:r.height,isDragging:a,project:r.project,unproject:r.unproject}))}ki.propTypes=Di,ki.defaultProps={captureScroll:!1,captureDrag:!1,captureClick:!1,captureDoubleClick:!1,capturePointerMove:!1};Ot()&&Ot().setRTLTextPlugin},9
vendor: 7,221 bytes, line 2
28765:t=>{const e=/^[-+]?0x[a-fA-F0-9]+$/,n=/^([\-\+])?(0*)(\.[0-9]+([eE]\-?[0-9]+)?|[0-9]+(\.[0-9]+([eE]\-?[0-9]+)?)?)$/;!Number.parseInt&&window.parseInt&&(Number.parseInt=window.parseInt),!Number.parseFloat&&window.parseFloat&&(Number.parseFloat=window.parseFloat);const i={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};t.exports=function(t){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(r=Object.assign({},i,r),!t||"string"!==typeof t)return t;let o=t.trim();if(void 0!==r.skipLike&&r.skipLike.test(o))return t;if(r.hex&&e.test(o))return Number.parseInt(o,16);{const e=n.exec(o);if(e){const n=e[1],i=e[2];let s=function(t){if(t&&-1!==t.indexOf("."))return"."===(t=t.replace(/0+$/,""))?t="0":"."===t[0]?t="0"+t:"."===t[t.length-1]&&(t=t.substr(0,t.length-1)),t;return t}(e[3]);const a=e[4]||e[6];if(!r.leadingZeros&&i.length>0&&n&&"."!==o[2])return t;if(!r.leadingZeros&&i.length>0&&!n&&"."!==o[1])return t;{const e=Number(o),l=""+e;return-1!==l.search(/[eE]/)||a?r.eNotation?e:t:-1!==o.indexOf(".")?"0"===l&&""===s||l===s||n&&l==="-"+s?e:t:i?s===l||n+s===l?e:t:o===l||o===n+l?e:t}}return t}}},56902:t=>{var e=Math.PI/180,n=180/Math.PI;function i(t){var e=r(t[0]+1,t[2]);return[r(t[0],t[2]),o(t[1]+1,t[2]),e,o(t[1],t[2])]}function r(t,e){return t/Math.pow(2,e)*360-180}function o(t,e){var i=Math.PI-2*Math.PI*t/Math.pow(2,e);return n*Math.atan(.5*(Math.exp(i)-Math.exp(-i)))}function s(t,e,n){var i=d(t,e,n);return i[0]=Math.floor(i[0]),i[1]=Math.floor(i[1]),i}function a(t){return[[2*t[0],2*t[1],t[2]+1],[2*t[0]+1,2*t[1],t[2]+1],[2*t[0]+1,2*t[1]+1,t[2]+1],[2*t[0],2*t[1]+1,t[2]+1]]}function l(t){return t[0]%2===0&&t[1]%2===0?[t[0]/2,t[1]/2,t[2]-1]:t[0]%2===0&&!t[1]%2===0?[t[0]/2,(t[1]-1)/2,t[2]-1]:!t[0]%2===0&&t[1]%2===0?[(t[0]-1)/2,t[1]/2,t[2]-1]:[(t[0]-1)/2,(t[1]-1)/2,t[2]-1]}function c(t){return a(l(t))}function u(t,e){for(var n=0;n<t.length;n++)if(h(t[n],e))return!0;return!1}function h(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}function d(t,n,i){var r=Math.sin(n*e),o=Math.pow(2,i);return[o*(t/360+.5),o*(.5-.25*Math.log((1+r)/(1-r))/Math.PI),i]}t.exports={tileToGeoJSON:function(t){var e=i(t);return{type:"Polygon",coordinates:[[[e[0],e[1]],[e[0],e[3]],[e[2],e[3]],[e[2],e[1]],[e[0],e[1]]]]}},tileToBBOX:i,getChildren:a,getParent:l,getSiblings:c,hasTile:u,hasSiblings:function(t,e){for(var n=c(t),i=0;i<n.length;i++)if(!u(e,n[i]))return!1;return!0},tilesEqual:h,tileToQuadkey:function(t){for(var e="",n=t[2];n>0;n--){var i=0,r=1<<n-1;0!==(t[0]&r)&&i++,0!==(t[1]&r)&&(i+=2),e+=i.toString()}return e},quadkeyToTile:function(t){for(var e=0,n=0,i=t.length,r=i;r>0;r--){var o=1<<r-1;switch(t[i-r]){case"0":break;case"1":e|=o;break;case"2":n|=o;break;case"3":e|=o,n|=o}}return[e,n,i]},pointToTile:s,bboxToTile:function(t){var e=s(t[0],t[1],32),n=s(t[2],t[3],32),i=[e[0],e[1],n[0],n[1]],r=function(t){for(var e=28,n=0;n<e;n++){var i=1<<32-(n+1);if((t[0]&i)!=(t[2]&i)||(t[1]&i)!=(t[3]&i))return n}return e}(i);return 0===r?[0,0,0]:[i[0]>>>32-r,i[1]>>>32-r,r]},pointToTileFraction:d}},93298:()=>{},92099:(t,e,n)=>{"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}n.d(e,{A:()=>i})},48183:(t,e,n)=>{"use strict";n.d(e,{A:()=>o});var i=n(92162);function r(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(0,i.A)(r.key),r)}}function o(t,e,n){return e&&r(t.prototype,e),n&&r(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}},74572:(t,e,n)=>{"use strict";function i(t){return i=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},i(t)}n.d(e,{A:()=>i})},50171:(t,e,n)=>{"use strict";n.d(e,{A:()=>r});var i=n(91576);function r(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&(0,i.A)(t,e)}},42912:(t,e,n)=>{"use strict";n.d(e,{A:()=>o});var i=n(40694),r=n(72367);function o(t,e){if(e&&("object"===(0,i.A)(e)||"function"===typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return(0,r.A)(t)}},97850:(t,e,n)=>{"use strict";n.d(e,{A:()=>r});var i=n(16438);function r(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var i,r,o,s,a=[],l=!0,c=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(i=o.call(n)).done)&&(a.push(i.value),a.length!==e);l=!0);}catch(u){c=!0,r=u}finally{try{if(!l&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw r}}return a}}(t,e)||(0,i.A)(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},43539:(t,e,n)=>{"use strict";n.r(e),n.d(e,{AGGREGATION_OPERATION:()=>h,CPUGridLayer:()=>Gt,ContourLayer:()=>$e,GPUGridLayer:()=>hn,GridLayer:()=>fn,HeatmapLayer:()=>Pn,HexagonLayer:()=>Qt,ScreenGridLayer:()=>Bt,_AggregationLayer:()=>Y,_BinSorter:()=>At,_CPUAggregator:()=>Ft,_GPUGridAggregator:()=>D});var i=n(45957),r=n(30141),o=n(86402);class s{device;model;sampler;currentIndex=0;samplerTextureMap=null;bindings=[];resources={};constructor(t,e){this.device=t,this.sampler=t.createSampler({addressModeU:"clamp-to-edge",addressModeV:"clamp-to-edge",minFilter:"nearest",magFilter:"nearest",mipmapFilter:"nearest"}),this.model=new r.K(this.device,{id:e.id||"texture-transform-model",fs:e.fs||(0,o.Wk)({input:e.targetTextureVarying,inputChannels:e.targetTextureChannels,output:"transform_output"}),vertexCount:e.vertexCount,...e}),this._initialize(e),Object.seal(this)}destroy(){}delete(){this.destroy()}run(t){const{framebuffer:e}=this.bindings[this.currentIndex],n=this.device.beginRenderPass({framebuffer:e,...t});this.model.draw(n),n.end()}update(){console.warn("TextureTransform#update() not implemented")}getData(){let{packed:t=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};throw new Error("getData() not implemented")}getTargetTexture(){const{targetTexture:t}=this.bindings[this.currentIndex];return t}getFramebuffer(){return this.bindings[this.currentIndex].framebuffer}_initialize(t){this._updateBindings(t)}_updateBindings(t){this.bindings[this.currentIndex]=this._updateBinding(this.bindings[this.currentIndex],t)}_updateBinding(t,e){let{sourceBuffers:n,sourceTextures:i,targetTexture:r}=e;if(t||(t={sourceBuffers:{},sourceTextures:{},targetTexture:null}),Object.assign(t.sourceTextures,i),Object.assign(t.sourceBuffers,n),r){t.targetTexture=r;const{width:e,height:n}=r;t.framebuffer&&t.framebuffer.destroy(),t.framebuffer=this.device.createFramebuffer({id:"transform-framebuffer",width:e,height:n,colorAttachments:[r]}),t.framebuffer.resize({width:e,height:n})}return t}_setSourceTextureParameters(){const t=this.currentIndex,{sourceTextures:e}=this.bindings[t];for(const n in e)e[n].sampler=this.sampler}}var a=n(63170),l=n(1434),c=n(57941),u=n(5683
vendor: 12,775 bytes, line 2
20);const h={SUM:1,MEAN:2,MIN:3,MAX:4};function d(t,e){return t+e}function p(t,e){return e>t?e:t}function f(t,e){return e<t?e:t}function A(t,e,n){const i=h[t]||h.SUM;switch(e=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(Number.isFinite(t))return t;return n=>(e.index=n.index,t(n.source,e))}(e,n),i){case h.MIN:return t=>function(t,e){if(Number.isFinite(e))return t.length?e:null;const n=t.map(e).filter(Number.isFinite);return n.length?n.reduce(f,1/0):null}(t,e);case h.SUM:return t=>function(t,e){if(Number.isFinite(e))return t.length?t.length*e:null;const n=t.map(e).filter(Number.isFinite);return n.length?n.reduce(d,0):null}(t,e);case h.MEAN:return t=>function(t,e){if(Number.isFinite(e))return t.length?e:null;const n=t.map(e).filter(Number.isFinite);return n.length?n.reduce(d,0)/n.length:null}(t,e);case h.MAX:return t=>function(t,e){if(Number.isFinite(e))return t.length?e:null;const n=t.map(e).filter(Number.isFinite);return n.length?n.reduce(p,-1/0):null}(t,e);default:return null}}function g(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return n=>(e.indices=n.map((t=>t.index)),t(n.map((t=>t.source)),e))}const m={projectPoints:!1,viewport:null,createBufferObjects:!0,moduleSettings:{}},y=3402823466e29,_=[32775,32774],v=[32776,32774],b=[32776,32775],x={[h.SUM]:32774,[h.MEAN]:32774,[h.MIN]:_,[h.MAX]:v},w={size:1,operation:h.SUM,needMin:!1,needMax:!1,combineMaxMin:!1},E="#version 300 es\n#define SHADER_NAME gpu-aggregation-to-grid-vs\nin vec3 positions;\nin vec3 positions64Low;\nin vec3 weights;\nuniform vec2 cellSize;\nuniform vec2 gridSize;\nuniform bool projectPoints;\nuniform vec2 translation;\nuniform vec3 scaling;\nout vec3 vWeights;\nvec2 project_to_pixel(vec4 pos) {\nvec4 result;\npos.xy = pos.xy/pos.w;\nresult = pos + vec4(translation, 0., 0.);\nresult.xy = scaling.z > 0. ? result.xy * scaling.xy : result.xy;\nreturn result.xy;\n}\nvoid main(void) {\nvWeights = weights;\nvec4 windowPos = vec4(positions, 1.);\nif (projectPoints) {\nwindowPos = project_position_to_clipspace(positions, positions64Low, vec3(0));\n}\nvec2 pos = project_to_pixel(windowPos);\nvec2 pixelXY64[2];\npixelXY64[0] = vec2(pos.x, 0.);\npixelXY64[1] = vec2(pos.y, 0.);\nvec2 gridXY64[2];\ngridXY64[0] = div_fp64(pixelXY64[0], vec2(cellSize.x, 0));\ngridXY64[1] = div_fp64(pixelXY64[1], vec2(cellSize.y, 0));\nfloat x = floor(gridXY64[0].x);\nfloat y = floor(gridXY64[1].x);\npos = vec2(x, y);\npos = (pos * (2., 2.) / (gridSize)) - (1., 1.);\nvec2 offset = 1.0 / gridSize;\npos = pos + offset;\ngl_Position = vec4(pos, 0.0, 1.0);\ngl_PointSize = 1.0;\n}\n",C="#version 300 es\n#define SHADER_NAME gpu-aggregation-to-grid-fs\nprecision highp float;\nin vec3 vWeights;\nout vec4 fragColor;\nvoid main(void) {\nfragColor = vec4(vWeights, 1.0);\nDECKGL_FILTER_COLOR(fragColor, geometry);\n}\n",T="#version 300 es\n#define SHADER_NAME gpu-aggregation-all-vs-64\nin vec2 position;\nuniform ivec2 gridSize;\nout vec2 vTextureCoord;\nvoid main(void) {\nvec2 pos = vec2(-1.0, -1.0);\nvec2 offset = 1.0 / vec2(gridSize);\npos = pos + offset;\ngl_Position = vec4(pos, 0.0, 1.0);\nint yIndex = gl_InstanceID / gridSize[0];\nint xIndex = gl_InstanceID - (yIndex * gridSize[0]);\nvec2 yIndexFP64 = vec2(float(yIndex), 0.);\nvec2 xIndexFP64 = vec2(float(xIndex), 0.);\nvec2 gridSizeYFP64 = vec2(gridSize[1], 0.);\nvec2 gridSizeXFP64 = vec2(gridSize[0], 0.);\nvec2 texCoordXFP64 = div_fp64(yIndexFP64, gridSizeYFP64);\nvec2 texCoordYFP64 = div_fp64(xIndexFP64, gridSizeXFP64);\nvTextureCoord = vec2(texCoordYFP64.x, texCoordXFP64.x);\ngl_PointSize = 1.0;\n}\n",S="#version 300 es\n#define SHADER_NAME gpu-aggregation-all-fs\nprecision highp float;\nin vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform bool combineMaxMin;\nout vec4 fragColor;\nvoid main(void) {\nvec4 textureColor = texture(uSampler, vec2(vTextureCoord.s, vTextureCoord.t));\nif (textureColor.a == 0.) {\ndiscard;\n}\nfragColor.rgb = textureColor.rgb;\nfragColor.a = combineMaxMin ? textureColor.r : textureColor.a;\n}\n",P="#version 300 es\n#define SHADER_NAME gpu-aggregation-transform-mean-vs\nin vec4 aggregationValues;\nout vec4 meanValues;\nvoid main()\n{\nbool isCellValid = bool(aggregationValues.w > 0.);\nmeanValues.xyz = isCellValid ? aggregationValues.xyz/aggregationValues.w : vec3(0, 0, 0);\nmeanValues.w = aggregationValues.w;\ngl_PointSize = 1.0;\n}\n",M={minFilter:"nearest",magFilter:"nearest"};function I(t,e){const{width:n=1,height:i=1,data:r=null,parameters:o=M}=e;return t.createTexture({data:r,format:"rgba32float",mipmaps:!1,sampler:o,width:n,height:i})}function B(t,e){const{id:n,width:i=1,height:r=1,texture:o}=e;return t.createFramebuffer({id:n,width:i,height:r,colorAttachments:[o]})}const R=["aggregationBuffer","maxMinBuffer","minBuffer","maxBuffer"],L={maxData:"maxBuffer",minData:"minBuffer",maxMinData:"maxMinBuffer"},O=["float32-renderable-webgl","texture-blend-float-webgl"];class D{static getAggregationData(t){let{aggregationData:e,maxData:n,minData:i,maxMinData:r,pixelIndex:o}=t;const s=4*o,a={};return e&&(a.cellCount=e[s+3],a.cellWeight=e[s]),r?(a.maxCellWieght=r[0],a.minCellWeight=r[3]):(n&&(a.maxCellWieght=n[0],a.totalCount=n[3]),i&&(a.minCellWeight=i[0],a.totalCount=i[3])),a}static getCellData(t){let{countsData:e,size:n=1}=t;const i=e.length/4,r=new Float32Array(i*n),o=new Uint32Array(i);for(let s=0;s<i;s++){for(let t=0;t<n;t++)r[s*n+t]=e[4*s+t];o[s]=e[4*s+3]}return{cellCounts:o,cellWeights:r}}static isSupported(t){return O.every((e=>t.features.has(e)))}constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.state={weightAttributes:{},textures:{},meanTextures:{},buffers:{},framebuffers:{},maxMinFramebuffers:{},minFramebuffers:{},maxFramebuffers:{},equations:{},shaderOptions:{},modelDirty:!1,resources:{},results:{}},this.id=e.id||"gpu-grid-aggregator",this.device=t;this._hasGPUSupport=["float32-renderable-webgl"].every((e=>t.features.has(e))),this._hasGPUSupport&&this._setupModels()}delete(){const{gridAggregationModel:t,allAggregationModel:e,meanTransform:n}=this,{textures:i,framebuffers:r,maxMinFramebuffers:o,minFramebuffers:s,maxFramebuffers:a,meanTextures:l,resources:c}=this.state;t?.destroy(),e?.destroy(),n?.destroy(),function(t){t=Array.isArray(t)?t:[t],t.forEach((t=>{for(const e in t)t[e].delete()}))}([r,i,o,s,a,l,c])}run(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.setState({results:{}});const e=this._normalizeAggregationParams(t);return this._runAggregation(e)}getData(t){const e={},n=this.state.results;n[t].aggregationData||(n[t].aggregationData=n[t].aggregationBuffer.getData()),e.aggregationData=n[t].aggregationData;for(const i in L){const r=L[i];(n[t][i]||n[t][r])&&(n[t][i]=n[t][i]||n[t][r].getData(),e[i]=n[t][i])}return e}updateShaders(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.setState({shaderOptions:t,modelDirty:!0})}_normalizeAggregationParams(t){const e={...m,...t},{weights:n}=e;return n&&(e.weights=function(t){const e={};for(const n in t)e[n]={...w,...t[n]};return e}(n)),e}setState(t){Object.assign(this.state,t)}_getAggregateData(t){const e={},{textures:n,framebuffers:i,maxMinFramebuffers:r,minFramebuffers:o,maxFramebuffers:s,resources:a}=this.state,{weights:l}=t;for(const c in l){e[c]={};const{needMin:t,needMax:u,combineMaxMin:h}=l[c];e[c].aggregationTexture=n[c],e[c].aggregationBuffer=this.device.readPixelsToBufferWebGL(i[c],{target:l[c].aggregationBuffer,sourceType:5126}),t&&u&&h?(e[c].maxMinBuffer=this.device.readPixelsToBufferWebGL(r[c],{target:l[c].maxMinBuffer,sourceType:5126}),e[c].maxMinTexture=a[`${c}-maxMinTexture`]):(t&&(e[c].minBuffer=this.device.readPixelsToBufferWebGL(o[c],{target:l[c].minBuffer,sourceType:5126}),e[c].minTexture=a[`${c}-minTexture`]),u&&(e[c].maxBuffer=this.device.readPixelsToBufferWebGL(s[c],{target:l[c].maxBuffer,sourceType:5126}),e[c].maxTexture=a[`${c}-maxTexture`]))}return this._trackGPUResultBuffers(e,l),e}_renderAggregateData(t){const{cellSize:e,projectPoints:n,attributes:i,moduleSettings:r,numCol:o,numRow:s,weights:a,translation:l,scaling:c}=t,{maxMinFramebuffers:u,minFramebuffers:h,maxFramebuffers:d}=this.state,p=[o,s],f={blend:!0,depthTest:!1,blendFunc:[1,1]},A={cellSize:e,gridSize:p,projectPoints:n,translation:l,scaling:c};for(const g in a){const{needMin:t,needMax:e}=a[g],n=t&&e&&a[g].combineMaxMin;this._renderToWeightsTexture({id:g,parameters:f,moduleSettings:r,uniforms:A,gridSize:p,attributes:i,weights:a}),n?this._renderToMaxMinTexture({id:g,parameters:{...f,blendEquation:b},gridSize:p,minOrMaxFb:u[g],clearParams:{clearColor:[0,0,0,y]},combineMaxMin:n}):(t&&this._renderToMaxMinTexture({id:g,parameters:{...f,blendEquation:_},gridSize:p,minOrMaxFb:h[g],clearParams:{clearColor:[y,y,y,0]},combineMaxMin:n}),e&&this._renderToMaxMinTexture({id:g,parameters:{...f,blendEquation:v},gridSize:p,minOrMaxFb:d[g],clearParams:{clearColor:[0,0,0,0]},combineMaxMin:n}))}}_renderToMaxMinTexture(t){const{id:e,gridSize:n,minOrMaxFb:i,combineMaxMin:r,clearParams:o={}}=t,{framebuffers:s}=this.state,{allAggregationModel:a}=this;this.device.withParametersWebGL({...o,framebuffer:i,viewport:[0,0,n[0],n[1]]},(()=>{this.device.clearWebGL({color:!0}),a.setUniforms({gridSize:n,combineMaxMin:r}),a.setBindings({uSampler:s[e].texture}),a.draw()}))}_renderToWeightsTexture(t){const{id:e,parameters:n,moduleSettings:i,uniforms:r,gridSize:o,weights:a}=t,{framebuffers:l,equations:c,weightAttributes:u}=this.state,{gridAggregationModel:d}=this,{operation:p}=a[e],f=p===h.MIN?[y,y,y,0]:[0,0,0,0];if(this.device.withParametersWebGL({framebuffer:l[e],viewport:[0,0,o[0],o[1]],clearColor:f},(()=>{this.device.clearWebGL({color:!0});const t={weights:u[e]};d.draw({parameters:{...n,blendEquation:c[e]},moduleSettings:i,uniforms:r,attributes:t})})),p===h.MEAN){const{meanTextures:t,textures:n}=this.state,i={_sourceTextures:{aggregationValues:t[e]},_targetTexture:n[e],elementCount:n[e].width*n[e].height};this.meanTransform?this.meanTransform.update(i):this.meanTransform=function(t,e){return new s(t,{vs:P,_targetTextureVarying:"meanValues",...e})}(this.device,i),this.meanTransform.run({parameters:{blend:!1,depthTest:!1}}),l[e].attach({36064:n[e]})}}_runAggregation(t){this._updateModels(t),this._setupFramebuffers(t),this._renderAggregateData(t);const e=this._getAggregateData(t);return this.setState({results:e}),e}_setupFramebuffers(t){const{textures:e,framebuffers:n,maxMinFramebuffers:i,minFramebuffers:r,maxFramebuffers:o,meanTextures:s,equations:a}=this.state,{weights:l}=t,{numCol:c,numRow:u}=t,d={width:c,height:u};for(const p in l){const{needMin:t,needMax:f,combineMaxMin:A,operation:g}=l[p];e[p]=l[p].aggregationTexture||e[p]||I(this.device,{id:`${p}-texture`,width:c,height:u}),e[p].resize(d);let m=e[p];g===h.MEAN&&(s[p]=s[p]||I(this.device,{id:`${p}-mean-texture`,width:c,height:u}),s[p].resize(d),m=s[p]),n[p]?n[p].attach({36064:m}):n[p]=B(this.device,{id:`${p}-fb`,width:c,height:u,texture:m}),n[p].resize(d),a[p]=x[g]||x[h.SUM],(t||f)&&(t&&f&&A?i[p]||(m=l[p].maxMinTexture||this._getMinMaxTexture(`${p}-maxMinTexture`),i[p]=B(this.device,{id:`${p}-maxMinFb`,texture:m})):(t&&(r[p]||(m=l[p].minTexture||this._getMinMaxTexture(`${p}-minTexture`),r[p]=B(this.device,{id:`${p}-minFb`,texture:m}))),f&&(o[p]||(m=l[p].maxTexture||this._getMinMaxTexture(`${p}-maxTexture`),o[p]=B(this.device,{id:`${p}-maxFb`,texture:m})))))}}_getMinMaxTexture(t){const{resources:e}=this.state;return e[t]||(e[t]=I(this.device,{id:"resourceName"})),e[t]}_setupModels(){let{numCol:t=0,numRow:e=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{shaderOptions:n}=this.state;if(this.gridAggregationModel?.destroy(),this.gridAggregationModel=function(t,e){const n=(0,l.n)({vs:E,fs:C,modules:[a.dI,c.A]},e);return new r.K(t,{id:"Grid-Aggregation-Model",vertexCount:1,drawMode:0,shaderAssembler:(0,u.cN)(),...n})}(this.device,n),!this.allAggregationModel){const n=t*e;this.allAggregationModel=function(t,e){return new r.K(t,{id:"All-Aggregation-Model",vs:T,fs:S,modules:[a.dI],vertexCount:1,topology:"point-list",isInstanced:!0,instanceCount:e,attributes:{position:[0,0]}})}(this.device,n)}}_setupWeightAttributes(t){const{weightAttributes:e}=this.state,{weights:n}=t;for(const i in n)e[i]=t.attributes[i]}_trackGPUResultBuffers(t,e){const{resources:n}=this.state;for(const i in t)if(t[i])for(const r of R)if(t[i][r]&&e[i][r]!==t[i][r]){const e=`gpu-result-${i}-${r}`;n[e]&&n[e].delete(),n[e]=t[i][r]}}_updateModels(t){const{vertexCount:e,attributes:n,numCol:i,numRow:r}=t,{modelDirty:o}=this.state;o&&(this._setupModels(t),this.setState({modelDirty:!1})),this._setupWeightAttributes(t),this.gridAggregationModel.setVertexCount(e),this.gridAggregationModel.setAttributes(n),this.allAggregationModel.setInstanceCount(i*r)}}var k=n(
vendor: 2,647 bytes, line 2
283647),F=n(14939),N=n(22108);const z=[[255,255,178],[254,217,118],[254,178,76],[253,141,60],[240,59,32],[189,0,38]];function U(t){let e,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Float32Array;if(Number.isFinite(t[0]))e=new i(t);else{e=new i(4*t.length);let n=0;for(let i=0;i<t.length;i++){const r=t[i];e[n++]=r[0],e[n++]=r[1],e[n++]=r[2],e[n++]=Number.isFinite(r[3])?r[3]:255}}if(n)for(let r=0;r<e.length;r++)e[r]/=255;return e}const G=[0,0,0,0],V=[0,255,0,255],j=["minColor","maxColor","colorRange","colorDomain"],H={cellSizePixels:{type:"number",value:100,min:1},cellMarginPixels:{type:"number",value:2,min:0,max:5},colorDomain:null,colorRange:z};class W extends F.A{getShaders(){return{vs:"#version 300 es\n#define SHADER_NAME screen-grid-layer-vertex-shader\n#define RANGE_COUNT 6\nin vec3 positions;\nin vec3 instancePositions;\nin vec4 instanceCounts;\nin vec3 instancePickingColors;\nuniform float opacity;\nuniform vec3 cellScale;\nuniform vec4 minColor;\nuniform vec4 maxColor;\nuniform vec4 colorRange[RANGE_COUNT];\nuniform vec2 colorDomain;\nuniform bool shouldUseMinMax;\nuniform sampler2D maxTexture;\nout vec4 vColor;\nout float vSampleCount;\nvec4 quantizeScale(vec2 domain, vec4 range[RANGE_COUNT], float value) {\nvec4 outColor = vec4(0., 0., 0., 0.);\nif (value >= domain.x && value <= domain.y) {\nfloat domainRange = domain.y - domain.x;\nif (domainRange <= 0.) {\noutColor = colorRange[0];\n} else {\nfloat rangeCount = float(RANGE_COUNT);\nfloat rangeStep = domainRange / rangeCount;\nfloat idx = floor((value - domain.x) / rangeStep);\nidx = clamp(idx, 0., rangeCount - 1.);\nint intIdx = int(idx);\noutColor = colorRange[intIdx];\n}\n}\noutColor = outColor / 255.;\nreturn outColor;\n}\nvoid main(void) {\nvSampleCount = instanceCounts.a;\nfloat weight = instanceCounts.r;\nfloat maxWeight = texture(maxTexture, vec2(0.5)).r;\nfloat step = weight / maxWeight;\nvec4 minMaxColor = mix(minColor, maxColor, step) / 255.;\nvec2 domain = colorDomain;\nfloat domainMaxValid = float(colorDomain.y != 0.);\ndomain.y = mix(maxWeight, colorDomain.y, domainMaxValid);\nvec4 rangeColor = quantizeScale(domain, colorRange, weight);\nfloat rangeMinMax = float(shouldUseMinMax);\nvec4 color = mix(rangeColor, minMaxColor, rangeMinMax);\nvColor = vec4(color.rgb, color.a * opacity);\npicking_setPickingColor(instancePickingColors);\ngl_Position = vec4(instancePositions + positions * cellScale, 1.);\n}\n",fs:"#version 300 es\n#define SHADER_NAME screen-grid-layer-fragment-shader\nprecision highp float;\nin vec4 vColor;\nin float vSampleCount;\nout vec4 fragColor;
2\nvoid main(void) {\nif (vSampleCount <= 0.0) {\ndiscard;\n}\nfragColor = vColor;\nDECKGL_FILTER_COLOR(fragColor, geometry);\n}\n",modules:[N.A]}}initializeState(){this.getAttributeManager().addInstanced({instancePositions:{size:3,update:this.calculateInstancePositions},instanceCounts:{size:4,noAlloc:!0}}),this.setState({model:this._getModel()})}shouldUpdateState(t){let{changeFlags:e}=t;return e.somethingChanged}updateState(t){super.updateState(t);const{oldProps:e,props:n,changeFlags:i}=t,r=this.getAttributeManager();n.numInstances!==e.numInstances?r.invalidateAll():e.cellSizePixels!==n.cellSizePixels&&r.invalidate("instancePositions"),this._updateUniforms(e,n,i)}draw(t){let{uniforms:e}=t;const{parameters:n,maxTexture:i}=this.props,r=this.props.minColor||G,o=this.props.maxColor||V,s=this.props.colorDomain||[1,0],a=this.state.model;a.setUniforms(e),a.setBindings({maxTexture:i}),a.setUniforms({minColor:r,maxColor:o,colorDomain:s}),a.setParameters({depthWriteEnabled:!1,...n}),a.draw(this.context.renderPass)}calculateInstancePositions(t,e){let{numInstances:n}=e;const{width:i,height:r}=this.context.viewport,{cellSizePixels:o}=this.props,s=Math.ceil(i/o),{value:a,size:l}=t;for(let c=0;c<n;c++){const t=c%s,e=Math.floor(c/s);a[c*l+0]=t*o/i*2-1,a[c*l+1]=1-e*o/r*2,a[c*l+2]=0}}_getModel(){return new r.K(this.context.device,{...this.getShaders(),id:this.props.id,bufferLayout:this.getAttributeManager().getBufferLayouts(),geometry:new k.V({topology:"triangle-list",attributes:{positions:new Float32Array([0,0,0,1,0,0,1,1,0,0,0,0,1,1,0,0,1,0])}}),isInstanced:!0})}_shouldUseMinMax(){const{minColor:t,maxColor:e,colorDomain:n,colorRange:r}=this.props;return t||e?(i.A.deprecated("ScreenGridLayer props: minColor and maxColor","colorRange, colorDomain")(),!0):!n&&!r}_updateUniforms(t,e,n){const i=this.state.model;if(j.some((n=>t[n]!==e[n]))&&i.setUniforms({shouldUseMinMax:this._shouldUseMinMax()}),t.colorRange!==e.colorRange&&i.setUniforms({colorRange:U(e.colorRange)}),t.cellMarginPixels!==e.cellMarginPixels||t.cellSizePixels!==e.cellSizePixels||n.viewportChanged){const{width:t,height:e}=this.context.viewport,{cellSizePixels:n,cellMarginPixels:r}=this.props,o=n>r?r:0,s=new Float32Array([(n-o)/t*2,-(n-o)/e*2,1]);i.setUniforms({cellScale:s})}}}W.layerName="ScreenGridCellLayer",W.defaultProps=H;const q=W;var Z=n(89522),X=n(75612),K=n(31652);function Q(t,e){const n={};for(const i in t)e.includes(i)||(n[i]=t[i]);return n}class J extends Z.A{initializeAggregationLayer(t){super.initializeState(this.context),this.setState({ignoreProps:Q(this.constructor._propTypes,t.data.props),dimensions:t})}updateState(t){super.updateState(t);const{changeFlags:e}=t;if(e.extensionsChanged){const t=this.getShaders({});t&&t.defines&&(t.defines.NON_INSTANCED_MODEL=1),this.updateShaders(t)}this._updateAttributes()}updateAttributes(t){this.setState({changedAttributes:t})}getAttributes(){return this.getAttributeManager().getAttributes()}getModuleSettings(){const{viewport:t,mousePosition:e,device:n}=this.context;return Object.assign(Object.create(this.props),{viewport:t,mousePosition:e,picking:{isActive:0},devicePixelRatio:n.canvasContext.cssToDeviceRatio()})}updateShaders(t){}isAggregationDirty(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{props:n,oldProps:i,changeFlags:r}=t,{compareAll:o=!1,dimension:s}=e,{ignoreProps:a}=this.state,{props:l,accessors:c=[]}=s,{updateTriggersChanged:u}=r;if(r.dataChanged)return!0;if(u){if(u.all)return!0;for(const t of c)if(u[t])return!0}if(o)return!!r.extensionsChanged||(0,X.Me)({oldProps:i,newProps:n,ignoreProps:a,propTypes:this.constructor._propTypes});for(const h of l)if(n[h]!==i[h])return!0;return!1}isAttributeChanged(t){const{changedAttributes:e}=this.state;return t?e&&void 0!==e[t]:!function(t){let e=!0;for(const n in t){e=!1;break}return e}(e)}_getAttributeManager(){return new K.A(this.context.device,{id:this.props.id,stats:this.context.stats})}}J.layerName="AggregationLayer";const Y=J;function $(t,e,n){const i=n;return i.domain=()=>t,i.range=()=>e,i}function tt(t,e){return $(t,e,(n=>function(t,e,n){const r=t[1]-t[0];if(r<=0)return i.A.warn("quantizeScale: invalid domain, returning range[0]")(),e[0];const o=r/e.length,s=Math.floor((n-t[0])/o),a=Math.max(Math.min(s,e.length-1),0);return e[a]}(t,e,n)))}function et(t,e){return $(t,e,(n=>function(t,e,n){return(n-t[0])/(t[1]-t[0])*(e[1]-e[0])+e[0]}(t,e,n)))}function nt(t,e){const n=t.sort(it);let i=0;const r=Math.max(1,e.length),o=new Array(r-1);for(;++i<r;)o[i-1]=rt(n,i/r);const s=t=>function(t,e,n){return e[function(t,e){let n=0,i=t.length;for(;n<i;){const r=n+i>>>1;it(t[r],e)>0?i=r:n=r+1}return n}(t,n)]}(o,e,t);return s.thresholds=()=>o,$(t,e,s)}function it(t,e){return t-e}function rt(t,e){const n=t.length;if(e<=0||n<2)return t[0];if(e>=1)return t[n-1];const i=(n-1)*e,r=Math.floor(i),o=t[r];return o+(t[r+1]-o)*(i-r)}function ot(t,e){const n=new Map,i=[];for(const r of t){const t=`${r}`;n.has(t)||n.set(t,i.push(r))}return $(t,e,(t=>function(t,e,n,i){const r=`${i}`;let o=e.get(r);return void 0===o&&(o=t.push(i),e.set(r,o)),n[(o-1)%n.length]}(i,n,e,t)))}function st(t){return void 0!==t&&null!==t}function at(t,e){return("function"===typeof e?t.map(e):t).filter(st)}function lt(t,e){return at(t,e)}function ct(t,e){return function(t){const e=[];return t.forEach((t=>{!e.includes(t)&&st(t)&&e.push(t)})),e}(at(t,e))}const ut=t=>t.length,ht=t=>t.points,dt=t=>t.index,pt=(t,e)=>t<e?-1:t>e?1:t>=e?0:NaN,ft={getValue:ut,getPoints:ht,getIndex:dt,filterData:null};class At{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ft;this.aggregatedBins=this.getAggregatedBins(t,e),this._updateMinMaxValues(),this.binMap=this.getBinMap()}getAggregatedBins(t,e){const{getValue:n=ut,getPoints:i=ht,getIndex:r=dt,filterData:o}=e,s="function"===typeof o,a=t.length,l=[];let c=0;for(let u=0;u<a;u++){const e=t[u],a=i(e),h=r(e),d=s?a.filter(o):a;e.filteredPoints=s?d:null;const p=d.length?n(d):null;null!==p&&void 0!==p&&(l[c]={i:Number.isFinite(h)?h:u,value:p,counts:d.length},c++)}return l}_percentileToIndex(t){const e=this.sortedBins.length;if(e<2)return[0,0];const[n,i]=t.map((t=>{return e=t,n=0,i=100,Math.max(n,Math.min(i,e));var e,n,i}));return[Math.ceil(n/100*(e-1)),Math.floor(i/100*(e-1))]}getBinMap(){const t={};for(const e of this.aggregatedBins)t[e.i]=e;return t}_updateMinMaxValues(){let t=0,e=0,n=3402823466e29,i=0;for(const r of this.aggregatedBins)t=t>r.counts?t:r.counts,e=e>r.value?e:r.value,n=n<r.value?n:r.value,i+=r.counts;this.maxCount=t,this.maxValue=e,this.minValue=n,this.totalCount=i}getValueRange(t){if(this.sortedBins||(this.sortedBins=this.aggregatedBins.sort(((t,e)=>pt(t.value,e.value)))),!this.sortedBins.length)return[];let e=0,n=this.sortedBins.length-1;if(Array.isArray(t)){const i=this._percentileToIndex(t);e=i[0],n=i[1]}return[this.sortedBins[e].value,this.sortedBins[n].value]}getValueDomainByScale(t){let[e=0,n=100]=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(this.sortedBins||(this.sortedBins=this.aggregatedBins.sort(((t,e)=>pt(t.value,e.value)))),!this.sortedBins.length)return[];const i=this._percentileToIndex([e,n]);return this._getScaleDomain(t,i)}_getScaleDomain(t,e){let[n,i]=e;const r=this.sortedBins;switch(t){case"quantize":case"linear":default:return[r[n].value,r[i].value];case"quantile":return lt(r.slice(n,i+1),(t=>t.value));case"ordinal":return ct(r,(t=>t.value))}}}var gt=n(61281),mt=n(4896
vendor: 8,424 bytes, line 2
2);const yt=6378e3;function _t(t){return Number.isFinite(t)?t:0}function vt(t,e){const n=t.positions.value;let i,r,o=1/0,s=-1/0,a=1/0,l=-1/0;for(let c=0;c<e;c++)r=n[3*c],i=n[3*c+1],o=i<o?i:o,s=i>s?i:s,a=r<a?r:a,l=r>l?r:l;return{xMin:_t(a),xMax:_t(l),yMin:_t(o),yMax:_t(s)}}function bt(t,e){const n=t<0?-1:1;let i=n<0?Math.abs(t)+e:Math.abs(t);return i=Math.floor(i/e)*e,i*n}function xt(t,e){if(!(!(arguments.length>2&&void 0!==arguments[2])||arguments[2]))return{xOffset:e,yOffset:e};const{yMin:n,yMax:i}=t;return function(t,e){const n=(s=t,s/yt*(180/Math.PI)),i=(r=e,o=t,o/yt*(180/Math.PI)/Math.cos(r*Math.PI/180));var r,o;var s;return{yOffset:n,xOffset:i}}(e,(n+i)/2)}function wt(t,e,n,r){const o=xt(t,e,r!==mt.rf.CARTESIAN),s=function(t,e,n,r){const{width:o,height:s}=r,a=n===mt.rf.CARTESIAN?[-o/2,-s/2]:[-180,-90];i.A.assert(n===mt.rf.CARTESIAN||n===mt.rf.LNGLAT||n===mt.rf.DEFAULT);const{xMin:l,yMin:c}=t;return[-1*(bt(l-a[0],e.xOffset)+a[0]),-1*(bt(c-a[1],e.yOffset)+a[1])]}(t,o,r,n),{xMin:a,yMin:l,xMax:c,yMax:u}=t,h=c-a+o.xOffset,d=u-l+o.yOffset;return{gridOffset:o,translation:s,width:h,height:d,numCol:Math.ceil(h/o.xOffset),numRow:Math.ceil(d/o.yOffset)}}function Et(t,e){const n=function(t,e){const{data:n=[],cellSize:i}=t,{attributes:r,viewport:o,projectPoints:s,numInstances:a}=e,l=r.positions.value,{size:c}=r.positions.getAccessor(),u=e.boundingBox||function(t,e){const n=t.value,{size:i}=t.getAccessor();let r,o,s=1/0,a=-1/0,l=1/0,c=-1/0;for(let u=0;u<e;u++)o=n[u*i],r=n[u*i+1],Number.isFinite(o)&&Number.isFinite(r)&&(s=r<s?r:s,a=r>a?r:a,l=o<l?o:l,c=o>c?o:c);return{xMin:l,xMax:c,yMin:s,yMax:a}}(r.positions,a),h=e.posOffset||[180,90],d=e.gridOffset||xt(u,i);if(d.xOffset<=0||d.yOffset<=0)return{gridHash:{},gridOffset:d,offsets:[0,0]};const{width:p,height:f}=o,A=Math.ceil(p/d.xOffset),g=Math.ceil(f/d.yOffset),m={},{iterable:y,objectInfo:_}=(0,gt.X)(n),v=new Array(3);for(const b of y){_.index++,v[0]=l[_.index*c],v[1]=l[_.index*c+1],v[2]=c>=3?l[_.index*c+2]:0;const[t,e]=s?o.project(v):v;if(Number.isFinite(t)&&Number.isFinite(e)){const n=Math.floor((e+h[1])/d.yOffset),i=Math.floor((t+h[0])/d.xOffset);if(!s||i>=0&&i<A&&n>=0&&n<g){const t=`${n}-${i}`;m[t]=m[t]||{count:0,points:[],lonIdx:i,latIdx:n},m[t].count+=1,m[t].points.push({source:b,index:_.index})}}}return{gridHash:m,gridOffset:d,offsets:[-1*h[0],-1*h[1]]}}(t,e),i=function(t){let{gridHash:e,gridOffset:n,offsets:i}=t;const r=new Array(Object.keys(e).length);let o=0;for(const s in e){const t=s.split("-"),a=parseInt(t[0],10),l=parseInt(t[1],10),c=o++;r[c]={index:c,position:[i[0]+n.xOffset*l,i[1]+n.yOffset*a],...e[s]}}return r}(n);return{gridHash:n.gridHash,gridOffset:n.gridOffset,data:i}}class Ct extends Y{initializeAggregationLayer(t){let{dimensions:e}=t;super.initializeAggregationLayer(e),this.setState({layerData:{},gpuGridAggregator:new D(this.context.device,{id:`${this.id}-gpu-aggregator`}),cpuGridAggregator:Et})}updateState(t){super.updateState(t),this.updateAggregationState(t);const{aggregationDataDirty:e,aggregationWeightsDirty:n,gpuAggregation:i}=this.state;if(this.getNumInstances()<=0)return;let r=!1;(e||i&&n)&&(this._updateAggregation(t),r=!0),i||!e&&!n||(this._updateWeightBins(),this._uploadAggregationResults(),r=!0),this.setState({aggregationDirty:r})}finalizeState(t){const{count:e}=this.state.weights;e&&e.aggregationBuffer&&e.aggregationBuffer.delete(),this.state.gpuGridAggregator?.delete(),super.finalizeState(t)}updateShaders(t){this.state.gpuAggregation&&this.state.gpuGridAggregator.updateShaders(t)}updateAggregationState(t){i.A.assert(!1)}allocateResources(t,e){if(this.state.numRow!==t||this.state.numCol!==e){const n=e*t*4*4,{weights:i}=this.state;for(const t in i){const e=i[t];e.aggregationBuffer&&e.aggregationBuffer.delete(),e.aggregationBuffer=this.context.device.createBuffer({byteLength:n,accessor:{size:4,type:5126,divisor:1}})}}}updateResults(t){let{aggregationData:e,maxMinData:n,maxData:i,minData:r}=t;const{count:o}=this.state.weights;o&&(o.aggregationData=e,o.maxMinData=n,o.maxData=i,o.minData=r)}_updateAggregation(t){const{cpuGridAggregator:e,gpuGridAggregator:n,gridOffset:i,posOffset:r,translation:o=[0,0],scaling:s=[0,0,0],boundingBox:a,projectPoints:l,gpuAggregation:c,numCol:u,numRow:h}=this.state,{props:d}=t,{viewport:p}=this.context,f=this.getAttributes(),A=this.getNumInstances();if(c){const{weights:t}=this.state;n.run({weights:t,cellSize:[i.xOffset,i.yOffset],numCol:u,numRow:h,translation:o,scaling:s,vertexCount:A,projectPoints:l,attributes:f,moduleSettings:this.getModuleSettings()})}else{const t=e(d,{gridOffset:i,projectPoints:l,attributes:f,viewport:p,posOffset:r,boundingBox:a});this.setState({layerData:t})}}_updateWeightBins(){const{getValue:t}=this.state,e=new At(this.state.layerData.data||[],{getValue:t});this.setState({sortedBins:e})}_uploadAggregationResults(){const{numCol:t,numRow:e}=this.state,{data:n}=this.state.layerData,{aggregatedBins:i,minValue:r,maxValue:o,totalCount:s}=this.state.sortedBins,a=new Float32Array(t*e*4).fill(0);for(const h of i){const{lonIdx:e,latIdx:i}=n[h.i],{value:r,counts:o}=h,s=4*(e+i*t);a[s]=r,a[s+4-1]=o}const l=new Float32Array([o,0,0,r]),c=new Float32Array([o,0,0,s]),u=new Float32Array([r,0,0,s]);this.updateResults({aggregationData:a,maxMinData:l,maxData:c,minData:u})}}Ct.layerName="GridAggregationLayer";const Tt=Ct,St={...q.defaultProps,getPosition:{type:"accessor",value:t=>t.position},getWeight:{type:"accessor",value:1},gpuAggregation:!1,aggregation:"SUM"},Pt="positions",Mt={data:{props:["cellSizePixels"]},weights:{props:["aggregation"],accessors:["getWeight"]}};class It extends Tt{initializeState(){super.initializeAggregationLayer({dimensions:Mt,getCellSize:t=>t.cellSizePixels});const t={count:{size:1,operation:h.SUM,needMax:!0,maxTexture:I(this.context.device,{id:`${this.id}-max-texture`})}};this.setState({supported:!0,projectPoints:!0,weights:t,subLayerData:{attributes:{}},maxTexture:t.count.maxTexture,positionAttributeName:"positions",posOffset:[0,0],translation:[1,-1]});this.getAttributeManager().add({[Pt]:{size:3,accessor:"getPosition",type:"float64",fp64:this.use64bitPositions()},count:{size:3,accessor:"getWeight"}})}shouldUpdateState(t){let{changeFlags:e}=t;return this.state.supported&&e.somethingChanged}updateState(t){super.updateState(t)}renderLayers(){if(!this.state.supported)return[];const{maxTexture:t,numRow:e,numCol:n,weights:i}=this.state,{updateTriggers:r}=this.props,{aggregationBuffer:o}=i.count;return new(this.getSubLayerClass("cells",q))(this.props,this.getSubLayerProps({id:"cell-layer",updateTriggers:r}),{data:{attributes:{instanceCounts:o}},maxTexture:t,numInstances:e*n})}finalizeState(t){super.finalizeState(t);const{aggregationBuffer:e,maxBuffer:n,maxTexture:i}=this.state;e?.delete(),n?.delete(),i?.delete()}getPickingInfo(t){let{info:e}=t;const{index:n}=e;if(n>=0){const{gpuGridAggregator:t,gpuAggregation:i,weights:r}=this.state,o=i?t.getData("count"):r.count;e.object=D.getAggregationData({pixelIndex:n,...o})}return e}updateResults(t){let{aggregationData:e,maxData:n}=t;const{count:i}=this.state.weights;i.aggregationData=e,i.aggregationBuffer.write(e),i.maxData=n,i.maxTexture.setImageData({data:n})}updateAggregationState(t){const e=t.props.cellSizePixels,n=t.oldProps.cellSizePixels!==e,{viewportChanged:r}=t.changeFlags;let o=t.props.gpuAggregation;this.state.gpuAggregation!==t.props.gpuAggregation&&o&&!D.isSupported(this.context.device)&&(i.A.warn("GPU Grid Aggregation not supported, falling back to CPU")(),o=!1);const s=o!==this.state.gpuAggregation;this.setState({gpuAggregation:o});const a=this.isAttributeChanged(Pt),{dimensions:l}=this.state,{data:c,weights:u}=l,h=a||s||r||this.isAggregationDirty(t,{compareAll:o,dimension:c}),d=this.isAggregationDirty(t,{dimension:u});this.setState({aggregationDataDirty:h,aggregationWeightsDirty:d});const{viewport:p}=this.context;if(r||n){const{width:t,height:n}=p,i=Math.ceil(t/e),r=Math.ceil(n/e);this.allocateResources(r,i),this.setState({scaling:[t/2,-n/2,1],gridOffset:{xOffset:e,yOffset:e},width:t,height:n,numCol:i,numRow:r})}d&&this._updateAccessors(t),(h||d)&&this._resetResults()}_updateAccessors(t){const{getWeight:e,aggregation:n,data:i}=t.props,{count:r}=this.state.weights;r&&(r.getWeight=e,r.operation=h[n]),this.setState({getValue:A(n,e,{data:i})})}_resetResults(){const{count:t}=this.state.weights;t&&(t.aggregationData=null)}}It.layerName="ScreenGridLayer",It.defaultProps=St;const Bt=It;var Rt=n(
297650
vendor: 8,945 bytes, line 2
2);function Lt(){}const Ot=["getBins","getDomain","getScaleFunc"],Dt=[{key:"fillColor",accessor:"getFillColor",pickingInfo:"colorValue",getBins:{triggers:{value:{prop:"getColorValue",updateTrigger:"getColorValue"},weight:{prop:"getColorWeight",updateTrigger:"getColorWeight"},aggregation:{prop:"colorAggregation"},filterData:{prop:"_filterData",updateTrigger:"_filterData"}}},getDomain:{triggers:{lowerPercentile:{prop:"lowerPercentile"},upperPercentile:{prop:"upperPercentile"},scaleType:{prop:"colorScaleType"}}},getScaleFunc:{triggers:{domain:{prop:"colorDomain"},range:{prop:"colorRange"}},onSet:{props:"onSetColorDomain"}},nullValue:[0,0,0,0]},{key:"elevation",accessor:"getElevation",pickingInfo:"elevationValue",getBins:{triggers:{value:{prop:"getElevationValue",updateTrigger:"getElevationValue"},weight:{prop:"getElevationWeight",updateTrigger:"getElevationWeight"},aggregation:{prop:"elevationAggregation"},filterData:{prop:"_filterData",updateTrigger:"_filterData"}}},getDomain:{triggers:{lowerPercentile:{prop:"elevationLowerPercentile"},upperPercentile:{prop:"elevationUpperPercentile"},scaleType:{prop:"elevationScaleType"}}},getScaleFunc:{triggers:{domain:{prop:"elevationDomain"},range:{prop:"elevationRange"}},onSet:{props:"onSetElevationDomain"}},nullValue:-1}],kt=t=>t.cellSize;class Ft{constructor(t){this.state={layerData:{data:void 0},dimensions:{}},this.changeFlags={},this.dimensionUpdaters={},this._getCellSize=t.getCellSize||kt,this._getAggregator=t.getAggregator,this._addDimension(t.dimensions||Dt)}static defaultDimensions(){return Dt}updateState(t,e){const{oldProps:n,props:i,changeFlags:r}=t;this.updateGetValueFuncs(n,i,r);const o=this.needsReProjectPoints(n,i,r);let s=!1;if(r.dataChanged||o)this.getAggregatedData(i,e),s=!0;else{(this.getDimensionChanges(n,i,r)||[]).forEach((t=>"function"===typeof t&&t())),s=!0}return this.setState({aggregationDirty:s}),this.state}setState(t){this.state={...this.state,...t}}setDimensionState(t,e){this.setState({dimensions:{...this.state.dimensions,[t]:{...this.state.dimensions[t],...e}}})}normalizeResult(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t.hexagons?{data:t.hexagons,...t}:t.layerData?{data:t.layerData,...t}:t}getAggregatedData(t,e){const n=this._getAggregator(t)(t,e);this.setState({layerData:this.normalizeResult(n)}),this.changeFlags={layerData:!0},this.getSortedBins(t)}updateGetValueFuncs(t,e,n){for(const i in this.dimensionUpdaters){const{value:r,weight:o,aggregation:s}=this.dimensionUpdaters[i].getBins.triggers;let a=e[r.prop];this.needUpdateDimensionStep(this.dimensionUpdaters[i].getBins,t,e,n)&&(a=a?g(a,{data:e.data}):A(e[s.prop],e[o.prop],{data:e.data})),a&&this.setDimensionState(i,{getValue:a})}}needsReProjectPoints(t,e,n){return this._getCellSize(t)!==this._getCellSize(e)||this._getAggregator(t)!==this._getAggregator(e)||n.updateTriggersChanged&&(n.updateTriggersChanged.all||n.updateTriggersChanged.getPosition)}addDimension(t){this._addDimension(t)}_addDimension(){(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).forEach((t=>{const{key:e}=t;this.dimensionUpdaters[e]=this.getDimensionUpdaters(t),this.state.dimensions[e]={getValue:null,domain:null,sortedBins:null,scaleFunc:Lt}}))}getDimensionUpdaters(t){let{key:e,accessor:n,pickingInfo:i,getBins:r,getDomain:o,getScaleFunc:s,nullValue:a}=t;return{key:e,accessor:n,pickingInfo:i,getBins:{updater:this.getDimensionSortedBins.bind(this),...r},getDomain:{updater:this.getDimensionValueDomain.bind(this),...o},getScaleFunc:{updater:this.getDimensionScale.bind(this),...s},attributeAccessor:this.getSubLayerDimensionAttribute(e,a)}}needUpdateDimensionStep(t,e,n,i){return Object.values(t.triggers).some((t=>t.updateTrigger?i.dataChanged||i.updateTriggersChanged&&(i.updateTriggersChanged.all||i.updateTriggersChanged[t.updateTrigger]):e[t.prop]!==n[t.prop]))}getDimensionChanges(t,e,n){const i=[];for(const r in this.dimensionUpdaters){const o=Ot.find((i=>this.needUpdateDimensionStep(this.dimensionUpdaters[r][i],t,e,n)));o&&i.push(this.dimensionUpdaters[r][o].updater.bind(this,e,this.dimensionUpdaters[r]))}return i.length?i:null}getUpdateTriggers(t){const e=t.updateTriggers||{},n={};for(const i in this.dimensionUpdaters){const{accessor:r}=this.dimensionUpdaters[i];n[r]={},Ot.forEach((o=>{Object.values(this.dimensionUpdaters[i][o].triggers).forEach((i=>{let{prop:o,updateTrigger:s}=i;if(s){const t=e[s];"object"!==typeof t||Array.isArray(t)?void 0!==t&&(n[r][o]=t):Object.assign(n[r],t)}else n[r][o]=t[o]}))}))}return n}getSortedBins(t){for(const e in this.dimensionUpdaters)this.getDimensionSortedBins(t,this.dimensionUpdaters[e])}getDimensionSortedBins(t,e){const{key:n}=e,{getValue:i}=this.state.dimensions[n],r=new At(this.state.layerData.data||[],{getValue:i,filterData:t._filterData});this.setDimensionState(n,{sortedBins:r}),this.getDimensionValueDomain(t,e)}getDimensionValueDomain(t,e){const{getDomain:n,key:i}=e,{triggers:{lowerPercentile:r,upperPercentile:o,scaleType:s}}=n,a=this.state.dimensions[i].sortedBins.getValueDomainByScale(t[s.prop],[t[r.prop],t[o.prop]]);this.setDimensionState(i,{valueDomain:a}),this.getDimensionScale(t,e)}getDimensionScale(t,e){const{key:n,getScaleFunc:i,getDomain:r}=e,{domain:o,range:s}=i.triggers,{scaleType:a}=r.triggers,{onSet:l}=i,c=t[s.prop],u=t[o.prop]||this.state.dimensions[n].valueDomain,h=function(t){switch(t){case"quantize":default:return tt;case"linear":return et;case"quantile":return nt;case"ordinal":return ot}}(a&&t[a.prop]),d=h(u,c);"object"===typeof l&&"function"===typeof t[l.props]&&t[l.props](d.domain()),this.setDimensionState(n,{scaleFunc:d})}getSubLayerDimensionAttribute(t,e){return n=>{const{sortedBins:i,scaleFunc:r}=this.state.dimensions[t],o=i.binMap[n.index];if(o&&0===o.counts)return e;const s=o&&o.value,a=r.domain();return s>=a[0]&&s<=a[a.length-1]?r(s):e}}getSubLayerAccessors(t){const e={};for(const n in this.dimensionUpdaters){const{accessor:i}=this.dimensionUpdaters[n];e[i]=this.getSubLayerDimensionAttribute(t,n)}return e}getPickingInfo(t){let{info:e}=t;let n=null;if(e.picked&&e.index>-1){const t=this.state.layerData.data[e.index],i={};for(const e in this.dimensionUpdaters){const{pickingInfo:n}=this.dimensionUpdaters[e],{sortedBins:r}=this.state.dimensions[e],o=r.binMap[t.index]&&r.binMap[t.index].value;i[n]=o}n=Object.assign(i,t,{points:t.filteredPoints||t.points})}return e.picked=Boolean(n),e.object=n,e}getAccessor(t){return this.dimensionUpdaters.hasOwnProperty(t)?this.dimensionUpdaters[t].attributeAccessor:Lt}}function Nt(){}const zt={colorDomain:null,colorRange:z,getColorValue:{type:"accessor",value:null},getColorWeight:{type:"accessor",value:1},colorAggregation:"SUM",lowerPercentile:{type:"number",min:0,max:100,value:0},upperPercentile:{type:"number",min:0,max:100,value:100},colorScaleType:"quantize",onSetColorDomain:Nt,elevationDomain:null,elevationRange:[0,1e3],getElevationValue:{type:"accessor",value:null},getElevationWeight:{type:"accessor",value:1},elevationAggregation:"SUM",elevationLowerPercentile:{type:"number",min:0,max:100,value:0},elevationUpperPercentile:{type:"number",min:0,max:100,value:100},elevationScale:{type:"number",min:0,value:1},elevationScaleType:"linear",onSetElevationDomain:Nt,gridAggregator:Et,cellSize:{type:"number",min:0,max:1e3,value:1e3},coverage:{type:"number",min:0,max:1,value:1},getPosition:{type:"accessor",value:t=>t.position},extruded:!1,material:!0,_filterData:{type:"function",value:null,optional:!0}};class Ut extends Y{initializeState(){const t=new Ft({getAggregator:t=>t.gridAggregator,getCellSize:t=>t.cellSize});this.state={cpuAggregator:t,aggregatorState:t.state};this.getAttributeManager().add({positions:{size:3,type:"float64",accessor:"getPosition"}})}updateState(t){super.updateState(t),this.setState({aggregatorState:this.state.cpuAggregator.updateState(t,{viewport:this.context.viewport,attributes:this.getAttributes(),numInstances:this.getNumInstances()})})}getPickingInfo(t){let{info:e}=t;return this.state.cpuAggregator.getPickingInfo({info:e})}_onGetSublayerColor(t){return this.state.cpuAggregator.getAccessor("fillColor")(t)}_onGetSublayerElevation(t){return this.state.cpuAggregator.getAccessor("elevation")(t)}_getSublayerUpdateTriggers(){return this.state.cpuAggregator.getUpdateTriggers(this.props)}renderLayers(){const{elevationScale:t,extruded:e,cellSize:n,coverage:i,material:r,transitions:o}=this.props,{cpuAggregator:s}=this.state,a=this.getSubLayerClass("grid-cell",Rt.A),l=this._getSublayerUpdateTriggers();return new a({cellSize:n,coverage:i,material:r,elevationScale:t,extruded:e,getFillColor:this._onGetSublayerColor.bind(this),getElevation:this._onGetSublayerElevation.bind(this),transitions:o&&{getFillColor:o.getColorValue||o.getColorWeight,getElevation:o.getElevationValue||o.getElevationWeight}},this.getSubLayerProps({id:"grid-cell",updateTriggers:l}),{data:s.state.layerData.data})}}Ut.layerName="CPUGridLayer",Ut.defaultProps=zt;const Gt=Ut;var Vt=n(8
vendor: 5,517 bytes, line 2
26044),jt=Math.PI/3,Ht=[0,jt,2*jt,3*jt,4*jt,5*jt];function Wt(t){return t[0]}function qt(t){return t[1]}function Zt(){}const Xt={colorDomain:null,colorRange:z,getColorValue:{type:"accessor",value:null},getColorWeight:{type:"accessor",value:1},colorAggregation:"SUM",lowerPercentile:{type:"number",value:0,min:0,max:100},upperPercentile:{type:"number",value:100,min:0,max:100},colorScaleType:"quantize",onSetColorDomain:Zt,elevationDomain:null,elevationRange:[0,1e3],getElevationValue:{type:"accessor",value:null},getElevationWeight:{type:"accessor",value:1},elevationAggregation:"SUM",elevationLowerPercentile:{type:"number",value:0,min:0,max:100},elevationUpperPercentile:{type:"number",value:100,min:0,max:100},elevationScale:{type:"number",min:0,value:1},elevationScaleType:"linear",onSetElevationDomain:Zt,radius:{type:"number",value:1e3,min:1},coverage:{type:"number",min:0,max:1,value:1},extruded:!1,hexagonAggregator:function(t,e){const{data:n,radius:r}=t,{viewport:o,attributes:s}=e,a=n.length?function(t,e){const{attributes:n}=e,i=n.positions.value,{size:r}=n.positions.getAccessor();let o,s=1/0,a=1/0,l=-1/0,c=-1/0;for(o=0;o<r*t.length;o+=r){const t=i[o],e=i[o+1];Number.isFinite(t)&&Number.isFinite(e)&&(s=Math.min(t,s),l=Math.max(t,l),a=Math.min(e,a),c=Math.max(e,c))}return[s,a,l,c].every(Number.isFinite)?[(s+l)/2,(a+c)/2]:null}(n,e):null,l=function(t,e,n){const{unitsPerMeter:i}=e.getDistanceScales(n);return t*i[0]}(r,o,a),c=[],{iterable:u,objectInfo:h}=(0,gt.X)(n),d=s.positions.value,{size:p}=s.positions.getAccessor();for(const A of u){h.index++;const t=h.index*p,e=[d[t],d[t+1]];Number.isFinite(e[0])&&Number.isFinite(e[1])?c.push({screenCoord:o.projectFlat(e),source:A,index:h.index}):i.A.warn("HexagonLayer: invalid position")()}const f=function(){var t,e,n,i=0,r=0,o=1,s=1,a=Wt,l=qt;function c(t){var i,r={},o=[],s=t.length;for(i=0;i<s;++i)if(!isNaN(u=+a.call(null,c=t[i],i,t))&&!isNaN(h=+l.call(null,c,i,t))){var c,u,h,d=Math.round(h/=n),p=Math.round(u=u/e-(1&d)/2),f=h-d;if(3*Math.abs(f)>1){var A=u-p,g=p+(u<p?-1:1)/2,m=d+(h<d?-1:1),y=u-g,_=h-m;A*A+f*f>y*y+_*_&&(p=g+(1&d?1:-1)/2,d=m)}var v=p+"-"+d,b=r[v];b?b.push(c):(o.push(b=r[v]=[c]),b.x=(p+(1&d)/2)*e,b.y=d*n)}return o}function u(t){var e=0,n=0;return Ht.map((function(i){var r=Math.sin(i)*t,o=-Math.cos(i)*t,s=r-e,a=o-n;return e=r,n=o,[s,a]}))}return c.hexagon=function(e){return"m"+u(null==e?t:+e).join("l")+"z"},c.centers=function(){for(var a=[],l=Math.round(r/n),c=Math.round(i/e),u=l*n;u<s+t;u+=n,++l)for(var h=c*e+(1&l)*e/2;h<o+e/2;h+=e)a.push([h,u]);return a},c.mesh=function(){var e=u(t).slice(0,4).join("l");return c.centers().map((function(t){return"M"+t+"m"+e})).join("")},c.x=function(t){return arguments.length?(a=t,c):a},c.y=function(t){return arguments.length?(l=t,c):l},c.radius=function(i){return arguments.length?(e=2*(t=+i)*Math.sin(jt),n=1.5*t,c):t},c.size=function(t){return arguments.length?(i=r=0,o=+t[0],s=+t[1],c):[o-i,s-r]},c.extent=function(t){return arguments.length?(i=+t[0][0],r=+t[0][1],o=+t[1][0],s=+t[1][1],c):[[i,r],[o,s]]},c.radius(1)}().radius(l).x((t=>t.screenCoord[0])).y((t=>t.screenCoord[1]));return{hexagons:f(c).map(((t,e)=>({position:o.unprojectFlat([t.x,t.y]),points:t,index:e}))),radiusCommon:l}},getPosition:{type:"accessor",value:t=>t.position},material:!0,_filterData:{type:"function",value:null,optional:!0}};class Kt extends Y{initializeState(){const t=new Ft({getAggregator:t=>t.hexagonAggregator,getCellSize:t=>t.radius});this.state={cpuAggregator:t,aggregatorState:t.state,vertices:null};this.getAttributeManager().add({positions:{size:3,type:"float64",accessor:"getPosition"}})}updateState(t){if(super.updateState(t),t.changeFlags.propsOrDataChanged){const e=this.state.cpuAggregator.updateState(t,{viewport:this.context.viewport,attributes:this.getAttributes()});if(this.state.aggregatorState.layerData!==e.layerData){const{hexagonVertices:t}=e.layerData||{};this.setState({vertices:t&&this.convertLatLngToMeterOffset(t)})}this.setState({aggregatorState:e})}}convertLatLngToMeterOffset(t){const{viewport:e}=this.context;if(Array.isArray(t)&&6===t.length){const n=t[0],i=t[3],r=[(n[0]+i[0])/2,(n[1]+i[1])/2],o=e.projectFlat(r),{metersPerUnit:s}=e.getDistanceScales(r);return t.map((t=>{const n=e.projectFlat(t);return[(n[0]-o[0])*s[0],(n[1]-o[1])*s[1]]}))}return i.A.error("HexagonLayer: hexagonVertices needs to be an array of 6 points")(),null}getPickingInfo(t){let{info:e}=t;return this.state.cpuAggregator.getPickingInfo({info:e})}_onGetSublayerColor(t){return this.state.cpuAggregator.getAccessor("fillColor")(t)}_onGetSublayerElevation(t){return this.state.cpuAggregator.getAccessor("elevation")(t)}_getSublayerUpdateTriggers(){return this.state.cpuAggregator.getUpdateTriggers(this.props)}renderLayers(){const{elevationScale:t,extruded:e,coverage:n,material:i,transitions:r}=this.props,{aggregatorState:o,vertices:s}=this.state,a=this.getSubLayerClass("hexagon-cell",Vt.A),l=this._getSublayerUpdateTriggers();return new a({...s?{vertices:s,radius:1}:{radius:o.layerData.radiusCommon||1,radiusUnits:"common",angle:90},diskResolution:6,elevationScale:t,extruded:e,coverage:n,material:i,getFillColor:this._onGetSublayerColor.bind(this),getElevation:this._onGetSublayerElevation.bind(this),transitions:r&&{getFillColor:r.getColorValue||r.getColorWeight,getElevation:r.getElevationValue||r.getElevationWeight}},this.getSubLayerProps({id:"hexagon-cell",updateTriggers:l}),{data:o.layerData.data})}}Kt.layerName="HexagonLayer",Kt.defaultProps=Xt;const Qt=Kt;var Jt=n(55296),Yt=n(56605
vendor: 9,230 bytes, line 2
2);const $t=.5,te=1/6,ee={N:[0,$t],E:[$t,0],S:[0,-.5],W:[-.5,0],NE:[$t,$t],NW:[-.5,$t],SE:[$t,-.5],SW:[-.5,-.5]},ne=[ee.W,ee.SW,ee.S],ie=[ee.S,ee.SE,ee.E],re=[ee.E,ee.NE,ee.N],oe=[ee.NW,ee.W,ee.N],se=[[-.5,te],[-.5,-te],[-te,-.5],[te,-.5]],ae=[[-te,-.5],[te,-.5],[$t,-te],[$t,te]],le=[[$t,-te],[$t,te],[te,$t],[-te,$t]],ce=[[-.5,te],[-.5,-te],[te,$t],[-te,$t]],ue=[ee.W,ee.SW,ee.SE,ee.E],he=[ee.S,ee.SE,ee.NE,ee.N],de=[ee.NW,ee.W,ee.E,ee.NE],pe=[ee.NW,ee.SW,ee.S,ee.N],fe=[[-.5,te],[-.5,-te],[$t,-te],[$t,te]],Ae=[[-te,-.5],[te,-.5],[te,$t],[-te,$t]],ge=[ee.NW,ee.SW,ee.SE,ee.NE],me=[ee.NW,ee.SW,ee.SE,ee.E,ee.N],ye=[ee.W,ee.SW,ee.SE,ee.NE,ee.N],_e=[ee.NW,ee.W,ee.S,ee.SE,ee.NE],ve=[ee.NW,ee.SW,ee.S,ee.E,ee.NE],be=[ee.NW,ee.W,[$t,-te],[$t,te],ee.N],xe=[[-te,-.5],[te,-.5],ee.E,ee.NE,ee.N],we=[[-.5,te],[-.5,-te],ee.S,ee.SE,ee.E],Ee=[ee.W,ee.SW,ee.S,[te,$t],[-te,$t]],Ce=[ee.NW,ee.W,[-te,-.5],[te,-.5],ee.N],Te=[[-.5,te],[-.5,-te],ee.E,ee.NE,ee.N],Se=[ee.S,ee.SE,ee.E,[te,$t],[-te,$t]],Pe=[ee.W,ee.SW,ee.S,[$t,-te],[$t,te]],Me=[ee.W,ee.SW,ee.SE,ee.E,[te,$t],[-te,$t]],Ie=[[-.5,te],[-.5,-te],ee.S,ee.SE,ee.NE,ee.N],Be=[ee.NW,ee.W,[-te,-.5],[te,-.5],ee.E,ee.NE],Re=[ee.NW,ee.SW,ee.S,[$t,-te],[$t,te],ee.N],Le=[ee.W,ee.SW,ee.S,ee.E,ee.NE,ee.N],Oe=[ee.NW,ee.W,ee.S,ee.SE,ee.E,ee.N],De=[[-.5,te],[-.5,-te],[-te,-.5],[te,-.5],ee.E,ee.NE,ee.N],ke=[ee.W,ee.SW,ee.S,[$t,-te],[$t,te],[te,$t],[-te,$t]],Fe=[ee.NW,ee.W,[-te,-.5],[te,-.5],[$t,-te],[$t,te],ee.N],Ne=[[-.5,te],[-.5,-te],ee.S,ee.SE,ee.E,[te,$t],[-te,$t]],ze=[[-.5,te],[-.5,-te],[-te,-.5],[te,-.5],[$t,-te],[$t,te],[te,$t],[-te,$t]],Ue={0:[],1:[[ee.W,ee.S]],2:[[ee.S,ee.E]],3:[[ee.W,ee.E]],4:[[ee.N,ee.E]],5:{0:[[ee.W,ee.S],[ee.N,ee.E]],1:[[ee.W,ee.N],[ee.S,ee.E]]},6:[[ee.N,ee.S]],7:[[ee.W,ee.N]],8:[[ee.W,ee.N]],9:[[ee.N,ee.S]],10:{0:[[ee.W,ee.N],[ee.S,ee.E]],1:[[ee.W,ee.S],[ee.N,ee.E]]},11:[[ee.N,ee.E]],12:[[ee.W,ee.E]],13:[[ee.S,ee.E]],14:[[ee.W,ee.S]],15:[]};function Ge(t){return parseInt(t,4)}const Ve={[Ge("0000")]:[],[Ge("2222")]:[],[Ge("2221")]:[ne],[Ge("2212")]:[ie],[Ge("2122")]:[re],[Ge("1222")]:[oe],[Ge("0001")]:[ne],[Ge("0010")]:[ie],[Ge("0100")]:[re],[Ge("1000")]:[oe],[Ge("2220")]:[se],[Ge("2202")]:[ae],[Ge("2022")]:[le],[Ge("0222")]:[ce],[Ge("0002")]:[se],[Ge("0020")]:[ae],[Ge("0200")]:[le],[Ge("2000")]:[ce],[Ge("0011")]:[ue],[Ge("0110")]:[he],[Ge("1100")]:[de],[Ge("1001")]:[pe],[Ge("2211")]:[ue],[Ge("2112")]:[he],[Ge("1122")]:[de],[Ge("1221")]:[pe],[Ge("2200")]:[fe],[Ge("2002")]:[Ae],[Ge("0022")]:[fe],[Ge("0220")]:[Ae],[Ge("1111")]:[ge],[Ge("1211")]:[me],[Ge("2111")]:[ye],[Ge("1112")]:[_e],[Ge("1121")]:[ve],[Ge("1011")]:[me],[Ge("0111")]:[ye],[Ge("1110")]:[_e],[Ge("1101")]:[ve],[Ge("1200")]:[be],[Ge("0120")]:[xe],[Ge("0012")]:[we],[Ge("2001")]:[Ee],[Ge("1022")]:[be],[Ge("2102")]:[xe],[Ge("2210")]:[we],[Ge("0221")]:[Ee],[Ge("1002")]:[Ce],[Ge("2100")]:[Te],[Ge("0210")]:[Se],[Ge("0021")]:[Pe],[Ge("1220")]:[Ce],[Ge("0122")]:[Te],[Ge("2012")]:[Se],[Ge("2201")]:[Pe],[Ge("0211")]:[Me],[Ge("2110")]:[Ie],[Ge("1102")]:[Be],[Ge("1021")]:[Re],[Ge("2011")]:[Me],[Ge("0112")]:[Ie],[Ge("1120")]:[Be],[Ge("1201")]:[Re],[Ge("2101")]:[Le],[Ge("0121")]:[Le],[Ge("1012")]:[Oe],[Ge("1210")]:[Oe],[Ge("0101")]:{0:[ne,re],1:[Le],2:[Le]},[Ge("1010")]:{0:[oe,ie],1:[Oe],2:[Oe]},[Ge("2121")]:{0:[Le],1:[Le],2:[ne,re]},[Ge("1212")]:{0:[Oe],1:[Oe],2:[oe,ie]},[Ge("2120")]:{0:[De],1:[De],2:[se,re]},[Ge("2021")]:{0:[ke],1:[ke],2:[ne,le]},[Ge("1202")]:{0:[Fe],1:[Fe],2:[oe,ae]},[Ge("0212")]:{0:[Ne],1:[Ne],2:[ie,ce]},[Ge("0102")]:{0:[se,re],1:[De],2:[De]},[Ge("0201")]:{0:[ne,le],1:[ke],2:[ke]},[Ge("1020")]:{0:[oe,ae],1:[Fe],2:[Fe]},[Ge("2010")]:{0:[ie,ce],1:[Ne],2:[Ne]},[Ge("2020")]:{0:[ce,ae],1:[ze],2:[se,le]},[Ge("0202")]:{0:[le,se],1:[ze],2:[ce,ae]}},je={ISO_LINES:1,ISO_BANDS:2},He={zIndex:0,zOffset:.005};function We(t,e){return Array.isArray(e)?t<e[0]?0:t<e[1]?1:2:t>=e?1:0}function qe(t){const{cellWeights:e,x:n,y:r,width:o,height:s}=t;let a=t.threshold;t.thresholdValue&&(i.A.deprecated("thresholdValue","threshold")(),a=t.thresholdValue);const l=n<0,c=n>=o-1,u=r<0,h=r>=s-1,d=l||c||u||h,p={},f={};l||h?f.top=0:(p.top=e[(r+1)*o+n],f.top=We(p.top,a)),c||h?f.topRight=0:(p.topRight=e[(r+1)*o+n+1],f.topRight=We(p.topRight,a)),c||u?f.right=0:(p.right=e[r*o+n+1],f.right=We(p.right,a)),l||u?f.current=0:(p.current=e[r*o+n],f.current=We(p.current,a));const{top:A,topRight:g,right:m,current:y}=f;let _=-1;Number.isFinite(a)&&(_=A<<3|g<<2|m<<1|y),Array.isArray(a)&&(_=A<<6|g<<4|m<<2|y);let v=0;return d||(v=We((p.top+p.topRight+p.right+p.current)/4,a)),{code:_,meanCode:v}}function Ze(t){const{gridOrigin:e,cellSize:n,x:i,y:r,code:o,meanCode:s,type:a=je.ISO_LINES}=t,l={...He,...t.thresholdData};let c=a===je.ISO_BANDS?Ve[o]:Ue[o];Array.isArray(c)||(c=c[s]);const u=l.zIndex*l.zOffset,h=(i+1)*n[0],d=(r+1)*n[1],p=e[0]+h,f=e[1]+d;if(a===je.ISO_BANDS){const t=[];return c.forEach((e=>{const i=[];e.forEach((t=>{const e=p+t[0]*n[0],r=f+t[1]*n[1];i.push([e,r,u])})),t.push(i)})),t}const A=[];return c.forEach((t=>{t.forEach((t=>{const e=p+t[0]*n[0],i=f+t[1]*n[1];A.push([e,i,u])}))})),A}const Xe=[255,255,255,255],Ke={cellSize:{type:"number",min:1,max:1e3,value:1e3},getPosition:{type:"accessor",value:t=>t.position},getWeight:{type:"accessor",value:1},gpuAggregation:!1,aggregation:"SUM",contours:{type:"object",value:[{threshold:1}],optional:!0,compare:3},zOffset:.005},Qe="positions",Je={data:{props:["cellSize"]},weights:{props:["aggregation"],accessors:["getWeight"]}};class Ye extends Tt{initializeState(){super.initializeAggregationLayer({dimensions:Je}),this.setState({contourData:{},projectPoints:!1,weights:{count:{size:1,operation:h.SUM}}});this.getAttributeManager().add({[Qe]:{size:3,accessor:"getPosition",type:"float64",fp64:this.use64bitPositions()},count:{size:3,accessor:"getWeight"}})}updateState(t){super.updateState(t);let e=!1;const{oldProps:n,props:i}=t,{aggregationDirty:r}=this.state;n.contours===i.contours&&n.zOffset===i.zOffset||(e=!0,this._updateThresholdData(t.props)),this.getNumInstances()>0&&(r||e)&&this._generateContours()}renderLayers(){const{contourSegments:t,contourPolygons:e}=this.state.contourData,n=this.getSubLayerClass("lines",Jt.A),i=this.getSubLayerClass("bands",Yt.A);return[t&&t.length>0&&new n(this.getSubLayerProps({id:"lines"}),{data:this.state.contourData.contourSegments,getSourcePosition:t=>t.start,getTargetPosition:t=>t.end,getColor:t=>t.contour.color||Xe,getWidth:t=>t.contour.strokeWidth||1}),e&&e.length>0&&new i(this.getSubLayerProps({id:"bands"}),{data:this.state.contourData.contourPolygons,getPolygon:t=>t.vertices,getFillColor:t=>t.contour.color||Xe})]}updateAggregationState(t){const{props:e,oldProps:n}=t,{cellSize:r,coordinateSystem:o}=e,{viewport:s}=this.context,a=n.cellSize!==r;let l=e.gpuAggregation;this.state.gpuAggregation!==e.gpuAggregation&&l&&!D.isSupported(this.context.device)&&(i.A.warn("GPU Grid Aggregation not supported, falling back to CPU")(),l=!1);const c=l!==this.state.gpuAggregation;this.setState({gpuAggregation:l});const{dimensions:u}=this.state,h=this.isAttributeChanged(Qe),{data:d,weights:p}=u;let{boundingBox:f}=this.state;if(h&&(f=vt(this.getAttributes(),this.getNumInstances()),this.setState({boundingBox:f})),h||a){const{gridOffset:t,translation:e,width:n,height:i,numCol:a,numRow:l}=wt(f,r,s,o);this.allocateResources(l,a),this.setState({gridOffset:t,boundingBox:f,translation:e,posOffset:e.slice(),gridOrigin:[-1*e[0],-1*e[1]],width:n,height:i,numCol:a,numRow:l})}const A=h||c||this.isAggregationDirty(t,{dimension:d,compareAll:l}),g=this.isAggregationDirty(t,{dimension:p});g&&this._updateAccessors(t),(A||g)&&this._resetResults(),this.setState({aggregationDataDirty:A,aggregationWeightsDirty:g})}_updateAccessors(t){const{getWeight:e,aggregation:n,data:i}=t.props,{count:r}=this.state.weights;r&&(r.getWeight=e,r.operation=h[n]),this.setState({getValue:A(n,e,{data:i})})}_resetResults(){const{count:t}=this.state.weights;t&&(t.aggregationData=null)}_generateContours(){const{numCol:t,numRow:e,gridOrigin:n,gridOffset:i,thresholdData:r}=this.state,{count:o}=this.state.weights;let{aggregationData:s}=o;s||(s=o.aggregationBuffer.readSyncWebGL(),o.aggregationData=s);const{cellWeights:a}=D.getCellData({countsData:s}),l=function(t){let{thresholdData:e,cellWeights:n,gridSize:i,gridOrigin:r,cellSize:o}=t;const s=[],a=[],l=i[0],c=i[1];let u=0,h=0;for(const d of e){const{contour:t}=d,{threshold:e}=t;for(let i=-1;i<l;i++)for(let p=-1;p<c;p++){const{code:f,meanCode:A}=qe({cellWeights:n,threshold:e,x:i,y:p,width:l,height:c}),g={type:je.ISO_BANDS,gridOrigin:r,cellSize:o,x:i,y:p,width:l,height:c,code:f,meanCode:A,thresholdData:d};if(Array.isArray(e)){g.type=je.ISO_BANDS;const e=Ze(g);for(const n of e)a[h++]={vertices:n,contour:t}}else{g.type=je.ISO_LINES;const e=Ze(g);for(let n=0;n<e.length;n+=2)s[u++]={start:e[n],end:e[n+1],contour:t}}}}return{contourSegments:s,contourPolygons:a}}({thresholdData:r,cellWeights:a,gridSize:[t,e],gridOrigin:n,cellSize:[i.xOffset,i.yOffset]});this.setState({contourData:l})}_updateThresholdData(t){const{contours:e,zOffset:n}=t,i=e.length,r=new Array(i);for(let o=0;o<i;o++){const t=e[o];r[o]={contour:t,zIndex:t.zIndex||o,zOffset:n}}this.setState({thresholdData:r})}}Ye.layerName="ContourLayer",Ye.defaultProps=Ke;const $e=Ye;var tn=n(6
23351),en=n(48357),nn=n(1883
vendor: 24,179 bytes, line 2
29);const rn={colorDomain:null,colorRange:z,elevationDomain:null,elevationRange:[0,1e3],elevationScale:{type:"number",min:0,value:1},gridSize:{type:"array",value:[1,1]},gridOrigin:{type:"array",value:[0,0]},gridOffset:{type:"array",value:[0,0]},cellSize:{type:"number",min:0,max:1e3,value:1e3},offset:{type:"array",value:[1,1]},coverage:{type:"number",min:0,max:1,value:1},extruded:!0,material:!0};class on extends F.A{getShaders(){return super.getShaders({vs:"#version 300 es\n#define SHADER_NAME gpu-grid-cell-layer-vertex-shader\n#define RANGE_COUNT 6\nin vec3 positions;\nin vec3 normals;\nin vec4 colors;\nin vec4 elevations;\nin vec3 instancePickingColors;\nuniform vec2 offset;\nuniform bool extruded;\nuniform float cellSize;\nuniform float coverage;\nuniform float opacity;\nuniform float elevationScale;\nuniform ivec2 gridSize;\nuniform vec2 gridOrigin;\nuniform vec2 gridOriginLow;\nuniform vec2 gridOffset;\nuniform vec2 gridOffsetLow;\nuniform vec4 colorRange[RANGE_COUNT];\nuniform vec2 elevationRange;\nuniform vec2 colorDomain;\nuniform bool colorDomainValid;\nuniform vec2 elevationDomain;\nuniform bool elevationDomainValid;\nlayout(std140) uniform;\nuniform ColorData\n{\nvec4 maxMinCount;\n} colorData;\nuniform ElevationData\n{\nvec4 maxMinCount;\n} elevationData;\n#define EPSILON 0.00001\nout vec4 vColor;\nvec4 quantizeScale(vec2 domain, vec4 range[RANGE_COUNT], float value) {\nvec4 outColor = vec4(0., 0., 0., 0.);\nif (value >= (domain.x - EPSILON) && value <= (domain.y + EPSILON)) {\nfloat domainRange = domain.y - domain.x;\nif (domainRange <= 0.) {\noutColor = colorRange[0];\n} else {\nfloat rangeCount = float(RANGE_COUNT);\nfloat rangeStep = domainRange / rangeCount;\nfloat idx = floor((value - domain.x) / rangeStep);\nidx = clamp(idx, 0., rangeCount - 1.);\nint intIdx = int(idx);\noutColor = colorRange[intIdx];\n}\n}\nreturn outColor;\n}\nfloat linearScale(vec2 domain, vec2 range, float value) {\nif (value >= (domain.x - EPSILON) && value <= (domain.y + EPSILON)) {\nreturn ((value - domain.x) / (domain.y - domain.x)) * (range.y - range.x) + range.x;\n}\nreturn -1.;\n}\nvoid main(void) {\nvec2 clrDomain = colorDomainValid ? colorDomain : vec2(colorData.maxMinCount.a, colorData.maxMinCount.r);\nvec4 color = quantizeScale(clrDomain, colorRange, colors.r);\nfloat elevation = 0.0;\nif (extruded) {\nvec2 elvDomain = elevationDomainValid ? elevationDomain : vec2(elevationData.maxMinCount.a, elevationData.maxMinCount.r);\nelevation = linearScale(elvDomain, elevationRange, elevations.r);\nelevation = elevation * (positions.z + 1.0) / 2.0 * elevationScale;\n}\nfloat shouldRender = float(color.r > 0.0 && elevations.r >= 0.0);\nfloat dotRadius = cellSize / 2. * coverage * shouldRender;\nint yIndex = (gl_InstanceID / gridSize[0]);\nint xIndex = gl_InstanceID - (yIndex * gridSize[0]);\nvec2 instancePositionXFP64 = mul_fp64(vec2(gridOffset[0], gridOffsetLow[0]), vec2(float(xIndex), 0.));\ninstancePositionXFP64 = sum_fp64(instancePositionXFP64, vec2(gridOrigin[0], gridOriginLow[0]));\nvec2 instancePositionYFP64 = mul_fp64(vec2(gridOffset[1], gridOffsetLow[1]), vec2(float(yIndex), 0.));\ninstancePositionYFP64 = sum_fp64(instancePositionYFP64, vec2(gridOrigin[1], gridOriginLow[1]));\nvec3 centroidPosition = vec3(instancePositionXFP64[0], instancePositionYFP64[0], elevation);\nvec3 centroidPosition64Low = vec3(instancePositionXFP64[1], instancePositionYFP64[1], 0.0);\ngeometry.worldPosition = centroidPosition;\nvec3 pos = vec3(project_size(positions.xy + offset) * dotRadius, 0.);\npicking_setPickingColor(instancePickingColors);\ngl_Position = project_position_to_clipspace(centroidPosition, centroidPosition64Low, pos, geometry.position);\nvec3 normals_commonspace = project_normal(normals);\nif (extruded) {\nvec3 lightColor = lighting_getLightColor(color.rgb, project_uCameraPosition, geometry.position.xyz, normals_commonspace);\nvColor = vec4(lightColor, color.a * opacity) / 255.;\n} else {\nvColor = vec4(color.rgb, color.a * opacity) / 255.;\n}\n}\n",fs:"#version 300 es\n#define SHADER_NAME gpu-grid-cell-layer-fragment-shader\nprecision highp float;\nin vec4 vColor;\nout vec4 fragColor;\nvoid main(void) {\nfragColor = vColor;\nfragColor = picking_filterColor(fragColor);\n}\n",modules:[c.A,tn.K,N.A,a.dI]})}initializeState(){this.getAttributeManager().addInstanced({colors:{size:4,noAlloc:!0},elevations:{size:4,noAlloc:!0}});const t=this._getModel();this._setupUniformBuffer(t),this.setState({model:t})}_getModel(){return new r.K(this.context.device,{...this.getShaders(),id:this.props.id,geometry:new nn.c9,isInstanced:!0})}draw(t){let{uniforms:e}=t;const{cellSize:n,offset:i,extruded:r,elevationScale:o,coverage:s,gridSize:a,gridOrigin:l,gridOffset:c,elevationRange:u,colorMaxMinBuffer:h,elevationMaxMinBuffer:d}=this.props,p=this.state.model,f=[(0,en.qk)(l[0]),(0,en.qk)(l[1])],A=[(0,en.qk)(c[0]),(0,en.qk)(c[1])],g=this.getDomainUniforms(),m=U(this.props.colorRange);this.bindUniformBuffers(h,d),p.setUniforms(e),p.setUniforms(g),p.setUniforms({cellSize:n,offset:i,extruded:r,elevationScale:o,coverage:s,gridSize:a,gridOrigin:l,gridOriginLow:f,gridOffset:c,gridOffsetLow:A,colorRange:m,elevationRange:u}),p.draw(this.context.renderPass),this.unbindUniformBuffers(h,d)}bindUniformBuffers(t,e){t.bind({target:35345,index:0}),e.bind({target:35345,index:1})}unbindUniformBuffers(t,e){t.unbind({target:35345,index:0}),e.unbind({target:35345,index:1})}getDomainUniforms(){const{colorDomain:t,elevationDomain:e}=this.props,n={};return null!==t?(n.colorDomainValid=!0,n.colorDomain=t):n.colorDomainValid=!1,null!==e?(n.elevationDomainValid=!0,n.elevationDomain=e):n.elevationDomainValid=!1,n}_setupUniformBuffer(t){const e=t.pipeline.handle,n=this.context.gl,i=n.getUniformBlockIndex(e,"ColorData"),r=n.getUniformBlockIndex(e,"ElevationData");n.uniformBlockBinding(e,i,0),n.uniformBlockBinding(e,r,1)}}on.layerName="GPUGridCellLayer",on.defaultProps=rn;const sn=on,an={colorDomain:null,colorRange:z,getColorWeight:{type:"accessor",value:1},colorAggregation:"SUM",elevationDomain:null,elevationRange:[0,1e3],getElevationWeight:{type:"accessor",value:1},elevationAggregation:"SUM",elevationScale:{type:"number",min:0,value:1},cellSize:{type:"number",min:1,max:1e3,value:1e3},coverage:{type:"number",min:0,max:1,value:1},getPosition:{type:"accessor",value:t=>t.position},extruded:!1,material:!0},ln={data:{props:["cellSize","colorAggregation","elevationAggregation"]}},cn="positions";class un extends Tt{initializeState(t){let{device:e}=t;const n=D.isSupported(e);n||i.A.error("GPUGridLayer is not supported on this browser, use GridLayer instead")(),super.initializeAggregationLayer({dimensions:ln}),this.setState({gpuAggregation:!1,projectPoints:!1,isSupported:n,weights:{color:{needMin:!0,needMax:!0,combineMaxMin:!0,maxMinBuffer:e.createBuffer({byteLength:16,accessor:{size:4,type:5126,divisor:1}})},elevation:{needMin:!0,needMax:!0,combineMaxMin:!0,maxMinBuffer:e.createBuffer({byteLength:16,accessor:{size:4,type:5126,divisor:1}})}},positionAttributeName:"positions"});this.getAttributeManager().add({[cn]:{size:3,accessor:"getPosition",type:"float64",fp64:this.use64bitPositions()},color:{size:3,accessor:"getColorWeight"},elevation:{size:3,accessor:"getElevationWeight"}})}updateState(t){if(!1===this.state.isSupported)return;super.updateState(t);const{aggregationDirty:e}=this.state;e&&this.setState({gridHash:null})}getHashKeyForIndex(t){const{numRow:e,numCol:n,boundingBox:i,gridOffset:r}=this.state,o=[n,e],s=[i.xMin,i.yMin],a=[r.xOffset,r.yOffset],l=Math.floor(t/o[0]),c=t-l*o[0];return`${Math.floor((l*a[1]+s[1]+90+a[1]/2)/a[1])}-${Math.floor((c*a[0]+s[0]+180+a[0]/2)/a[0])}`}getPositionForIndex(t){const{numRow:e,numCol:n,boundingBox:i,gridOffset:r}=this.state,o=[n,e],s=[i.xMin,i.yMin],a=[r.xOffset,r.yOffset],l=Math.floor(t/o[0]);return[(t-l*o[0])*a[0]+s[0],l*a[1]+s[1]]}getPickingInfo(t){let{info:e,mode:n}=t;const{index:i}=e;let r=null;if(i>=0){const t=this.state.gpuGridAggregator,e=this.getPositionForIndex(i),o=D.getAggregationData({pixelIndex:i,...t.getData("color")}),s=D.getAggregationData({pixelIndex:i,...t.getData("elevation")});if(r={colorValue:o.cellWeight,elevationValue:s.cellWeight,count:o.cellCount||s.cellCount,position:e,totalCount:o.totalCount||s.totalCount},"hover"!==n){const{props:t}=this;let{gridHash:e}=this.state;if(!e){const{gridOffset:n,translation:i,boundingBox:r}=this.state,{viewport:o}=this.context;e=Et(t,{gridOffset:n,attributes:this.getAttributes(),viewport:o,translation:i,boundingBox:r}).gridHash,this.setState({gridHash:e})}const n=e[this.getHashKeyForIndex(i)];Object.assign(r,n)}}return e.picked=Boolean(r),e.object=r,e}renderLayers(){if(!this.state.isSupported)return null;const{elevationScale:t,extruded:e,cellSize:n,coverage:i,material:r,elevationRange:o,colorDomain:s,elevationDomain:a}=this.props,{weights:l,numRow:c,numCol:u,gridOrigin:h,gridOffset:d}=this.state,{color:p,elevation:f}=l,A=U(this.props.colorRange);return new(this.getSubLayerClass("gpu-grid-cell",sn))({gridSize:[u,c],gridOrigin:h,gridOffset:[d.xOffset,d.yOffset],colorRange:A,elevationRange:o,colorDomain:s,elevationDomain:a,cellSize:n,coverage:i,material:r,elevationScale:t,extruded:e},this.getSubLayerProps({id:"gpu-grid-cell"}),{data:{attributes:{colors:p.aggregationBuffer,elevations:f.aggregationBuffer}},colorMaxMinBuffer:p.maxMinBuffer,elevationMaxMinBuffer:f.maxMinBuffer,numInstances:u*c})}finalizeState(t){const{color:e,elevation:n}=this.state.weights;[e,n].forEach((t=>{const{aggregationBuffer:e,maxMinBuffer:n}=t;n?.destroy(),e?.destroy()})),super.finalizeState(t)}updateAggregationState(t){const{props:e,oldProps:n}=t,{cellSize:i,coordinateSystem:r}=e,{viewport:o}=this.context,s=n.cellSize!==i,{dimensions:a}=this.state,l=this.isAttributeChanged(cn),c=l||this.isAttributeChanged();let{boundingBox:u}=this.state;if(l&&(u=vt(this.getAttributes(),this.getNumInstances()),this.setState({boundingBox:u})),l||s){const{gridOffset:t,translation:e,width:n,height:s,numCol:a,numRow:l}=wt(u,i,o,r);this.allocateResources(l,a),this.setState({gridOffset:t,translation:e,gridOrigin:[-1*e[0],-1*e[1]],width:n,height:s,numCol:a,numRow:l})}const h=c||this.isAggregationDirty(t,{dimension:a.data,compareAll:!0});h&&this._updateAccessors(t),this.setState({aggregationDataDirty:h})}_updateAccessors(t){const{colorAggregation:e,elevationAggregation:n}=t.props,{color:i,elevation:r}=this.state.weights;i.operation=h[e],r.operation=h[n]}}un.layerName="GPUGridLayer",un.defaultProps=an;const hn=un,dn={...hn.defaultProps,...Gt.defaultProps,gpuAggregation:!1};class pn extends Z.A{initializeState(){this.state={useGPUAggregation:!1}}updateState(t){let{props:e}=t;this.setState({useGPUAggregation:!1})}renderLayers(){const{data:t,updateTriggers:e}=this.props,n=this.state.useGPUAggregation?"GPU":"CPU";return new(this.state.useGPUAggregation?this.getSubLayerClass("GPU",hn):this.getSubLayerClass("CPU",Gt))(this.props,this.getSubLayerProps({id:n,updateTriggers:e}),{data:t})}canUseGPUAggregation(t){const{gpuAggregation:e,lowerPercentile:n,upperPercentile:i,getColorValue:r,getElevationValue:o,colorScaleType:s}=t;return!!e&&(!!D.isSupported(this.context.device)&&(0===n&&100===i&&(null===r&&null===o&&("quantile"!==s&&"ordinal"!==s))))}}pn.layerName="GridLayer",pn.defaultProps=dn;const fn=pn;const An=new Float32Array(12);function gn(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,n=0;for(const i of t)for(let t=0;t<e;t++)An[n++]=i[t]||0;return An}class mn extends F.A{getShaders(){return{vs:"#version 300 es\n#define SHADER_NAME heatp-map-layer-vertex-shader\nuniform sampler2D maxTexture;\nuniform float intensity;\nuniform vec2 colorDomain;\nuniform float threshold;\nuniform float aggregationMode;\nin vec3 positions;\nin vec2 texCoords;\nout vec2 vTexCoords;\nout float vIntensityMin;\nout float vIntensityMax;\nvoid main(void) {\ngl_Position = project_position_to_clipspace(positions, vec3(0.0), vec3(0.0));\nvTexCoords = texCoords;\nvec4 maxTexture = texture(maxTexture, vec2(0.5));\nfloat maxValue = aggregationMode < 0.5 ? maxTexture.r : maxTexture.g;\nfloat minValue = maxValue * threshold;\nif (colorDomain[1] > 0.) {\nmaxValue = colorDomain[1];\nminValue = colorDomain[0];\n}\nvIntensityMax = intensity / maxValue;\nvIntensityMin = intensity / minValue;\n}\n",fs:"#version 300 es\n#define SHADER_NAME triangle-layer-fragment-shader\nprecision highp float;\nuniform float opacity;\nuniform sampler2D weightsTexture;\nuniform sampler2D colorTexture;\nuniform float aggregationMode;\nin vec2 vTexCoords;\nin float vIntensityMin;\nin float vIntensityMax;\nout vec4 fragColor;\nvec4 getLinearColor(float value) {\nfloat factor = clamp(value * vIntensityMax, 0., 1.);\nvec4 color = texture(colorTexture, vec2(factor, 0.5));\ncolor.a *= min(value * vIntensityMin, 1.0);\nreturn color;\n}\nvoid main(void) {\nvec4 weights = texture(weightsTexture, vTexCoords);\nfloat weight = weights.r;\nif (aggregationMode > 0.5) {\nweight /= max(1.0, weights.a);\n}\nif (weight <= 0.) {\ndiscard;\n}\nvec4 linearColor = getLinearColor(weight);\nlinearColor.a *= opacity;\nfragColor = linearColor;\n}\n",modules:[c.A]}}initializeState(t){let{device:e}=t;this.setState({model:this._getModel(e)})}_getModel(t){const{vertexCount:e,data:n,weightsTexture:i,maxTexture:o,colorTexture:s}=this.props;return new r.K(t,{...this.getShaders(),id:this.props.id,bindings:{weightsTexture:i,maxTexture:o,colorTexture:s},attributes:n.attributes,bufferLayout:[{name:"positions",format:"float32x3"},{name:"texCoords",format:"float32x2"}],topology:"triangle-fan-webgl",vertexCount:e})}draw(t){let{uniforms:e}=t;const{model:n}=this.state,{intensity:i,threshold:r,aggregationMode:o,colorDomain:s}=this.props;n.setUniforms({...e,intensity:i,threshold:r,aggregationMode:o,colorDomain:s}),n.draw(this.context.renderPass)}}mn.layerName="TriangleLayer";const yn=mn,_n="#version 300 es\nin vec3 positions;\nin vec3 positions64Low;\nin float weights;\nout vec4 weightsTexture;\nuniform float radiusPixels;\nuniform float textureWidth;\nuniform vec4 commonBounds;\nuniform float weightsScale;\nvoid main()\n{\nweightsTexture = vec4(weights * weightsScale, 0., 0., 1.);\nfloat radiusTexels = project_pixel_size(radiusPixels) * textureWidth / (commonBounds.z - commonBounds.x);\ngl_PointSize = radiusTexels * 2.;\nvec3 commonPosition = project_position(positions, positions64Low);\ngl_Position.xy = (commonPosition.xy - commonBounds.xy) / (commonBounds.zw - commonBounds.xy) ;\ngl_Position.xy = (gl_Position.xy * 2.) - (1.);\ngl_Position.w = 1.0;\n}\n",vn="#version 300 es\nin vec4 weightsTexture;\nout vec4 fragColor;\nfloat gaussianKDE(float u){\nreturn pow(2.71828, -u*u/0.05555)/(1.77245385*0.166666);\n}\nvoid main()\n{\nfloat dist = length(gl_PointCoord - vec2(0.5, 0.5));\nif (dist > 0.5) {\ndiscard;\n}\nfragColor = weightsTexture * gaussianKDE(2. * dist);\nDECKGL_FILTER_COLOR(fragColor, geometry);\n}\n",bn={format:"rgba8unorm",mipmaps:!1,sampler:{minFilter:"linear",magFilter:"linear",addressModeU:"clamp-to-edge",addressModeV:"clamp-to-edge"}},xn=[0,0],wn={SUM:0,MEAN:1},En={getPosition:{type:"accessor",value:t=>t.position},getWeight:{type:"accessor",value:1},intensity:{type:"number",min:0,value:1},radiusPixels:{type:"number",min:1,max:100,value:50},colorRange:z,threshold:{type:"number",min:0,max:1,value:.05},colorDomain:{type:"array",value:null,optional:!0},aggregation:"SUM",weightsTextureSize:{type:"number",min:128,max:2048,value:2048},debounceTimeout:{type:"number",min:0,max:1e3,value:500}},Cn=["float32-renderable-webgl","texture-blend-float-webgl"],Tn={data:{props:["radiusPixels"]}};class Sn extends Y{initializeState(){super.initializeAggregationLayer(Tn),this.setState({colorDomain:xn}),this._setupTextureParams(),this._setupAttributes(),this._setupResources()}shouldUpdateState(t){let{changeFlags:e}=t;return e.somethingChanged}updateState(t){super.updateState(t),this._updateHeatmapState(t)}_updateHeatmapState(t){const{props:e,oldProps:n}=t,i=this._getChangeFlags(t);(i.dataChanged||i.viewportChanged)&&(i.boundsChanged=this._updateBounds(i.dataChanged),this._updateTextureRenderingBounds()),i.dataChanged||i.boundsChanged?(clearTimeout(this.state.updateTimer),this.setState({isWeightMapDirty:!0})):i.viewportZoomChanged&&this._debouncedUpdateWeightmap(),e.colorRange!==n.colorRange&&this._updateColorTexture(t),this.state.isWeightMapDirty&&this._updateWeightmap(),this.setState({zoom:t.context.viewport.zoom})}renderLayers(){const{weightsTexture:t,triPositionBuffer:e,triTexCoordBuffer:n,maxWeightsTexture:i,colorTexture:r,colorDomain:o}=this.state,{updateTriggers:s,intensity:a,threshold:l,aggregation:c}=this.props;return new(this.getSubLayerClass("triangle",yn))(this.getSubLayerProps({id:"triangle-layer",updateTriggers:s}),{coordinateSystem:mt.rf.DEFAULT,data:{attributes:{positions:e,texCoords:n}},vertexCount:4,maxTexture:i,colorTexture:r,aggregationMode:wn[c]||0,weightsTexture:t,intensity:a,threshold:l,colorDomain:o})}finalizeState(t){super.finalizeState(t);const{weightsTransform:e,weightsTexture:n,maxWeightTransform:i,maxWeightsTexture:r,triPositionBuffer:o,triTexCoordBuffer:s,colorTexture:a,updateTimer:l}=this.state;e?.destroy(),n?.destroy(),i?.destroy(),r?.destroy(),o?.destroy(),s?.destroy(),a?.destroy(),l&&clearTimeout(l)}_getAttributeManager(){return new K.A(this.context.device,{id:this.props.id,stats:this.context.stats})}_getChangeFlags(t){const e={},{dimensions:n}=this.state;e.dataChanged=this.isAttributeChanged()?"attribute changed":this.isAggregationDirty(t,{compareAll:!0,dimension:n.data})&&"aggregation is dirty",e.viewportChanged=t.changeFlags.viewportChanged;const{zoom:i}=this.state;return t.context.viewport&&t.context.viewport.zoom===i||(e.viewportZoomChanged=!0),e}_createTextures(){const{textureSize:t,format:e}=this.state;this.setState({weightsTexture:this.context.device.createTexture({...bn,width:t,height:t,format:e}),maxWeightsTexture:this.context.device.createTexture({...bn,width:1,height:1,format:e})})}_setupAttributes(){this.getAttributeManager().add({positions:{size:3,type:"float64",accessor:"getPosition"},weights:{size:1,accessor:"getWeight"}}),this.setState({positionAttributeName:"positions"})}_setupTextureParams(){const{device:t}=this.context,{weightsTextureSize:e}=this.props,n=Math.min(e,t.limits.maxTextureDimension2D),r=Cn.every((e=>t.features.has(e))),o=r?"rgba32float":"rgba8unorm",s=r?1:1/255;this.setState({textureSize:n,format:o,weightsScale:s}),r||i.A.warn(`HeatmapLayer: ${this.id} rendering to float texture not supported, falling back to low precision format`)()}_createWeightsTransform(t){let{weightsTransform:e}=this.state;const{weightsTexture:n}=this.state,i=this.getAttributeManager();e?.destroy(),e=new s(this.context.device,{id:`${this.id}-weights-transform`,bufferLayout:i.getBufferLayouts(),vertexCount:1,targetTexture:n,parameters:{depthWriteEnabled:!1,blendColorOperation:"add",blendColorSrcFactor:"one",blendColorDstFactor:"one",blendAlphaSrcFactor:"one",blendAlphaDstFactor:"one"},topology:"point-list",...t}),this.setState({weightsTransform:e})}_setupResources(){this._createTextures();const{device:t}=this.context,{textureSize:e,weightsTexture:n,maxWeightsTexture:i}=this.state,r=this.getShaders({vs:_n,fs:vn});this._createWeightsTransform(r);const o=this.getShaders({vs:"#version 300 es\nuniform sampler2D inTexture;\nuniform float textureSize;\nout vec4 outTexture;\nvoid main()\n{\nint yIndex = gl_VertexID / int(textureSize);\nint xIndex = gl_VertexID - (yIndex * int(textureSize));\nvec2 uv = (0.5 + vec2(float(xIndex), float(yIndex))) / textureSize;\noutTexture = texture(inTexture, uv);\ngl_Position = vec4(0.0, 0.0, 0.0, 1.0);\ngl_PointSize = 1.0;\n}\n",fs:"#version 300 es\nin vec4 outTexture;\nout vec4 fragColor;\nvoid main() {\nfragColor = outTexture;\nfragColor.g = outTexture.r / max(1.0, outTexture.a);\n}\n"}),a=new s(t,{id:`${this.id}-max-weights-transform`,bindings:{inTexture:n},uniforms:{textureSize:e},targetTexture:i,...o,vertexCount:e*e,topology:"point-list",parameters:{depthWriteEnabled:!1,blendColorOperation:"max",blendAlphaOperation:"max",blendColorSrcFactor:"one",blendColorDstFactor:"one",blendAlphaSrcFactor:"one",blendAlphaDstFactor:"one"}});this.setState({weightsTexture:n,maxWeightsTexture:i,maxWeightTransform:a,zoom:null,triPositionBuffer:t.createBuffer({byteLength:48}),triTexCoordBuffer:t.createBuffer({byteLength:48})})}updateShaders(t){this._createWeightsTransform({vs:_n,fs:vn,...t})}_updateMaxWeightValue(){const{maxWeightTransform:t}=this.state;t.run({parameters:{viewport:[0,0,1,1]},clearColor:[0,0,0,0]})}_updateBounds(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const{viewport:e}=this.context,n=[e.unproject([0,0]),e.unproject([e.width,0]),e.unproject([e.width,e.height]),e.unproject([0,e.height])].map((t=>t.map(Math.fround))),i=function(t){const e=t.map((t=>t[0])),n=t.map((t=>t[1])),i=Math.min.apply(null,e),r=Math.max.apply(null,e);return[i,Math.min.apply(null,n),r,Math.max.apply(null,n)]}(n),r={visibleWorldBounds:i,viewportCorners:n};let o=!1;if(t||!this.state.worldBounds||(s=this.state.worldBounds,!((a=i)[0]>=s[0]&&a[2]<=s[2]&&a[1]>=s[1]&&a[3]<=s[3]))){const t=this._worldToCommonBounds(i),e=this._commonToWorldBounds(t);this.props.coordinateSystem===mt.rf.LNGLAT&&(e[1]=Math.max(e[1],-85.051129),e[3]=Math.min(e[3],85.051129),e[0]=Math.max(e[0],-360),e[2]=Math.min(e[2],360));const n=this._worldToCommonBounds(e);r.worldBounds=e,r.normalizedCommonBounds=n,o=!0}var s,a;return this.setState(r),o}_updateTextureRenderingBounds(){const{triPositionBuffer:t,triTexCoordBuffer:e,normalizedCommonBounds:n,viewportCorners:i}=this.state,{viewport:r}=this.context;t.write(gn(i,3));const o=i.map((t=>function(t,e){const[n,i,r,o]=e;return[(t[0]-n)/(r-n),(t[1]-i)/(o-i)]}(r.projectPosition(t),n)));e.write(gn(o,2))}_updateColorTexture(t){const{colorRange:e}=t.props;let{colorTexture:n}=this.state;const i=U(e,!1,Uint8Array);n&&n?.width===e.length?n.setSubImageData({data:i}):(n?.destroy(),n=this.context.device.createTexture({...bn,data:i,width:e.length,height:1})),this.setState({colorTexture:n})}_updateWeightmap(){const{radiusPixels:t,colorDomain:e,aggregation:n}=this.props,{worldBounds:i,textureSize:r,weightsScale:o}=this.state,s=this.state.weightsTransform;this.state.isWeightMapDirty=!1;const a=this._worldToCommonBounds(i,{useLayerCoordinateSystem:!0});if(e&&"SUM"===n){const{viewport:t}=this.context,n=t.distanceScales.metersPerUnit[2]*(a[2]-a[0])/r;this.state.colorDomain=e.map((t=>t*n*o))}else this.state.colorDomain=e||xn;const l=this.getAttributeManager().getAttributes(),c=this.getModuleSettings(),u={radiusPixels:t,commonBounds:a,textureWidth:r,weightsScale:o};this._setModelAttributes(s.model,l),s.model.setVertexCount(this.getNumInstances()),s.model.setUniforms(u),s.model.updateModuleSettings(c),s.run({parameters:{viewport:[0,0,r,r]},clearColor:[0,0,0,0]}),this._updateMaxWeightValue()}_debouncedUpdateWeightmap(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],{updateTimer:e}=this.state;const{debounceTimeout:n}=this.props;t?(e=null,this._updateBounds(!0),this._updateTextureRenderingBounds(),this.setState({isWeightMapDirty:!0})):(this.setState({isWeightMapDirty:!1}),clearTimeout(e),e=setTimeout(this._debouncedUpdateWeightmap.bind(this,!0),n)),this.setState({updateTimer:e})}_worldToCommonBounds(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{useLayerCoordinateSystem:n=!1}=e,[i,r,o,s]=t,{viewport:a}=this.context,{textureSize:l}=this.state,{coordinateSystem:c}=this.props,u=n&&(c===mt.rf.LNGLAT_OFFSETS||c===mt.rf.METER_OFFSETS),h=u?a.projectPosition(this.props.coordinateOrigin):[0,0],d=2*l/a.scale;let p,f;return n&&!u?(p=this.projectPosition([i,r,0]),f=this.projectPosition([o,s,0])):(p=a.projectPosition([i,r,0]),f=a.projectPosition([o,s,0])),function(t,e,n){const[i,r,o,s]=t,a=o-i,l=s-r;let c=a,u=l;a/l<e/n?c=e/n*l:u=n/e*a,c<e&&(c=e,u=n);const h=(o+i)/2,d=(s+r)/2;return[h-c/2,d-u/2,h+c/2,d+u/2]}([p[0]-h[0],p[1]-h[1],f[0]-h[0],f[1]-h[1]],d,d)}_commonToWorldBounds(t){const[e,n,i,r]=t,{viewport:o}=this.context,s=o.unprojectPosition([e,n]),a=o.unprojectPosition([i,r]);return s.slice(0,2).concat(a.slice(0,2))}}Sn.layerName="HeatmapLayer",Sn.defaultProps=En;const Pn=Sn},
vendor: 7,653 bytes, line 2
271279:(t,e,n)=>{"use strict";n.d(e,{bE:()=>De});var i=n(94514),r=n(67099),o=n(78477),s=n(78547),a=n(67440),l=n(89522);n(30765);const c=[0x5555555555555555n,0x3333333333333333n,0x0f0f0f0f0f0f0f0fn,0x00ff00ff00ff00ffn,0x0000ffff0000ffffn,0x00000000ffffffffn],u=[0n,1n,2n,4n,8n,16n];function h(t){return t.toString(16)}function d(t){if(t.z<0||t.z>26)throw new Error("Wrong zoom");const e=BigInt(t.z);let n=BigInt(t.x)<<32n-e,i=BigInt(t.y)<<32n-e;for(let r=0;r<5;r++){const t=u[5-r],e=c[4-r];n=(n|n<<t)&e,i=(i|i<<t)&e}return 5188146770730811392n|e<<52n|(n|i<<1n)>>12n|0xfffffffffffffn>>2n*e}function p(t){const e=t>>52n&0x1fn,n=(0xfffffffffffffn&t)<<12n;if(1n!==(t>>59n&7n)&&0n!==(t>>57n&3n))throw new Error("Wrong mode");let i=n,r=n>>1n;for(let o=0;o<6;o++){const t=u[o],e=c[o];i=(i|i>>t)&e,r=(r|r>>t)&e}return i>>=32n-e,r>>=32n-e,{z:Number(e),x:Number(i),y:Number(r)}}function f(t){return t>>52n&0x1fn}function A(t){const e=f(t)-1n;return t&~(0x1fn<<52n)|e<<52n|0xfffffffffffffn>>2n*e}var g=n(45957);function m(t,e,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],r=arguments.length>4?arguments[4]:void 0,o=arguments.length>5?arguments[5]:void 0;if(!t.content)return!1;t.userData||(t.userData={});const s=e.get(n)?.[0];if(s){if(i.every((t=>t.name in s)))return!1;e.clear()}const a={};for(const l of t.content){let t=l.id;const e="function"===typeof r?r(l,{}):r;for(let i=0;i<n-1;i++)t=A(t);const s=Number(t);if(!(s in a)){a[s]={id:t,count:0,position:[0,0]};for(const{name:t,aggregation:e}of i)a[s][t]="any"===e?l.properties[t]:0}const c=a[s].count;a[s].count+="function"===typeof o?o(l,{}):o;const u=a[s].count,h=u-c;a[s].position[0]=(c*a[s].position[0]+h*e[0])/u,a[s].position[1]=(c*a[s].position[1]+h*e[1])/u;for(const{name:n,aggregation:r}of i){const t=a[s][n],e=l.properties[n];"average"===r?a[s][n]=(c*t+h*e)/u:"count"===r||"sum"===r?a[s][n]=t+e:"max"===r?a[s][n]=Math.max(t,e):"min"===r&&(a[s][n]=Math.min(t,e))}}return e.set(n,Object.values(a)),!0}const y=new Uint16Array,_={positions:{value:new Float32Array,size:2},properties:[],numericProps:{},featureIds:{value:y,size:1},globalFeatureIds:{value:y,size:1}};const v=512;var b=n(61299);class x extends b.TL{getTileIndices(t){return super.getTileIndices(t).map(d).map((t=>({q:t,i:h(t)})))}getTileId(t){let{q:e,i:n}=t;return n||h(e)}getTileMetadata(t){let{q:e}=t;return super.getTileMetadata(p(e))}getTileZoom(t){let{q:e}=t;return Number(f(e))}getParentIndex(t){let{q:e}=t;return{q:A(e)}}}var w=n(68945);const E=512;function C(t){const{x:e,y:n,z:i}=p(t),r=E/(1<<i);return[e*r,E-n*r,r]}function T(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;const[n,i]=function(t,e){const[n,i,r]=C(t);return[[n,i],[n+e*r,i-e*r]]}(t,e),[r,o]=(0,w.iV)(n),[s,a]=(0,w.iV)(i);return[s,o,s,a,r,a,r,o,s,o]}function S(t,e,n){const i=2===e.type?e.readVarint()+e.pos:e.pos+1;return n.value=new t(e.buf.buffer.slice(e.pos,i)),e.pos=i,n.value}class P{static read(t,e){return t.readFields(P._readField,{key:"",value:null},e)}static _readField(t,e,n){1===t?e.key=n.readString():2===t&&(e.value=n.readString())}}class M{static read(t,e){return t.readFields(M._readField,{},e)}static _readField(t,e,n){if(1===t){const{key:t,value:i}=P.read(n,n.readVarint()+n.pos);e[t]=i}}}class I{static read(t,e){const{value:n,size:i}=t.readFields(I._readField,{value:[],size:0},e);return{value:n,size:i}}static _readField(t,e,n){1===t?S(Float64Array,n,e):2===t&&(e.size=n.readVarint(!0))}}class B{static read(t,e){const{value:n,size:i}=t.readFields(B._readField,{value:[],size:0},e);return{value:new Uint32Array(n),size:i}}static _readField(t,e,n){1===t?n.readPackedVarint(e.value):2===t&&(e.size=n.readVarint(!0))}}class R{static read(t,e){return t.readFields(R._readField,{id:0},e)}static _readField(t,e,n){1===t&&(e.id=n.readVarint())}}class L{static read(t,e){return t.readFields(L._readField,{value:[]},e)}static _readField(t,e,n){1===t&&S(Float64Array,n,e)}}class O{static read(t,e){return t.readFields(O._readField,{key:"",value:null},e)}static _readField(t,e,n){1===t?e.key=n.readString():2===t&&(e.value=L.read(n,n.readVarint()+n.pos))}}class D{static read(t,e){return t.readFields(D._readField,{positions:null,globalFeatureIds:null,featureIds:null,properties:[],numericProps:{},fields:[]},e)}static _readField(t,e,n){if(1===t)e.positions=I.read(n,n.readVarint()+n.pos);else if(2===t)e.globalFeatureIds=B.read(n,n.readVarint()+n.pos);else if(3===t)e.featureIds=B.read(n,n.readVarint()+n.pos);else if(4===t)e.properties.push(M.read(n,n.readVarint()+n.pos));else if(5===t){const t=O.read(n,n.readVarint()+n.pos);e.numericProps[t.key]=t.value}else 6===t&&e.fields.push(R.read(n,n.readVarint()+n.pos))}}class k{static read(t,e){return t.readFields(k._readField,{positions:null,pathIndices:null,globalFeatureIds:null,featureIds:null,properties:[],numericProps:{},fields:[]},e)}static _readField(t,e,n){if(1===t)e.positions=I.read(n,n.readVarint()+n.pos);else if(2===t)e.pathIndices=B.read(n,n.readVarint()+n.pos);else if(3===t)e.globalFeatureIds=B.read(n,n.readVarint()+n.pos);else if(4===t)e.featureIds=B.read(n,n.readVarint()+n.pos);else if(5===t)e.properties.push(M.read(n,n.readVarint()+n.pos));else if(6===t){const t=O.read(n,n.readVarint()+n.pos);e.numericProps[t.key]=t.value}else 7===t&&e.fields.push(R.read(n,n.readVarint()+n.pos))}}class F{static read(t,e){return t.readFields(F._readField,{positions:null,polygonIndices:null,globalFeatureIds:null,featureIds:null,primitivePolygonIndices:null,triangles:null,properties:[],numericProps:{},fields:[]},e)}static _readField(t,e,n){if(1===t)e.positions=I.read(n,n.readVarint()+n.pos);else if(2===t)e.polygonIndices=B.read(n,n.readVarint()+n.pos);else if(3===t)e.globalFeatureIds=B.read(n,n.readVarint()+n.pos);else if(4===t)e.featureIds=B.read(n,n.readVarint()+n.pos);else if(5===t)e.primitivePolygonIndices=B.read(n,n.readVarint()+n.pos);else if(6===t)e.triangles=B.read(n,n.readVarint()+n.pos);else if(7===t)e.properties.push(M.read(n,n.readVarint()+n.pos));else if(8===t){const t=O.read(n,n.readVarint()+n.pos);e.numericProps[t.key]=t.value}else 9===t&&e.fields.push(R.read(n,n.readVarint()+n.pos))}}class N{static read(t,e){return t.readFields(N._readField,{points:null,lines:null,polygons:null},e)}static _readField(t,e,n){1===t?e.points=D.read(n,n.readVarint()+n.pos):2===t?e.lines=k.read(n,n.readVarint()+n.pos):3===t&&(e.polygons=F.read(n,n.readVarint()+n.pos))}}class z{static read(t,e){return t.readFields(z._readField,{value:[]},e)}static _readField(t,e,n){1===t&&S(BigUint64Array,n,e)}}class U{static read(t,e){return t.readFields(U._readField,{indices:null,properties:[],numericProps:{}},e)}static _readField(t,e,n){if(1===t)e.indices=z.read(n,n.readVarint()+n.pos);else if(2===t)e.properties.push(M.read(n,n.readVarint()+n.pos));else if(3===t){const t=O.read(n,n.readVarint()+n.pos);e.numericProps[t.key]=t.value}}}class G{static read(t,e){return t.readFields(G._readField,{scheme:0,cells:null},e)}static _readField(t,e,n){1===t?e.scheme=n.readVarint():2===t&&(e.cells=U.read(n,n.readVarint()+n.pos))}}var V=n(15361);function j(t,e){const n=new V(t);return e.read(n)}var H=n(35090);const W="9.0.33",q="cartoSpatialTile";function Z(t,e){if(!t)return null;const n=j(t,G),{cells:i}=n,r=e?.cartoSpatialTile?.scheme;return function(t){const{cells:e,scheme:n}=t,i=e.indices.value.length,r=[];for(let o=0;o<i;o++){const t="h3"===n?h(e.indices.value[o]):e.indices.value[o],i={...e.properties[o]};for(const n of Object.keys(e.numericProps))i[n]=e.numericProps[n].value[o];r.push({id:t,properties:i})}return r}({cells:i,scheme:r})}const X={name:"CARTO Spatial Tile",version:W,id:q,module:"carto",extensions:["pbf"],mimeTypes:["application/vnd.c
2arto-spatial-tile"],category:"geometry",parse:async(t,e)=>Z(t,e),parseSync:Z,worker:!0,options:{cartoSpatialTile:{scheme:"quadbin",workerUrl:(0,H.MU)(q,W)}}};function K(t,e){t?.fetch?.headers?.Authorization||(t.fetch={...t.fetch,headers:{...t.fetch?.headers,Authorization:`Bearer ${e}`}})}const Q={type:"object",value:null,validate:(t,e)=>e.optional&&null===t||"object"===typeof t&&Array.isArray(t.tiles)&&t.tiles.every((t=>"string"===typeof t)),equal:(t,e)=>(0,a.b)(t,e,2),async:!0};(0,o.mk)([X]);const J={data:Q,clusterLevel:{type:"number",value:5,min:1},getPosition:{type:"accessor",value:t=>{let{id:e}=t;return T(e,.5).slice(2,4)}},getWeight:{type:"accessor",value:1},refinementStrategy:"no-overlap",tileSize:v};class Y extends r.A{initializeState(){super.initializeState(),this.state.aggregationCache=new WeakMap}renderLayers(){const t=this.state.tileset?.tiles.filter((t=>t.isLoaded&&t.content&&this.state.tileset.isTileVisible(t)));if(!t?.length)return null;t.sort(((t,e)=>e.zoom-t.zoom));const{zoom:e}=this.context.viewport,{clusterLevel:n,getPosition:r,getWeight:o}=this.props,{aggregationCache:s}=this.state,l=function(t){const e=[],n=["any","average","count","min","max","sum"];for(const i of Object.keys(t.content[0].properties)){let t=i.split("_").pop().toLowerCase();n.includes(t)||(g.A.warn(`No valid aggregation present in ${i} property`)(),t="any"),e.push({name:i,aggregation:t})}return e}(t[0]),c=[];let u=!1;for(const i of t){const t=Math.round(e-i.zoom),a=Math.round(n)-t;let h=s.get(i.content);h||(h=new Map,s.set(i.content,h));const d=m(i,h,a,l,r,o);u||(u=d),c.push(...h.get(a))}c.sort(((t,e)=>Number(e.count-t.count)));const h=c?.map((t=>t.id));if(u||(u=!(0,a.b)(h,this.state.clusterIds,1)),this.setState({clusterIds:h}),u){const t=function(t,e){const n={};for(const{name:i,aggregation:r}of e)if(n[i]={min:1/0,max:-1/0},"any"!==r)for(const e of t)n[i].min=Math.min(n[i].min,e[i]),n[i].max=Math.max(n[i].max,e[i]);return n}(c,l),e=function(t){const e=new Float32Array(2*t.length),n=new Uint16Array(t.length);for(let i=0;i<t.length;i++)e.set(t[i].position,2*i),n[i]=i;return{shape:"binary-feature-collection",points:{type:"Point",positions:{value:e,size:2},properties:t,numericProps:{},featureIds:{value:n,size:1},globalFeatureIds:{value:n,size:1}},lines:{type:"LineString",pathIndices:{value:y,size:1},..._},polygons:{type:"Polygon",polygonIndices:{value:y,size:1},primitivePolygonIndices:{value:y,size:1},..._}}}(c);e.points.attributes={stats:t},this.setState({data:e})}const d={...this.props,id:"clusters",data:this.state.data,dataComparator:(t,e)=>{const n=t?.points?.properties?.map((t=>t.id)),i=e?.points?.properties?.map((t=>t.id));return(0,a.b)(n,i,1)}};return new i.A(this.getSubLayerProps(d))}getPickingInfo(t){const e=t.info;if(-1!==e.index){const{data:n}=t.sourceLayer.props;e.object=(0,s.K)(n,{globalFeatureId:e.index})}return e}_updateAutoHighlight(t){for(const e of this.getSubLayers())e.updateAutoHighlight(t)}filterSubLayer(){return!0}}Y.layerName="ClusterGeoJsonLayer",Y.defaultProps=J;class $ extends l.A{getLoadOptions(){const t=super.getLoadOptions()||{};return K(t,this.props.data.accessToken),t.cartoSpatialTile={...t.cartoSpatialTile,scheme:"quadbin"},t}renderLayers(){const t=this.props.data;if(!t)return null;const{tiles:e,maxresolution:n}=t;return[new Y(this.props,{id:`cluster-geojson-layer-${this.props.id}`,data:e,TilesetClass:x,maxZoom:n,loadOptions:this.getLoadOptions()})]}}$.layerName="ClusterTileLayer",$.defaultProps=J;const tt=$;var et=n(82111),nt=n(79437
vendor: 2,329 bytes, line 2
2);const it=85.051128;function rt(t,e){let{west:n,north:i,east:r,south:o}=t;const s=Math.abs(r-n);if(s>180){const t=Math.ceil(s/180);let a=[];for(let s=0;s<t;s++){const t=n+180*s,l=Math.min(t+179.9999999,r);a=a.concat(rt({west:t,north:i,east:l,south:o},e))}return[...new Set(a)]}const a=[[i,r],[o,r],[o,n],[i,n],[i,r]];return(0,nt.r1)(a,e)}function ot(t){const e=(0,nt.u$)(t),n=e.map((t=>t[0])),i=e.map((t=>t[1]));return{west:Math.min(...i),south:Math.min(...n),east:Math.max(...i),north:Math.max(...n)}}function st(t,e){const n=Math.log2(e/512),i=2/3*(t.zoom-n),r=Math.log(1/Math.cos(Math.PI*t.latitude/180));return Math.max(0,Math.floor(i+r-2))}class at extends b.TL{getTileIndices(t){let{viewport:e,minZoom:n,maxZoom:i}=t;if(void 0===e.latitude)return[];const[r,o,s,a]=e.getBounds(),{tileSize:l}=this.opts;let c,u=st(e,l);if("number"===typeof n&&Number.isFinite(n)&&u<n)return[];if("number"===typeof i&&Number.isFinite(i)&&u>i){u=i;const t=(0,nt.Sg)(e.latitude,e.longitude,i);c=(0,nt.uE)(t,1)}else{const t=function(t,e){let{west:n,north:i,east:r,south:o}=t;const s=[[i,r],[o,r],[o,n],[i,n]].map((t=>(0,nt.Sg)(t[0],t[1],e))).map((t=>180*Math.max(...(0,nt.Wq)(t).map((t=>(0,nt.Wy)(t,nt.QN.rads))))/Math.PI)),a=Math.max(...s),l=Math.min(180,a/Math.cos((i+o)/2*Math.PI/180));return{north:Math.min(i+a,it),east:r+l,south:Math.max(o-a,-85.051128),west:n-l}}({west:r,north:a,east:s,south:o},u);c=rt(t,u)}return c.map((t=>({i:t})))}getTileId(t){let{i:e}=t;return e}getTileMetadata(t){let{i:e}=t;return{bbox:ot(e)}}getTileZoom(t){let{i:e}=t;return(0,nt.Hn)(e)}getParentIndex(t){const e=(0,nt.Hn)(t.i);return{i:(0,nt.s7)(t.i,e-1)}}}const lt={uint8:Uint8Array,uint16:Uint16Array,uint32:Uint32Array,uint64:BigUint64Array,int8:Int8Array,int16:Int16Array,int32:Int32Array,int64:BigInt64Array,float32:Float32Array,float64:Float64Array};class ct{static read(t,e){return t.readFields(ct._readField,{name:"",type:"",data:null},e)}static _readField(t,e,n){if(1===t)e.name=n.readString();else if(2===t)e.type=n.readString();else if(3===t){const t=lt[e.type];if(!t)throw Error(`Invalid data type: ${e.type}`);e.data={},S(t,n,e.data)}}}class ut{static read(t,e){return t.readFields(ut._readField,{blockSize:0,bands:[]},e)}static _readField(t,e,n){1===t?e.blockSize=n.readVarint():2===t&&e.bands.push(ct.read(n,n.readVarint()+n.pos))}}const ht="9.0.3
23",dt="cartoRasterTile";function pt(t,e){if(!t)return null;const{bands:n,blockSize:i}=j(t,ut),r={};for(let o=0;o<n.length;o++){const{name:t,data:e}=n[o];r[t]=e}return{blockSize:i,cells:{numericProps:r,properties:[]}}}const ft={name:"CARTO Raster Tile",version:ht,id:dt,module:"carto",extensions:["pbf"],mimeTypes:["application/vnd.carto-raster-tile"],category:"geometry",parse:async(t,e)=>pt(t,e),parseSync:pt,worker:!0,options:{cartoRasterTile:{workerUrl:(0,H.MU)(dt,ht)}}};(0,o.mk)([ft,X]);const At={tileSize:v};class gt extends r.A{_updateAutoHighlight(t){const{hoveredFeatureId:e}=this.state,n=t.object;let i=null;if(n&&(i=n.id),e!==i){let{highlightColor:e}=this.props;"function"===typeof e&&(e=e(t)),this.setState({highlightColor:e,hoveredFeatureId:i})}}getSubLayerPropsByTile(t){return{highlightedObjectIndex:this.getHighlightedObjectIndex(t),highlightColor:this.state.highlightColor}}getHighlightedObjectIndex(t){const{hoveredFeatureId:e}=this.state,n=t.content;var i;return void 0!==(i=e)&&null!==i&&""!==i&&Array.isArray(n)&&this._featureInTile(t,e)?n.findIndex((t=>t.id===e)):-1}_featureInTile(t,e){const n=this.state.tileset,i=n.getTileZoom(t.index),r=t.index.q?"q":"i";let o={[r]:e},s=n.getTileZoom(o);for(;!(s<=i);)o=n.getParentIndex(o),s=n.getTileZoom(o);return o[r]===t.index[r]}}gt.layerName="SpatialIndexTileLayer",gt.defaultProps=At;const mt=gt,yt=t=>{const{data:e}=t,{index:n}=t.tile;return e&&e.length?new et.A(t,{getHexagon:t=>t.id,centerHexagon:n,highPrecision:!0}):null},_t={data:Q,tileSize:v};class vt extends l.A{initializeState(){et.A._checkH3Lib()}getLoadOptions(){const t=super.getLoadOptions()||{};return K(t,this.props.data.accessToken),t.cartoSpatialTile={...t.cartoSpatialTile,scheme:"h3"},t}renderLayers(){const t=this.props.data;if(!t)return null;const{tiles:e}=t;let{minresolution:n,maxresolution:i}=t;return this.props.minZoom&&(n=Math.max(n,st({zoom:this.props.minZoom,latitude:0},this.props.tileSize))),this.props.maxZoom&&(i=Math.min(i,st({zoom:this.props.maxZoom,latitude:0},this.props.tileSize))),[new mt(this.props,{id:`h3-tile-layer-${this.props.id}`,data:e,TilesetClass:at,renderSubLayers:yt,minZoom:n,maxZoom:i,loadOptions:this.getLoadOptions()})]}}vt.layerName="H3TileLayer",vt.defaultProps=_t;const bt=vt;var xt=n(56605);const wt=[[255,255,178],[254,217,118],[254,178,76],[253,141,60],[240,59,32],[189,0,38]],Et={name:"heatmap",uniformPropTypes:{delta:{value:[0,1]},radiusPixels:{value:20,min:0,softMax:100},colorDomain:{value:[0,1]},color1:{value:[0,0,0]},color2:{value:[0,0,0]},color3:{value:[0,0,0]},color4:{value:[0,0,0]},color5:{value:[0,0,0]},color6:{value:[0,0,0]},intensity:{value:1,min:.1,max:10},opacity:{value:1,min:0,max:1}},uniformTypes:{delta:"vec2<f32>",radiusPixels:"f32",colorDomain:"vec2<f32>",color1:"vec3<f32>",color2:"vec3<f32>",color3:"vec3<f32>",color4:"vec3<f32>",color5:"vec3<f32>",color6:"vec3<f32>",intensity:"f32",opacity:"f32"},getUniforms:t=>{const{delta:e=[1,0],colorRange:n=wt,radiusPixels:i=20,colorDomain:r=[0,1],intensity:o=1,opacity:s=1}=t,[a,l,c,u,h,d]=n;return{delta:e,color1:a,color2:l,color3:c,color4:u,color5:h,color6:d,radiusPixels:i,colorDomain:r,intensity:o,opacity:s}},fs:"uniform heatmapUniforms {\nvec2 delta;\nfloat radiusPixels;\nvec2 colorDomain;\nvec3 color1;\nvec3 color2;\nvec3 color3;\nvec3 color4;
2\nvec3 color5;\nvec3 color6;\nfloat intensity;\nfloat opacity;\n} heatmap;\nconst vec4 STOPS = vec4(0.2, 0.4, 0.6, 0.8);\nvec3 colorGradient(float value) {\nvec3 c1;\nvec3 c2;\nvec2 range;\nif (value < STOPS.x) {\nrange = vec2(0.0, STOPS.x);\nc1 = heatmap.color1; c2 = heatmap.color2;\n} else if (value < STOPS.y) {\nrange = STOPS.xy;\nc1 = heatmap.color2; c2 = heatmap.color3;\n} else if (value < STOPS.z) {\nrange = STOPS.yz;\nc1 = heatmap.color3; c2 = heatmap.color4;\n} else if (value < STOPS.w) {\nrange = STOPS.zw;\nc1 = heatmap.color4; c2 = heatmap.color5;\n} else {\nrange = vec2(STOPS.w, 1.0);\nc1 = heatmap.color5; c2 = heatmap.color6;\n}\nfloat f = (clamp(value, 0.0, 1.0) - range.x) / (range.y - range.x);\nreturn mix(c1, c2, f) / 255.0;\n}\nconst vec3 SHIFT = vec3(1.0, 256.0, 256.0 * 256.0);\nconst float MAX_VAL = SHIFT.z * 255.0;\nconst float SCALE = MAX_VAL / 8.0;\nvec4 pack(float value) {\nreturn vec4(mod(vec3(value, floor(value / SHIFT.yz)), 256.0), 255.0) / 255.0;\n}\nfloat unpack(vec3 color) {\nreturn 255.0 * dot(color, SHIFT);\n}\nvec4 heatmap_sampleColor(sampler2D source, vec2 texSize, vec2 texCoord) {\nbool firstPass = (heatmap.delta.y < 0.5);\nfloat accumulator = 0.0;\nfloat SUPPORT = clamp(heatmap.radiusPixels / 2.0, 8.0, 32.0);\nfloat sigma = SUPPORT / 3.0;\nfloat a = -0.5 / (sigma * sigma);\nfloat w0 = 0.3989422804014327 / sigma;\nfor (float t = -SUPPORT; t <= SUPPORT; t++) {\nvec2 percent = (t * heatmap.delta - 0.5) / SUPPORT;\nvec2 delta = percent * heatmap.radiusPixels / texSize;\nvec4 offsetColor = texture(source, texCoord + delta);\nfloat value = unpack(offsetColor.rgb);\nfloat weight = w0 * exp(a * t * t);\naccumulator += value * weight;\n}\nif (firstPass) {\nreturn pack(accumulator);\n}\nfloat density = 10.0 * heatmap.intensity * accumulator / SCALE;\nvec2 domain = heatmap.colorDomain;\nfloat f = (density - domain[0]) / (domain[1] - domain[0]);\nvec4 color = vec4(0.0);\ncolor.rgb = colorGradient(f);\ncolor.a = smoothstep(0.0, 0.1, f);\ncolor.a = pow(color.a, 1.0 / 2.2);\ncolor.a *= heatmap.opacity;\nreturn color;\n}\n",passes:[{sampler:!0,uniforms:{delta:[1,0]}},{sampler:!0,uniforms:{delta:[0,1]}}]};var Ct=n(14939),Tt=n(57027);var St=n(30141),Pt=n(83647);const Mt=[-1,-1,1,-1,-1,1,1,1];class It extends St.K{constructor(t,e){const n=Mt.map((t=>-1===t?0:t));super(t,{...e,vs:"#version 300 es\nin vec2 aClipSpacePosition;\nin vec2 aTexCoord;\nin vec2 aCoordinate;\nout vec2 position;\nout vec2 coordinate;\nout vec2 uv;\nvoid main(void) {\ngl_Position = vec4(aClipSpacePosition, 0., 1.);\nposition = aClipSpacePosition;\ncoordinate = aCoordinate;\nuv = aTexCoord;\n}\n",vertexCount:4,geometry:new Pt.V({topology:"triangle-strip",vertexCount:4,attributes:{aClipSpacePosition:{size:2,value:new Float32Array(Mt)},aTexCoord:{size:2,value:new Float32Array(n)},aCoordinate:{size:2,value:new Float32Array(n)}}})})}}var Bt=n(78550);class Rt extends Bt.A{constructor(t,e){super(t,e);const{module:n,fs:i,id:r}=e;this.model=new It(t,{id:r,fs:i,modules:[n],parameters:{depthWriteEnabled:!1,depthCompare:"always"}})}render(t){this._renderPass(this.device,t)}delete(){this.model.destroy(),this.model=null}_renderPass(t,e){const{clearCanvas:n,inputBuffer:i,outputBuffer:r}=e,o=[i.width,i.height];this.model.shaderInputs.setProps(e.moduleSettings),this.model.setBindings({texSrc:i.colorAttachments[0]}),this.model.setUniforms({texSize:o});const s=this.device.beginRenderPass({framebuffer:r,parameters:{viewport:[0,0,...o]},clearColor:!!n&&[0,0,0,0],clearDepth:1});this.model.draw(s),s.end()}}class Lt{constructor(t,e){this.id=`${t.name}-pass`,this.props=e,function(t){if(!t.normalized&&(t.normalized=!0,t.uniformPropTypes&&!t.getUniforms)){const e=new Tt.z(t);t.getUniforms=e.getUniforms.bind(e)}}(t),this.module=t}setup(t){let{device:e}=t;this.passes=function(t,e,n){return e.passes.map(((i,r)=>{const o=function(t,e){if(e.filter){const n="string"===typeof e.filter?e.filter:`${t.name}_filterColor`;return Dt(n)}if(e.sampler){const n="string"===typeof e.sampler?e.sampler:`${t.name}_sampleColor`;return kt(n)}return""}(e,i);return new Rt(t,{id:`${n}-${r}`,module:e,fs:o})}))}(e,this.module,this.id)}setProps(t){this.props=t}preRender(){}postRender(t){const e=this.passes,{target:n}=t;let i=t.inputBuffer,r=t.swapBuffer;for(let o=0;o<e.length;o++){const s=o===e.length-1,a=void 0!==n&&s;a&&(r=n);const l=!a||Boolean(t.clearCanvas),c={},u=this.module.passes[o].uniforms;c[this.module.name]={...this.props,...u},e[o].render({clearCanvas:l,inputBuffer:i,outputBuffer:r,moduleSettings:c});const h=r;r=i,i=h}return i}cleanup(){if(this.passes){for(const t of this.passes)t.delete();this.passes=void 0}}}
vendor: 20,724 bytes, line 2
2const Ot="#version 300 es\nuniform sampler2D texSrc;\nuniform vec2 texSize;\n\nin vec2 position;\nin vec2 coordinate;\nin vec2 uv;\n\nout vec4 fragColor;\n",Dt=t=>`${Ot}\nvoid main() {\n fragColor = texture(texSrc, coordinate);\n fragColor = ${t}(fragColor, texSize, coordinate);\n}\n`,kt=t=>`${Ot}\nvoid main() {\n fragColor = ${t}(texSrc, texSize, coordinate);\n}\n`;const Ft={format:"rgba8unorm",mipmaps:!1,sampler:{minFilter:"linear",magFilter:"linear",addressModeU:"clamp-to-edge",addressModeV:"clamp-to-edge"}};function Nt(t){for(;t.parent&&!t.applyPostProcess;)t=t.parent;return t}class zt extends Ct.A{initializeState(){this.id=`draw-callback-${Nt(this).props.id}`}_drawLayer(){Nt(this).applyPostProcess()}}zt.layerName="DrawCallbackLayer";var Ut=n(49793);class Gt extends Ut.A{indexToBounds(){const{data:t,extruded:e,getQuadbin:n}=this.props,i=e?.99:1;return{data:t,_normalize:!1,positionFormat:"XY",getPolygon:(t,e)=>T(n(t,e),i),updateTriggers:{getPolygon:i}}}}Gt.layerName="QuadbinLayer",Gt.defaultProps={getQuadbin:{type:"accessor",value:t=>t.quadbin}};const Vt=Gt,jt=t=>{const{data:e}=t;if(!e||!e.length)return null;const n="bigint"===typeof e[0].id;return new Vt(t,{getQuadbin:n?t=>t.id:t=>{return e=t.id,BigInt(`0x${e}`);var e}})},Ht={data:Q,tileSize:v};class Wt extends l.A{getLoadOptions(){const t=super.getLoadOptions()||{};return K(t,this.props.data.accessToken),t.cartoSpatialTile={...t.cartoSpatialTile,scheme:"quadbin"},t}renderLayers(){const t=this.props.data;if(!t)return null;const{tiles:e,maxresolution:n}=t;return[new mt(this.props,{id:`quadbin-tile-layer-${this.props.id}`,data:e,TilesetClass:x,renderSubLayers:jt,maxZoom:n,loadOptions:this.getLoadOptions()})]}}Wt.layerName="QuadbinTileLayer",Wt.defaultProps=Ht;const qt=Wt;function Zt(t){const e=Number(f(t));return Math.pow(4,e)}class Xt extends(function(t){var e;return(e=class extends t{draw(t){const{moduleParameters:e}=t,{picking:n}=e,i=Nt(this);n.isActive||i.enableRTT(t),super.draw(t),n.isActive||i.disableRTT()}}).layerName=`RTT-${t.layerName}`,e}(xt.A)){getShaders(t){const e=super.getShaders(t);return e.inject={"vs:#decl":"\nuniform float densityFactor;\n","vs:#main-end":'\n // Value from getWeight accessor\n float weight = elevations;\n\n // Keep "power" delivered to screen constant when tiles update\n // by outputting normalized density \n weight *= densityFactor;\n\n // Pack float into 3 channels to pass to heatmap shader\n // SCALE value important, as we don\'t want to saturate\n // but also want enough definition to avoid banding\n const vec3 SHIFT = vec3(1.0, 256.0, 256.0 * 256.0);\n const float MAX_VAL = SHIFT.z * 255.0;\n const float SCALE = MAX_VAL / 8.0;\n weight *= SCALE;\n weight = clamp(weight, 0.0, MAX_VAL);\n vColor = vec4(mod(vec3(weight, floor(weight / SHIFT.yz)), 256.0), 255.0) / 255.0;\n'},e}draw(t){const e=this.props.data[0],n=this.props.elevationScale,i=Zt(e.id)/n;for(const r of this.state.models)r.setUniforms({densityFactor:i});super.draw(t)}}Xt.layerName="RTTSolidPolygonLayer";const Kt=function(t,e){var n;return(n=class extends t{initializeState(t){super.initializeState(t),this._createTextures(),this.internalState.postProcess=new Lt(e,this.props),this.internalState.postProcess.setup(t)}updateState(t){super.updateState(t),this.internalState.postProcess.setProps(this.props)}renderLayers(){let t=super.renderLayers();return t?(t=Array.isArray(t)?t:[t],[...t,new zt]):null}_createTextures(){const{device:t}=this.context;this.internalState.renderBuffers=[0,1].map((e=>t.createFramebuffer({id:`layer-fbo-${e}`,colorAttachments:[t.createTexture(Ft)],depthStencilAttachment:"depth16unorm"})))}_resizeBuffers(t){const{moduleParameters:e}=t,{viewport:n}=this.context,i=e.devicePixelRatio*n.width,r=e.devicePixelRatio*n.height;this.internalState.renderBuffers.forEach((t=>t.resize({width:i,height:r})))}enableRTT(t){this._resizeBuffers(t),this.internalState.originalRenderPass=this.context.renderPass;const[e]=this.internalState.renderBuffers;this.internalState.internalRenderPass=this.context.device.beginRenderPass({framebuffer:e,parameters:{viewport:[0,0,e.width,e.height]},clearColor:!this.internalState.renderInProgress&&[0,0,0,0]}),this.internalState.renderInProgress=!0,this.context.renderPass=this.internalState.internalRenderPass}disableRTT(){this.internalState.internalRenderPass.end(),this.context.renderPass=this.internalState.originalRenderPass}applyPostProcess(){if(!this.internalState.renderInProgress)return;const[t,e]=this.internalState.renderBuffers,{framebuffer:n}=this.context.renderPass.props;this.internalState.postProcess.postRender({inputBuffer:t,swapBuffer:e,target:n}),this.internalState.renderInProgress=!1}}).layerName=`PostProcess${t.layerName}`,n}(qt,Et),Qt={data:Q,getWeight:{type:"accessor",value:1},onMaxDensityChange:{type:"function",optional:!0,value:null},colorDomain:{type:"array",value:[0,1]},intensity:{type:"number",value:1},radiusPixels:{type:"number",min:0,max:100,value:20}};class Jt extends l.A{initializeState(){this.state={isLoaded:!1,tiles:new Set,viewportChanged:!1}}shouldUpdateState(t){let{changeFlags:e}=t;const{viewportChanged:n}=e;return this.setState({viewportChanged:n}),e.somethingChanged}renderLayers(){const{data:t,getWeight:e,colorDomain:n,colorRange:i,intensity:r,radiusPixels:o,_subLayerProps:s,updateTriggers:a,onMaxDensityChange:l,onViewportLoad:c,onTileLoad:u,onTileUnload:h,...d}=this.props,p={...s,cell:{...s?.cell,_subLayerProps:{...s?.cell?._subLayerProps,fill:{...s?.cell?._subLayerProps?.fill,type:Xt}}}};let f=0,A=0;const g=[...this.state.tiles].filter((t=>t.isVisible&&t.content));for(const y of g){const t=Zt(y.content[0].id);A=Math.max(y.userData.maxWeight*t,A),f=Math.max(y.zoom,f)}const m=this.context.viewport.zoom-f;return A=A*Math.pow(2,m),"function"===typeof l&&l(A),new Kt(d,this.getSubLayerProps({id:"heatmap",data:t,getFillColor:0,getElevation:e,elevationScale:A,colorDomain:n,colorRange:i,radiusPixels:o,intensity:r,_subLayerProps:p,refinementStrategy:"no-overlap",extruded:!1,stroked:!1,updateTriggers:{getElevation:a.getWeight},onViewportLoad:t=>{this.setState({isLoaded:!0}),"function"===typeof c&&c(t)},onTileLoad:t=>{let n=-1/0;if("function"!==typeof e)n=e;else if(t.content)for(const i of t.content)n=Math.max(e(i,{}),n);t.userData={maxWeight:n},this.state.tiles.add(t),"function"===typeof u&&u(t)},onTileUnload:t=>{this.state.tiles.delete(t),"function"===typeof h&&h(t)},transitions:{elevationScale:{type:"spring",stiffness:.3,damping:.5}}}))}}Jt.layerName="HeatmapTileLayer",Jt.defaultProps=Qt;const Yt=Jt;var $t=n(90458),te=n(48754);const[ee,ne,ie,re]=[0,1,2,3];class oe extends $t.A{getShaders(){const t=super.getShaders();let e=t.vs;return e=e.replaceAll("padding.","_padding."),e=e.replace("void main(void) {","void main(void) {\n vec4 _padding = padding + instancePixelOffsets.xyxy * vec4(1.0, 1.0, -1.0, -1.0);"),{...t,vs:e}}}oe.layerName="EnhancedTextBackgroundLayer";class se extends te.A{filterSubLayer(t){let{layer:e,renderPass:n}=t;const i=e.id.includes("primary-background");return"collision"===n?i:!i}}se.layerName="EnhancedTextLayer";const ae={...te.A.defaultProps,getRadius:{type:"accessor",value:1},radiusScale:{type:"number",min:0,value:1}};class le extends l.A{calculatePixelOffset(t){const{getTextAnchor:e,getAlignmentBaseline:n,getRadius:i,getSecondaryText:r,radiusScale:o,secondarySizeScale:s,sizeScale:a}=this.props,l="middle"===e?0:"start"===e?1:-1,c="center"===n?0:"bottom"===n?1:-1,u=a/4,h=1.25*a,d=.6*(1-c)*a;let p=t?d:0;"middle"===e&&"top"===n&&r&&(p-=d,p-=s,p+=a);const f=1.25;return"function"===typeof i?(t,e)=>{const n=(e?i(t,e):1)*o*f;return[l*(n+u),c*(n+h)+p]}:[l*(i*o*f+u),c*(i*o*f+h)+p]}calculateBackgroundPadding(){const{getTextAnchor:t,getAlignmentBaseline:e,sizeScale:n}=this.props,i=12*n,r=3*n,o=[0,0,0,0];return"top"===e?o[ne]=r:"bottom"===e?o[re]=r:(o[ne]=.5*r,o[re]=.5*r),"start"===t?o[ee]=i:"end"===t?o[ie]=i:(o[ee]=.5*i,o[ie]=.5*i),o}renderTextLayer(t,e){let{updateTriggers:n={},...i}=e;const{data:r,characterSet:o,fontFamily:s,fontSettings:a,fontWeight:l,outlineColor:c,outlineWidth:u,sizeScale:h,radiusScale:d,getAlignmentBaseline:p,getColor:f,getPosition:A,getTextAnchor:g,updateTriggers:m}=this.props;return new se(this.getSubLayerProps({id:t,data:r,characterSet:o,fontFamily:s,fontSettings:a,fontWeight:l,outlineColor:c,outlineWidth:u,sizeScale:h,getAlignmentBaseline:p,getColor:f,getPosition:A,getTextAnchor:g,updateTriggers:{...m,...n,getPixelOffset:[m.getRadius,m.getTextAnchor,m.getAlignmentBaseline,d,h]}}),{getSize:1,_subLayerProps:{background:{type:oe}}},i)}renderLayers(){const{getText:t,getSecondaryColor:e,getSecondaryText:n,secondaryOutlineColor:i,secondarySizeScale:r,updateTriggers:o}=this.props,s=this.calculatePixelOffset(!1),a=this.calculateBackgroundPadding();return[this.renderTextLayer(`${o.getText}-primary`,{backgroundPadding:a,getText:t,getPixelOffset:s,background:!0}),Boolean(n)&&this.renderTextLayer(`${o.getSecondaryText}-secondary`,{getText:n,getPixelOffset:this.calculatePixelOffset(!0),getAlignmentBaseline:"top",...e&&{getColor:e},...r&&{sizeScale:r},...i&&{outlineColor:i}})]}}le.layerName="PointLabelLayer",le.defaultProps=ae;const ce=le;var ue=n(86044);const he={...ue.A.defaultProps,extruded:!1,diskResolution:4,vertices:[[-.5,-.5],[.5,-.5],[.5,.5],[-.5,.5]]};class de extends ue.A{getShaders(){const t=super.getShaders(),e=this.props.data,n=e.data.blockSize??Math.sqrt(e.length);return{...t,defines:{...t.defines,BLOCK_WIDTH:n},vs:"#version 300 es\n#define SHADER_NAME raster-layer-vertex-shader\nin vec3 positions;\nin vec3 normals;\nin float instanceElevations;\nin vec4 instanceFillColors;\nin vec4 instanceLineColors;\nin vec3 instancePickingColors;\nuniform float opacity;\nuniform bool extruded;\nuniform bool stroked;\nuniform bool isStroke;\nuniform float coverage;\nuniform float elevationScale;\nuniform float widthScale;\nuniform vec3 offset;\nout vec4 vColor;\n#ifdef FLAT_SHADING\nout vec4 position_commonspace;\n#endif\nvoid main(void) {\nvec2 common_position = offset.xy;\nfloat scale = offset.z;\nint yIndex = - (gl_InstanceID / BLOCK_WIDTH);\nint xIndex = gl_InstanceID + (yIndex * BLOCK_WIDTH);\ncommon_position += scale * vec2(float(xIndex), float(yIndex));\nvec4 color = isStroke ? instanceLineColors : instanceFillColors;\nfloat shouldRender = float(color.a > 0.0 && instanceElevations >= 0.0);\nfloat cellWidth = coverage * scale;\ngeometry.position = vec4(common_position, 0.0, 1.0);\nif (project_uProjectionMode == PROJECTION_MODE_WEB_MERCATOR_AUTO_OFFSET) {\ngeometry.position.xyz -= project_uCommonOrigin;\n}\nfloat elevation = 0.0;\nfloat strokeOffsetRatio = 1.0;\nif (extruded) {\nelevation = instanceElevations * (positions.z + 1.0) / 2.0 * elevationScale;\n} else if (stroked) {\nfloat halfOffset = project_pixel_size(widthScale) / cellWidth;\nif (isStroke) {\nstrokeOffsetRatio -= sign(positions.z) * halfOffset;\n} else {\nstrokeOffsetRatio -= halfOffset;\n}\n}\ngeometry.pickingColor = instancePickingColors;\nvec2 offset = (vec2(0.5) + positions.xy * strokeOffsetRatio) * cellWidth * shouldRender;\nvec3 pos = vec3(offset, project_size(elevation));\nDECKGL_FILTER_SIZE(pos, geometry);\ngeometry.position.xyz += pos;\ngl_Position = project_common_position_to_clipspace(geometry.position);\ngeometry.normal = project_normal(normals);\nDECKGL_FILTER_GL_POSITION(gl_Position, geometry);\nif (extruded && !isStroke) {\n#ifdef FLAT_SHADING\nposition_commonspace = geometry.position;\nvColor = vec4(color.rgb, color.a * opacity);\n#else\nvec3 lightColor = lighting_getLightColor(color.rgb, project_uCameraPosition, geometry.position.xyz, geometry.normal);\nvColor = vec4(lightColor, color.a * opacity);\n#endif\n} else {\nvColor = vec4(color.rgb, color.a * opacity);\n}\nDECKGL_FILTER_COLOR(vColor, geometry);\n}\n"}}initializeState(){this.getAttributeManager().addInstanced({instanceElevations:{size:1,transition:!0,accessor:"getElevation"},instanceFillColors:{size:this.props.colorFormat.length,type:"unorm8",transition:!0,accessor:"getFillColor",defaultValue:[0,0,0,255]},instanceLineColors:{size:this.props.colorFormat.length,type:"unorm8",transition:!0,accessor:"getLineColor",defaultValue:[255,255,255,255]}})}}de.layerName="RasterColumnLayer";class pe extends l.A{renderLayers(){const{data:t,getElevation:e,getFillColor:n,getLineColor:i,getLineWidth:r,tileIndex:o,updateTriggers:s}=this.props;if(!t||!o)return null;const a=t.blockSize??0,[l,c,u]=C(o),h=[l,c,u/a],d=this.getSubLayerClass("column",de),{highlightedObjectIndex:p,highlightColor:f}=this.state;return new d(this.props,this.getSubLayerProps({id:"cell",updateTriggers:s,getElevation:this.getSubLayerAccessor(e),getFillColor:this.getSubLayerAccessor(n),getLineColor:this.getSubLayerAccessor(i),getLineWidth:this.getSubLayerAccessor(r)}),{data:{data:t,length:a*a},offset:h,highlightedObjectIndex:p,highlightColor:f})}getSubLayerAccessor(t){return"function"!==typeof t?super.getSubLayerAccessor(t):(e,n)=>{const{data:i,index:r}=n,o=i.data,s=(0,H.Qd)(o.cells,r);return t({properties:s},n)}}getPickingInfo(t){const e=super.getPickingInfo(t);return-1!==e.index&&(e.object=this.getSubLayerAccessor((t=>t))(void 0,{data:this.props,index:e.index})),e}_updateAutoHighlight(t){const{highlightedObjectIndex:e}=this.state;let n=-1;if(-1!==t.index&&(n=t.index),e!==n){let{highlightColor:e}=this.props;"function"===typeof e&&(e=e(t)),this.setState({highlightColor:e,highlightedObjectIndex:n})}}}pe.layerName="RasterLayer",pe.defaultProps=he;const fe=pe,Ae=t=>{const e=t.tile?.index?.q;return e?new fe(t,{tileIndex:e}):null},ge={data:Q,tileSize:v};class me extends l.A{getLoadOptions(){const t=super.getLoadOptions()||{};return K(t,this.props.data.accessToken),t}renderLayers(){const t=this.props.data;if(!t)return null;const{tiles:e,minzoom:n,maxzoom:i}=t;return[new r.A(this.props,{id:`raster-tile-layer-${this.props.id}`,data:e,TilesetClass:x,renderSubLayers:Ae,minZoom:n,maxZoom:i,loadOptions:this.getLoadOptions()})]}}me.layerName="RasterTileLayer",me.defaultProps=ge;const ye=me;class _e{static read(t,e){return t.readFields(_e._readField,{properties:[],numericProps:{}},e)}static _readField(t,e,n){if(1===t)e.properties.push(M.read(n,n.readVarint()+n.pos));else if(2===t){const t=O.read(n,n.readVarint()+n.pos);e.numericProps[t.key]=t.value}}}function ve(t,e){return t?j(t,_e):null}const be={name:"CARTO Properties Tile",version:"1",id:"cartoPropertiesTile",module:"carto",extensions:["pbf"],mimeTypes:["application/vnd.carto-properties-tile"],category:"geometry",worker:!1,parse:async(t,e)=>ve(t,e),parseSync:ve,options:{}};var xe=n(35008);const we="9.0.33",Ee="cartoVectorTile";function Ce(t,e,n){let{startPosition:i,endPosition:r,indices:o}=n;const s=t.positions.size,a=i*s,l=r*s,c=t.positions.value.subarray(a,l),u=o.slice(1).map((t=>t-i)),h=xe(c,u,s);for(let d=0,p=h.length;d<p;++d)e.push(i+h[d])}function Te(t,e){if(!t)return null;const n=j(t,N);return n.polygons&&!n.polygons.triangles&&function(t){const{polygonIndices:e,primitivePolygonIndices:n}=t,i=[];let r=0;for(let o=0;o<e.value.length-1;o++){const s=e.value[o],a=e.value[o+1],l=n.value.indexOf(a),c=n.value.subarray(r,l);r=l,Ce(t,i,{startPosition:s,endPosition:a,indices:c})}t.triangles={value:new Uint32Array(i),size:1}}(n.polygons),n}const Se={name:"CARTO Vector Tile",version:we,id:Ee,module:"carto",extensions:["pbf"],mimeTypes:["application/vnd.carto-vector-tile"],category:"geometry",parse:async(t,e)=>Te(t,e),parseSync:Te,worker:!0,options:{cartoVectorTile:{workerUrl:(0,H.MU)(Ee,we)}}};var Pe=n(30202),Me=n(40973),Ie=n(50854);(0,o.mk)([be,Se]);const Be={...Me.A.defaultProps,data:Q,dataComparator:Q.equal,tileSize:v};class Re extends Me.A{constructor(){super(...arguments)}initializeState(){super.initializeState(),this.setState({binary:!0})}updateState(t){const{props:e}=t;if(e.data){super.updateState(t);const n="mvt"===new URL(e.data.tiles[0]).searchParams.get("formatTiles");this.setState({mvt:n})}}getLoadOptions(){const t=super.getLoadOptions()||{};return K(t,this.props.data.accessToken),t.gis={format:"binary"},t}async getTileData(t){const e=this.props.data,{tiles:n,properties_tiles:i}=e,r=(0,Ie.g8)(n,t);if(!r)return Promise.reject("Invalid URL");const o=this.getLoadOptions(),{fetch:s}=this.props,{signal:a}=t,l=s(r,{propName:"data",layer:this,loadOptions:o,signal:a});if(!i)return await l;const c=(0,Ie.g8)(i,t);if(!c)return Promise.reject("Invalid properties URL");const u=s(c,{propName:"data",layer:this,loadOptions:o,signal:a}),[h,d]=await Promise.all([l,u]);return h?d?function(t,e){const n={};for(const{geoid:i,...r}of e.properties)i in n?g.A.warn("Duplicate geoid key in boundary mapping, using first occurance")():n[i]=r;for(const i of["points","lines","polygons"]){const r=t[i];if(0===r.positions.value.length)continue;r.properties=r.properties.map((t=>{let{geoid:e}=t;return n[e]}));const{positions:o,globalFeatureIds:s}=r;let a=null;"lines"===i&&(a=r.pathIndices.value),"polygons"===i&&(a=r.polygonIndices.value);const l=o.value.length/o.size;for(const t in e.numericProps){const n=e.numericProps[t].value,i=new(0,n.constructor)(l);if(r.numericProps[t]={value:i,size:1},a)for(let t=0;t<a.length-1;t++){const e=a[t],r=a[t+1],o=s.value[e];i.fill(n[o],e,r)}else for(let t=0;t<l;t++){const e=s.value[t];i[t]=n[e]}}}return t}(h,d):h:null}renderSubLayers(t){if(null===t.data)return null;if(this.state.mvt)return super.renderSubLayers(t);const e=t.tile.bbox,{west:n,south:r,east:o,north:s}=e,a=[new Pe.A,...t.extensions||[]],l={clipBounds:[n,r,o,s]},c=e=>({[e]:{...l,...t?._subLayerProps?.[e],extensions:[...a,...t?._subLayerProps?.[e]?.extensions||[]]}}),u={...t,autoHighlight:!1,_subLayerProps:{...t._subLayerProps,...c("polygons-fill"),...c("polygons-stroke"),...c("linestrings")}};return new i.A(u)}_isWGS84(){return!this.state.mvt||super._isWGS84()}}Re.layerName="VectorTileLayer",Re.defaultProps=Be;const Le=Re;var Oe=n(44432);Error;Oe.x,new Map;const De={ClusterTileLayer:tt,H3TileLayer:bt,HeatmapTileLayer:Yt,_PointLabelLayer:ce,QuadbinTileLayer:qt,RasterTileLayer:ye,VectorTileLayer:Le}},95237:(t,e,n)=>{"use strict";n.d(e,{A:()=>a});var i=n(31708),r=n(22771),o=n(35090),s=n(89716);function a(t){let{attr:e,domain:n,colors:a=r.GT,nullColor:l=r.Uf}=t;(0,o.vA)(Array.isArray(n),'Expected "domain" to be an array of numbers');const c="string"===typeof a?(0,r.Ay)(a,n.length+1):a,u=(0,i.A)().domain(n).range(c);return(t,n)=>{const i=(0,s.l)(e,t,n);return"number"===typeof i&&Number.isFinite(i)?u(i):l}}},19507:(t,e,n)=>{"use strict";n.d(e,{A:()=>s});var i=n(22771),r=n(35090),o=n(89716);function s(t){let{attr:e,domain:n,colors:s=i.GT,nullColor:a=i.Uf,othersColor:l=i.Sr}=t;(0,r.vA)(Array.isArray(n),'Expected "domain" to be an array of numbers or strings');const c={},u="string"===typeof s?(0,i.Ay)(s,n.length):s;for(const[i,r]of n.entries())c[r]=u[i];return(t,n)=>{const i=(0,o.l)(e,t,n);return"number"===typeof i&&Number.isFinite(i)||"string"===typeof i?c[i]||l:a}}},89428:(t,e,n)=>{"use strict";n.d(e,{A:()=>a});var i=n(53142),r=n(22771),o=n(35090),s=n(89716);function a(t){let{attr:e,domain:n,colors:a=r.GT,nullColor:l=r.Uf}=t;(0,o.vA)(Array.isArray(n),'Expected "domain" to be an array of numbers');const c="string"===typeof a?(0,r.Ay)(a,n.length):a,u=(0,i.A)().domain(n).range(c);return(t,n)=>{const i=(0,s.l)(e,t,n);return"number"===typeof i&&Number.isFinite(i)?u(i):l}}},22771:(t,e,n)=>{"use strict";n.d(e,{GT:()=>bt,Uf:()=>xt,Sr:()=>wt,Ay:()=>Et});var i={};n.r(i),n.d(i,{Antique:()=>L,ArmyRose:()=>T,BluGrn:()=>d,BluYl:()=>g,Bold:()=>O,BrwnYl:()=>C,Burg:()=>o,BurgYl:()=>s,DarkMint:()=>p,Earth:()=>R,Emrld:()=>f,Fall:()=>S,Geyser:()=>P,Magenta:()=>x,Mint:()=>h,OrYel:()=>l,Pastel:()=>D,Peach:()=>c,PinkYl:()=>u,Prism:()=>k,Purp:()=>_,PurpOr:()=>v,RedOr:()=>a,Safe:()=>F,Sunset:()=>b,SunsetDark:()=>w,Teal:()=>m,TealGrn:()=>y,TealRose:()=>I,Temps:()=>M,Tropic:()=>B,Vivid:()=>N,ag_GrnYl:()=>A,ag_Sunset:()=>E,cb_Accent:()=>J,cb_Blues:()=>ot,cb_BrBG:()=>ht,cb_BuGn:()=>z,cb_BuPu:()=>U,cb_Dark2:()=>Y,cb_GnBu:()=>G,cb_Greens:()=>st,cb_Greys:()=>at,cb_OrRd:()=>V,cb_Oranges:()=>lt,cb_PRGn:()=>pt,cb_Paired:()=>$,cb_Pastel1:()=>tt,cb_Pastel2:()=>et,cb_PiYG:()=>dt,cb_PuBu:()=>j,cb_PuBuGn:()=>H,cb_PuOr:()=>ft,cb_PuRd:()=>W,cb_Purples:()=>ct,cb_RdBu:()=>At,cb_RdGy:()=>gt,cb_RdPu:()=>q,cb_RdYlBu:()=>mt,cb_RdYlGn:()=>yt,cb_Reds:()=>ut,cb_Set1:()=>nt,cb_Set2:()=>it,cb_Set3:()=>rt,cb_Spectral:()=>_t,cb_YlGn:()=>Z,cb_YlGnBu:()=>X,cb_YlOrBr:()=>K,cb_YlOrRd:()=>Q});const r={schemeGroups:{sequential:["BuGn","BuPu","GnBu","OrRd","PuBu","PuBuGn","PuRd","RdPu","YlGn","YlGnBu","YlOrBr","YlOrRd"],singlehue:["Blues","Greens","Greys","Oranges","Purples","Reds"],diverging:["BrBG","PiYG","PRGn","PuOr","RdBu","RdGy","RdYlBu","RdYlGn","Spectral"],qualitative:["Accent","Dark2","Paired","Pastel1","Pastel2","Set1","Set2","Set3"]},
vendor: 13,077 bytes, line 2
2YlGn:{3:["#f7fcb9","#addd8e","#31a354"],4:["#ffffcc","#c2e699","#78c679","#238443"],5:["#ffffcc","#c2e699","#78c679","#31a354","#006837"],6:["#ffffcc","#d9f0a3","#addd8e","#78c679","#31a354","#006837"],7:["#ffffcc","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#005a32"],8:["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#005a32"],9:["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#006837","#004529"]},YlGnBu:{3:["#edf8b1","#7fcdbb","#2c7fb8"],4:["#ffffcc","#a1dab4","#41b6c4","#225ea8"],5:["#ffffcc","#a1dab4","#41b6c4","#2c7fb8","#253494"],6:["#ffffcc","#c7e9b4","#7fcdbb","#41b6c4","#2c7fb8","#253494"],7:["#ffffcc","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#0c2c84"],8:["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#0c2c84"],9:["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#253494","#081d58"]},GnBu:{3:["#e0f3db","#a8ddb5","#43a2ca"],4:["#f0f9e8","#bae4bc","#7bccc4","#2b8cbe"],5:["#f0f9e8","#bae4bc","#7bccc4","#43a2ca","#0868ac"],6:["#f0f9e8","#ccebc5","#a8ddb5","#7bccc4","#43a2ca","#0868ac"],7:["#f0f9e8","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#08589e"],8:["#f7fcf0","#e0f3db","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#08589e"],9:["#f7fcf0","#e0f3db","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#0868ac","#084081"]},BuGn:{3:["#e5f5f9","#99d8c9","#2ca25f"],4:["#edf8fb","#b2e2e2","#66c2a4","#238b45"],5:["#edf8fb","#b2e2e2","#66c2a4","#2ca25f","#006d2c"],6:["#edf8fb","#ccece6","#99d8c9","#66c2a4","#2ca25f","#006d2c"],7:["#edf8fb","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#005824"],8:["#f7fcfd","#e5f5f9","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#005824"],9:["#f7fcfd","#e5f5f9","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#006d2c","#00441b"]},PuBuGn:{3:["#ece2f0","#a6bddb","#1c9099"],4:["#f6eff7","#bdc9e1","#67a9cf","#02818a"],5:["#f6eff7","#bdc9e1","#67a9cf","#1c9099","#016c59"],6:["#f6eff7","#d0d1e6","#a6bddb","#67a9cf","#1c9099","#016c59"],7:["#f6eff7","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016450"],8:["#fff7fb","#ece2f0","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016450"],9:["#fff7fb","#ece2f0","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016c59","#014636"]},PuBu:{3:["#ece7f2","#a6bddb","#2b8cbe"],4:["#f1eef6","#bdc9e1","#74a9cf","#0570b0"],5:["#f1eef6","#bdc9e1","#74a9cf","#2b8cbe","#045a8d"],6:["#f1eef6","#d0d1e6","#a6bddb","#74a9cf","#2b8cbe","#045a8d"],7:["#f1eef6","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#034e7b"],8:["#fff7fb","#ece7f2","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#034e7b"],9:["#fff7fb","#ece7f2","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#045a8d","#023858"]},BuPu:{3:["#e0ecf4","#9ebcda","#8856a7"],4:["#edf8fb","#b3cde3","#8c96c6","#88419d"],5:["#edf8fb","#b3cde3","#8c96c6","#8856a7","#810f7c"],6:["#edf8fb","#bfd3e6","#9ebcda","#8c96c6","#8856a7","#810f7c"],7:["#edf8fb","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#6e016b"],8:["#f7fcfd","#e0ecf4","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#6e016b"],9:["#f7fcfd","#e0ecf4","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#810f7c","#4d004b"]},RdPu:{3:["#fde0dd","#fa9fb5","#c51b8a"],4:["#feebe2","#fbb4b9","#f768a1","#ae017e"],5:["#feebe2","#fbb4b9","#f768a1","#c51b8a","#7a0177"],6:["#feebe2","#fcc5c0","#fa9fb5","#f768a1","#c51b8a","#7a0177"],7:["#feebe2","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177"],8:["#fff7f3","#fde0dd","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177"],9:["#fff7f3","#fde0dd","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177","#49006a"]},PuRd:{3:["#e7e1ef","#c994c7","#dd1c77"],4:["#f1eef6","#d7b5d8","#df65b0","#ce1256"],5:["#f1eef6","#d7b5d8","#df65b0","#dd1c77","#980043"],6:["#f1eef6","#d4b9da","#c994c7","#df65b0","#dd1c77","#980043"],7:["#f1eef6","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#91003f"],8:["#f7f4f9","#e7e1ef","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#91003f"],9:["#f7f4f9","#e7e1ef","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#980043","#67001f"]},OrRd:{3:["#fee8c8","#fdbb84","#e34a33"],4:["#fef0d9","#fdcc8a","#fc8d59","#d7301f"],5:["#fef0d9","#fdcc8a","#fc8d59","#e34a33","#b30000"],6:["#fef0d9","#fdd49e","#fdbb84","#fc8d59","#e34a33","#b30000"],7:["#fef0d9","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#990000"],8:["#fff7ec","#fee8c8","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#990000"],9:["#fff7ec","#fee8c8","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#b30000","#7f0000"]},YlOrRd:{3:["#ffeda0","#feb24c","#f03b20"],4:["#ffffb2","#fecc5c","#fd8d3c","#e31a1c"],5:["#ffffb2","#fecc5c","#fd8d3c","#f03b20","#bd0026"],6:["#ffffb2","#fed976","#feb24c","#fd8d3c","#f03b20","#bd0026"],7:["#ffffb2","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#b10026"],8:["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#b10026"],9:["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#bd0026","#800026"]},YlOrBr:{3:["#fff7bc","#fec44f","#d95f0e"],4:["#ffffd4","#fed98e","#fe9929","#cc4c02"],5:["#ffffd4","#fed98e","#fe9929","#d95f0e","#993404"],6:["#ffffd4","#fee391","#fec44f","#fe9929","#d95f0e","#993404"],7:["#ffffd4","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#8c2d04"],8:["#ffffe5","#fff7bc","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#8c2d04"],9:["#ffffe5","#fff7bc","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#993404","#662506"]},Purples:{3:["#efedf5","#bcbddc","#756bb1"],4:["#f2f0f7","#cbc9e2","#9e9ac8","#6a51a3"],5:["#f2f0f7","#cbc9e2","#9e9ac8","#756bb1","#54278f"],6:["#f2f0f7","#dadaeb","#bcbddc","#9e9ac8","#756bb1","#54278f"],7:["#f2f0f7","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#4a1486"],8:["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#4a1486"],9:["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#54278f","#3f007d"]},Blues:{3:["#deebf7","#9ecae1","#3182bd"],4:["#eff3ff","#bdd7e7","#6baed6","#2171b5"],5:["#eff3ff","#bdd7e7","#6baed6","#3182bd","#08519c"],6:["#eff3ff","#c6dbef","#9ecae1","#6baed6","#3182bd","#08519c"],7:["#eff3ff","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#084594"],8:["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#084594"],9:["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#08519c","#08306b"]},Greens:{3:["#e5f5e0","#a1d99b","#31a354"],4:["#edf8e9","#bae4b3","#74c476","#238b45"],5:["#edf8e9","#bae4b3","#74c476","#31a354","#006d2c"],6:["#edf8e9","#c7e9c0","#a1d99b","#74c476","#31a354","#006d2c"],7:["#edf8e9","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#005a32"],8:["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#005a32"],9:["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#006d2c","#00441b"]},Oranges:{3:["#fee6ce","#fdae6b","#e6550d"],4:["#feedde","#fdbe85","#fd8d3c","#d94701"],5:["#feedde","#fdbe85","#fd8d3c","#e6550d","#a63603"],6:["#feedde","#fdd0a2","#fdae6b","#fd8d3c","#e6550d","#a63603"],7:["#feedde","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#8c2d04"],8:["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#8c2d04"],9:["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#a63603","#7f2704"]},Reds:{3:["#fee0d2","#fc9272","#de2d26"],4:["#fee5d9","#fcae91","#fb6a4a","#cb181d"],5:["#fee5d9","#fcae91","#fb6a4a","#de2d26","#a50f15"],6:["#fee5d9","#fcbba1","#fc9272","#fb6a4a","#de2d26","#a50f15"],7:["#fee5d9","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#99000d"],8:["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#99000d"],9:["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#a50f15","#67000d"]},Greys:{3:["#f0f0f0","#bdbdbd","#636363"],4:["#f7f7f7","#cccccc","#969696","#525252"],5:["#f7f7f7","#cccccc","#969696","#636363","#252525"],6:["#f7f7f7","#d9d9d9","#bdbdbd","#969696","#636363","#252525"],7:["#f7f7f7","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525"],8:["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525"],9:["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525","#000000"]},PuOr:{3:["#f1a340","#f7f7f7","#998ec3"],4:["#e66101","#fdb863","#b2abd2","#5e3c99"],5:["#e66101","#fdb863","#f7f7f7","#b2abd2","#5e3c99"],6:["#b35806","#f1a340","#fee0b6","#d8daeb","#998ec3","#542788"],7:["#b35806","#f1a340","#fee0b6","#f7f7f7","#d8daeb","#998ec3","#542788"],8:["#b35806","#e08214","#fdb863","#fee0b6","#d8daeb","#b2abd2","#8073ac","#542788"],9:["#b35806","#e08214","#fdb863","#fee0b6","#f7f7f7","#d8daeb","#b2abd2","#8073ac","#542788"],10:["#7f3b08","#b35806","#e08214","#fdb863","#fee0b6","#d8daeb","#b2abd2","#8073ac","#542788","#2d004b"],11:["#7f3b08","#b35806","#e08214","#fdb863","#fee0b6","#f7f7f7","#d8daeb","#b2abd2","#8073ac","#542788","#2d004b"]},BrBG:{3:["#d8b365","#f5f5f5","#5ab4ac"],4:["#a6611a","#dfc27d","#80cdc1","#018571"],5:["#a6611a","#dfc27d","#f5f5f5","#80cdc1","#018571"],6:["#8c510a","#d8b365","#f6e8c3","#c7eae5","#5ab4ac","#01665e"],7:["#8c510a","#d8b365","#f6e8c3","#f5f5f5","#c7eae5","#5ab4ac","#01665e"],8:["#8c510a","#bf812d","#dfc27d","#f6e8c3","#c7eae5","#80cdc1","#35978f","#01665e"],9:["#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e"],10:["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"],11:["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"]},PRGn:{3:["#af8dc3","#f7f7f7","#7fbf7b"],4:["#7b3294","#c2a5cf","#a6dba0","#008837"],5:["#7b3294","#c2a5cf","#f7f7f7","#a6dba0","#008837"],6:["#762a83","#af8dc3","#e7d4e8","#d9f0d3","#7fbf7b","#1b7837"],7:["#762a83","#af8dc3","#e7d4e8","#f7f7f7","#d9f0d3","#7fbf7b","#1b7837"],8:["#762a83","#9970ab","#c2a5cf","#e7d4e8","#d9f0d3","#a6dba0","#5aae61","#1b7837"],9:["#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837"],10:["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"],11:["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"]},PiYG:{3:["#e9a3c9","#f7f7f7","#a1d76a"],4:["#d01c8b","#f1b6da","#b8e186","#4dac26"],5:["#d01c8b","#f1b6da","#f7f7f7","#b8e186","#4dac26"],6:["#c51b7d","#e9a3c9","#fde0ef","#e6f5d0","#a1d76a","#4d9221"],7:["#c51b7d","#e9a3c9","#fde0ef","#f7f7f7","#e6f5d0","#a1d76a","#4d9221"],8:["#c51b7d","#de77ae","#f1b6da","#fde0ef","#e6f5d0","#b8e186","#7fbc41","#4d9221"],9:["#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221"],10:["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"],11:["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"]},RdBu:{3:["#ef8a62","#f7f7f7","#67a9cf"],4:["#ca0020","#f4a582","#92c5de","#0571b0"],5:["#ca0020","#f4a582","#f7f7f7","#92c5de","#0571b0"],6:["#b2182b","#ef8a62","#fddbc7","#d1e5f0","#67a9cf","#2166ac"],7:["#b2182b","#ef8a62","#fddbc7","#f7f7f7","#d1e5f0","#67a9cf","#2166ac"],8:["#b2182b","#d6604d","#f4a582","#fddbc7","#d1e5f0","#92c5de","#4393c3","#2166ac"],9:["#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac"],10:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"],11:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"]},RdGy:{3:["#ef8a62","#ffffff","#999999"],4:["#ca0020","#f4a582","#bababa","#404040"],5:["#ca0020","#f4a582","#ffffff","#bababa","#404040"],6:["#b2182b","#ef8a62","#fddbc7","#e0e0e0","#999999","#4d4d4d"],7:["#b2182b","#ef8a62","#fddbc7","#ffffff","#e0e0e0","#999999","#4d4d4d"],8:["#b2182b","#d6604d","#f4a582","#fddbc7","#e0e0e0","#bababa","#878787","#4d4d4d"],9:["#b2182b","#d6604d","#f4a582","#fddbc7","#ffffff","#e0e0e0","#bababa","#878787","#4d4d4d"],10:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#e0e0e0","#bababa","#878787","#4d4d4d","#1a1a1a"],11:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#ffffff","#e0e0e0","#bababa","#878787","#4d4d4d","#1a1a1a"]},RdYlBu:{3:["#fc8d59","#ffffbf","#91bfdb"],4:["#d7191c","#fdae61","#abd9e9","#2c7bb6"],5:["#d7191c","#fdae61","#ffffbf","#abd9e9","#2c7bb6"],6:["#d73027","#fc8d59","#fee090","#e0f3f8","#91bfdb","#4575b4"],7:["#d73027","#fc8d59","#fee090","#ffffbf","#e0f3f8","#91bfdb","#4575b4"],8:["#d73027","#f46d43","#fdae61","#fee090","#e0f3f8","#abd9e9","#74add1","#4575b4"],9:["#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4"],10:["#a50026","#d73027","#f46d43","#fdae61","#fee090","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"],11:["#a50026","#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"]},Spectral:{3:["#fc8d59","#ffffbf","#99d594"],4:["#d7191c","#fdae61","#abdda4","#2b83ba"],5:["#d7191c","#fdae61","#ffffbf","#abdda4","#2b83ba"],
vendor: 20,333 bytes, line 2
26:["#d53e4f","#fc8d59","#fee08b","#e6f598","#99d594","#3288bd"],7:["#d53e4f","#fc8d59","#fee08b","#ffffbf","#e6f598","#99d594","#3288bd"],8:["#d53e4f","#f46d43","#fdae61","#fee08b","#e6f598","#abdda4","#66c2a5","#3288bd"],9:["#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd"],10:["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"],11:["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"]},RdYlGn:{3:["#fc8d59","#ffffbf","#91cf60"],4:["#d7191c","#fdae61","#a6d96a","#1a9641"],5:["#d7191c","#fdae61","#ffffbf","#a6d96a","#1a9641"],6:["#d73027","#fc8d59","#fee08b","#d9ef8b","#91cf60","#1a9850"],7:["#d73027","#fc8d59","#fee08b","#ffffbf","#d9ef8b","#91cf60","#1a9850"],8:["#d73027","#f46d43","#fdae61","#fee08b","#d9ef8b","#a6d96a","#66bd63","#1a9850"],9:["#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850"],10:["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"],11:["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"]},Accent:{3:["#7fc97f","#beaed4","#fdc086"],4:["#7fc97f","#beaed4","#fdc086","#ffff99"],5:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0"],6:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f"],7:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f","#bf5b17"],8:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f","#bf5b17","#666666"]},Dark2:{3:["#1b9e77","#d95f02","#7570b3"],4:["#1b9e77","#d95f02","#7570b3","#e7298a"],5:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e"],6:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02"],7:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02","#a6761d"],8:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02","#a6761d","#666666"]},Paired:{3:["#a6cee3","#1f78b4","#b2df8a"],4:["#a6cee3","#1f78b4","#b2df8a","#33a02c"],5:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99"],6:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c"],7:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f"],8:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00"],9:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6"],10:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a"],11:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a","#ffff99"],12:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a","#ffff99","#b15928"]},Pastel1:{3:["#fbb4ae","#b3cde3","#ccebc5"],4:["#fbb4ae","#b3cde3","#ccebc5","#decbe4"],5:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6"],6:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc"],7:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd"],8:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd","#fddaec"],9:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd","#fddaec","#f2f2f2"]},Pastel2:{3:["#b3e2cd","#fdcdac","#cbd5e8"],4:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4"],5:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9"],6:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae"],7:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae","#f1e2cc"],8:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae","#f1e2cc","#cccccc"]},Set1:{3:["#e41a1c","#377eb8","#4daf4a"],4:["#e41a1c","#377eb8","#4daf4a","#984ea3"],5:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00"],6:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33"],7:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628"],8:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628","#f781bf"],9:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628","#f781bf","#999999"]},Set2:{3:["#66c2a5","#fc8d62","#8da0cb"],4:["#66c2a5","#fc8d62","#8da0cb","#e78ac3"],5:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854"],6:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f"],7:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f","#e5c494"],8:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f","#e5c494","#b3b3b3"]},Set3:{3:["#8dd3c7","#ffffb3","#bebada"],4:["#8dd3c7","#ffffb3","#bebada","#fb8072"],5:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3"],6:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462"],7:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69"],8:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5"],9:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9"],10:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd"],11:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5"],12:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5","#ffed6f"]}};var o={2:["#ffc6c4","#672044"],3:["#ffc6c4","#cc607d","#672044"],4:["#ffc6c4","#e38191","#ad466c","#672044"],5:["#ffc6c4","#ee919b","#cc607d","#9e3963","#672044"],6:["#ffc6c4","#f29ca3","#da7489","#b95073","#93345d","#672044"],7:["#ffc6c4","#f4a3a8","#e38191","#cc607d","#ad466c","#8b3058","#672044"],tags:["quantitative"]},s={2:["#fbe6c5","#70284a"],3:["#fbe6c5","#dc7176","#70284a"],4:["#fbe6c5","#ee8a82","#c8586c","#70284a"],5:["#fbe6c5","#f2a28a","#dc7176","#b24b65","#70284a"],6:["#fbe6c5","#f4b191","#e7807d","#d06270","#a44360","#70284a"],7:["#fbe6c5","#f5ba98","#ee8a82","#dc7176","#c8586c","#9c3f5d","#70284a"],tags:["quantitative"]},a={2:["#f6d2a9","#b13f64"],3:["#f6d2a9","#ea8171","#b13f64"],4:["#f6d2a9","#f19c7c","#dd686c","#b13f64"],5:["#f6d2a9","#f3aa84","#ea8171","#d55d6a","#b13f64"],6:["#f6d2a9","#f4b28a","#ef9177","#e3726d","#cf5669","#b13f64"],7:["#f6d2a9","#f5b78e","#f19c7c","#ea8171","#dd686c","#ca5268","#b13f64"],tags:["quantitative"]},l={2:["#ecda9a","#ee4d5a"],3:["#ecda9a","#f7945d","#ee4d5a"],4:["#ecda9a","#f3ad6a","#f97b57","#ee4d5a"],5:["#ecda9a","#f1b973","#f7945d","#f86f56","#ee4d5a"],6:["#ecda9a","#f0c079","#f5a363","#f98558","#f76856","#ee4d5a"],7:["#ecda9a","#efc47e","#f3ad6a","#f7945d","#f97b57","#f66356","#ee4d5a"],tags:["quantitative"]},c={2:["#fde0c5","#eb4a40"],3:["#fde0c5","#f59e72","#eb4a40"],4:["#fde0c5","#f8b58b","#f2855d","#eb4a40"],5:["#fde0c5","#f9c098","#f59e72","#f17854","#eb4a40"],6:["#fde0c5","#fac7a1","#f7ac80","#f38f65","#f0704f","#eb4a40"],7:["#fde0c5","#facba6","#f8b58b","#f59e72","#f2855d","#ef6a4c","#eb4a40"],tags:["quantitative"]},u={2:["#fef6b5","#e15383"],3:["#fef6b5","#ffa679","#e15383"],4:["#fef6b5","#ffc285","#fa8a76","#e15383"],5:["#fef6b5","#ffd08e","#ffa679","#f67b77","#e15383"],6:["#fef6b5","#ffd795","#ffb77f","#fd9576","#f37378","#e15383"],7:["#fef6b5","#ffdd9a","#ffc285","#ffa679","#fa8a76","#f16d7a","#e15383"],tags:["quantitative"]},h={2:["#e4f1e1","#0d585f"],3:["#e4f1e1","#63a6a0","#0d585f"],4:["#e4f1e1","#89c0b6","#448c8a","#0d585f"],5:["#E4F1E1","#9CCDC1","#63A6A0","#337F7F","#0D585F"],6:["#e4f1e1","#abd4c7","#7ab5ad","#509693","#2c7778","#0d585f"],7:["#e4f1e1","#b4d9cc","#89c0b6","#63a6a0","#448c8a","#287274","#0d585f"],tags:["quantitative"]},d={2:["#c4e6c3","#1d4f60"],3:["#c4e6c3","#4da284","#1d4f60"],4:["#c4e6c3","#6dbc90","#36877a","#1d4f60"],5:["#c4e6c3","#80c799","#4da284","#2d7974","#1d4f60"],6:["#c4e6c3","#8dce9f","#5fb28b","#3e927e","#297071","#1d4f60"],7:["#c4e6c3","#96d2a4","#6dbc90","#4da284","#36877a","#266b6e","#1d4f60"],tags:["quantitative"]},p={2:["#d2fbd4","#123f5a"],3:["#d2fbd4","#559c9e","#123f5a"],4:["#d2fbd4","#7bbcb0","#3a7c89","#123f5a"],5:["#d2fbd4","#8eccb9","#559c9e","#2b6c7f","#123f5a"],6:["#d2fbd4","#9cd5be","#6cafa9","#458892","#266377","#123f5a"],7:["#d2fbd4","#a5dbc2","#7bbcb0","#559c9e","#3a7c89","#235d72","#123f5a"],tags:["quantitative"]},f={2:["#d3f2a3","#074050"],3:["#d3f2a3","#4c9b82","#074050"],4:["#d3f2a3","#6cc08b","#217a79","#074050"],5:["#d3f2a3","#82d091","#4c9b82","#19696f","#074050"],6:["#d3f2a3","#8fda94","#60b187","#35877d","#145f69","#074050"],7:["#d3f2a3","#97e196","#6cc08b","#4c9b82","#217a79","#105965","#074050"],tags:["quantitative"]},A={2:["#245668","#EDEF5D"],3:["#245668","#39AB7E","#EDEF5D"],4:["#245668","#0D8F81","#6EC574","#EDEF5D"],5:["#245668","#04817E","#39AB7E","#8BD16D","#EDEF5D"],6:["#245668","#09787C","#1D9A81","#58BB79","#9DD869","#EDEF5D"],7:["#245668","#0F7279","#0D8F81","#39AB7E","#6EC574","#A9DC67","#EDEF5D"],tags:["aggregation"]},g={2:["#f7feae","#045275"],3:["#f7feae","#46aea0","#045275"],4:["#f7feae","#7ccba2","#089099","#045275"],5:["#f7feae","#9bd8a4","#46aea0","#058092","#045275"],6:["#f7feae","#ace1a4","#68bfa1","#2a9c9c","#02778e","#045275"],7:["#f7feae","#b7e6a5","#7ccba2","#46aea0","#089099","#00718b","#045275"],tags:["quantitative"]},m={2:["#d1eeea","#2a5674"],3:["#d1eeea","#68abb8","#2a5674"],4:["#d1eeea","#85c4c9","#4f90a6","#2a5674"],5:["#d1eeea","#96d0d1","#68abb8","#45829b","#2a5674"],6:["#d1eeea","#a1d7d6","#79bbc3","#599bae","#3f7994","#2a5674"],7:["#d1eeea","#a8dbd9","#85c4c9","#68abb8","#4f90a6","#3b738f","#2a5674"],tags:["quantitative"]},y={2:["#b0f2bc","#257d98"],3:["#b0f2bc","#4cc8a3","#257d98"],4:["#b0f2bc","#67dba5","#38b2a3","#257d98"],5:["#b0f2bc","#77e2a8","#4cc8a3","#31a6a2","#257d98"],6:["#b0f2bc","#82e6aa","#5bd4a4","#3fbba3","#2e9ea1","#257d98"],7:["#b0f2bc","#89e8ac","#67dba5","#4cc8a3","#38b2a3","#2c98a0","#257d98"],tags:["quantitative"]},_={2:["#f3e0f7","#63589f"],3:["#f3e0f7","#b998dd","#63589f"],4:["#f3e0f7","#d1afe8","#9f82ce","#63589f"],5:["#f3e0f7","#dbbaed","#b998dd","#9178c4","#63589f"],6:["#f3e0f7","#e0c2ef","#c8a5e4","#aa8bd4","#8871be","#63589f"],7:["#f3e0f7","#e4c7f1","#d1afe8","#b998dd","#9f82ce","#826dba","#63589f"],tags:["quantitative"]},v={2:["#f9ddda","#573b88"],3:["#f9ddda","#ce78b3","#573b88"],4:["#f9ddda","#e597b9","#ad5fad","#573b88"],5:["#f9ddda","#eda8bd","#ce78b3","#9955a8","#573b88"],6:["#f9ddda","#f0b2c1","#dd8ab6","#bb69b0","#8c4fa4","#573b88"],7:["#f9ddda","#f2b9c4","#e597b9","#ce78b3","#ad5fad","#834ba0","#573b88"],tags:["quantitative"]},b={2:["#f3e79b","#5c53a5"],3:["#f3e79b","#eb7f86","#5c53a5"],4:["#f3e79b","#f8a07e","#ce6693","#5c53a5"],5:["#f3e79b","#fab27f","#eb7f86","#b95e9a","#5c53a5"],6:["#f3e79b","#fabc82","#f59280","#dc6f8e","#ab5b9e","#5c53a5"],7:["#f3e79b","#fac484","#f8a07e","#eb7f86","#ce6693","#a059a0","#5c53a5"],tags:["quantitative"]},x={2:["#f3cbd3","#6c2167"],3:["#f3cbd3","#ca699d","#6c2167"],4:["#f3cbd3","#dd88ac","#b14d8e","#6c2167"],5:["#f3cbd3","#e498b4","#ca699d","#a24186","#6c2167"],6:["#f3cbd3","#e7a2b9","#d67ba5","#bc5894","#983a81","#6c2167"],7:["#f3cbd3","#eaa9bd","#dd88ac","#ca699d","#b14d8e","#91357d","#6c2167"],tags:["quantitative"]},w={2:["#fcde9c","#7c1d6f"],3:["#fcde9c","#e34f6f","#7c1d6f"],4:["#fcde9c","#f0746e","#dc3977","#7c1d6f"],5:["#fcde9c","#f58670","#e34f6f","#d72d7c","#7c1d6f"],6:["#fcde9c","#f89872","#ec666d","#df4273","#c5287b","#7c1d6f"],7:["#fcde9c","#faa476","#f0746e","#e34f6f","#dc3977","#b9257a","#7c1d6f"],tags:["quantitative"]},E={2:["#4b2991","#edd9a3"],3:["#4b2991","#ea4f88","#edd9a3"],4:["#4b2991","#c0369d","#fa7876","#edd9a3"],5:["#4b2991","#a52fa2","#ea4f88","#fa9074","#edd9a3"],6:["#4b2991","#932da3","#d43f96","#f7667c","#f89f77","#edd9a3"],7:["#4b2991","#872ca2","#c0369d","#ea4f88","#fa7876","#f6a97a","#edd9a3"],tags:["aggregation"]},C={2:["#ede5cf","#541f3f"],3:["#ede5cf","#c1766f","#541f3f"],4:["#ede5cf","#d39c83","#a65461","#541f3f"],5:["#ede5cf","#daaf91","#c1766f","#95455a","#541f3f"],6:["#ede5cf","#ddba9b","#cd8c7a","#b26166","#8a3c56","#541f3f"],7:["#ede5cf","#e0c2a2","#d39c83","#c1766f","#a65461","#813753","#541f3f"],tags:["quantitative"]},T={2:["#929b4f","#db8195"],3:["#a3ad62","#fdfbe4","#df91a3"],4:["#929b4f","#d9dbaf","#f3d1ca","#db8195"],5:["#879043","#c1c68c","#fdfbe4","#ebb4b8","#d8758b"],6:["#7f883b","#b0b874","#e3e4be","#f6ddd1","#e4a0ac","#d66d85"],7:["#798234","#a3ad62","#d0d3a2","#fdfbe4","#f0c6c3","#df91a3","#d46780"],tags:["diverging"]},S={2:["#3d5941","#ca562c"],3:["#3d5941","#f6edbd","#ca562c"],4:["#3d5941","#b5b991","#edbb8a","#ca562c"],5:["#3d5941","#96a07c","#f6edbd","#e6a272","#ca562c"],6:["#3d5941","#839170","#cecea2","#f1cf9e","#e19464","#ca562c"],7:["#3d5941","#778868","#b5b991","#f6edbd","#edbb8a","#de8a5a","#ca562c"],tags:["diverging"]},P={2:["#008080","#ca562c"],3:["#008080","#f6edbd","#ca562c"],4:["#008080","#b4c8a8","#edbb8a","#ca562c"],5:["#008080","#92b69e","#f6edbd","#e6a272","#ca562c"],6:["#008080","#7eab98","#ced7b1","#f1cf9e","#e19464","#ca562c"],7:["#008080","#70a494","#b4c8a8","#f6edbd","#edbb8a","#de8a5a","#ca562c"],tags:["diverging"]},M={2:["#009392","#cf597e"],3:["#009392","#e9e29c","#cf597e"],4:["#009392","#9ccb86","#eeb479","#cf597e"],5:["#009392","#71be83","#e9e29c","#ed9c72","#cf597e"],6:["#009392","#52b684","#bcd48c","#edc783","#eb8d71","#cf597e"],7:["#009392","#39b185","#9ccb86","#e9e29c","#eeb479","#e88471","#cf597e"],tags:["diverging"]},I={2:["#009392","#d0587e"],3:["#009392","#f1eac8","#d0587e"],4:["#009392","#91b8aa","#f1eac8","#dfa0a0","#d0587e"],5:["#009392","#91b8aa","#f1eac8","#dfa0a0","#d0587e"],6:["#009392","#72aaa1","#b1c7b3","#e5b9ad","#d98994","#d0587e"],7:["#009392","#72aaa1","#b1c7b3","#f1eac8","#e5b9ad","#d98994","#d0587e"],tags:["diverging"]},B={2:["#009B9E","#C75DAB"],3:["#009B9E","#F1F1F1","#C75DAB"],4:["#009B9E","#A7D3D4","#E4C1D9","#C75DAB"],5:["#009B9E","#7CC5C6","#F1F1F1","#DDA9CD","#C75DAB"],6:["#009B9E","#5DBCBE","#C6DFDF","#E9D4E2","#D99BC6","#C75DAB"],7:["#009B9E","#42B7B9","#A7D3D4","#F1F1F1","#E4C1D9","#D691C1","#C75DAB"],tags:["diverging"]},R={2:["#A16928","#2887a1"],3:["#A16928","#edeac2","#2887a1"],4:["#A16928","#d6bd8d","#b5c8b8","#2887a1"],5:["#A16928","#caa873","#edeac2","#98b7b2","#2887a1"],6:["#A16928","#c29b64","#e0cfa2","#cbd5bc","#85adaf","#2887a1"],7:["#A16928","#bd925a","#d6bd8d","#edeac2","#b5c8b8","#79a7ac","#2887a1"],tags:["diverging"]},L={2:["#855C75","#D9AF6B","#7C7C7C"],3:["#855C75","#D9AF6B","#AF6458","#7C7C7C"],4:["#855C75","#D9AF6B","#AF6458","#736F4C","#7C7C7C"],5:["#855C75","#D9AF6B","#AF6458","#736F4C","#526A83","#7C7C7C"],6:["#855C75","#D9AF6B","#AF6458","#736F4C","#526A83","#625377","#7C7C7C"],7:["#855C75","#D9AF6B","#AF6458","#736F4C","#526A83","#625377","#68855C","#7C7C7C"],8:["#855C75","#D9AF6B","#AF6458","#736F4C","#526A83","#625377","#68855C","#9C9C5E","#7C7C7C"],9:["#855C75","#D9AF6B","#AF6458","#736F4C","#526A83","#625377","#68855C","#9C9C5E","#A06177","#7C7C7C"],10:["#855C75","#D9AF6B","#AF6458","#736F4C","#526A83","#625377","#68855C","#9C9C5E","#A06177","#8C785D","#7C7C7C"],11:["#855C75","#D9AF6B","#AF6458","#736F4C","#526A83","#625377","#68855C","#9C9C5E","#A06177","#8C785D","#467378","#7C7C7C"],tags:["qualitative"]},O={2:["#7F3C8D","#11A579","#A5AA99"],3:["#7F3C8D","#11A579","#3969AC","#A5AA99"],4:["#7F3C8D","#11A579","#3969AC","#F2B701","#A5AA99"],5:["#7F3C8D","#11A579","#3969AC","#F2B701","#E73F74","#A5AA99"],6:["#7F3C8D","#11A579","#3969AC","#F2B701","#E73F74","#80BA5A","#A5AA99"],7:["#7F3C8D","#11A579","#3969AC","#F2B701","#E73F74","#80BA5A","#E68310","#A5AA99"],8:["#7F3C8D","#11A579","#3969AC","#F2B701","#E73F74","#80BA5A","#E68310","#008695","#A5AA99"],9:["#7F3C8D","#11A579","#3969AC","#F2B701","#E73F74","#80BA5A","#E68310","#008695","#CF1C90","#A5AA99"],10:["#7F3C8D","#11A579","#3969AC","#F2B701","#E73F74","#80BA5A","#E68310","#008695","#CF1C90","#f97b72","#A5AA99"],11:["#7F3C8D","#11A579","#3969AC","#F2B701","#E73F74","#80BA5A","#E68310","#008695","#CF1C90","#f97b72","#4b4b8f","#A5AA99"],tags:["qualitative"]},D={2:["#66C5CC","#F6CF71","#B3B3B3"],3:["#66C5CC","#F6CF71","#F89C74","#B3B3B3"],4:["#66C5CC","#F6CF71","#F89C74","#DCB0F2","#B3B3B3"],5:["#66C5CC","#F6CF71","#F89C74","#DCB0F2","#87C55F","#B3B3B3"],6:["#66C5CC","#F6CF71","#F89C74","#DCB0F2","#87C55F","#9EB9F3","#B3B3B3"],7:["#66C5CC","#F6CF71","#F89C74","#DCB0F2","#87C55F","#9EB9F3","#FE88B1","#B3B3B3"],8:["#66C5CC","#F6CF71","#F89C74","#DCB0F2","#87C55F","#9EB9F3","#FE88B1","#C9DB74","#B3B3B3"],9:["#66C5CC","#F6CF71","#F89C74","#DCB0F2","#87C55F","#9EB9F3","#FE88B1","#C9DB74","#8BE0A4","#B3B3B3"],10:["#66C5CC","#F6CF71","#F89C74","#DCB0F2","#87C55F","#9EB9F3","#FE88B1","#C9DB74","#8BE0A4","#B497E7","#B3B3B3"],11:["#66C5CC","#F6CF71","#F89C74","#DCB0F2","#87C55F","#9EB9F3","#FE88B1","#C9DB74","#8BE0A4","#B497E7","#D3B484","#B3B3B3"],tags:["qualitative"]},k={2:["#5F4690","#1D6996","#666666"],3:["#5F4690","#1D6996","#38A6A5","#666666"],4:["#5F4690","#1D6996","#38A6A5","#0F8554","#666666"],5:["#5F4690","#1D6996","#38A6A5","#0F8554","#73AF48","#666666"],6:["#5F4690","#1D6996","#38A6A5","#0F8554","#73AF48","#EDAD08","#666666"],7:["#5F4690","#1D6996","#38A6A5","#0F8554","#73AF48","#EDAD08","#E17C05","#666666"],8:["#5F4690","#1D6996","#38A6A5","#0F8554","#73AF48","#EDAD08","#E17C05","#CC503E","#666666"],9:["#5F4690","#1D6996","#38A6A5","#0F8554","#73AF48","#EDAD08","#E17C05","#CC503E","#94346E","#666666"],10:["#5F4690","#1D6996","#38A6A5","#0F8554","#73AF48","#EDAD08","#E17C05","#CC503E","#94346E","#6F4070","#666666"],11:["#5F4690","#1D6996","#38A6A5","#0F8554","#73AF48","#EDAD08","#E17C05","#CC503E","#94346E","#6F4070","#994E95","#666666"],tags:["qualitative"]},F={2:["#88CCEE","#CC6677","#888888"],3:["#88CCEE","#CC6677","#DDCC77","#888888"],4:["#88CCEE","#CC6677","#DDCC77","#117733","#888888"],5:["#88CCEE","#CC6677","#DDCC77","#117733","#332288","#888888"],6:["#88CCEE","#CC6677","#DDCC77","#117733","#332288","#AA4499","#888888"],7:["#88CCEE","#CC6677","#DDCC77","#117733","#332288","#AA4499","#44AA99","#888888"],8:["#88CCEE","#CC6677","#DDCC77","#117733","#332288","#AA4499","#44AA99","#999933","#888888"],9:["#88CCEE","#CC6677","#DDCC77","#117733","#332288","#AA4499","#44AA99","#999933","#882255","#888888"],10:["#88CCEE","#CC6677","#DDCC77","#117733","#332288","#AA4499","#44AA99","#999933","#882255","#661100","#888888"],11:["#88CCEE","#CC6677","#DDCC77","#117733","#332288","#AA4499","#44AA99","#999933","#882255","#661100","#6699CC","#888888"],tags:["qualitative","colorblind"]},N={2:["#E58606","#5D69B1","#A5AA99"],3:["#E58606","#5D69B1","#52BCA3","#A5AA99"],4:["#E58606","#5D69B1","#52BCA3","#99C945","#A5AA99"],5:["#E58606","#5D69B1","#52BCA3","#99C945","#CC61B0","#A5AA99"],6:["#E58606","#5D69B1","#52BCA3","#99C945","#CC61B0","#24796C","#A5AA99"],7:["#E58606","#5D69B1","#52BCA3","#99C945","#CC61B0","#24796C","#DAA51B","#A5AA99"],8:["#E58606","#5D69B1","#52BCA3","#99C945","#CC61B0","#24796C","#DAA51B","#2F8AC4","#A5AA99"],9:["#E58606","#5D69B1","#52BCA3","#99C945","#CC61B0","#24796C","#DAA51B","#2F8AC4","#764E9F","#A5AA99"],10:["#E58606","#5D69B1","#52BCA3","#99C945","#CC61B0","#24796C","#DAA51B","#2F8AC4","#764E9F","#ED645A","#A5AA99"],11:["#E58606","#5D69B1","#52BCA3","#99C945","#CC61B0","#24796C","#DAA51B","#2F8AC4","#764E9F","#ED645A","#CC3A8E","#A5AA99"],tags:["qualitative"]},z={...r.BuGn,tags:["quantitative"]},U={...r.BuPu,tags:["quantitative"]},G={...r.GnBu,tags:["quantitative"]},V={...r.OrRd,tags:["quantitative"]},j={...r.PuBu,tags:["quantitative"]},H={...r.PuBuGn,tags:["quantitative"]},W={...r.PuRd,tags:["quantitative"]},q={...r.RdPu,tags:["quantitative"]},Z={...r.YlGn,tags:["quantitative"]},X={...r.YlGnBu,tags:["quantitative"]},K={...r.YlOrBr,tags:["quantitative"]},Q={...r.YlOrRd,tags:["quantitative"]},J={...r.Accent,tags:["qualitative"]},Y={...r.Dark2,tags:["qualitative"]},$={...r.Paired,tags:["qualitative"]},tt={...r.Pastel1,tags:["qualitative"]},et={...r.Pastel2,tags:["qualitative"]},nt={...r.Set1,tags:["qualitative"]},it={...r.Set2,tags:["qualitative"]},rt={...r.Set3,tags:["qualitative"]},ot={...r.Blues,tags:["quantitative"]},st={...r.Greens,tags:["quantitative"]},at={...r.Greys,tags:["quantitative"]},lt={...r.Oranges,tags:["quantitative"]},ct={...r.Purples,tags:["quantitative"]},ut={...r.Reds,tags:["quantitative"]},ht={...r.BrBG,tags:["diverging"]},dt={...r.PiYG,tags:["diverging"]},pt={...r.PRGn,tags:["diverging"]},ft={...r.PuOr,tags:["diverging"]},At={...r.RdBu,tags:["diverging"]},gt={...r.RdGy,tags:["diverging"]},mt={...r.RdYlBu,tags:["diverging"]},yt={...r.RdYlGn,tags:["diverging"]},_t={...r.Spectral,tags:["diverging"]},vt=n(
vendor: 17,925 bytes, line 2
235090);const bt="PurpOr",xt=[204,204,204],wt=[119,119,119];function Et(t,e){const n=i[t];let r=e;(0,vt.vA)(n,`Palette "${t}" not found. Expected a CARTOColors string`);const o=Object.keys(n).filter((t=>"tags"!==t)).map(Number),s=Math.max(...o),a=Math.min(...o);!Number.isInteger(e)||e>s?r=s:e<a&&(r=a);let l=n[r];return n.tags&&n.tags.includes("qualitative")&&(l=l.slice(0,-1)),l.map((t=>function(t){let e=/^#?([a-f\d]{1})([a-f\d]{1})([a-f\d]{1})$/i.exec(t);if(e)return[parseInt(e[1]+e[1],16),parseInt(e[2]+e[2],16),parseInt(e[3]+e[3],16),255];if(e=/^#?([a-f\d]{1})([a-f\d]{1})([a-f\d]{1})([a-f\d]{1})$/i.exec(t),e)return[parseInt(e[1]+e[1],16),parseInt(e[2]+e[2],16),parseInt(e[3]+e[3],16),parseInt(e[4]+e[4],16)];if(e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t),e)return[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16),255];return e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t),(0,vt.vA)(e,`Hexadecimal color "${t}" was not parsed correctly`),[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16),parseInt(e[4],16)]}(t)))}},89716:(t,e,n)=>{"use strict";n.d(e,{l:()=>o});var i=n(35090);const r=Object.freeze(["function","string"]);function o(t,e,n){return(0,i.vA)("object"===typeof e,'Expected "data" to be an object'),(0,i.vA)(r.includes(typeof t),'Expected "attr" to be a function or string'),"function"===typeof t?t(e,n):e?.properties?.[t]}},35090:(t,e,n)=>{"use strict";n.d(e,{MU:()=>s,Qd:()=>o,aC:()=>a,vA:()=>r});var i=n(45957);function r(t,e){i.A.assert(t,e)}function o(t,e){const{properties:n,numericProps:i}=t;return new Proxy(n[e]||{},{get:(t,n)=>n in i?i[n].value[e]:t[n],has:(t,e)=>e in i||e in t,ownKeys:t=>[...Object.keys(i),...Reflect.ownKeys(t)],getOwnPropertyDescriptor:(t,e)=>({enumerable:!0,configurable:!0})})}function s(t,e){return`https://unpkg.com/@deck.gl/carto@${e}/dist/${t}-worker.js`}const a=t=>(t=>null!==t&&"object"===typeof t)(t)&&t.constructor==={}.constructor},81997:(t,e,n)=>{"use strict";n.d(e,{A:()=>s,k:()=>o});var i=n(45957);let r={};function o(t){r=t}function s(t,e,n,o){i.A.level>0&&r[t]&&r[t].call(null,e,n,o)}},31652:(t,e,n)=>{"use strict";n.d(e,{A:()=>j});var i=n(86561),r=n(6376);const o=r.UE;function s(t,e){return{attribute:t,format:e.size>1?`${e.type}x${e.size}`:e.type,byteOffset:e.offset||0}}function a(t){return t.stride||t.size*t.bytesPerElement}var l=n(15753),c=n(48357),u=n(45957);function h(t,e){e.offset&&u.A.removed("shaderAttribute.offset","vertexOffset, elementOffset")();const n=a(t),i=(void 0!==e.vertexOffset?e.vertexOffset:t.vertexOffset||0)*n+(e.elementOffset||0)*t.bytesPerElement+(t.offset||0);return{...e,offset:i,stride:n}}class d{constructor(t,e,n){this._buffer=null,this.device=t,this.id=e.id||"",this.size=e.size||1;const i=e.logicalType||e.type,o="float64"===i;let s,{defaultValue:a}=e;a=Number.isFinite(a)?[a]:a||new Array(this.size).fill(0),s=o?"float32":!i&&e.isIndexed?"uint32":i||"float32";let l=function(t){switch(t){case"float64":return Float64Array;case"uint8":case"unorm8":return Uint8ClampedArray;default:return(0,r.Y0)(t)}}(i||s);this.doublePrecision=o,o&&!1===e.fp64&&(l=Float32Array),this.value=null,this.settings={...e,defaultType:l,defaultValue:a,logicalType:i,type:s,normalized:s.includes("norm"),size:this.size,bytesPerElement:l.BYTES_PER_ELEMENT},this.state={...n,externalBuffer:null,bufferAccessor:this.settings,allocatedValue:null,numInstances:0,bounds:null,constant:!1}}get isConstant(){return this.state.constant}get buffer(){return this._buffer}get byteOffset(){const t=this.getAccessor();return t.vertexOffset?t.vertexOffset*a(t):0}get numInstances(){return this.state.numInstances}set numInstances(t){this.state.numInstances=t}delete(){this._buffer&&(this._buffer.delete(),this._buffer=null),l.A.release(this.state.allocatedValue)}getBuffer(){return this.state.constant?null:this.state.externalBuffer||this._buffer}getValue(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.id,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n={};if(this.state.constant){const i=this.value;if(e){const r=h(this.getAccessor(),e),o=r.offset/i.BYTES_PER_ELEMENT,s=r.size||this.size;n[t]=i.subarray(o,o+s)}else n[t]=i}else n[t]=this.getBuffer();return this.doublePrecision&&(this.value instanceof Float64Array?n[`${t}64Low`]=n[t]:n[`${t}64Low`]=new Float32Array(this.size)),n}_getBufferLayout(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.id,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=this.getAccessor(),i=[],r={name:this.id,byteStride:a(n),attributes:i};if(this.doublePrecision){const r=function(t,e){const n=h(t,e);return{high:n,low:{...n,offset:n.offset+4*t.size}}}(n,e||{});i.push(s(t,{...n,...r.high}),s(`${t}64Low`,{...n,...r.low}))}else if(e){const r=h(n,e);i.push(s(t,{...n,...r}))}else i.push(s(t,n));return r}setAccessor(t){this.state.bufferAccessor=t}getAccessor(){return this.state.bufferAccessor}getBounds(){if(this.state.bounds)return this.state.bounds;let t=null;if(this.state.constant&&this.value){const e=Array.from(this.value);t=[e,e]}else{const{value:e,numInstances:n,size:i}=this,r=n*i;if(e&&r&&e.length>=r){const n=new Array(i).fill(1/0),o=new Array(i).fill(-1/0);for(let t=0;t<r;)for(let r=0;r<i;r++){const i=e[t++];i<n[r]&&(n[r]=i),i>o[r]&&(o[r]=i)}t=[n,o]}}return this.state.bounds=t,t}setData(t){const{state:e}=this;let n;n=ArrayBuffer.isView(t)?{value:t}:t instanceof i.h?{buffer:t}:t;const r={...this.settings,...n};if(ArrayBuffer.isView(n.value)){if(!n.type){if(this.doublePrecision&&n.value instanceof Float64Array)r.type="float32";else{const t=o(n.value);r.type=r.normalized?t.replace("int","norm"):t}}r.bytesPerElement=n.value.BYTES_PER_ELEMENT,r.stride=a(r)}if(e.bounds=null,n.constant){let t=n.value;t=this._normalizeValue(t,[],0),this.settings.normalized&&(t=this.normalizeConstant(t));if(!(!e.constant||!this._areValuesEqual(t,this.value)))return!1;e.externalBuffer=null,e.constant=!0,this.value=ArrayBuffer.isView(t)?t:new Float32Array(t)}else if(n.buffer){const t=n.buffer;e.externalBuffer=t,e.constant=!1,this.value=n.value||null}else if(n.value){this._checkExternalBuffer(n);let t=n.value;e.externalBuffer=null,e.constant=!1,this.value=t;let{buffer:i}=this;const o=a(r),s=(r.vertexOffset||0)*o;if(this.doublePrecision&&t instanceof Float64Array&&(t=(0,c.cT)(t,r)),this.settings.isIndexed){const e=this.settings.defaultType;t.constructor!==e&&(t=new e(t))}const l=t.byteLength+s+2*o;(!i||i.byteLength<l)&&(i=this._createBuffer(l)),i.write(t,s)}return this.setAccessor(r),!0}updateSubBuffer(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.state.bounds=null;const e=this.value,{startOffset:n=0,endOffset:i}=t;this.buffer.write(this.doublePrecision&&e instanceof Float64Array?(0,c.cT)(e,{size:this.size,startIndex:n,endIndex:i}):e.subarray(n,i),n*e.BYTES_PER_ELEMENT+this.byteOffset)}allocate(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const{state:n}=this,i=n.allocatedValue,r=l.A.allocate(i,t+1,{size:this.size,type:this.settings.defaultType,copy:e});this.value=r;const{byteOffset:o}=this;let{buffer:s}=this;return(!s||s.byteLength<r.byteLength+o)&&(s=this._createBuffer(r.byteLength+o),e&&i&&s.write(i instanceof Float64Array?(0,c.cT)(i,this):i,o)),n.allocatedValue=r,n.constant=!1,n.externalBuffer=null,this.setAccessor(this.settings),!0}_checkExternalBuffer(t){const{value:e}=t;if(!ArrayBuffer.isView(e))throw new Error(`Attribute ${this.id} value is not TypedArray`);const n=this.settings.defaultType;let i=!1;if(this.doublePrecision&&(i=e.BYTES_PER_ELEMENT<4),i)throw new Error(`Attribute ${this.id} does not support ${e.constructor.name}`);e instanceof n||!this.settings.normalized||"normalized"in t||u.A.warn(`Attribute ${this.id} is normalized`)()}normalizeConstant(t){switch(this.settings.type){case"snorm8":return new Float32Array(t).map((t=>(t+128)/255*2-1));case"snorm16":return new Float32Array(t).map((t=>(t+32768)/65535*2-1));case"unorm8":return new Float32Array(t).map((t=>t/255));case"unorm16":return new Float32Array(t).map((t=>t/65535));default:return t}}_normalizeValue(t,e,n){const{defaultValue:i,size:r}=this.settings;if(Number.isFinite(t))return e[n]=t,e;if(!t){let t=r;for(;--t>=0;)e[n+t]=i[t];return e}switch(r){case 4:e[n+3]=Number.isFinite(t[3])?t[3]:i[3];case 3:e[n+2]=Number.isFinite(t[2])?t[2]:i[2];case 2:e[n+1]=Number.isFinite(t[1])?t[1]:i[1];case 1:e[n+0]=Number.isFinite(t[0])?t[0]:i[0];break;default:let o=r;for(;--o>=0;)e[n+o]=Number.isFinite(t[o])?t[o]:i[o]}return e}_areValuesEqual(t,e){if(!t||!e)return!1;const{size:n}=this;for(let i=0;i<n;i++)if(t[i]!==e[i])return!1;return!0}_createBuffer(t){this._buffer&&this._buffer.destroy();const{isIndexed:e,type:n}=this.settings;return this._buffer=this.device.createBuffer({...this._buffer?.props,id:this.id,usage:e?i.h.INDEX:i.h.VERTEX,indexType:e?n:void 0,byteLength:t}),this._buffer}}var p=n(57813),f=n(61281),A=n(8729);const g=[],m=[[0,1/0]];var y=n(39393);class _ extends d{constructor(t,e){super(t,e,{startIndices:null,lastExternalBuffer:null,binaryValue:null,binaryAccessor:null,needsUpdate:!0,needsRedraw:!1,layoutChanged:!1,updateRanges:m}),this.constant=!1,this.settings.update=e.update||(e.accessor?this._autoUpdater:void 0),Object.seal(this.settings),Object.seal(this.state),this._validateAttributeUpdaters()}get startIndices(){return this.state.startIndices}set startIndices(t){this.state.startIndices=t}needsUpdate(){return this.state.needsUpdate}needsRedraw(){let{clearChangedFlags:t=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const e=this.state.needsRedraw;return this.state.needsRedraw=e&&!t,e}layoutChanged(){return this.state.layoutChanged}setAccessor(t){var e,n,i;(e=this.state).layoutChanged||(e.layoutChanged=(n=t,i=this.getAccessor(),!(n.type===i.type&&n.size===i.size&&a(n)===a(i)&&(n.offset||0)===(i.offset||0)))),super.setAccessor(t)}getUpdateTriggers(){const{accessor:t}=this.settings;return[this.id].concat("function"!==typeof t&&t||[])}supportsTransition(){return Boolean(this.settings.transition)}getTransitionSetting(t){if(!t||!this.supportsTransition())return null;const{accessor:e}=this.settings,n=this.settings.transition,i=Array.isArray(e)?t[e.find((e=>t[e]))]:t[e];return(0,y.K)(i,n)}setNeedsUpdate(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.id,e=arguments.length>1?arguments[1]:void 0;if(this.state.needsUpdate=this.state.needsUpdate||t,this.setNeedsRedraw(t),e){const{startRow:t=0,endRow:n=1/0}=e;this.state.updateRanges=function(t,e){if(t===m)return t;if(e[0]<0&&(e[0]=0),e[0]>=e[1])return t;const n=[],i=t.length;let r=0;for(let o=0;o<i;o++){const i=t[o];i[1]<e[0]?(n.push(i),r=o+1):i[0]>e[1]?n.push(i):e=[Math.min(i[0],e[0]),Math.max(i[1],e[1])]}return n.splice(r,0,e),n}(this.state.updateRanges,[t,n])}else this.state.updateRanges=m}clearNeedsUpdate(){this.state.needsUpdate=!1,this.state.updateRanges=g}setNeedsRedraw(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.id;this.state.needsRedraw=this.state.needsRedraw||t}allocate(t){const{state:e,settings:n}=this;return!n.noAlloc&&(!!n.update&&(super.allocate(t,e.updateRanges!==m),!0))}updateBuffer(t){let{numInstances:e,data:n,props:i,context:r}=t;if(!this.needsUpdate())return!1;const{state:{updateRanges:o},settings:{update:s,noAlloc:a}}=this;let l=!0;if(s){for(const[t,a]of o)s.call(r,this,{data:n,startRow:t,endRow:a,props:i,numInstances:e});if(this.value)if(this.constant||!this.buffer||this.buffer.byteLength<this.value.byteLength+this.byteOffset)this.setData({value:this.value,constant:this.constant}),this.constant=!1;else for(const[t,n]of o){const i=Number.isFinite(t)?this.getVertexOffset(t):0,r=Number.isFinite(n)?this.getVertexOffset(n):a||!Number.isFinite(e)?this.value.length:e*this.size;super.updateSubBuffer({startOffset:i,endOffset:r})}else;this._checkAttributeArray()}else l=!1;return this.clearNeedsUpdate(),this.setNeedsRedraw(),l}setConstantValue(t){if(void 0===t||"function"===typeof t)return!1;return this.setData({constant:!0,value:t})&&this.setNeedsRedraw(),this.clearNeedsUpdate(),!0}setExternalBuffer(t){const{state:e}=this;return t?(this.clearNeedsUpdate(),e.lastExternalBuffer===t||(e.lastExternalBuffer=t,this.setNeedsRedraw(),this.setData(t)),!0):(e.lastExternalBuffer=null,!1)}setBinaryValue(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const{state:n,settings:i}=this;if(!t)return n.binaryValue=null,n.binaryAccessor=null,!1;if(i.noAlloc)return!1;if(n.binaryValue===t)return this.clearNeedsUpdate(),!0;n.binaryValue=t,this.setNeedsRedraw();if(i.transform||e!==this.startIndices){ArrayBuffer.isView(t)&&(t={value:t});const r=t;(0,p.A)(ArrayBuffer.isView(r.value),`invalid ${i.accessor}`);const o=Boolean(r.size)&&r.size!==this.size;return n.binaryAccessor=(0,f.I)(r.value,{size:r.size||this.size,stride:r.stride,offset:r.offset,startIndices:e,nested:o}),!1}return this.clearNeedsUpdate(),this.setData(t),!0}getVertexOffset(t){const{startIndices:e}=this;return(e?t<e.length?e[t]:this.numInstances:t)*this.size}getValue(){const t=this.settings.shaderAttributes,e=super.getValue();if(!t)return e;for(const n in t)Object.assign(e,super.getValue(n,t[n]));return e}getBufferLayout(t){this.state.layoutChanged=!1;const e=this.settings.shaderAttributes,n=super._getBufferLayout(),{stepMode:i}=this.settings;if(n.stepMode="dynamic"===i?t?t.isInstanced?"instance":"vertex":"instance":i??"vertex",!e)return n;for(const r in e){const t=super._getBufferLayout(r,e[r]);n.attributes.push(...t.attributes)}return n}_autoUpdater(t,e){let{data:n,startRow:i,endRow:r,props:o,numInstances:s}=e;if(t.constant)return;const{settings:a,state:l,value:c,size:u,startIndices:h}=t,{accessor:d,transform:g}=a,m=l.binaryAccessor||("function"===typeof d?d:o[d]);(0,p.A)("function"===typeof m,`accessor "${d}" is not a function`);let y=t.getVertexOffset(i);const{iterable:_,objectInfo:v}=(0,f.X)(n,i,r);for(const p of _){v.index++;let e=m(p,v);if(g&&(e=g.call(this,e)),h){const n=(v.index<h.length-1?h[v.index+1]:s)-h[v.index];if(e&&Array.isArray(e[0])){let n=y;for(const i of e)t._normalizeValue(i,c,n),n+=u}else e&&e.length>u?c.set(e,y):(t._normalizeValue(e,v.target,0),(0,A.R)({target:c,source:v.target,start:y,count:n}));y+=n*u}else t._normalizeValue(e,c,y),y+=u}}_validateAttributeUpdaters(){const{settings:t}=this;if(!(t.noAlloc||"function"===typeof t.update))throw new Error(`Attribute ${this.id} missing update or accessor`)}_checkAttributeArray(){const{value:t}=this,e=Math.min(4,this.size);if(t&&t.length>=e){let n=!0;switch(e){case 4:n=n&&Number.isFinite(t[3]);case 3:n=n&&Number.isFinite(t[2]);case 2:n=n&&Number.isFinite(t[1]);case 1:n=n&&Number.isFinite(t[0]);break;default:n=!1}if(!n)throw new Error(`Illegal attribute generated for ${this.id}`)}}}var v=n(72011),b=n(81997),x=n(25077),w=n(86402),E=n(30141);class C{device;model;transformFeedback;static isSupported(t){return"webgl"===t?.info?.type}constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:E.K.defaultProps;(0,x.v)(C.isSupported(t),"BufferTransform not yet implemented on WebGPU"),this.device=t,this.model=new E.K(this.device,{id:e.id||"buffer-transform-model",fs:e.fs||(0,w.Wk)(),topology:e.topology||"point-list",...e}),this.transformFeedback=this.device.createTransformFeedback({layout:this.model.pipeline.shaderLayout,buffers:e.feedbackBuffers}),this.model.setTransformFeedback(this.transformFeedback),Object.seal(this)}destroy(){this.model&&this.model.destroy()}delete(){this.destroy()}run(t){const e=this.device.beginRenderPass(t);this.model.draw(e),e.end()}update(){console.warn("TextureTransform#update() not implemented")}getBuffer(t){return this.transformFeedback.getBuffer(t)}readAsync(t){const e=this.getBuffer(t);if(e instanceof i.h)return e.readAsync();const{buffer:n,byteOffset:r=0,byteLength:o=n.byteLength}=e;return n.readAsync(r,o)}}var T=n(63170);function S(t){const{source:e,target:n,start:i=0,size:r,getData:o}=t,s=t.end||n.length,a=e.length,l=s-i;if(a>l)return void n.set(e.subarray(0,l),i);if(n.set(e,i),!o)return;let c=a;for(;c<l;){const t=o(c,e);for(let e=0;e<r;e++)n[i+c]=t[e]||0,c++}}function P(t){switch(t){case 1:return"float";case 2:return"vec2";case 3:return"vec3";case 4:return"vec4";default:throw new Error(`No defined attribute type for size "${t}"`)}}function M(t){switch(t){case 1:return"float32";case 2:return"float32x2";case 3:return"float32x3";case 4:return"float32x4";default:throw new Error("invalid type size")}}function I(t){t.push(t.shift())}function B(t){let{device:e,source:n,target:i}=t;return(!i||i.byteLength<n.byteLength)&&(i?.destroy(),i=e.createBuffer({byteLength:n.byteLength,usage:n.usage})),i}function R(t){let{device:e,buffer:n,attribute:i,fromLength:r,toLength:o,fromStartIndices:s,getData:a=t=>t}=t;const l=i.doublePrecision&&i.value instanceof Float64Array?2:1,c=i.size*l,u=i.byteOffset,h=i.settings.bytesPerElement<4?u/i.settings.bytesPerElement*4:u,d=i.startIndices,p=s&&d,f=i.isConstant;if(!p&&n&&r>=o)return n;const A=i.value instanceof Float64Array?Float32Array:i.value.constructor,g=f?i.value:new A(i.getBuffer().readSyncWebGL(u,o*A.BYTES_PER_ELEMENT).buffer);if(i.settings.normalized&&!f){const t=a;a=(e,n)=>i.normalizeConstant(t(e,n))}const m=f?(t,e)=>a(g,e):(t,e)=>a(g.subarray(t+u,t+u+c),e),y=n?new Float32Array(n.readSyncWebGL(h,4*r).buffer):new Float32Array(0),_=new Float32Array(o);return function(t){let{source:e,target:n,size:i,getData:r,sourceStartIndices:o,targetStartIndices:s}=t;if(!o||!s)return S({source:e,target:n,size:i,getData:r}),n;let a=0,l=0;const c=r&&((t,e)=>r(t+l,e)),u=Math.min(o.length,s.length);for(let h=1;h<u;h++){const t=o[h]*i,r=s[h]*i;S({source:e.subarray(a,t),target:n,start:l,end:r,size:i,getData:c}),a=t,l=r}l<n.length&&S({source:[],target:n,start:l,size:i,getData:c})}({source:y,target:_,sourceStartIndices:s,targetStartIndices:d,size:c,getData:m}),(!n||n.byteLength<_.byteLength+h)&&(n?.destroy(),n=e.createBuffer({byteLength:_.byteLength+h,usage:35050})),n.write(_,h),n}var L=n(48163
vendor: 12,019 bytes, line 2
2);class O{constructor(t){let{device:e,attribute:n,timeline:i}=t;this.buffers=[],this.currentLength=0,this.device=e,this.transition=new L.A(i),this.attribute=n,this.attributeInTransition=function(t){const{device:e,settings:n,value:i}=t,r=new _(e,n);return r.setData({value:i instanceof Float64Array?new Float64Array(0):new Float32Array(0),normalized:n.normalized}),r}(n),this.currentStartIndices=n.startIndices}get inProgress(){return this.transition.inProgress}start(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1/0;this.settings=t,this.currentStartIndices=this.attribute.startIndices,this.currentLength=function(t,e){const{doublePrecision:n,settings:i,value:r,size:o}=t,s=n&&r instanceof Float64Array?2:1;let a=0;const{shaderAttributes:l}=t.settings;if(l)for(const c of Object.values(l))a=Math.max(a,c.vertexOffset??0);return(i.noAlloc?r.length:(e+a)*o)*s}(this.attribute,e),this.transition.start({...t,duration:n})}update(){const t=this.transition.update();return t&&this.onUpdate(),t}setBuffer(t){this.attributeInTransition.setData({buffer:t,normalized:this.attribute.settings.normalized,value:this.attributeInTransition.value})}cancel(){this.transition.cancel()}delete(){this.cancel();for(const t of this.buffers)t.destroy();this.buffers.length=0}}const D="#version 300 es\n#define SHADER_NAME interpolation-transition-vertex-shader\n\nuniform float time;\nin ATTRIBUTE_TYPE aFrom;\nin ATTRIBUTE_TYPE aTo;\nout ATTRIBUTE_TYPE vCurrent;\n\nvoid main(void) {\n vCurrent = mix(aFrom, aTo, time);\n gl_Position = vec4(0.0);\n}\n",k="#version 300 es\n#define SHADER_NAME interpolation-transition-vertex-shader\n\nuniform float time;\nin ATTRIBUTE_TYPE aFrom;\nin ATTRIBUTE_TYPE aFrom64Low;\nin ATTRIBUTE_TYPE aTo;\nin ATTRIBUTE_TYPE aTo64Low;\nout ATTRIBUTE_TYPE vCurrent;\nout ATTRIBUTE_TYPE vCurrent64Low;\n\nvec2 mix_fp64(vec2 a, vec2 b, float x) {\n vec2 range = sub_fp64(b, a);\n return sum_fp64(a, mul_fp64(range, vec2(x, 0.0)));\n}\n\nvoid main(void) {\n for (int i=0; i<ATTRIBUTE_SIZE; i++) {\n vec2 value = mix_fp64(vec2(aFrom[i], aFrom64Low[i]), vec2(aTo[i], aTo64Low[i]), time);\n vCurrent[i] = value.x;\n vCurrent64Low[i] = value.y;\n }\n gl_Position = vec4(0.0);\n}\n";function F(t){return t.doublePrecision&&t.value instanceof Float64Array}const N="#version 300 es\n#define SHADER_NAME spring-transition-vertex-shader\n\n#define EPSILON 0.00001\n\nuniform float stiffness;\nuniform float damping;\nin ATTRIBUTE_TYPE aPrev;\nin ATTRIBUTE_TYPE aCur;\nin ATTRIBUTE_TYPE aTo;\nout ATTRIBUTE_TYPE vNext;\nout float vIsTransitioningFlag;\n\nATTRIBUTE_TYPE getNextValue(ATTRIBUTE_TYPE cur, ATTRIBUTE_TYPE prev, ATTRIBUTE_TYPE dest) {\n ATTRIBUTE_TYPE velocity = cur - prev;\n ATTRIBUTE_TYPE delta = dest - cur;\n ATTRIBUTE_TYPE spring = delta * stiffness;\n ATTRIBUTE_TYPE damper = velocity * -1.0 * damping;\n return spring + damper + velocity + cur;\n}\n\nvoid main(void) {\n bool isTransitioning = length(aCur - aPrev) > EPSILON || length(aTo - aCur) > EPSILON;\n vIsTransitioningFlag = isTransitioning ? 1.0 : 0.0;\n\n vNext = getNextValue(aCur, aPrev, aTo);\n gl_Position = vec4(0, 0, 0, 1);\n gl_PointSize = 100.0;\n}\n",z="#version 300 es\n#define SHADER_NAME spring-transition-is-transitioning-fragment-shader\n\nin float vIsTransitioningFlag;\n\nout vec4 fragColor;\n\nvoid main(void) {\n if (vIsTransitioningFlag == 0.0) {\n discard;\n }\n fragColor = vec4(1.0);\n}";const U={interpolation:class extends O{constructor(t){let{device:e,attribute:n,timeline:i}=t;super({device:e,attribute:n,timeline:i}),this.type="interpolation",this.transform=function(t,e){const n=e.size,i=P(n),r=M(n),o=e.getBufferLayout();if(F(e))return new C(t,{vs:k,bufferLayout:[{name:"aFrom",byteStride:8*n,attributes:[{attribute:"aFrom",format:r,byteOffset:0},{attribute:"aFrom64Low",format:r,byteOffset:4*n}]},{name:"aTo",byteStride:8*n,attributes:[{attribute:"aTo",format:r,byteOffset:0},{attribute:"aTo64Low",format:r,byteOffset:4*n}]}],modules:[T.dI],defines:{ATTRIBUTE_TYPE:i,ATTRIBUTE_SIZE:n},moduleSettings:{},varyings:["vCurrent","vCurrent64Low"],bufferMode:35980,disableWarnings:!0});return new C(t,{vs:D,bufferLayout:[{name:"aFrom",format:r},{name:"aTo",format:o.attributes[0].format}],defines:{ATTRIBUTE_TYPE:i},varyings:["vCurrent"],disableWarnings:!0})}(e,n)}start(t,e){const n=this.currentLength,i=this.currentStartIndices;if(super.start(t,e,t.duration),t.duration<=0)return void this.transition.cancel();const{buffers:r,attribute:o}=this;I(r),r[0]=R({device:this.device,buffer:r[0],attribute:o,fromLength:n,toLength:this.currentLength,fromStartIndices:i,getData:t.enter}),r[1]=B({device:this.device,source:r[0],target:r[1]}),this.setBuffer(r[1]);const{transform:s}=this,a=s.model;let l=Math.floor(this.currentLength/o.size);F(o)&&(l/=2),a.setVertexCount(l),o.isConstant?(a.setAttributes({aFrom:r[0]}),a.setConstantAttributes({aTo:o.value})):a.setAttributes({aFrom:r[0],aTo:o.getBuffer()}),s.transformFeedback.setBuffers({vCurrent:r[1]})}onUpdate(){const{duration:t,easing:e}=this.settings,{time:n}=this.transition;let i=n/t;e&&(i=e(i));const{model:r}=this.transform;r.setUniforms({time:i}),this.transform.run({discard:!0})}delete(){super.delete(),this.transform.destroy()}},spring:class extends O{constructor(t){let{device:e,attribute:n,timeline:i}=t;super({device:e,attribute:n,timeline:i}),this.type="spring",this.texture=function(t){return t.createTexture({data:new Uint8Array(4),format:"rgba8unorm",mipmaps:!1,width:1,height:1})}(e),this.framebuffer=function(t,e){return t.createFramebuffer({id:"spring-transition-is-transitioning-framebuffer",width:1,height:1,colorAttachments:[e]})}(e,this.texture),this.transform=function(t,e){const n=P(e.size),i=M(e.size);return new C(t,{vs:N,fs:z,bufferLayout:[{name:"aPrev",format:i},{name:"aCur",format:i},{name:"aTo",format:e.getBufferLayout().attributes[0].format}],varyings:["vNext"],defines:{ATTRIBUTE_TYPE:n},parameters:{depthCompare:"always",blendColorOperation:"max",blendColorSrcFactor:"one",blendColorDstFactor:"one",blendAlphaOperation:"max",blendAlphaSrcFactor:"one",blendAlphaDstFactor:"one"}})}(e,n)}start(t,e){const n=this.currentLength,i=this.currentStartIndices;super.start(t,e);const{buffers:r,attribute:o}=this;for(let a=0;a<2;a++)r[a]=R({device:this.device,buffer:r[a],attribute:o,fromLength:n,toLength:this.currentLength,fromStartIndices:i,getData:t.enter});r[2]=B({device:this.device,source:r[0],target:r[2]}),this.setBuffer(r[1]);const{model:s}=this.transform;s.setVertexCount(Math.floor(this.currentLength/o.size)),o.isConstant?s.setConstantAttributes({aTo:o.value}):s.setAttributes({aTo:o.getBuffer()})}onUpdate(){const{buffers:t,transform:e,framebuffer:n,transition:i}=this,r=this.settings;e.model.setAttributes({aPrev:t[0],aCur:t[1]}),e.transformFeedback.setBuffers({vNext:t[2]}),e.model.setUniforms({stiffness:r.stiffness,damping:r.damping}),e.run({framebuffer:n,discard:!1,parameters:{viewport:[0,0,1,1]},clearColor:[0,0,0,0]}),I(t),this.setBuffer(t[1]);this.device.readPixelsToArrayWebGL(n)[0]>0||i.end()}delete(){super.delete(),this.transform.destroy(),this.texture.destroy(),this.framebuffer.destroy()}}};class G{constructor(t,e){let{id:n,timeline:i}=e;if(!t)throw new Error("AttributeTransitionManager is constructed without device");this.id=n,this.device=t,this.timeline=i,this.transitions={},this.needsRedraw=!1,this.numInstances=1}finalize(){for(const t in this.transitions)this._removeTransition(t)}update(t){let{attributes:e,transitions:n,numInstances:i}=t;this.numInstances=i||1;for(const r in e){const t=e[r],i=t.getTransitionSetting(n);i&&this._updateAttribute(r,t,i)}for(const r in this.transitions){const t=e[r];t&&t.getTransitionSetting(n)||this._removeTransition(r)}}hasAttribute(t){const e=this.transitions[t];return e&&e.inProgress}getAttributes(){const t={};for(const e in this.transitions){const n=this.transitions[e];n.inProgress&&(t[e]=n.attributeInTransition)}return t}run(){if(0===this.numInstances)return!1;for(const e in this.transitions){this.transitions[e].update()&&(this.needsRedraw=!0)}const t=this.needsRedraw;return this.needsRedraw=!1,t}_removeTransition(t){this.transitions[t].delete(),delete this.transitions[t]}_updateAttribute(t,e,n){const i=this.transitions[t];let r=!i||i.type!==n.type;if(r){i&&this._removeTransition(t);const o=U[n.type];o?this.transitions[t]=new o({attribute:e,timeline:this.timeline,device:this.device}):(u.A.error(`unsupported transition type '${n.type}'`)(),r=!1)}(r||e.needsRedraw())&&(this.needsRedraw=!0,this.transitions[t].start(n,this.numInstances))}}const V="attributeManager.invalidate";class j{constructor(t){let{id:e="attribute-manager",stats:n,timeline:i}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.mergeBoundsMemoized=(0,v.A)(c._Z),this.id=e,this.device=t,this.attributes={},this.updateTriggers={},this.needsRedraw=!0,this.userData={},this.stats=n,this.attributeTransitionManager=new G(t,{id:`${e}-transitions`,timeline:i}),Object.seal(this)}finalize(){for(const t in this.attributes)this.attributes[t].delete();this.attributeTransitionManager.finalize()}getNeedsRedraw(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1};const e=this.needsRedraw;return this.needsRedraw=this.needsRedraw&&!t.clearRedrawFlags,e&&this.id}setNeedsRedraw(){this.needsRedraw=!0}add(t){this._add(t)}addInstanced(t){this._add(t,{stepMode:"instance"})}remove(t){for(const e of t)void 0!==this.attributes[e]&&(this.attributes[e].delete(),delete this.attributes[e])}invalidate(t,e){const n=this._invalidateTrigger(t,e);(0,b.A)(V,this,t,n)}invalidateAll(t){for(const e in this.attributes)this.attributes[e].setNeedsUpdate(e,t);(0,b.A)(V,this,"all")}update(t){let{data:e,numInstances:n,startIndices:i=null,transitions:r,props:o={},buffers:s={},context:a={}}=t,l=!1;(0,b.A)("attributeManager.updateStart",this),this.stats&&this.stats.get("Update Attributes").timeStart();for(const c in this.attributes){const t=this.attributes[c],r=t.settings.accessor;t.startIndices=i,t.numInstances=n,o[c]&&u.A.removed(`props.${c}`,`data.attributes.${c}`)(),t.setExternalBuffer(s[c])||t.setBinaryValue("string"===typeof r?s[r]:void 0,e.startIndices)||"string"===typeof r&&!s[r]&&t.setConstantValue(o[r])||t.needsUpdate()&&(l=!0,this._updateAttribute({attribute:t,numInstances:n,data:e,props:o,context:a})),this.needsRedraw=this.needsRedraw||t.needsRedraw()}l&&(0,b.A)("attributeManager.updateEnd",this,n),this.stats&&this.stats.get("Update Attributes").timeEnd(),this.attributeTransitionManager.update({attributes:this.attributes,numInstances:n,transitions:r})}updateTransition(){const{attributeTransitionManager:t}=this,e=t.run();return this.needsRedraw=this.needsRedraw||e,e}getAttributes(){return{...this.attributes,...this.attributeTransitionManager.getAttributes()}}getBounds(t){const e=t.map((t=>this.attributes[t]?.getBounds()));return this.mergeBoundsMemoized(e)}getChangedAttributes(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearChangedFlags:!1};const{attributes:e,attributeTransitionManager:n}=this,i={...n.getAttributes()};for(const r in e){const o=e[r];o.needsRedraw(t)&&!n.hasAttribute(r)&&(i[r]=o)}return i}getBufferLayouts(t){return Object.values(this.getAttributes()).map((e=>e.getBufferLayout(t)))}_add(t,e){for(const n in t){const i=t[n],r={...i,id:n,size:(i.isIndexed?1:i.size)||1,...e};this.attributes[n]=new _(this.device,r)}this._mapUpdateTriggersToAttributes()}_mapUpdateTriggersToAttributes(){const t={};for(const e in this.attributes){this.attributes[e].getUpdateTriggers().forEach((n=>{t[n]||(t[n]=[]),t[n].push(e)}))}this.updateTriggers=t}_invalidateTrigger(t,e){const{attributes:n,updateTriggers:i}=this,r=i[t];return r&&r.forEach((t=>{const i=n[t];i&&i.setNeedsUpdate(i.id,e)})),r}_updateAttribute(t){const{attribute:e,numInstances:n}=t;if((0,b.A)("attribute.updateStart",e),e.constant)return void e.setConstantValue(e.value);e.allocate(n)&&(0,b.A)("attribute.allocate",e,n);e.updateBuffer(t)&&(this.needsRedraw=!0,(0,b.A)("attribute.updateEnd",e,n))}}},3
vendor: 9,887 bytes, line 2
29393:(t,e,n)=>{"use strict";n.d(e,{K:()=>r});const i={interpolation:{duration:0,easing:t=>t},spring:{stiffness:.05,damping:.5}};function r(t,e){if(!t)return null;Number.isFinite(t)&&(t={type:"interpolation",duration:t});const n=t.type||"interpolation";return{...i[n],...e,...t,type:n}}},89522:(t,e,n)=>{"use strict";n.d(e,{A:()=>l});var i=n(14939),r=n(81997),o=n(8729),s=n(11275);class a extends i.A{get isComposite(){return!0}get isLoaded(){return super.isLoaded&&this.getSubLayers().every((t=>t.isLoaded))}getSubLayers(){return this.internalState&&this.internalState.subLayers||[]}initializeState(t){}setState(t){super.setState(t),this.setNeedsUpdate()}getPickingInfo(t){let{info:e}=t;const{object:n}=e;return n&&n.__source&&n.__source.parent&&n.__source.parent.id===this.id?(e.object=n.__source.object,e.index=n.__source.index,e):e}filterSubLayer(t){return!0}shouldRenderSubLayer(t,e){return e&&e.length}getSubLayerClass(t,e){const{_subLayerProps:n}=this.props;return n&&n[t]&&n[t].type||e}getSubLayerRow(t,e,n){return t.__source={parent:this,object:e,index:n},t}getSubLayerAccessor(t){if("function"===typeof t){const e={index:-1,data:this.props.data,target:[]};return(n,i)=>n&&n.__source?(e.index=n.__source.index,t(n.__source.object,e)):t(n,i)}return t}getSubLayerProps(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{opacity:e,pickable:n,visible:i,parameters:r,getPolygonOffset:o,highlightedObjectIndex:a,autoHighlight:l,highlightColor:c,coordinateSystem:u,coordinateOrigin:h,wrapLongitude:d,positionFormat:p,modelMatrix:f,extensions:A,fetch:g,operation:m,_subLayerProps:y}=this.props,_={id:"",updateTriggers:{},opacity:e,pickable:n,visible:i,parameters:r,getPolygonOffset:o,highlightedObjectIndex:a,autoHighlight:l,highlightColor:c,coordinateSystem:u,coordinateOrigin:h,wrapLongitude:d,positionFormat:p,modelMatrix:f,extensions:A,fetch:g,operation:m},v=y&&t.id&&y[t.id],b=v&&v.updateTriggers,x=t.id||"sublayer";if(v){const e=this.props[s.fW],n=t.type?t.type._propTypes:{};for(const t in v){const i=n[t]||e[t];i&&"accessor"===i.type&&(v[t]=this.getSubLayerAccessor(v[t]))}}Object.assign(_,t,v),_.id=`${this.props.id}-${x}`,_.updateTriggers={all:this.props.updateTriggers?.all,...t.updateTriggers,...b};for(const s of A){const t=s.getSubLayerProps.call(this,s);t&&Object.assign(_,t,{updateTriggers:Object.assign(_.updateTriggers,t.updateTriggers)})}return _}_updateAutoHighlight(t){for(const e of this.getSubLayers())e.updateAutoHighlight(t)}_getAttributeManager(){return null}_postUpdate(t,e){let n=this.internalState.subLayers;const i=!n||this.needsUpdate();if(i){const t=this.renderLayers();n=(0,o.B)(t,Boolean),this.internalState.subLayers=n}(0,r.A)("compositeLayer.renderLayers",this,i,n);for(const r of n)r.parent=this}}a.layerName="CompositeLayer";const l=a},4896:(t,e,n)=>{"use strict";n.d(e,{Kx:()=>o,p5:()=>s,qY:()=>a,rf:()=>r});var i=n(45957);const r={DEFAULT:-1,LNGLAT:1,METER_OFFSETS:2,LNGLAT_OFFSETS:3,CARTESIAN:0};Object.defineProperty(r,"IDENTITY",{get:()=>(i.A.deprecated("COORDINATE_SYSTEM.IDENTITY","COORDINATE_SYSTEM.CARTESIAN")(),0)});const o={WEB_MERCATOR:1,GLOBE:2,WEB_MERCATOR_AUTO_OFFSET:4,IDENTITY:0},s={common:0,meters:1,pixels:2},a={click:{handler:"onClick"},panstart:{handler:"onDragStart"},panmove:{handler:"onDrag"},panend:{handler:"onDragEnd"}}},44432:(t,e,n)=>{"use strict";n.d(e,{x:()=>l});var i=n(78477),r=n(83474),o=n(45957),s=n(81997);const a={dataType:null,batchType:null,id:"JSON",name:"JSON",module:"",version:"",options:{},extensions:["json","geojson"],mimeTypes:["application/json","application/geo+json"],testText:function(t){const e=t[0],n=t[t.length-1];return"{"===e&&"}"===n||"["===e&&"]"===n},parseTextSync:JSON.parse};const l=function(){const t="9.0.33",e=globalThis.deck&&globalThis.deck.VERSION;if(e&&e!==t)throw new Error(`deck.gl - multiple versions detected: ${e} vs ${t}`);return e||(o.A.log(1,`deck.gl ${t}`)(),globalThis.deck={...globalThis.deck,VERSION:t,version:t,log:o.A,_registerLoggers:s.k},(0,i.mk)([a,[r.$,{imagebitmap:{premultiplyAlpha:"none"}}]])),t}()},14939:(t,e,n)=>{"use strict";n.d(e,{A:()=>lt});var i=n(86561),r=n(4896),o=n(31652),s=n(39393),a=n(25195),l=n(48163);class c extends l.A{get value(){return this._value}_onUpdate(){const{time:t,settings:{fromValue:e,toValue:n,duration:i,easing:r}}=this,o=r(t/i);this._value=(0,a.Cc)(e,n,o)}}const u=1e-5;function h(t,e,n,i,r){const o=e-t;return(n-e)*r+-o*i+o+e}function d(t,e){if(Array.isArray(t)){let n=0;for(let i=0;i<t.length;i++){const r=t[i]-e[i];n+=r*r}return Math.sqrt(n)}return Math.abs(t-e)}class p extends l.A{get value(){return this._currValue}_onUpdate(){const{fromValue:t,toValue:e,damping:n,stiffness:i}=this.settings,{_prevValue:r=t,_currValue:o=t}=this;let s=function(t,e,n,i,r){if(Array.isArray(n)){const o=[];for(let s=0;s<n.length;s++)o[s]=h(t[s],e[s],n[s],i,r);return o}return h(t,e,n,i,r)}(r,o,e,n,i);const a=d(s,e),l=d(s,o);a<u&&l<u&&(s=e,this.end()),this._prevValue=o,this._currValue=s}}var f=n(45957);const A={interpolation:c,spring:p};class g{constructor(t){this.transitions=new Map,this.timeline=t}get active(){return this.transitions.size>0}add(t,e,n,i){const{transitions:r}=this;if(r.has(t)){const n=r.get(t),{value:i=n.settings.fromValue}=n;e=i,this.remove(t)}if(!(i=(0,s.K)(i)))return;const o=A[i.type];if(!o)return void f.A.error(`unsupported transition type '${i.type}'`)();const a=new o(this.timeline);a.start({...i,fromValue:e,toValue:n}),r.set(t,a)}remove(t){const{transitions:e}=this;e.has(t)&&(e.get(t).cancel(),e.delete(t))}update(){const t={};for(const[e,n]of this.transitions)n.update(),t[e]=n.value,n.inProgress||this.remove(e);return t}clear(){for(const t of this.transitions.keys())this.remove(t)}}var m=n(75612),y=n(11275);function _(t){if(null===(e=t)||"object"!==typeof e)throw new Error("count(): argument not an object");var e;if("function"===typeof t.count)return t.count();if(Number.isFinite(t.size))return t.size;if(Number.isFinite(t.length))return t.length;if(function(t){return null!==t&&"object"===typeof t&&t.constructor===Object}(t))return Object.keys(t).length;throw new Error("count(): argument not a container")}var v=n(81997),b=n(57813),x=n(72011),w=n(1434),E=n(95840),C=n(2816),T=n(7964),S=n(98953),P=n(68945);const M=[0,0,0];function I(t,e){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const i=e.projectPosition(t);if(n&&e instanceof C.A){const[n,r,o=0]=t,s=e.getDistanceScales([n,r]);i[2]=o*s.unitsPerMeter[2]}return i}function B(t,e){let{viewport:n,modelMatrix:i,coordinateSystem:o,coordinateOrigin:s,offsetMode:a}=e,[l,c,u=0]=t;switch(i&&([l,c,u]=T.Z0([],[l,c,u,1],i)),o){case r.rf.LNGLAT:return I([l,c,u],n,a);case r.rf.LNGLAT_OFFSETS:return I([l+s[0],c+s[1],u+(s[2]||0)],n,a);case r.rf.METER_OFFSETS:return I((0,P.dT)(s,[l,c,u]),n,a);case r.rf.CARTESIAN:default:return n.isGeospatial?[l+s[0],c+s[1],u+s[2]]:n.projectPosition([l,c,u])}}function R(t,e){const{viewport:n,coordinateSystem:i,coordinateOrigin:o,modelMatrix:s,fromCoordinateSystem:a,fromCoordinateOrigin:l}=function(t){const{viewport:e,modelMatrix:n,coordinateOrigin:i}=t;let{coordinateSystem:o,fromCoordinateSystem:s,fromCoordinateOrigin:a}=t;return o===r.rf.DEFAULT&&(o=e.isGeospatial?r.rf.LNGLAT:r.rf.CARTESIAN),void 0===s&&(s=o),void 0===a&&(a=i),{viewport:e,coordinateSystem:o,coordinateOrigin:i,modelMatrix:n,fromCoordinateSystem:s,fromCoordinateOrigin:a}}(e),{autoOffset:c=!0}=e,{geospatialOrigin:u=M,shaderCoordinateOrigin:h=M,offsetMode:d=!1}=c?(0,E.o)(n,i,o):{},p=B(t,{viewport:n,modelMatrix:s,coordinateSystem:a,coordinateOrigin:l,offsetMode:d});if(d){const t=n.projectPosition(u||h);S.jb(p,p,t)}return p}var L=n(15753),O=n(61281),D=n(44980);const k={minFilter:"linear",mipmapFilter:"linear",magFilter:"linear",addressModeU:"clamp-to-edge",addressModeV:"clamp-to-edge"},F={};var N=n(67440);const z={boolean:{validate:(t,e)=>!0,equal:(t,e,n)=>Boolean(t)===Boolean(e)},number:{validate:(t,e)=>Number.isFinite(t)&&(!("max"in e)||t<=e.max)&&(!("min"in e)||t>=e.min)},color:{validate:(t,e)=>e.optional&&!t||V(t)&&(3===t.length||4===t.length),equal:(t,e,n)=>(0,N.b)(t,e,1)},accessor:{validate(t,e){const n=j(t);return"function"===n||n===j(e.value)},equal:(t,e,n)=>"function"===typeof e||(0,N.b)(t,e,1)},array:{validate:(t,e)=>e.optional&&!t||V(t),equal(t,e,n){const{compare:i}=n,r=Number.isInteger(i)?i:i?1:0;return i?(0,N.b)(t,e,r):t===e}},object:{equal(t,e,n){if(n.ignore)return!0;const{compare:i}=n,r=Number.isInteger(i)?i:i?1:0;return i?(0,N.b)(t,e,r):t===e}},function:{validate:(t,e)=>e.optional&&!t||"function"===typeof t,equal:(t,e,n)=>!n.compare&&!1!==n.ignore||t===e},data:{transform:(t,e,n)=>{if(!t)return t;const{dataTransform:i}=n.props;return i?i(t):"string"===typeof t.shape&&t.shape.endsWith("-table")&&Array.isArray(t.data)?t.data:t}},image:{transform:(t,e,n)=>{const i=n.context;return i&&i.device?function(t,e,n,i){if(n instanceof D.g)return n;n.constructor&&"Object"!==n.constructor.name&&(n={data:n});let r=null;n.compressed&&(r={minFilter:"linear",mipmapFilter:n.data.length>1?"nearest":"linear"});const o=e.createTexture({...n,sampler:{...k,...r,...i}});return F[o.id]=t,o}(n.id,i.device,t,{...e.parameters,...n.props.textureParameters}):null},release:(t,e,n)=>{var i,r;i=n.id,(r=t)&&r instanceof D.g&&F[r.id]===i&&(r.delete(),delete F[r.id])}}};function U(t,e){switch(j(e)){case"object":return G(t,e);case"array":return G(t,{type:"array",value:e,compare:!1});case"boolean":return G(t,{type:"boolean",value:e});case"number":return G(t,{type:"number",value:e});case"function":return G(t,{type:"function",value:e,compare:!0});default:return{name:t,type:"unknown",value:e}}}function G(t,e){return"type"in e?{name:t,...z[e.type],...e}:"value"in e?{name:t,type:j(e.value),...e}:{name:t,type:"object",value:e}}function V(t){return Array.isArray(t)||ArrayBuffer.isView(t)}function j(t){return V(t)?"array":null===t?"null":typeof t}const H="_mergedDefaultProps";function W(t,e){
vendor: 6,340 bytes, line 2
2let n=H;if(e)for(const r of e){const t=r.constructor;t&&(n+=`:${t.extensionName||t.name}`)}const i=X(t,n);return i||(t[n]=function(t,e){const n=t.prototype;if(!n)return null;const i=Object.getPrototypeOf(t),r=W(i),o=X(t,"defaultProps")||{},s=function(t){const e={},n={},i={};for(const[r,o]of Object.entries(t)){const t=o?.deprecatedFor;if(t)i[r]=Array.isArray(t)?t:[t];else{const t=U(r,o);e[r]=t,n[r]=t.value}}return{propTypes:e,defaultProps:n,deprecatedProps:i}}(o),a=Object.assign(Object.create(null),r,s.defaultProps),l=Object.assign(Object.create(null),r?.[y.fW],s.propTypes),c=Object.assign(Object.create(null),r?.[y.uH],s.deprecatedProps);for(const u of e){const t=W(u.constructor);t&&(Object.assign(a,t),Object.assign(l,t[y.fW]),Object.assign(c,t[y.uH]))}(function(t,e){const n=function(t){const e=t.componentName;e||f.A.warn(`${t.name}.componentName not specified`)();return e||t.name}(e);Object.defineProperties(t,{id:{writable:!0,value:n}})})(a,t),function(t,e){const n={},i={};for(const r in e){const t=e[r],{name:o,value:s}=t;t.async&&(n[o]=s,i[o]=q(o))}t[y.jA]=n,t[y.YN]={},Object.defineProperties(t,i)}(a,l),function(t,e){for(const n in e)Object.defineProperty(t,n,{enumerable:!1,set(t){const i=`${this.id}: ${n}`;for(const r of e[n])Z(this,r)||(this[r]=t);f.A.deprecated(i,e[n].join("/"))()}})}(a,c),a[y.fW]=l,a[y.uH]=c,0!==e.length||Z(t,"_propTypes")||(t._propTypes=l);return a}(t,e||[]))}function q(t){return{enumerable:!0,set(e){"string"===typeof e||e instanceof Promise||(0,O.Td)(e)?this[y.YN][t]=e:this[y.vf][t]=e},get(){if(this[y.vf]){if(t in this[y.vf]){return this[y.vf][t]||this[y.jA][t]}if(t in this[y.YN]){const e=this[y.r3]&&this[y.r3].internalState;if(e&&e.hasAsyncProp(t))return e.getAsyncProp(t)||this[y.jA][t]}}return this[y.jA][t]}}}function Z(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function X(t,e){return Z(t,e)&&t[e]}let K=0;class Q{constructor(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];this.props=function(t,e){let n;for(let o=e.length-1;o>=0;o--){const t=e[o];"extensions"in t&&(n=t.extensions)}const i=W(t.constructor,n),r=Object.create(i);r[y.r3]=t,r[y.YN]={},r[y.vf]={};for(let o=0;o<e.length;++o){const t=e[o];for(const e in t)r[e]=t[e]}return Object.freeze(r),r}(this,e),this.id=this.props.id,this.count=K++}clone(t){const{props:e}=this,n={};for(const i in e[y.jA])i in e[y.vf]?n[i]=e[y.vf][i]:i in e[y.YN]&&(n[i]=e[y.YN][i]);return new this.constructor({...e,...n,...t})}}Q.componentName="Component",Q.defaultProps={};const J=Q,Y=Object.freeze({});class ${constructor(t){this.component=t,this.asyncProps={},this.onAsyncPropUpdated=()=>{},this.oldProps=null,this.oldAsyncProps=null}finalize(){for(const t in this.asyncProps){const e=this.asyncProps[t];e&&e.type&&e.type.release&&e.type.release(e.resolvedValue,e.type,this.component)}this.asyncProps={},this.component=null,this.resetOldProps()}getOldProps(){return this.oldAsyncProps||this.oldProps||Y}resetOldProps(){this.oldAsyncProps=null,this.oldProps=this.component?this.component.props:null}hasAsyncProp(t){return t in this.asyncProps}getAsyncProp(t){const e=this.asyncProps[t];return e&&e.resolvedValue}isAsyncPropLoading(t){if(t){const e=this.asyncProps[t];return Boolean(e&&e.pendingLoadCount>0&&e.pendingLoadCount!==e.resolvedLoadCount)}for(const e in this.asyncProps)if(this.isAsyncPropLoading(e))return!0;return!1}reloadAsyncProp(t,e){this._watchPromise(t,Promise.resolve(e))}setAsyncProps(t){this.component=t[y.r3]||this.component;const e=t[y.vf]||{},n=t[y.YN]||t,i=t[y.jA]||{};for(const r in e){const t=e[r];this._createAsyncPropData(r,i[r]),this._updateAsyncProp(r,t),e[r]=this.getAsyncProp(r)}for(const r in n){const t=n[r];this._createAsyncPropData(r,i[r]),this._updateAsyncProp(r,t)}}_fetch(t,e){return null}_onResolve(t,e){}_onError(t,e){}_updateAsyncProp(t,e){this._didAsyncInputValueChange(t,e)&&("string"===typeof e&&(e=this._fetch(t,e)),e instanceof Promise?this._watchPromise(t,e):(0,O.Td)(e)?this._resolveAsyncIterable(t,e):this._setPropValue(t,e))}_freezeAsyncOldProps(){if(!this.oldAsyncProps&&this.oldProps){this.oldAsyncProps=Object.create(this.oldProps);for(const t in this.asyncProps)Object.defineProperty(this.oldAsyncProps,t,{enumerable:!0,value:this.oldProps[t]})}}_didAsyncInputValueChange(t,e){const n=this.asyncProps[t];return e!==n.resolvedValue&&e!==n.lastValue&&(n.lastValue=e,!0)}_setPropValue(t,e){this._freezeAsyncOldProps();const n=this.asyncProps[t];n&&(e=this._postProcessValue(n,e),n.resolvedValue=e,n.pendingLoadCount++,n.resolvedLoadCount=n.pendingLoadCount)}_setAsyncPropValue(t,e,n){const i=this.asyncProps[t];i&&n>=i.resolvedLoadCount&&void 0!==e&&(this._freezeAsyncOldProps(),i.resolvedValue=e,i.resolvedLoadCount=n,this.onAsyncPropUpdated(t,e))}_watchPromise(t,e){const n=this.asyncProps[t];if(n){n.pendingLoadCount++;const i=n.pendingLoadCount;e.then((e=>{this.component&&(e=this._postProcessValue(n,e),this._setAsyncPropValue(t,e,i),this._onResolve(t,e))})).catch((e=>{this._onError(t,e)}))}}async _resolveAsyncIterable(t,e){if("data"!==t)return void this._setPropValue(t,e);const n=this.asyncProps[t];if(!n)return;n.pendingLoadCount++;const i=n.pendingLoadCount;let r=[],o=0;for await(const s of e){if(!this.component)return;const{dataTransform:e}=this.component.props;r=e?e(s,r):r.concat(s),Object.defineProperty(r,"__diff",{enumerable:!1,value:[{startRow:o,endRow:r.length}]}),o=r.length,this._setAsyncPropValue(t,r,i)}this._onResolve(t,r)}_postProcessValue(t,e){const n=t.type;return n&&this.component&&(n.release&&n.release(t.resolvedValue,n,this.component),n.transform)?n.transform(e,n,this.component):e}_createAsyncPropData(t,e){if(!this.asyncProps[t]){const n=this.component&&this.component.props[y.fW];this.asyncProps[t]={type:n&&n[t],lastValue:null,resolvedValue:e,pendingLoadCount:0,resolvedLoadCount:0}}}}class tt extends ${constructor(t){let{attributeManager:e,layer:n}=t;super(n),this.attributeManager=e,this.needsRedraw=!0,this.needsUpdate=!0,this.subLayers=null,this.usesPickingColorCache=!1}get layer(){return this.component}_fetch(t,e){const n=this.layer,i=n?.props.fetch;return i?i(e,{propName:t,layer:n}):super._fetch(t,e)}_onResolve(t,e){const n=this.layer;if(n){const i=n.props.onDataLoad;"data"===t&&i&&i(e,{propName:t,layer:n})}}_onError(t,e){const n=this.layer;n&&n.raiseError(e,`loading ${t} of ${this.layer}`)}}var et=n(
270889
vendor: 15,236 bytes, line 2
2);const nt=2**24-1,it=Object.freeze([]),rt=(0,x.A)((t=>{let{oldViewport:e,viewport:n}=t;return e.equals(n)}));let ot=new Uint8ClampedArray(0);const st={data:{type:"data",value:it,async:!0},dataComparator:{type:"function",value:null,optional:!0},_dataDiff:{type:"function",value:t=>t&&t.__diff,optional:!0},dataTransform:{type:"function",value:null,optional:!0},onDataLoad:{type:"function",value:null,optional:!0},onError:{type:"function",value:null,optional:!0},fetch:{type:"function",value:(t,e)=>{let{propName:n,layer:i,loaders:r,loadOptions:o,signal:s}=e;const{resourceManager:a}=i.context;o=o||i.getLoadOptions(),r=r||i.props.loaders,s&&(o={...o,fetch:{...o?.fetch,signal:s}});let l=a.contains(t);return l||o||(a.add({resourceId:t,data:(0,et.H)(t,r),persistent:!1}),l=!0),l?a.subscribe({resourceId:t,onChange:t=>i.internalState?.reloadAsyncProp(n,t),consumerId:i.id,requestId:n}):(0,et.H)(t,r,o)}},updateTriggers:{},visible:!0,pickable:!1,opacity:{type:"number",min:0,max:1,value:1},operation:"draw",onHover:{type:"function",value:null,optional:!0},onClick:{type:"function",value:null,optional:!0},onDragStart:{type:"function",value:null,optional:!0},onDrag:{type:"function",value:null,optional:!0},onDragEnd:{type:"function",value:null,optional:!0},coordinateSystem:r.rf.DEFAULT,coordinateOrigin:{type:"array",value:[0,0,0],compare:!0},modelMatrix:{type:"array",value:null,compare:!0,optional:!0},wrapLongitude:!1,positionFormat:"XYZ",colorFormat:"RGBA",parameters:{type:"object",value:{},optional:!0,compare:2},loadOptions:{type:"object",value:null,optional:!0,ignore:!0},transitions:null,extensions:[],loaders:{type:"array",value:[],optional:!0,ignore:!0},getPolygonOffset:{type:"function",value:t=>{let{layerIndex:e}=t;return[0,100*-e]}},highlightedObjectIndex:null,autoHighlight:!1,highlightColor:{type:"accessor",value:[0,0,128,128]}};class at extends J{constructor(){super(...arguments),this.internalState=null,this.lifecycle=y.VD.NO_STATE,this.parent=null}static get componentName(){return Object.prototype.hasOwnProperty.call(this,"layerName")?this.layerName:""}get root(){let t=this;for(;t.parent;)t=t.parent;return t}toString(){return`${this.constructor.layerName||this.constructor.name}({id: '${this.props.id}'})`}project(t){(0,b.A)(this.internalState);const e=this.internalState.viewport||this.context.viewport,n=B(t,{viewport:e,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem}),[i,r,o]=(0,P.VJ)(n,e.pixelProjectionMatrix);return 2===t.length?[i,r]:[i,r,o]}unproject(t){(0,b.A)(this.internalState);return(this.internalState.viewport||this.context.viewport).unproject(t)}projectPosition(t,e){(0,b.A)(this.internalState);return R(t,{viewport:this.internalState.viewport||this.context.viewport,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem,...e})}get isComposite(){return!1}setState(t){this.setChangeFlags({stateChanged:!0}),Object.assign(this.state,t),this.setNeedsRedraw()}setNeedsRedraw(){this.internalState&&(this.internalState.needsRedraw=!0)}setNeedsUpdate(){this.internalState&&(this.context.layerManager.setNeedsUpdate(String(this)),this.internalState.needsUpdate=!0)}get isLoaded(){return!!this.internalState&&!this.internalState.isAsyncPropLoading()}get wrapLongitude(){return this.props.wrapLongitude}isPickable(){return this.props.pickable&&this.props.visible}getModels(){const t=this.state;return t&&(t.models||t.model&&[t.model])||[]}setModuleParameters(t){for(const e of this.getModels())e.updateModuleSettings(t)}setShaderModuleProps(){for(const t of this.getModels())t.shaderInputs.setProps(...arguments)}getAttributeManager(){return this.internalState&&this.internalState.attributeManager}getCurrentLayer(){return this.internalState&&this.internalState.layer}getLoadOptions(){return this.props.loadOptions}use64bitPositions(){const{coordinateSystem:t}=this.props;return t===r.rf.DEFAULT||t===r.rf.LNGLAT||t===r.rf.CARTESIAN}onHover(t,e){return this.props.onHover&&this.props.onHover(t,e)||!1}onClick(t,e){return this.props.onClick&&this.props.onClick(t,e)||!1}nullPickingColor(){return[0,0,0]}encodePickingColor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return e[0]=t+1&255,e[1]=t+1>>8&255,e[2]=t+1>>8>>8&255,e}decodePickingColor(t){(0,b.A)(t instanceof Uint8Array);const[e,n,i]=t;return e+256*n+65536*i-1}getNumInstances(){return Number.isFinite(this.props.numInstances)?this.props.numInstances:this.state&&void 0!==this.state.numInstances?this.state.numInstances:_(this.props.data)}getStartIndices(){return this.props.startIndices?this.props.startIndices:this.state&&this.state.startIndices?this.state.startIndices:null}getBounds(){return this.getAttributeManager()?.getBounds(["positions","instancePositions"])}getShaders(t){t=(0,w.n)(t,{disableWarnings:!0,modules:this.context.defaultShaderModules});for(const e of this.props.extensions)t=(0,w.n)(t,e.getShaders.call(this,e));return t}shouldUpdateState(t){return t.changeFlags.propsOrDataChanged}updateState(t){const e=this.getAttributeManager(),{dataChanged:n}=t.changeFlags;if(n&&e)if(Array.isArray(n))for(const i of n)e.invalidateAll(i);else e.invalidateAll();if(e){const{props:n}=t,i=this.internalState.hasPickingBuffer,r=Number.isInteger(n.highlightedObjectIndex)||n.pickable||n.extensions.some((t=>t.getNeedsPickingBuffer.call(this,t)));if(i!==r){this.internalState.hasPickingBuffer=r;const{pickingColors:t,instancePickingColors:n}=e.attributes,i=t||n;i&&(r&&i.constant&&(i.constant=!1,e.invalidate(i.id)),i.value||r||(i.constant=!0,i.value=[0,0,0]))}}}finalizeState(t){for(const n of this.getModels())n.destroy();const e=this.getAttributeManager();e&&e.finalize(),this.context&&this.context.resourceManager.unsubscribe({consumerId:this.id}),this.internalState&&(this.internalState.uniformTransitions.clear(),this.internalState.finalize())}draw(t){for(const e of this.getModels())e.draw(t)}getPickingInfo(t){let{info:e,mode:n,sourceLayer:i}=t;const{index:r}=e;return r>=0&&Array.isArray(this.props.data)&&(e.object=this.props.data[r]),e}raiseError(t,e){e&&(t=new Error(`${e}: ${t.message}`,{cause:t})),this.props.onError?.(t)||this.context?.onError?.(t,this)}getNeedsRedraw(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1};return this._getNeedsRedraw(t)}needsUpdate(){return!!this.internalState&&(this.internalState.needsUpdate||this.hasUniformTransition()||this.shouldUpdateState(this._getUpdateParams()))}hasUniformTransition(){return this.internalState?.uniformTransitions.active||!1}activateViewport(t){if(!this.internalState)return;const e=this.internalState.viewport;this.internalState.viewport=t,e&&rt({oldViewport:e,viewport:t})||(this.setChangeFlags({viewportChanged:!0}),this.isComposite?this.needsUpdate()&&this.setNeedsUpdate():this._update())}invalidateAttribute(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"all";const e=this.getAttributeManager();e&&("all"===t?e.invalidateAll():e.invalidate(t))}updateAttributes(t){let e=!1;for(const n in t)t[n].layoutChanged()&&(e=!0);for(const n of this.getModels())this._setModelAttributes(n,t,e)}_updateAttributes(){const t=this.getAttributeManager();if(!t)return;const e=this.props,n=this.getNumInstances(),i=this.getStartIndices();t.update({data:e.data,numInstances:n,startIndices:i,props:e,transitions:e.transitions,buffers:e.data.attributes,context:this});const r=t.getChangedAttributes({clearChangedFlags:!0});this.updateAttributes(r)}_updateAttributeTransition(){const t=this.getAttributeManager();t&&t.updateTransition()}_updateUniformTransition(){const{uniformTransitions:t}=this.internalState;if(t.active){const e=t.update(),n=Object.create(this.props);for(const t in e)Object.defineProperty(n,t,{value:e[t]});return n}return this.props}calculateInstancePickingColors(t,e){let{numInstances:n}=e;if(t.constant)return;const i=Math.floor(ot.length/4);if(this.internalState.usesPickingColorCache=!0,i<n){n>nt&&f.A.warn("Layer has too many data objects. Picking might not be able to distinguish all objects.")(),ot=L.A.allocate(ot,n,{size:4,copy:!0,maxCount:Math.max(n,nt)});const t=Math.floor(ot.length/4),e=[];for(let n=i;n<t;n++)this.encodePickingColor(n,e),ot[4*n+0]=e[0],ot[4*n+1]=e[1],ot[4*n+2]=e[2]}t.value=ot.subarray(0,4*n)}_setModelAttributes(t,e){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!Object.keys(e).length)return;if(n){const n=this.getAttributeManager();t.setBufferLayout(n.getBufferLayouts(t)),e=n.getAttributes()}const r=t.userData?.excludeAttributes||{},o={},s={};for(const a in e){if(r[a])continue;const n=e[a].getValue();for(const r in n){const l=n[r];l instanceof i.h?e[a].settings.isIndexed?t.setIndexBuffer(l):o[r]=l:l&&(s[r]=l)}}t.setAttributes(o),t.setConstantAttributes(s)}disablePickingIndex(t){const e=this.props.data;if(!("attributes"in e))return void this._disablePickingIndex(t);const{pickingColors:n,instancePickingColors:i}=this.getAttributeManager().attributes,r=n||i,o=r&&e.attributes&&e.attributes[r.id];if(o&&o.value){const n=o.value,i=this.encodePickingColor(t);for(let t=0;t<e.length;t++){const e=r.getVertexOffset(t);n[e]===i[0]&&n[e+1]===i[1]&&n[e+2]===i[2]&&this._disablePickingIndex(t)}}else this._disablePickingIndex(t)}_disablePickingIndex(t){const{pickingColors:e,instancePickingColors:n}=this.getAttributeManager().attributes,i=e||n;if(!i)return;const r=i.getVertexOffset(t),o=i.getVertexOffset(t+1);i.buffer.write(new Uint8Array(o-r),r)}restorePickingColors(){const{pickingColors:t,instancePickingColors:e}=this.getAttributeManager().attributes,n=t||e;n&&(this.internalState.usesPickingColorCache&&n.value.buffer!==ot.buffer&&(n.value=ot.subarray(0,n.value.length)),n.updateSubBuffer({startOffset:0}))}_initialize(){(0,b.A)(!this.internalState),(0,b.A)(Number.isFinite(this.props.coordinateSystem)),(0,v.A)("layer.initialize",this);const t=this._getAttributeManager();t&&t.addInstanced({instancePickingColors:{type:"uint8",size:4,noAlloc:!0,update:this.calculateInstancePickingColors}}),this.internalState=new tt({attributeManager:t,layer:this}),this._clearChangeFlags(),this.state={},Object.defineProperty(this.state,"attributeManager",{get:()=>(f.A.deprecated("layer.state.attributeManager","layer.getAttributeManager()")(),t)}),this.internalState.uniformTransitions=new g(this.context.timeline),this.internalState.onAsyncPropUpdated=this._onAsyncPropUpdated.bind(this),this.internalState.setAsyncProps(this.props),this.initializeState(this.context);for(const e of this.props.extensions)e.initializeState.call(this,this.context,e);this.setChangeFlags({dataChanged:"init",propsChanged:"init",viewportChanged:!0,extensionsChanged:!0}),this._update()}_transferState(t){(0,v.A)("layer.matched",this,this===t);const{state:e,internalState:n}=t;this!==t&&(this.internalState=n,this.state=e,this.internalState.setAsyncProps(this.props),this._diffProps(this.props,this.internalState.getOldProps()))}_update(){const t=this.needsUpdate();if((0,v.A)("layer.update",this,t),!t)return;const e=this.props,n=this.context,i=this.internalState,r=n.viewport,o=this._updateUniformTransition();i.propsInTransition=o,n.viewport=i.viewport||r,this.props=o;try{const t=this._getUpdateParams(),e=this.getModels();if(n.device)this.updateState(t);else try{this.updateState(t)}catch(s){}for(const n of this.props.extensions)n.updateState.call(this,t,n);const i=this.getModels()[0]!==e[0];this._postUpdate(t,i)}finally{n.viewport=r,this.props=e,this._clearChangeFlags(),i.needsUpdate=!1,i.resetOldProps()}}_finalize(){(0,v.A)("layer.finalize",this),this.finalizeState(this.context);for(const t of this.props.extensions)t.finalizeState.call(this,this.context,t)}_drawLayer(t){let{renderPass:e,moduleParameters:n=null,uniforms:i={},parameters:r={}}=t;this._updateAttributeTransition();const o=this.props,s=this.context;this.props=this.internalState.propsInTransition||o;const a=this.props.opacity;i.opacity=Math.pow(a,1/2.2);try{if(n){const{isActive:t,isAttribute:e}=n.picking;this.setModuleParameters(n),this.setShaderModuleProps({picking:{isActive:t,isAttribute:e}})}const{getPolygonOffset:t}=this.props,o=t&&t(i)||[0,0];s.device.setParametersWebGL({polygonOffset:o});for(const e of this.getModels())e.setParameters(r);s.device.withParametersWebGL(r,(()=>{const t={renderPass:e,moduleParameters:n,uniforms:i,parameters:r,context:s};for(const e of this.props.extensions)e.draw.call(this,t,e);this.draw(t)}))}finally{this.props=o}}getChangeFlags(){return this.internalState?.changeFlags}setChangeFlags(t){if(!this.internalState)return;const{changeFlags:e}=this.internalState;for(const i in t)if(t[i]){let n=!1;if("dataChanged"===i){const r=t[i],o=e[i];r&&Array.isArray(o)&&(e.dataChanged=Array.isArray(r)?o.concat(r):r,n=!0)}e[i]||(e[i]=t[i],n=!0),n&&(0,v.A)("layer.changeFlag",this,i,t)}const n=Boolean(e.dataChanged||e.updateTriggersChanged||e.propsChanged||e.extensionsChanged);e.propsOrDataChanged=n,e.somethingChanged=n||e.viewportChanged||e.stateChanged}_clearChangeFlags(){this.internalState.changeFlags={dataChanged:!1,propsChanged:!1,updateTriggersChanged:!1,viewportChanged:!1,stateChanged:!1,extensionsChanged:!1,propsOrDataChanged:!1,somethingChanged:!1}}_diffProps(t,e){const n=(0,m.mg)(t,e);if(n.updateTriggersChanged)for(const i in n.updateTriggersChanged)n.updateTriggersChanged[i]&&this.invalidateAttribute(i);if(n.transitionsChanged)for(const i in n.transitionsChanged)this.internalState.uniformTransitions.add(i,e[i],t[i],t.transitions?.[i]);return this.setChangeFlags(n)}validateProps(){(0,m.zo)(this.props)}updateAutoHighlight(t){this.props.autoHighlight&&!Number.isInteger(this.props.highlightedObjectIndex)&&this._updateAutoHighlight(t)}_updateAutoHighlight(t){const e={highlightedObjectColor:t.picked?t.color:null},{highlightColor:n}=this.props;t.picked&&"function"===typeof n&&(e.highlightColor=n(t)),this.setShaderModuleProps({picking:e}),this.setNeedsRedraw()}_getAttributeManager(){const t=this.context;return new o.A(t.device,{id:this.props.id,stats:t.stats,timeline:t.timeline})}_postUpdate(t,e){const{props:n,oldProps:i}=t;this.setNeedsRedraw(),this._updateAttributes();const r=this.state.model;r?.isInstanced&&r.setInstanceCount(this.getNumInstances());const{autoHighlight:o,highlightedObjectIndex:s,highlightColor:a}=n;if(e||i.autoHighlight!==o||i.highlightedObjectIndex!==s||i.highlightColor!==a){const t={};Array.isArray(a)&&(t.highlightColor=a),(e||i.autoHighlight!==o||s!==i.highlightedObjectIndex)&&(t.highlightedObjectColor=Number.isFinite(s)&&s>=0?this.encodePickingColor(s):null),this.setShaderModuleProps({picking:t})}}_getUpdateParams(){return{props:this.props,oldProps:this.internalState.getOldProps(),context:this.context,changeFlags:this.internalState.changeFlags}}_getNeedsRedraw(t){if(!this.internalState)return!1;let e=!1;e=e||this.internalState.needsRedraw&&this.id;const n=this.getAttributeManager(),i=!!n&&n.getNeedsRedraw(t);if(e=e||i,e)for(const r of this.props.extensions)r.onNeedsRedraw.call(this,r);return this.internalState.needsRedraw=this.internalState.needsRedraw&&!t.clearRedrawFlags,e}_onAsyncPropUpdated(){this._diffProps(this.props,this.internalState.getOldProps()),this.setNeedsUpdate()}}at.defaultProps=st,at.layerName="Layer";const lt=at},
211275:(t,e,n)=>{"use strict";n.d(e,{VD:()=>i,YN:()=>l,fW:()=>o,jA:()=>a,r3:()=>r,uH:()=>s,vf:()=>c});
vendor: 4,576 bytes, line 2
2const i={NO_STATE:"Awaiting state",MATCHED:"Matched. State transferred from previous layer",INITIALIZED:"Initialized",AWAITING_GC:"Discarded. Awaiting garbage collection",AWAITING_FINALIZATION:"No longer matched. Awaiting garbage collection",FINALIZED:"Finalized! Awaiting garbage collection"},r=Symbol.for("component"),o=Symbol.for("propTypes"),s=Symbol.for("deprecatedProps"),a=Symbol.for("asyncPropDefaults"),l=Symbol.for("asyncPropOriginal"),c=Symbol.for("asyncPropResolved")},75612:(t,e,n)=>{"use strict";n.d(e,{Me:()=>a,mg:()=>o,zo:()=>r});var i=n(11275);function r(t){const e=t[i.fW];for(const n in e){const i=e[n],{validate:r}=i;if(r&&!r(t[n],i))throw new Error(`Invalid prop ${n}: ${t[n]}`)}}function o(t,e){const n=a({newProps:t,oldProps:e,propTypes:t[i.fW],ignoreProps:{data:null,updateTriggers:null,extensions:null,transitions:null}}),r=function(t,e){if(null===e)return"oldProps is null, initial diff";let n=!1;const{dataComparator:i,_dataDiff:r}=t;i?i(t.data,e.data)||(n="Data comparator detected a change"):t.data!==e.data&&(n="A new data container was supplied");n&&r&&(n=r(t.data,e.data)||n);return n}(t,e);let o=!1;return r||(o=function(t,e){if(null===e)return{all:!0};if("all"in t.updateTriggers){if(u(t,e,"all"))return{all:!0}}const n={};let i=!1;for(const r in t.updateTriggers)if("all"!==r){u(t,e,r)&&(n[r]=!0,i=!0)}return!!i&&n}(t,e)),{dataChanged:r,propsChanged:n,updateTriggersChanged:o,extensionsChanged:c(t,e),transitionsChanged:s(t,e)}}function s(t,e){if(!t.transitions)return!1;const n={},r=t[i.fW];let o=!1;for(const i in t.transitions){const s=r[i],a=s&&s.type;("number"===a||"color"===a||"array"===a)&&l(t[i],e[i],s)&&(n[i]=!0,o=!0)}return!!o&&n}function a(t){let{newProps:e,oldProps:n,ignoreProps:i={},propTypes:r={},triggerName:o="props"}=t;if(n===e)return!1;if("object"!==typeof e||null===e)return`${o} changed shallowly`;if("object"!==typeof n||null===n)return`${o} changed shallowly`;for(const s of Object.keys(e))if(!(s in i)){if(!(s in n))return`${o}.${s} added`;const t=l(e[s],n[s],r[s]);if(t)return`${o}.${s} ${t}`}for(const s of Object.keys(n))if(!(s in i)){if(!(s in e))return`${o}.${s} dropped`;if(!Object.hasOwnProperty.call(e,s)){const t=l(e[s],n[s],r[s]);if(t)return`${o}.${s} ${t}`}}return!1}function l(t,e,n){let i=n&&n.equal;return i&&!i(t,e,n)?"changed deeply":i||(i=t&&e&&t.equals,!i||i.call(t,e))?i||e===t?null:"changed shallowly":"changed deeply"}function c(t,e){if(null===e)return!0;const n=e.extensions,{extensions:i}=t;if(i===n)return!1;if(!n||!i)return!0;if(i.length!==n.length)return!0;for(let r=0;r<i.length;r++)if(!i[r].equals(n[r]))return!0;return!1}function u(t,e,n){let i=t.updateTriggers[n];i=void 0===i||null===i?{}:i;let r=e.updateTriggers[n];r=void 0===r||null===r?{}:r;return a({oldProps:r,newProps:i,triggerName:n})}},78550:(t,e,n)=>{"use strict";n.d(e,{A:()=>i});class i{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{id:"pass"};const{id:n}=e;this.id=n,this.device=t,this.props={...e}}setProps(t){Object.assign(this.props,t)}render(t){}cleanup(){}}},56830:(t,e,n)=>{"use strict";n.d(e,{cN:()=>s});var i=n(32479);const r=[n(95835).A],o=["vs:DECKGL_FILTER_SIZE(inout vec3 size, VertexGeometry geometry)","vs:DECKGL_FILTER_GL_POSITION(inout vec4 position, VertexGeometry geometry)","vs:DECKGL_FILTER_COLOR(inout vec4 color, VertexGeometry geometry)","fs:DECKGL_FILTER_COLOR(inout vec4 color, FragmentGeometry geometry)"];function s(){const t=i._.getDefaultShaderAssembler();for(const e of r)t.addDefaultModule(e);for(const e of o)t.addShaderHook(e);return t}},22108:(t,e,n)=>{"use strict";n.d(e,{A:()=>r});const i={name:"picking",vs:"uniform pickingUniforms {\nfloat isActive;\nfloat isAttribute;\nfloat isHighlightActive;\nfloat useFloatColors;\nvec3 highlightedObjectColor;\nvec4 highlightColor;\n} picking;\nout vec4 picking_vRGBcolor_Avalid;\nvec3 picking_normalizeColor(vec3 color) {\nreturn picking.useFloatColors > 0.5 ? color : color / 255.0;\n}\nvec4 picking_normalizeColor(vec4 color) {\nreturn picking.useFloatColors > 0.5 ? color : color / 255.0;\n}\nbool picking_isColorZero(vec3 color) {\nreturn dot(color, vec3(1.0)) < 0.00001;\n}\nbool picking_isColorValid(vec3 color) {\nreturn dot(color, vec3(1.0)) > 0.00001;\n}\nbool isVertexHighlighted(vec3 vertexColor) {\nvec3 highlightedObjectColor = picking_normalizeColor(picking.highlightedObjectColor);\nreturn\nbool(picking.isHighlightActive) && picking_isColorZero(abs(vertexColor - highlightedObjectColor));\n}\nvoid picking_setPickingColor(vec3 pickingColor) {\npickingColor = picking_normalizeColor(pickingColor);
2\nif (bool(picking.isActive)) {\npicking_vRGBcolor_Avalid.a = float(picking_isColorValid(pickingColor));\nif (!bool(picking.isAttribute)) {\npicking_vRGBcolor_Avalid.rgb = pickingColor;\n}\n} else {\npicking_vRGBcolor_Avalid.a = float(isVertexHighlighted(pickingColor));\n}\n}\nvoid picking_setPickingAttribute(float value) {\nif (bool(picking.isAttribute)) {\npicking_vRGBcolor_Avalid.r = value;\n}\n}\nvoid picking_setPickingAttribute(vec2 value) {\nif (bool(picking.isAttribute)) {\npicking_vRGBcolor_Avalid.rg = value;\n}\n}\nvoid picking_setPickingAttribute(vec3 value) {\nif (bool(picking.isAttribute)) {\npicking_vRGBcolor_Avalid.rgb = value;\n}\n}\n",fs:"uniform pickingUniforms {\nfloat isActive;\nfloat isAttribute;\nfloat isHighlightActive;\nfloat useFloatColors;\nvec3 highlightedObjectColor;\nvec4 highlightColor;\n} picking;\nin vec4 picking_vRGBcolor_Avalid;\nvec4 picking_filterHighlightColor(vec4 color) {\nif (picking.isActive > 0.5) {\nreturn color;\n}\nbool selected = bool(picking_vRGBcolor_Avalid.a);\nif (selected) {\nfloat highLightAlpha = picking.highlightColor.a;\nfloat blendedAlpha = highLightAlpha + color.a * (1.0 - highLightAlpha);\nfloat highLightRatio = highLightAlpha / blendedAlpha;\nvec3 blendedRGB = mix(color.rgb, picking.highlightColor.rgb, highLightRatio);\nreturn vec4(blendedRGB, blendedAlpha);\n} else {\nreturn color;\n}\n}\nvec4 picking_filterPickingColor(vec4 color) {\nif (bool(picking.isActive)) {\nif (picking_vRGBcolor_Avalid.a == 0.0) {\ndiscard;\n}\nreturn picking_vRGBcolor_Avalid;\n}\nreturn color;\n}\nvec4 picking_filterColor(vec4 color) {\nvec4 highlightColor = picking_filterHighlightColor(color);\nreturn picking_filterPickingColor(highlightColor);\n}\n",uniformTypes:{isActive:"f32",isAttribute:"f32",isHighlightActive:"f32",useFloatColors:"f32",highlightedObjectColor:"vec3<f32>",highlightColor:"vec4<f32>"},defaultUniforms:{isActive:!1,isAttribute:!1,isHighlightActive:!1,useFloatColors:!0,highlightedObjectColor:[0,0,0],highlightColor:[0,1,1,1]},getUniforms:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const e={};if(void 0===t.highlightedObjectColor);else if(null===t.highlightedObjectColor)e.isHighlightActive=!1;else{e.isHighlightActive=!0;const n=t.highlightedObjectColor.slice(0,3);e.highlightedObjectColor=n}if(t.highlightColor){const n=Array.from(t.highlightColor,(t=>t/255));Number.isFinite(n[3])||(n[3]=1),e.highlightColor=n}void 0!==t.isActive&&(e.isActive=Boolean(t.isActive),e.isAttribute=Boolean(t.isAttribute));void 0!==t.useFloatColors&&(e.useFloatColors=Boolean(t.useFloatColors));return e}};const r={...i,defaultUniforms:{...i.defaultUniforms,useFloatColors:!1},inject:{"vs:DECKGL_FILTER_GL_POSITION":"\n // for picking depth values\n picking_setPickingAttribute(position.z / position.w);\n ","vs:DECKGL_FILTER_COLOR":"\n picking_setPickingColor(geometry.pickingColor);\n ","fs:DECKGL_FILTER_COLOR":{order:99,injection:"\n // use highlight color if this fragment belongs to the selected object.\n color = picking_filterHighlightColor(color);\n\n // use picking color if rendering to picking FBO.\n color = picking_filterPickingColor(color);\n "}}}},95835:(t,e,n)=>{"use strict";n.d(e,{A:()=>u});const i={name:"fp32",vs:"#ifdef LUMA_FP32_TAN_PRECISION_WORKAROUND\nconst float TWO_PI = 6.2831854820251465;\nconst float PI_2 = 1.5707963705062866;\nconst float PI_16 = 0.1963495463132858;\nconst float SIN_TABLE_0 = 0.19509032368659973;\nconst float SIN_TABLE_1 = 0.3826834261417389;\nconst float SIN_TABLE_2 = 0.5555702447891235;\nconst float SIN_TABLE_3 = 0.7071067690849304;\nconst float COS_TABLE_0 = 0.9807852506637573;\nconst float COS_TABLE_1 = 0.9238795042037964;\nconst float COS_TABLE_2 = 0.8314695954322815;\nconst float COS_TABLE_3 = 0.7071067690849304;\nconst float INVERSE_FACTORIAL_3 = 1.666666716337204e-01;\nconst float INVERSE_FACTORIAL_5 = 8.333333767950535e-03;\nconst float INVERSE_FACTORIAL_7 = 1.9841270113829523e-04;\nconst float INVERSE_FACTORIAL_9 = 2.75573188446287533e-06;\nfloat sin_taylor_fp32(float a) {\nfloat r, s, t, x;\nif (a == 0.0) {\nreturn 0.0;\n}\nx = -a * a;\ns = a;\nr = a;\nr = r * x;\nt = r * INVERSE_FACTORIAL_3;
2\ns = s + t;\nr = r * x;\nt = r * INVERSE_FACTORIAL_5;\ns = s + t;\nr = r * x;\nt = r * INVERSE_FACTORIAL_7;\ns = s + t;\nr = r * x;\nt = r * INVERSE_FACTORIAL_9;\ns = s + t;\nreturn s;\n}\nvoid sincos_taylor_fp32(float a, out float sin_t, out float cos_t) {\nif (a == 0.0) {\nsin_t = 0.0;\ncos_t = 1.0;\n}\nsin_t = sin_taylor_fp32(a);\ncos_t = sqrt(1.0 - sin_t * sin_t);\n}\nfloat tan_taylor_fp32(float a) {\nfloat sin_a;\nfloat cos_a;\nif (a == 0.0) {\nreturn 0.0;\n}\nfloat z = floor(a / TWO_PI);\nfloat r = a - TWO_PI * z;\nfloat t;\nfloat q = floor(r / PI_2 + 0.5);\nint j = int(q);\nif (j < -2 || j > 2) {\nreturn 1.0 / 0.0;\n}\nt = r - PI_2 * q;\nq = floor(t / PI_16 + 0.5);\nint k = int(q);\nint abs_k = int(abs(float(k)));\nif (abs_k > 4) {\nreturn 1.0 / 0.0;\n} else {\nt = t - PI_16 * q;\n}\nfloat u = 0.0;\nfloat v = 0.0;\nfloat sin_t, cos_t;\nfloat s, c;\nsincos_taylor_fp32(t, sin_t, cos_t);\nif (k == 0) {\ns = sin_t;\nc = cos_t;\n} else {\nif (abs(float(abs_k) - 1.0) < 0.5) {\nu = COS_TABLE_0;\nv = SIN_TABLE_0;\n} else if (abs(float(abs_k) - 2.0) < 0.5) {\nu = COS_TABLE_1;\nv = SIN_TABLE_1;\n} else if (abs(float(abs_k) - 3.0) < 0.5) {\nu = COS_TABLE_2;\nv = SIN_TABLE_2;\n} else if (abs(float(abs_k) - 4.0) < 0.5) {\nu = COS_TABLE_3;\nv = SIN_TABLE_3;\n}\nif (k > 0) {\ns = u * sin_t + v * cos_t;\nc = u * cos_t - v * sin_t;\n} else {\ns = u * sin_t - v * cos_t;\nc = u * cos_t + v * sin_t;\n}\n}\nif (j == 0) {\nsin_a = s;\ncos_a = c;\n} else if (j == 1) {\nsin_a = c;\ncos_a = -s;\n} else if (j == -1) {\nsin_a = -c;\ncos_a = s;\n} else {\nsin_a = -s;\ncos_a = -c;\n}\nreturn sin_a / cos_a;\n}\n#endif\nfloat tan_fp32(float a) {\n#ifdef LUMA_FP32_TAN_PRECISION_WORKAROUND\nreturn tan_taylor_fp32(a);\n#else\nreturn tan(a);\n#endif\n}\n"},r="#define SMOOTH_EDGE_RADIUS 0.5",o={name:"geometry",vs:`\n${r}\n\nstruct VertexGeometry {\n vec4 position;\n vec3 worldPosition;\n vec3 worldPositionAlt;\n vec3 normal;\n vec2 uv;\n vec3 pickingColor;\n} geometry = VertexGeometry(\n vec4(0.0, 0.0, 1.0, 0.0),\n vec3(0.0),\n vec3(0.0),\n vec3(0.0),\n vec2(0.0),\n vec3(0.0)\n);\n`,fs:`\n${r}\n\nstruct FragmentGeometry {\n vec2 uv;\n} geometry;\n\nfloat smoothedge(float edge, float x) {\n return smoothstep(edge - SMOOTH_EDGE_RADIUS, edge + SMOOTH_EDGE_RADIUS, x);\n}\n`};var s=n(4896
vendor: 6,826 bytes, line 2
2);const a=`${Object.keys(s.rf).map((t=>`const int COORDINATE_SYSTEM_${t} = ${s.rf[t]};`)).join("")}\n${Object.keys(s.Kx).map((t=>`const int PROJECTION_MODE_${t} = ${s.Kx[t]};`)).join("")}\n${Object.keys(s.p5).map((t=>`const int UNIT_${t.toUpperCase()} = ${s.p5[t]};`)).join("")}\nuniform int project_uCoordinateSystem;\nuniform int project_uProjectionMode;\nuniform float project_uScale;\nuniform bool project_uWrapLongitude;\nuniform vec3 project_uCommonUnitsPerMeter;\nuniform vec3 project_uCommonUnitsPerWorldUnit;\nuniform vec3 project_uCommonUnitsPerWorldUnit2;\nuniform vec4 project_uCenter;\nuniform mat4 project_uModelMatrix;\nuniform mat4 project_uViewProjectionMatrix;\nuniform vec2 project_uViewportSize;\nuniform float project_uDevicePixelRatio;\nuniform float project_uFocalDistance;\nuniform vec3 project_uCameraPosition;\nuniform vec3 project_uCoordinateOrigin;\nuniform vec3 project_uCommonOrigin;\nuniform bool project_uPseudoMeters;\nconst float TILE_SIZE = 512.0;\nconst float PI = 3.1415926536;\nconst float WORLD_SCALE = TILE_SIZE / (PI * 2.0);\nconst vec3 ZERO_64_LOW = vec3(0.0);\nconst float EARTH_RADIUS = 6370972.0;\nconst float GLOBE_RADIUS = 256.0;\nfloat project_size_at_latitude(float lat) {\nfloat y = clamp(lat, -89.9, 89.9);\nreturn 1.0 / cos(radians(y));\n}\nfloat project_size() {\nif (project_uProjectionMode == PROJECTION_MODE_WEB_MERCATOR &&\nproject_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT &&\nproject_uPseudoMeters == false) {\nif (geometry.position.w == 0.0) {\nreturn project_size_at_latitude(geometry.worldPosition.y);\n}\nfloat y = geometry.position.y / TILE_SIZE * 2.0 - 1.0;\nfloat y2 = y * y;\nfloat y4 = y2 * y2;\nfloat y6 = y4 * y2;\nreturn 1.0 + 4.9348 * y2 + 4.0587 * y4 + 1.5642 * y6;\n}\nreturn 1.0;\n}\nfloat project_size_at_latitude(float meters, float lat) {\nreturn meters * project_uCommonUnitsPerMeter.z * project_size_at_latitude(lat);\n}\nfloat project_size(float meters) {\nreturn meters * project_uCommonUnitsPerMeter.z * project_size();\n}\nvec2 project_size(vec2 meters) {\nreturn meters * project_uCommonUnitsPerMeter.xy * project_size();\n}\nvec3 project_size(vec3 meters) {\nreturn meters * project_uCommonUnitsPerMeter * project_size();\n}\nvec4 project_size(vec4 meters) {\nreturn vec4(meters.xyz * project_uCommonUnitsPerMeter, meters.w);\n}\nmat3 project_get_orientation_matrix(vec3 up) {\nvec3 uz = normalize(up);\nvec3 ux = abs(uz.z) == 1.0 ? vec3(1.0, 0.0, 0.0) : normalize(vec3(uz.y, -uz.x, 0));\nvec3 uy = cross(uz, ux);\nreturn mat3(ux, uy, uz);\n}\nbool project_needs_rotation(vec3 commonPosition, out mat3 transform) {\nif (project_uProjectionMode == PROJECTION_MODE_GLOBE) {\ntransform = project_get_orientation_matrix(commonPosition);\nreturn true;\n}\nreturn false;\n}\nvec3 project_normal(vec3 vector) {\nvec4 normal_modelspace = project_uModelMatrix * vec4(vector, 0.0);\nvec3 n = normalize(normal_modelspace.xyz * project_uCommonUnitsPerMeter);\nmat3 rotation;\nif (project_needs_rotation(geometry.position.xyz, rotation)) {\nn = rotation * n;\n}\nreturn n;\n}\nvec4 project_offset_(vec4 offset) {\nfloat dy = offset.y;\nvec3 commonUnitsPerWorldUnit = project_uCommonUnitsPerWorldUnit + project_uCommonUnitsPerWorldUnit2 * dy;\nreturn vec4(offset.xyz * commonUnitsPerWorldUnit, offset.w);\n}\nvec2 project_mercator_(vec2 lnglat) {\nfloat x = lnglat.x;\nif (project_uWrapLongitude) {\nx = mod(x + 180., 360.0) - 180.;\n}\nfloat y = clamp(lnglat.y, -89.9, 89.9);\nreturn vec2(\nradians(x) + PI,\nPI + log(tan_fp32(PI * 0.25 + radians(y) * 0.5))\n) * WORLD_SCALE;\n}\nvec3 project_globe_(vec3 lnglatz) {\nfloat lambda = radians(lnglatz.x);\nfloat phi = radians(lnglatz.y);\nfloat cosPhi = cos(phi);\nfloat D = (lnglatz.z / EARTH_RADIUS + 1.0) * GLOBE_RADIUS;\nreturn vec3(\nsin(lambda) * cosPhi,\n-cos(lambda) * cosPhi,\nsin(phi)\n) * D;\n}\nvec4 project_position(vec4 position, vec3 position64Low) {\nvec4 position_world = project_uModelMatrix * position;\nif (project_uProjectionMode == PROJECTION_MODE_WEB_MERCATOR) {\nif (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\nreturn vec4(\nproject_mercator_(position_world.xy),\nproject_size_at_latitude(position_world.z, position_world.y),\nposition_world.w\n);\n}\nif (project_uCoordinateSystem == COORDINATE_SYSTEM_CARTESIAN) {\nposition_world.xyz += project_uCoordinateOrigin;\n}\n}\nif (project_uProjectionMode == PROJECTION_MODE_GLOBE) {\nif (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\nreturn vec4(\nproject_globe_(position_world.xyz),\nposition_world.w\n);\n}\n}\nif (project_uProjectionMode == PROJECTION_MODE_WEB_MERCATOR_AUTO_OFFSET) {\nif (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\nif (abs(position_world.y - project_uCoordinateOrigin.y) > 0.25) {\nreturn vec4(\nproject_mercator_(position_world.xy) - project_uCommonOrigin.xy,\nproject_size(position_world.z),\nposition_world.w\n);\n}\n}\n}\nif (project_uProjectionMode == PROJECTION_MODE_IDENTITY ||\n(project_uProjectionMode == PROJECTION_MODE_WEB_MERCATOR_AUTO_OFFSET &&\n(project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT ||\nproject_uCoordinateSystem == COORDINATE_SYSTEM_CARTESIAN))) {\nposition_world.xyz -= project_uCoordinateOrigin;\n}\nreturn project_offset_(position_world) + project_offset_(project_uModelMatrix * vec4(position64Low, 0.0));\n}\nvec4 project_position(vec4 position) {\nreturn project_position(position, ZERO_64_LOW);\n}\nvec3 project_position(vec3 position, vec3 position64Low) {\nvec4 projected_position = project_position(vec4(position, 1.0), position64Low);\nreturn projected_position.xyz;\n}\nvec3 project_position(vec3 position) {\nvec4 projected_position = project_position(vec4(position, 1.0), ZERO_64_LOW);\nreturn projected_position.xyz;\n}\nvec2 project_position(vec2 position) {\nvec4 projected_position = project_position(vec4(position, 0.0, 1.0), ZERO_64_LOW);\nreturn projected_position.xy;\n}\nvec4 project_common_position_to_clipspace(vec4 position, mat4 viewProjectionMatrix, vec4 center) {\nreturn viewProjectionMatrix * position + center;\n}\nvec4 project_common_position_to_clipspace(vec4 position) {\nreturn project_common_position_to_clipspace(position, project_uViewProjectionMatrix, project_uCenter);\n}\nvec2 project_pixel_size_to_clipspace(vec2 pixels) {\nvec2 offset = pixels / project_uViewportSize * project_uDevicePixelRatio * 2.0;\nreturn offset * project_uFocalDistance;\n}\nfloat project_size_to_pixel(float meters) {\nreturn project_size(meters) * project_uScale;\n}\nfloat project_size_to_pixel(float size, int unit) {\nif (unit == UNIT_METERS) return project_size_to_pixel(size);\nif (unit == UNIT_COMMON) return size * project_uScale;\nreturn size;\n}\nfloat project_pixel_size(float pixels) {\nreturn pixels / project_uScale;\n}\nvec2 project_pixel_size(vec2 pixels) {\nreturn pixels / project_uScale;\n}\n`;var l=n(
vendor: 22,452 bytes, line 2
295840);const c={};const u={name:"project",dependencies:[i,o],vs:a,getUniforms:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:c;return"viewport"in t?(0,l.a)(t):{}}}},95840:(t,e,n)=>{"use strict";n.d(e,{a:()=>f,o:()=>p});var i=n(7964),r=n(95572),o=n(4896),s=n(72011);const a=[0,0,0,0],l=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0],c=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],u=[0,0,0],h=[0,0,0],d=(0,s.A)((function(t){let{viewport:e,devicePixelRatio:n,coordinateSystem:s,coordinateOrigin:h}=t;const{projectionCenter:d,viewProjectionMatrix:f,originCommon:A,cameraPosCommon:g,shaderCoordinateOrigin:m,geospatialOrigin:y}=function(t,e,n){const{viewMatrixUncentered:o,projectionMatrix:s}=t;let{viewMatrix:c,viewProjectionMatrix:u}=t,h=a,d=a,f=t.cameraPosition;const{geospatialOrigin:A,shaderCoordinateOrigin:g,offsetMode:m}=p(t,e,n);m&&(d=t.projectPosition(A||g),f=[f[0]-d[0],f[1]-d[1],f[2]-d[2]],d[3]=1,h=i.Z0([],d,u),c=o||c,u=r.lw([],s,c),u=r.lw([],u,l));return{viewMatrix:c,viewProjectionMatrix:u,projectionCenter:h,originCommon:d,cameraPosCommon:f,shaderCoordinateOrigin:g,geospatialOrigin:A}}(e,s,h),_=e.getDistanceScales(),v=[e.width*n,e.height*n],b=i.Z0([],[0,0,-e.focalDistance,1],e.projectionMatrix)[3]||1,x={project_uCoordinateSystem:s,project_uProjectionMode:e.projectionMode,project_uCoordinateOrigin:m,project_uCommonOrigin:A.slice(0,3),project_uCenter:d,project_uPseudoMeters:Boolean(e._pseudoMeters),project_uViewportSize:v,project_uDevicePixelRatio:n,project_uFocalDistance:b,project_uCommonUnitsPerMeter:_.unitsPerMeter,project_uCommonUnitsPerWorldUnit:_.unitsPerMeter,project_uCommonUnitsPerWorldUnit2:u,project_uScale:e.scale,project_uWrapLongitude:!1,project_uViewProjectionMatrix:f,project_uModelMatrix:c,project_uCameraPosition:g};if(y){const t=e.getDistanceScales(y);switch(s){case o.rf.METER_OFFSETS:x.project_uCommonUnitsPerWorldUnit=t.unitsPerMeter,x.project_uCommonUnitsPerWorldUnit2=t.unitsPerMeter2;break;case o.rf.LNGLAT:case o.rf.LNGLAT_OFFSETS:e._pseudoMeters||(x.project_uCommonUnitsPerMeter=t.unitsPerMeter),x.project_uCommonUnitsPerWorldUnit=t.unitsPerDegree,x.project_uCommonUnitsPerWorldUnit2=t.unitsPerDegree2;break;case o.rf.CARTESIAN:x.project_uCommonUnitsPerWorldUnit=[1,1,t.unitsPerMeter[2]],x.project_uCommonUnitsPerWorldUnit2=[0,0,t.unitsPerMeter2[2]]}}return x}));function p(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:h;n.length<3&&(n=[n[0],n[1],0]);let i,r=n,s=!0;switch(i=e===o.rf.LNGLAT_OFFSETS||e===o.rf.METER_OFFSETS?n:t.isGeospatial?[Math.fround(t.longitude),Math.fround(t.latitude),0]:null,t.projectionMode){case o.Kx.WEB_MERCATOR:e!==o.rf.LNGLAT&&e!==o.rf.CARTESIAN||(i=[0,0,0],s=!1);break;case o.Kx.WEB_MERCATOR_AUTO_OFFSET:e===o.rf.LNGLAT?r=i:e===o.rf.CARTESIAN&&(r=[Math.fround(t.center[0]),Math.fround(t.center[1]),0],i=t.unprojectPosition(r),r[0]-=n[0],r[1]-=n[1],r[2]-=n[2]);break;case o.Kx.IDENTITY:r=t.position.map(Math.fround),r[2]=r[2]||0;break;case o.Kx.GLOBE:s=!1,i=null;break;default:s=!1}return{geospatialOrigin:i,shaderCoordinateOrigin:r,offsetMode:s}}function f(t){let{viewport:e,devicePixelRatio:n=1,modelMatrix:i=null,coordinateSystem:r=o.rf.DEFAULT,coordinateOrigin:s=h,autoWrapLongitude:a=!1}=t;r===o.rf.DEFAULT&&(r=e.isGeospatial?o.rf.LNGLAT:o.rf.CARTESIAN);const l=d({viewport:e,devicePixelRatio:n,coordinateSystem:r,coordinateOrigin:s});return l.project_uWrapLongitude=a,l.project_uModelMatrix=i||c,l}},57941:(t,e,n)=>{"use strict";n.d(e,{A:()=>i});const i={name:"project32",dependencies:[n(95835).A],vs:"\nvec4 project_position_to_clipspace(\n vec3 position, vec3 position64Low, vec3 offset, out vec4 commonPosition\n) {\n vec3 projectedPosition = project_position(position, position64Low);\n mat3 rotation;\n if (project_needs_rotation(projectedPosition, rotation)) {\n // offset is specified as ENU\n // when in globe projection, rotate offset so that the ground alighs with the surface of the globe\n offset = rotation * offset;\n }\n commonPosition = vec4(projectedPosition + offset, 1.0);\n return project_common_position_to_clipspace(commonPosition);\n}\n\nvec4 project_position_to_clipspace(\n vec3 position, vec3 position64Low, vec3 offset\n) {\n vec4 commonPosition;\n return project_position_to_clipspace(position, position64Low, offset, commonPosition);\n}\n"}},48163:(t,e,n)=>{"use strict";n.d(e,{A:()=>i});class i{constructor(t){this._inProgress=!1,this._handle=null,this.time=0,this.settings={duration:0},this._timeline=t}get inProgress(){return this._inProgress}start(t){this.cancel(),this.settings=t,this._inProgress=!0,this.settings.onStart?.(this)}end(){this._inProgress&&(this._timeline.removeChannel(this._handle),this._handle=null,this._inProgress=!1,this.settings.onEnd?.(this))}cancel(){this._inProgress&&(this.settings.onInterrupt?.(this),this._timeline.removeChannel(this._handle),this._handle=null,this._inProgress=!1)}update(){if(!this._inProgress)return!1;if(null===this._handle){const{_timeline:t,settings:e}=this;this._handle=t.addChannel({delay:t.getTime(),duration:e.duration})}return this.time=this._timeline.getTime(this._handle),this._onUpdate(),this.settings.onUpdate?.(this),this._timeline.isFinished(this._handle)&&this.end(),!0}_onUpdate(){}}},57813:(t,e,n)=>{"use strict";function i(t,e){if(!t)throw new Error(e||"deck.gl: assertion failed.")}n.d(e,{A:()=>i})},67440:(t,e,n)=>{"use strict";function i(t,e,n){if(t===e)return!0;if(!n||!t||!e)return!1;if(Array.isArray(t)){if(!Array.isArray(e)||t.length!==e.length)return!1;for(let r=0;r<t.length;r++)if(!i(t[r],e[r],n-1))return!1;return!0}if(Array.isArray(e))return!1;if("object"===typeof t&&"object"===typeof e){const r=Object.keys(t),o=Object.keys(e);if(r.length!==o.length)return!1;for(const s of r){if(!e.hasOwnProperty(s))return!1;if(!i(t[s],e[s],n-1))return!1}return!0}return!1}n.d(e,{b:()=>i})},8729:(t,e,n)=>{"use strict";function i(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>!0;return Array.isArray(t)?r(t,e,[]):e(t)?[t]:[]}function r(t,e,n){let i=-1;for(;++i<t.length;){const o=t[i];Array.isArray(o)?r(o,e,n):e(o)&&n.push(o)}return n}function o(t){let{target:e,source:n,start:i=0,count:r=1}=t;const o=n.length,s=r*o;let a=0;for(let l=i;a<o;a++)e[l++]=n[a];for(;a<s;)a<s-a?(e.copyWithin(i+a,i,i+a),a*=2):(e.copyWithin(i+a,i,i+s-a),a=s);return e}n.d(e,{B:()=>i,R:()=>o})},61281:(t,e,n)=>{"use strict";n.d(e,{I:()=>a,Td:()=>s,X:()=>o});const i=[],r=[];function o(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1/0,o=i;const s={index:-1,data:t,target:[]};return t?"function"===typeof t[Symbol.iterator]?o=t:t.length>0&&(r.length=t.length,o=r):o=i,(e>0||Number.isFinite(n))&&(o=(Array.isArray(o)?o:Array.from(o)).slice(e,n),s.index=e-1),{iterable:o,objectInfo:s}}function s(t){return t&&t[Symbol.asyncIterator]}function a(t,e){const{size:n,stride:i,offset:r,startIndices:o,nested:s}=e,a=t.BYTES_PER_ELEMENT,l=i?i/a:n,c=r?r/a:0,u=Math.floor((t.length-c)/l);return(e,i)=>{let{index:r,target:a}=i;if(!o){const e=r*l+c;for(let i=0;i<n;i++)a[i]=t[e+i];return a}const h=o[r],d=o[r+1]||u;let p;if(s){p=new Array(d-h);for(let e=h;e<d;e++){const i=e*l+c;a=new Array(n);for(let e=0;e<n;e++)a[e]=t[i+e];p[e-h]=a}}else if(l===n)p=t.subarray(h*n+c,d*n+c);else{p=new t.constructor((d-h)*n);let e=0;for(let i=h;i<d;i++){const r=i*l+c;for(let i=0;i<n;i++)p[e++]=t[r+i]}}return p}}},45957:(t,e,n)=>{"use strict";n.d(e,{A:()=>i});const i=new(n(24990).t)({id:"deck"})},48357:(t,e,n)=>{"use strict";n.d(e,{$M:()=>o,Vl:()=>s,_Z:()=>p,cT:()=>d,on:()=>a,qk:()=>u});var i=n(15753),r=n(15183);function o(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function s(t){return[t[12],t[13],t[14]]}function a(t){return{left:c(t[3]+t[0],t[7]+t[4],t[11]+t[8],t[15]+t[12]),right:c(t[3]-t[0],t[7]-t[4],t[11]-t[8],t[15]-t[12]),bottom:c(t[3]+t[1],t[7]+t[5],t[11]+t[9],t[15]+t[13]),top:c(t[3]-t[1],t[7]-t[5],t[11]-t[9],t[15]-t[13]),near:c(t[3]+t[2],t[7]+t[6],t[11]+t[10],t[15]+t[14]),far:c(t[3]-t[2],t[7]-t[6],t[11]-t[10],t[15]-t[14])}}const l=new r.P;function c(t,e,n,i){l.set(t,e,n);const o=l.len();return{distance:i/o,normal:new r.P(-t/o,-e/o,-n/o)}}function u(t){return t-Math.fround(t)}let h;function d(t,e){const{size:n=1,startIndex:r=0}=e,o=void 0!==e.endIndex?e.endIndex:t.length,s=(o-r)/n;h=i.A.allocate(h,s,{type:Float32Array,size:2*n});let a=r,l=0;for(;a<o;){for(let e=0;e<n;e++){const i=t[a++];h[l+e]=i,h[l+e+n]=u(i)}l+=2*n}return h.subarray(0,s*n*2)}function p(t){let e=null,n=!1;for(const i of t)i&&(e?(n||(e=[[e[0][0],e[0][1]],[e[1][0],e[1][1]]],n=!0),e[0][0]=Math.min(e[0][0],i[0][0]),e[0][1]=Math.min(e[0][1],i[0][1]),e[1][0]=Math.max(e[1][0],i[1][0]),e[1][1]=Math.max(e[1][1],i[1][1])):e=i);return e}},72011:(t,e,n)=>{"use strict";function i(t,e){if(t===e)return!0;if(Array.isArray(t)){const n=t.length;if(!e||e.length!==n)return!1;for(let i=0;i<n;i++)if(t[i]!==e[i])return!1;return!0}return!1}function r(t){let e,n={};return r=>{for(const o in r)if(!i(r[o],n[o])){e=t(r),n=r;break}return e}}n.d(e,{A:()=>r})},1434:(t,e,n)=>{"use strict";function i(t,e){if(!e)return t;const n={...t,...e};if("defines"in e&&(n.defines={...t.defines,...e.defines}),"modules"in e&&(n.modules=(t.modules||[]).concat(e.modules),e.modules.some((t=>"project64"===t.name)))){const t=n.modules.findIndex((t=>"project32"===t.name));t>=0&&n.modules.splice(t,1)}if("inject"in e)if(t.inject){const i={...t.inject};for(const t in e.inject)i[t]=(i[t]||"")+e.inject[t];n.inject=i}else n.inject=e.inject;return n}n.d(e,{n:()=>i})},39611:(t,e,n)=>{"use strict";n.d(e,{A:()=>a});var i=n(61281),r=n(15753),o=n(57813),s=n(86561);class a{constructor(t){this.indexStarts=[0],this.vertexStarts=[0],this.vertexCount=0,this.instanceCount=0;const{attributes:e={}}=t;this.typedArrayManager=r.A,this.attributes={},this._attributeDefs=e,this.opts=t,this.updateGeometry(t)}updateGeometry(t){Object.assign(this.opts,t);const{data:e,buffers:n={},getGeometry:i,geometryBuffer:r,positionFormat:s,dataChanged:a,normalize:l=!0}=this.opts;if(this.data=e,this.getGeometry=i,this.positionSize=r&&r.size||("XY"===s?2:3),this.buffers=n,this.normalize=l,r&&((0,o.A)(e.startIndices),this.getGeometry=this.getGeometryFromBuffer(r),l||(n.vertexPositions=r)),this.geometryBuffer=n.vertexPositions,Array.isArray(a))for(const o of a)this._rebuildGeometry(o);else this._rebuildGeometry()}updatePartialGeometry(t){let{startRow:e,endRow:n}=t;this._rebuildGeometry({startRow:e,endRow:n})}getGeometryFromBuffer(t){const e=t.value||t;return ArrayBuffer.isView(e)?(0,i.I)(e,{size:this.positionSize,offset:t.offset,stride:t.stride,startIndices:this.data.startIndices}):null}_allocate(t,e){const{attributes:n,buffers:i,_attributeDefs:r,typedArrayManager:o}=this;for(const s in r)if(s in i)o.release(n[s]),n[s]=null;else{const i=r[s];i.copy=e,n[s]=o.allocate(n[s],t,i)}}_forEachGeometry(t,e,n){const{data:r,getGeometry:o}=this,{iterable:s,objectInfo:a}=(0,i.X)(r,e,n);for(const i of s){a.index++;t(o?o(i,a):null,a.index)}}_rebuildGeometry(t){if(!this.data)return;let{indexStarts:e,vertexStarts:n,instanceCount:i}=this;const{data:r,geometryBuffer:o}=this,{startRow:a=0,endRow:l=1/0}=t||{},c={};if(t||(e=[0],n=[0]),this.normalize||!o)this._forEachGeometry(((t,e)=>{const i=t&&this.normalizeGeometry(t);c[e]=i,n[e+1]=n[e]+(i?this.getGeometrySize(i):0)}),a,l),i=n[n.length-1];else if(n=r.startIndices,i=n[r.length]||0,ArrayBuffer.isView(o))i=i||o.length/this.positionSize;else if(o instanceof s.h){const t=4*this.positionSize;i=i||o.byteLength/t}else if(o.buffer){const t=o.stride||4*this.positionSize;i=i||o.buffer.byteLength/t}else if(o.value){const t=o.value,e=o.stride/t.BYTES_PER_ELEMENT||this.positionSize;i=i||t.length/e}this._allocate(i,Boolean(t)),this.indexStarts=e,this.vertexStarts=n,this.instanceCount=i;const u={};this._forEachGeometry(((t,r)=>{const o=c[r]||t;u.vertexStart=n[r],u.indexStart=e[r];const s=r<n.length-1?n[r+1]:i;u.geometrySize=s-n[r],u.geometryIndex=r,this.updateGeometryAttributes(o,u)}),a,l),this.vertexCount=e[e.length-1]}}},15753:(t,e,n)=>{"use strict";n.d(e,{A:()=>i});const i=new class{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this._pool=[],this.opts={overAlloc:2,poolSize:100},this.setOptions(t)}setOptions(t){Object.assign(this.opts,t)}allocate(t,e,n){let{size:i=1,type:r,padding:o=0,copy:s=!1,initialize:a=!1,maxCount:l}=n;const c=r||t&&t.constructor||Float32Array,u=e*i+o;if(ArrayBuffer.isView(t)){if(u<=t.length)return t;if(u*t.BYTES_PER_ELEMENT<=t.buffer.byteLength)return new c(t.buffer,0,u)}let h=1/0;l&&(h=l*i+o);const d=this._allocate(c,u,a,h);return t&&s?d.set(t):a||d.fill(0,0,4),this._release(t),d}release(t){this._release(t)}_allocate(t,e,n,i){let r=Math.max(Math.ceil(e*this.opts.overAlloc),1);r>i&&(r=i);const o=this._pool,s=t.BYTES_PER_ELEMENT*r,a=o.findIndex((t=>t.byteLength>=s));if(a>=0){const e=new t(o.splice(a,1)[0],0,r);return n&&e.fill(0),e}return new t(r)}_release(t){if(!ArrayBuffer.isView(t))return;const e=this._pool,{buffer:n}=t,{byteLength:i}=n,r=e.findIndex((t=>t.byteLength>=i));r<0?e.push(n):(r>0||e.length<this.opts.poolSize)&&e.splice(r,0,n),e.length>this.opts.poolSize&&e.shift()}}},5279:(t,e,n)=>{"use strict";n.d(e,{A:()=>g});var i=n(45957),r=n(48357),o=n(33128),s=n(25195),a=n(15183),l=n(95572),c=n(68945),u=n(4896);const h=Math.PI/180,d=(0,r.$M)(),p=[0,0,0],f={unitsPerMeter:[1,1,1],metersPerUnit:[1,1,1]};class A{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this._frustumPlanes={},this.id=t.id||this.constructor.displayName||"viewport",this.x=t.x||0,this.y=t.y||0,this.width=t.width||1,this.height=t.height||1,this.zoom=t.zoom||0,this.padding=t.padding,this.distanceScales=t.distanceScales||f,this.focalDistance=t.focalDistance||1,this.position=t.position||p,this.modelMatrix=t.modelMatrix||null;const{longitude:e,latitude:n}=t;this.isGeospatial=Number.isFinite(n)&&Number.isFinite(e),this._initProps(t),this._initMatrices(t),this.equals=this.equals.bind(this),this.project=this.project.bind(this),this.unproject=this.unproject.bind(this),this.projectPosition=this.projectPosition.bind(this),this.unprojectPosition=this.unprojectPosition.bind(this),this.projectFlat=this.projectFlat.bind(this),this.unprojectFlat=this.unprojectFlat.bind(this)}get subViewports(){return null}get metersPerPixel(){return this.distanceScales.metersPerUnit[2]/this.scale}get projectionMode(){return this.isGeospatial?this.zoom<12?u.Kx.WEB_MERCATOR:u.Kx.WEB_MERCATOR_AUTO_OFFSET:u.Kx.IDENTITY}equals(t){return t instanceof A&&(this===t||t.width===this.width&&t.height===this.height&&t.scale===this.scale&&(0,s.aI)(t.projectionMatrix,this.projectionMatrix)&&(0,s.aI)(t.viewMatrix,this.viewMatrix))}project(t){let{topLeft:e=!0}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=this.projectPosition(t),i=(0,c.VJ)(n,this.pixelProjectionMatrix),[r,o]=i,s=e?o:this.height-o;return 2===t.length?[r,s]:[r,s,i[2]]}unproject(t){let{topLeft:e=!0,targetZ:n}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const[i,r,o]=t,s=e?r:this.height-r,a=n&&n*this.distanceScales.unitsPerMeter[2],l=(0,c.xJ)([i,s,o],this.pixelUnprojectionMatrix,a),[u,h,d]=this.unprojectPosition(l);return Number.isFinite(o)?[u,h,d]:Number.isFinite(n)?[u,h,n]:[u,h]}projectPosition(t){const[e,n]=this.projectFlat(t);return[e,n,(t[2]||0)*this.distanceScales.unitsPerMeter[2]]}unprojectPosition(t){const[e,n]=this.unprojectFlat(t);return[e,n,(t[2]||0)*this.distanceScales.metersPerUnit[2]]}projectFlat(t){if(this.isGeospatial){const e=(0,c.Gw)(t);return e[1]=(0,s.qE)(e[1],-318,830),e}return t}unprojectFlat(t){return this.isGeospatial?(0,c.iV)(t):t}getBounds(){const t={targetZ:(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).z||0},e=this.unproject([0,0],t),n=this.unproject([this.width,0],t),i=this.unproject([0,this.height],t),r=this.unproject([this.width,this.height],t);return[Math.min(e[0],n[0],i[0],r[0]),Math.min(e[1],n[1],i[1],r[1]),Math.max(e[0],n[0],i[0],r[0]),Math.max(e[1],n[1],i[1],r[1])]}getDistanceScales(t){return t?(0,c.nI)({longitude:t[0],latitude:t[1],highPrecision:!0}):this.distanceScales}containsPixel(t){let{x:e,y:n,width:i=1,height:r=1}=t;return e<this.x+this.width&&this.x<e+i&&n<this.y+this.height&&this.y<n+r}getFrustumPlanes(){return this._frustumPlanes.near||Object.assign(this._frustumPlanes,(0,r.on)(this.viewProjectionMatrix)),this._frustumPlanes}panByPosition(t,e){return null}_initProps(t){const e=t.longitude,n=t.latitude;this.isGeospatial&&(Number.isFinite(t.zoom)||(this.zoom=(0,c.fO)({latitude:n})+Math.log2(this.focalDistance)),this.distanceScales=t.distanceScales||(0,c.nI)({latitude:n,longitude:e}));const i=Math.pow(2,this.zoom);this.scale=i;const{position:r,modelMatrix:s}=t;let l=p;if(r&&(l=s?new o.k(s).transformAsVector(r,[]):r),this.isGeospatial){const t=this.projectPosition([e,n,0]);this.center=new a.P(l).scale(this.distanceScales.unitsPerMeter).add(t)}else this.center=this.projectPosition(l)}_initMatrices(t){const{viewMatrix:e=d,projectionMatrix:n=null,orthographic:c=!1,fovyRadians:u,fovy:p=75,near:f=.1,far:A=1e3,padding:g=null,focalDistance:m=1}=t;this.viewMatrixUncentered=e,this.viewMatrix=(new o.k).multiplyRight(e).translate(new a.P(this.center).negate()),this.projectionMatrix=n||function(t){let{width:e,height:n,orthographic:i,fovyRadians:r,focalDistance:a,padding:l,near:c,far:u}=t;const h=e/n,d=i?(new o.k).orthographic({fovy:r,aspect:h,focalDistance:a,near:c,far:u}):(new o.k).perspective({fovy:r,aspect:h,near:c,far:u});if(l){const{left:t=0,right:i=0,top:r=0,bottom:o=0}=l,a=(0,s.qE)((t+e-i)/2,0,e)-e/2,c=(0,s.qE)((r+n-o)/2,0,n)-n/2;d[8]-=2*a/e,d[9]+=2*c/n}return d}({width:this.width,height:this.height,orthographic:c,fovyRadians:u||p*h,focalDistance:m,padding:g,near:f,far:A});const y=(0,r.$M)();l.lw(y,y,this.projectionMatrix),l.lw(y,y,this.viewMatrix),this.viewProjectionMatrix=y,this.viewMatrixInverse=l.B8([],this.viewMatrix)||this.viewMatrix,this.cameraPosition=(0,r.Vl)(this.viewMatrixInverse);const _=(0,r.$M)(),v=(0,r.$M)();l.hs(_,_,[this.width/2,-this.height/2,1]),l.Tl(_,_,[1,-1,0]),l.lw(v,_,this.viewProjectionMatrix),this.pixelProjectionMatrix=v,this.pixelUnprojectionMatrix=l.B8((0,r.$M)(),this.pixelProjectionMatrix),this.pixelUnprojectionMatrix||i.A.warn("Pixel project matrix not invertible")()}}A.displayName="Viewport";const g=A},2816:(t,e,n)=>{"use strict";n.d(e,{A:()=>c});var i=n(5279),r=n(68945),o=n(25195),s=n(33128),a=n(28442);class l extends i.A{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{latitude:e=0,longitude:n=0,zoom:i=0,pitch:a=0,bearing:l=0,nearZMultiplier:c=.1,farZMultiplier:u=1.01,nearZ:h,farZ:d,orthographic:p=!1,projectionMatrix:f,repeat:A=!1,worldOffset:g=0,position:m,padding:y,legacyMeterSizes:_=!1}=t;let{width:v,height:b,altitude:x=1.5}=t;const w=Math.pow(2,i);let E;v=v||1,b=b||1;let C=null;if(f)x=f[5]/2,E=(0,r.Os)(x);else{let n;if(t.fovy?(E=t.fovy,x=(0,r.wZ)(E)):E=(0,r.Os)(x),y){const{top:t=0,bottom:e=0}=y;n=[0,(0,o.qE)((t+b-e)/2,0,b)-b/2]}C=(0,r.om)({width:v,height:b,scale:w,center:m&&[0,0,m[2]*(0,r.mY)(e)],offset:n,pitch:a,fovy:E,nearZMultiplier:c,farZMultiplier:u}),Number.isFinite(h)&&(C.near=h),Number.isFinite(d)&&(C.far=d)}let T=(0,r.rY)({height:b,pitch:a,bearing:l,scale:w,altitude:x});if(g){T=(new s.k).translate([512*g,0,0]).multiplyLeft(T)}super({...t,width:v,height:b,viewMatrix:T,longitude:n,latitude:e,zoom:i,...C,fovy:E,focalDistance:x}),this.latitude=e,this.longitude=n,this.zoom=i,this.pitch=a,this.bearing=l,this.altitude=x,this.fovy=E,this.orthographic=p,this._subViewports=A?[]:null,this._pseudoMeters=_,Object.freeze(this)}get subViewports(){if(this._subViewports&&!this._subViewports.length){const t=this.getBounds(),e=Math.floor((t[0]+180)/360),n=Math.ceil((t[2]-180)/360);for(let i=e;i<=n;i++){const t=i?new l({...this,worldOffset:i}):this;this._subViewports.push(t)}}return this._subViewports}projectPosition(t){if(this._pseudoMeters)return super.projectPosition(t);const[e,n]=this.projectFlat(t);return[e,n,(t[2]||0)*(0,r.mY)(t[1])]}unprojectPosition(t){if(this._pseudoMeters)return super.unprojectPosition(t);const[e,n]=this.unprojectFlat(t);return[e,n,(t[2]||0)/(0,r.mY)(n)]}addMetersToLngLat(t,e){return(0,r.dT)(t,e)}panByPosition(t,e){const n=(0,r.xJ)(e,this.pixelUnprojectionMatrix),i=this.projectFlat(t),o=a.WQ([],i,a.ze([],n)),s=a.WQ([],this.center,o),[l,c]=this.unprojectFlat(s);return{longitude:l,latitude:c}}getBounds(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const e=(0,r.gW)(this,t.z||0);return[Math.min(e[0][0],e[1][0],e[2][0],e[3][0]),Math.min(e[0][1],e[1][1],e[2][1],e[3][1]),Math.max(e[0][0],e[1][0],e[2][0],e[3][0]),Math.max(e[0][1],e[1][1],e[2][1],e[3][1])]}fitBounds(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{width:n,height:i}=this,{longitude:o,latitude:s,zoom:a}=(0,r.Fe)({width:n,height:i,bounds:t,...e});return new l({width:n,height:i,longitude:o,latitude:s,zoom:a})}}l.displayName="WebMercatorViewport";const c=l},30202:(t,e,n)=>{"use strict";n.d(e,{A:()=>p});var i=n(67440);class r{static get componentName(){return Object.prototype.hasOwnProperty.call(this,"extensionName")?this.extensionName:""}constructor(t){t&&(this.opts=t)}equals(t){return this===t||this.constructor===t.constructor&&(0,i.b)(this.opts,t.opts,1)}getShaders(t){return null}getSubLayerProps(t){const{defaultProps:e}=t.constructor,n={updateTriggers:{}};for(const i in e)if(i in this.props){const t=e[i],r=this.props[i];n[i]=r,t&&"accessor"===t.type&&(n.updateTriggers[i]=this.props.updateTriggers[i],"function"===typeof r&&(n[i]=this.getSubLayerAccessor(r)))}return n}initializeState(t,e){}updateState(t,e){}onNeedsRedraw(t){}getNeedsPickingBuffer(t){return!1}draw(t,e){}finalizeState(t,e){}}r.defaultProps={},r.extensionName="LayerExtension";const o=r,s={clipBounds:[0,0,1,1],clipByInstance:void 0},a="\nuniform vec4 clip_bounds;\nbool clip_isInBounds(vec2 position) {\nreturn position.x >= clip_bounds[0] && position.y >= clip_bounds[1] && position.x < clip_bounds[2] && position.y < clip_bounds[3];\n}\n",l={name:"clip-vs",vs:a},c={"vs:#decl":"\nout float clip_isVisible;\n","vs:DECKGL_FILTER_GL_POSITION":"\nclip_isVisible = float(clip_isInBounds(geometry.worldPosition.xy));\n","fs:#decl":"\nin float clip_isVisible;\n","fs:DECKGL_FILTER_COLOR":"\nif (clip_isVisible < 0.5) discard;\n"},u={name:"clip-fs",fs:a},h={"vs:#decl":"\nout vec2 clip_commonPosition;\n","vs:DECKGL_FILTER_GL_POSITION":"\nclip_commonPosition = geometry.position.xy;\n","fs:#decl":"\nin vec2 clip_commonPosition;
2\n","fs:DECKGL_FILTER_COLOR":"\nif (!clip_isInBounds(clip_commonPosition)) discard;\n"};class d extends o{getShaders(){let t="instancePositions"in this.getAttributeManager().attributes;return void 0!==this.props.clipByInstance&&(t=Boolean(this.props.clipByInstance)),this.state.clipByInstance=t,t?{modules:[l],inject:c}:{modules:[u],inject:h}}draw(t){let{uniforms:e}=t;const{clipBounds:n}=this.props;if(this.state.clipByInstance)e.clip_bounds=n;else{const t=this.projectPosition([n[0],n[1],0]),i=this.projectPosition([n[2],n[3],0]);e.clip_bounds=[Math.min(t[0],i[0]),Math.min(t[1],i[1]),Math.max(t[0],i[0]),Math.max(t[1],i[1])]}}}d.defaultProps=s,d.extensionName="ClipExtension";const p=d},49793:(t,e,n)=>{"use strict";n.d(e,{A:()=>a});var i=n(89522),r=n(16249);const o={...r.A.defaultProps};class s extends i.A{indexToBounds(){return null}renderLayers(){const{elevationScale:t,extruded:e,wireframe:n,filled:i,stroked:o,lineWidthUnits:s,lineWidthScale:a,lineWidthMinPixels:l,lineWidthMaxPixels:c,lineJointRounded:u,lineMiterLimit:h,lineDashJustified:d,getElevation:p,getFillColor:f,getLineColor:A,getLineWidth:g}=this.props,{updateTriggers:m,material:y,transitions:_}=this.props,v=this.getSubLayerClass("cell",r.A),{updateTriggers:b,...x}=this.indexToBounds()||{};return new v({filled:i,wireframe:n,extruded:e,elevationScale:t,stroked:o,lineWidthUnits:s,lineWidthScale:a,lineWidthMinPixels:l,lineWidthMaxPixels:c,lineJointRounded:u,lineMiterLimit:h,lineDashJustified:d,material:y,transitions:_,getElevation:p,getFillColor:f,getLineColor:A,getLineWidth:g},this.getSubLayerProps({id:"cell",updateTriggers:m&&{...b,getElevation:m.getElevation,getFillColor:m.getFillColor,getLineColor:m.getLineColor,getLineWidth:m.getLineWidth}}),x)}}s.layerName="GeoCellLayer",s.defaultProps=o;const a=s},16389:(t,e,n)=>{"use strict";n.d(e,{A:()=>d});var i=n(49793);const r="0123456789bcdefghjkmnpqrstuvwxyz",o={};for(let p=0;p<32;p++)o[r.charAt(p)]=p;const s=-90,a=90,l=-180,c=180;function u(t){const[e,n,i,r]=function(t){let e,n=!0,i=a,r=s,u=c,h=l,d=0;for(let s=0,a=t.length;s<a;s++){const a=t[s].toLowerCase();d=o[a];for(let t=4;t>=0;t--){const o=d>>t&1;n?(e=(u+h)/2,1===o?h=e:u=e):(e=(i+r)/2,1===o?r=e:i=e),n=!n}}return[r,h,i,u]}(t);return[r,i,r,e,n,e,n,i,r,i]}class h extends i.A{indexToBounds(){const{data:t,getGeohash:e}=this.props;return{data:t,_normalize:!1,positionFormat:"XY",getPolygon:(t,n)=>u(e(t,n))}}}h.layerName="GeohashLayer",h.defaultProps={getGeohash:{type:"accessor",value:t=>t.geohash}};const d=h},57741:(t,e,n)=>{"use strict";n.d(e,{A:()=>c});var i=n(79437),r=n(61281),o=n(82111),s=n(49793),a=n(6242);class l extends s.A{initializeState(){o.A._checkH3Lib()}updateState(t){let{props:e,changeFlags:n}=t;if(n.dataChanged||n.updateTriggersChanged&&n.updateTriggersChanged.getHexagons){const{data:t,getHexagons:n}=e,o=[],{iterable:s,objectInfo:l}=(0,r.X)(t);for(const e of s){l.index++;const t=n(e,l),r=(0,i.Au)(t,!0);for(const n of r){for(const t of n)(0,a.yB)(t);o.push(this.getSubLayerRow({polygon:n},e,l.index))}}this.setState({polygons:o})}}indexToBounds(){const{getElevation:t,getFillColor:e,getLineColor:n,getLineWidth:i}=this.props;return{data:this.state.polygons,getPolygon:t=>t.polygon,getElevation:this.getSubLayerAccessor(t),getFillColor:this.getSubLayerAccessor(e),getLineColor:this.getSubLayerAccessor(n),getLineWidth:this.getSubLayerAccessor(i)}}}l.layerName="H3ClusterLayer",l.defaultProps={getHexagons:{type:"accessor",value:t=>t.hexagons}};const c=l},82111:(t,e,n)=>{"use strict";n.d(e,{A:()=>h});var i=n(79437),r=n(89522),o=n(61281),s=n(16249),a=n(86044),l=n(6242);const c={...s.A.defaultProps,highPrecision:"auto",coverage:{type:"number",min:0,max:1,value:1},centerHexagon:null,getHexagon:{type:"accessor",value:t=>t.hexagon},extruded:!0};class u extends r.A{initializeState(){u._checkH3Lib(),this.state={edgeLengthKM:0,resolution:-1}}shouldUpdateState(t){let{changeFlags:e}=t;return this._shouldUseHighPrecision()?e.propsOrDataChanged:e.somethingChanged}updateState(t){let{props:e,changeFlags:n}=t;if(!0!==e.highPrecision&&(n.dataChanged||n.updateTriggersChanged&&n.updateTriggersChanged.getHexagon)){const t=this._calculateH3DataProps();this.setState(t)}this._updateVertices(this.context.viewport)}_calculateH3DataProps(){let t=-1,e=!1,n=!1;const{iterable:r,objectInfo:s}=(0,o.X)(this.props.data);for(const o of r){s.index++;const r=this.props.getHexagon(o,s),a=(0,i.Hn)(r);if(t<0){if(t=a,!this.props.highPrecision)break}else if(t!==a){n=!0;break}if((0,i.PB)(r)){e=!0;break}}return{resolution:t,edgeLengthKM:t>=0?(0,i.a0)(t,"km"):0,hasMultipleRes:n,hasPentagon:e}}_shouldUseHighPrecision(){if("auto"===this.props.highPrecision){const{resolution:t,hasPentagon:e,hasMultipleRes:n}=this.state,{viewport:i}=this.context;return Boolean(i?.resolution)||n||e||t>=0&&t<=5}return this.props.highPrecision}_updateVertices(t){if(this._shouldUseHighPrecision())return;const{resolution:e,edgeLengthKM:n,centerHex:r}=this.state;if(e<0)return;const o=this.props.centerHexagon||(0,i.Sg)(t.latitude,t.longitude,e);if(r===o)return;if(r)try{if((0,i.QO)(r,o)*n<10)return}catch{}const{unitsPerMeter:s}=t.distanceScales;let a=(0,l.Dn)(o);const[c,u]=(0,i._k)(o),[h,d]=t.projectFlat([u,c]);a=a.map((e=>{const n=t.projectFlat(e);return[(n[0]-h)/s[0],(n[1]-d)/s[1]]})),this.setState({centerHex:o,vertices:a})}renderLayers(){return this._shouldUseHighPrecision()?this._renderPolygonLayer():this._renderColumnLayer()}_getForwardProps(){const{elevationScale:t,material:e,coverage:n,extruded:i,wireframe:r,stroked:o,filled:s,lineWidthUnits:a,lineWidthScale:l,lineWidthMinPixels:c,lineWidthMaxPixels:u,getFillColor:h,getElevation:d,getLineColor:p,getLineWidth:f,transitions:A,updateTriggers:g}=this.props;return{elevationScale:t,extruded:i,coverage:n,wireframe:r,stroked:o,filled:s,lineWidthUnits:a,lineWidthScale:l,lineWidthMinPixels:c,lineWidthMaxPixels:u,material:e,getElevation:d,getFillColor:h,getLineColor:p,getLineWidth:f,transitions:A,updateTriggers:{getFillColor:g.getFillColor,getElevation:g.getElevation,getLineColor:g.getLineColor,getLineWidth:g.getLineWidth}}}_renderPolygonLayer(){const{data:t,getHexagon:e,updateTriggers:n,coverage:i}=this.props,r=this.getSubLayerClass("hexagon-cell-hifi",s.A),o=this._getForwardProps();return o.updateTriggers.getPolygon=function(t,e){let n;return n=void 0===t||null===t?e:"object"===typeof t?{...t,coverage:e}:{getHexagon:t,coverage:e},n}
vendor: 12,452 bytes, line 2
2(n.getHexagon,i),new r(o,this.getSubLayerProps({id:"hexagon-cell-hifi",updateTriggers:o.updateTriggers}),{data:t,_normalize:!1,_windingOrder:"CCW",positionFormat:"XY",getPolygon:(t,n)=>{const r=e(t,n);return(0,l.jT)((0,l.Dn)(r,i))}})}_renderColumnLayer(){const{data:t,getHexagon:e,updateTriggers:n}=this.props,i=this.getSubLayerClass("hexagon-cell",a.A),r=this._getForwardProps();return r.updateTriggers.getPosition=n.getHexagon,new i(r,this.getSubLayerProps({id:"hexagon-cell",flatShading:!0,updateTriggers:r.updateTriggers}),{data:t,diskResolution:6,radius:1,vertices:this.state.vertices,getPosition:l.tk.bind(null,e)})}}u.defaultProps=c,u.layerName="H3HexagonLayer",u._checkH3Lib=()=>{};const h=u},6242:(t,e,n)=>{"use strict";n.d(e,{Dn:()=>a,jT:()=>l,tk:()=>s,yB:()=>o});var i=n(79437),r=n(25195);function o(t,e){e=void 0===e?t[0][0]:e;for(const n of t){const t=n[0]-e;t>180?n[0]-=360:t<-180&&(n[0]+=360)}}function s(t,e,n){const r=t(e,n),[o,s]=(0,i._k)(r);return[s,o]}function a(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;const n=(0,i.u$)(t,!0);return 1!==e?function(t,e,n){const[s,a]=(0,i._k)(t),l=e.length;o(e,a);const c=e[0]===e[l-1]?l-1:l;for(let i=0;i<c;i++)e[i][0]=(0,r.Cc)(a,e[i][0],n),e[i][1]=(0,r.Cc)(s,e[i][1],n)}(t,n,e):o(n),n}function l(t){const e=new Float64Array(2*t.length);let n=0;for(const i of t)e[n++]=i[0],e[n++]=i[1];return e}},66643:(t,e,n)=>{"use strict";n.r(e),n.d(e,{GeohashLayer:()=>Br.A,GreatCircleLayer:()=>W,H3ClusterLayer:()=>Q.A,H3HexagonLayer:()=>J.A,MVTLayer:()=>Ir.A,QuadkeyLayer:()=>Z.A,S2Layer:()=>q.A,TerrainLayer:()=>Mr,Tile3DLayer:()=>br,TileLayer:()=>X.A,TripsLayer:()=>K.A,_GeoCellLayer:()=>Rr.A,_Tile2DHeader:()=>Or.I,_Tileset2D:()=>Lr.TL,_WMSLayer:()=>V,_getURLFromTemplate:()=>Er.g8});var i=n(89522),r=n(67440),o=n(4896),s=n(59969);class a{fetch;loadOptions;_needsRefresh=!0;props;constructor(t){this.props={...t},this.loadOptions={...t.loadOptions},this.fetch=function(t){const e=t?.fetch;if(e&&"function"===typeof e)return(t,n)=>e(t,n);const n=t?.fetch;if(n&&"function"!==typeof n)return t=>fetch(t,n);return t=>fetch(t)}(this.loadOptions)}setProps(t){this.props=Object.assign(this.props,t),this.setNeedsRefresh()}setNeedsRefresh(){this._needsRefresh=!0}getNeedsRefresh(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const e=this._needsRefresh;return t&&(this._needsRefresh=!1),e}}class l extends a{static type="template";static testURL=t=>!1}var c=n(83474),u=n(59328);function h(t){if(Array.isArray(t))return t.map((t=>h(t)));if(t&&"object"===typeof t){const n={};for(const[i,r]of Object.entries(t))n[(e=i,"string"===typeof e?e.charAt(0).toLowerCase()+e.slice(1):e)]=h(r);return n}var e;return t}var d=n(27756);function p(t,e){if(e?._parser&&"fast-xml-parser"!==e._parser)throw new Error(e?._parser);const n={allowBooleanAttributes:!0,ignoreDeclaration:!0,removeNSPrefix:e?.removeNSPrefix,textNodeName:e?.textNodeName,isArray:(t,n,i,r)=>{const o=Boolean(e?.arrayPaths?.some((t=>n===t)));return o},...e?._fastXML},i=function(t,e){const n=new d.XMLParser({ignoreAttributes:!1,attributeNamePrefix:"",...e}),i=n.parse(t);return i}(t,n);return e?.uncapitalizeKeys?h(i):i}const f={dataType:null,batchType:null,name:"XML",id:"xml",module:"xml",version:"4.2.4",worker:!1,extensions:["xml"],mimeTypes:["application/xml","text/xml"],testText:function(t){return t.startsWith("<?xml")},options:{xml:{_parser:"fast-xml-parser",uncapitalizeKeys:!1,removeNSPrefix:!1,textNodeName:"value",arrayPaths:[]}},parse:async(t,e)=>p((new TextDecoder).decode(t),{...f.options.xml,...e?.xml}),parseTextSync:(t,e)=>p(t,{...f.options.xml,...e?.xml})};function A(t){return Array.isArray(t)?t:t?[t]:[]}function g(t){const e=A(t);return e.length>0&&e.every((t=>"string"===typeof t))?e:[]}function m(t){switch(typeof t){case"number":return t;case"string":return parseFloat(t);default:return}}function y(t){switch(typeof t){case"number":return t;case"string":return parseInt(t,10);default:return}}function _(t){switch(t){case"true":case"1":return!0;default:return!1}}function v(t,e){const n=f.parseTextSync?.(t,e),i=n.WMT_MS_Capabilities||n.WMS_Capabilities||n,r=function(t){const e={version:String(t.version||""),name:String(t.Service?.Name||"unnamed"),title:t.Service?.Title?String(t.Service?.Title):void 0,abstract:t.Service?.Abstract?String(t.Service?.Abstract):void 0,keywords:g(t.Service?.KeywordList?.Keyword),fees:t.Service?.Fees?JSON.stringify(t.Service?.Fees):void 0,accessConstraints:t.Service?.AccessConstraints?JSON.stringify(t.Service?.AccessConstraints):void 0,layerLimit:y(t.Service?.LayerLimit),maxWidth:y(t.Service?.maxWidth),maxHeight:y(t.Service?.maxHeight),layers:[],requests:b(t.Capability?.Request),exceptions:x(t.Exception)},n=A(t.Capability?.Layer);for(const i of n)e.layers.push(w(i));for(const[i,r]of Object.entries(e))void 0===r&&delete e[i];return e}(i);if(e?.inheritedLayerProps)for(const o of r.layers)E(o,null);return e?.includeRawJSON&&(r.json=i),e?.includeXMLText&&(r.xml=t),r}function b(t){const e={};for(const[n,i]of Object.entries(t||{})){const t=g(i?.Format);e[n]={mimeTypes:t}}return e}function x(t){if(A(t?.Format).length>0)return{mimeTypes:g(t)}}function w(t){const e={title:String(t?.Title||""),name:t?.Name&&String(t?.Name),abstract:t?.Name&&String(t?.Abstract),keywords:g(t.KeywordList?.Keyword)},n=t?.CRS||t?.SRS;n&&Array.isArray(n)&&n.every((t=>"string"===typeof t))&&(e.crs=n);let i=t?.EX_GeographicBoundingBox&&function(t){const{westBoundLongitude:e,northBoundLatitude:n,eastBoundLongitude:i,southBoundLatitude:r}=t;return[[e,r],[i,n]]}(t?.EX_GeographicBoundingBox);i&&(e.geographicBoundingBox=i),i=t?.LatLonBoundingBox&&function(t){const{minx:e,miny:n,maxx:i,maxy:r}=t;return[[e,n],[i,r]]}(t?.LatLonBoundingBox),i&&(e.geographicBoundingBox=i);const r=t?.BoundingBox&&(o=t?.BoundingBox,A(o).map((t=>function(t){const{CRS:e,SRS:n,minx:i,miny:r,maxx:o,maxy:s,resx:a,resy:l}=t,c={crs:e||n,boundingBox:[[m(i),m(r)],[m(o),m(s)]]};return a&&(c.xResolution=a),l&&(c.yResolution=l),c}(t))));var o;r&&r.length>0&&(e.boundingBoxes=r);const s=A(t?.Dimension).map((t=>function(t){const{name:e,units:n,value:i}=t,r={name:e,units:n,extent:i};t.unitSymbol&&(r.unitSymbol=t.unitSymbol);t.default&&(r.defaultValue=t.default);t.multipleValues&&(r.multipleValues=_(t.multipleValues));t.nearestValue&&(r.nearestValue=_(t.nearestValue));t.current&&(r.current=_(t.current));return r}(t)));s.length&&(e.dimensions=s),t?.opaque&&(e.opaque=_(t?.opaque)),t?.cascaded&&(e.cascaded=_(t?.cascaded)),t?.queryable&&(e.queryable=_(t?.queryable));const a=A(t?.Layer),l=[];for(const c of a)l.push(w(c));l.length>0&&(e.layers=l);for(const[c,u]of Object.entries(e))void 0===u&&delete e[c];return e}function E(t,e){e?.geographicBoundingBox&&!t.geographicBoundingBox&&(t.geographicBoundingBox=[...e.geographicBoundingBox]),e?.crs&&!t.crs&&(t.crs=[...e.crs]),e?.boundingBoxes&&!t.boundingBoxes&&(t.boundingBoxes=[...e.boundingBoxes]),e?.dimensions&&!t.dimensions&&(t.dimensions=[...e.dimensions]);for(const n of t.layers||[])E(n,t)}const C={dataType:null,batchType:null,id:"wms-capabilities",name:"WMS Capabilities",module:"wms",version:"4.2.4",worker:!1,extensions:["xml"],mimeTypes:["application/vnd.ogc.wms_xml","application/xml","text/xml"],testText:function(t){return t.startsWith("<?xml")},options:{wms:{}},parse:async(t,e)=>v((new TextDecoder).decode(t),e?.wms),parseTextSync:(t,e)=>v(t,e?.wms)};function T(t,e){const n=f.parseTextSync?.(t,e),i=n.FeatureInfoResponse?.FIELDS||[];return{features:(Array.isArray(i)?i:[i]).map((t=>function(t){const e=t||{};return{attributes:e,type:"",bounds:{bottom:0,top:0,left:0,right:0}}}(t)))}}const S={...C,dataType:null,id:"wms-feature-info",name:"WMS FeatureInfo",parse:async(t,e)=>T((new TextDecoder).decode(t),e),parseTextSync:(t,e)=>T(t,e)};function P(t,e){const n=f.parseTextSync?.(t,e);return n}const M={...C,dataType:null,id:"wms-layer-description",name:"WMS DescribeLayer",parse:async(t,e)=>P((new TextDecoder).decode(t),e),parseTextSync:(t,e)=>P(t,e)};const I={dataType:null,batchType:null,id:"wms-error",name:"WMS Error",module:"wms",version:"4.2.4",worker:!1,extensions:["xml"],mimeTypes:["application/vnd.ogc.se_xml","application/xml","text/xml"],testText:function(t){return t.startsWith("<?xml")},options:{wms:{throwOnError:!1}},parse:async(t,e)=>B((new TextDecoder).decode(t),e),parseSync:(t,e)=>B((new TextDecoder).decode(t),e),parseTextSync:(t,e)=>B(t,e)};function B(t,e){const n={...I.options.wms,...e?.wms},i=function(t,e){const n=f.parseTextSync?.(t,e),i=n?.ServiceExceptionReport?.ServiceException||n?.["ogc:ServiceExceptionReport"]?.["ogc:ServiceException"];return"string"===typeof i?i:i.value||i.code||"Unknown error"}(t,n),r=n.minimalErrors?i:`WMS Service error: ${i}`;if(n.throwOnError)throw new Error(r);return r}const R={type:"wms",testURL:t=>t.toLowerCase().includes("wms"),create:t=>new L(t)};class L extends l{url;data;substituteCRS84;flipCRS;wmsParameters;vendorParameters;capabilities=null;constructor(t){super(t),this.url=t.url,this.data=t.url,this.substituteCRS84=t.substituteCRS84??!1,this.flipCRS=["EPSG:4326"],this.wmsParameters={layers:void 0,query_layers:void 0,styles:void 0,version:"1.3.0",crs:"EPSG:4326",format:"image/png",info_format:"text/plain",transparent:void 0,time:void 0,elevation:void 0,...t.wmsParameters},this.vendorParameters=t.vendorParameters||{}}async getMetadata(){const t=await this.getCapabilities();return this.normalizeMetadata(t)}async getImage(t){const{boundingBox:e,bbox:n,...i}=t,r={bbox:e?[...e[0],...e[1]]:n,...i};return await this.getMap(r)}normalizeMetadata(t){return t}async getCapabilities(t,e){const n=this.getCapabilitiesURL(t,e),i=await this.fetch(n),r=await i.arrayBuffer();this._checkResponse(i,r);const o=await C.parse(r,this.loadOptions);return this.capabilities=o,o}async getMap(t,e){const n=this.getMapURL(t,e),i=await this.fetch(n),r=await i.arrayBuffer();this._checkResponse(i,r);try{return await c.$.parse(r,this.loadOptions)}catch{throw this._parseError(r)}}async getFeatureInfo(t,e){const n=this.getFeatureInfoURL(t,e),i=await this.fetch(n),r=await i.arrayBuffer();return this._checkResponse(i,r),await S.parse(r,this.loadOptions)}async getFeatureInfoText(t,e){const n=this.getFeatureInfoURL(t,e),i=await this.fetch(n),r=await i.arrayBuffer();return this._checkResponse(i,r),(new TextDecoder).decode(r)}async describeLayer(t,e){const n=this.describeLayerURL(t,e),i=await this.fetch(n),r=await i.arrayBuffer();return this._checkResponse(i,r),await M.parse(r,this.loadOptions)}async getLegendGraphic(t,e){const n=this.getLegendGraphicURL(t,e),i=await this.fetch(n),r=await i.arrayBuffer();this._checkResponse(i,r);try{return await c.$.parse(r,this.loadOptions)}catch{throw this._parseError(r)}}getCapabilitiesURL(t,e){const n={version:this.wmsParameters.version,...t};return this._getWMSUrl("GetCapabilities",n,e)}getMapURL(t,e){t=this._getWMS130Parameters(t);const n={version:this.wmsParameters.version,format:this.wmsParameters.format,transparent:this.wmsParameters.transparent,time:this.wmsParameters.time,elevation:this.wmsParameters.elevation,layers:this.wmsParameters.layers,styles:this.wmsParameters.styles,crs:this.wmsParameters.crs,...t};return this._getWMSUrl("GetMap",n,e)}getFeatureInfoURL(t,e){t=this._getWMS130Parameters(t);const{boundingBox:n,bbox:i}=t;t.bbox=n?[...n[0],...n[1]]:i;const r={version:this.wmsParameters.version,info_format:this.wmsParameters.info_format,layers:this.wmsParameters.layers,query_layers:this.wmsParameters.query_layers,styles:this.wmsParameters.styles,crs:this.wmsParameters.crs,...t};return this._getWMSUrl("GetFeatureInfo",r,e)}describeLayerURL(t,e){const n={version:this.wmsParameters.version,...t};return this._getWMSUrl("DescribeLayer",n,e)}getLegendGraphicURL(t,e){const n={version:this.wmsParameters.version,...t};return this._getWMSUrl("GetLegendGraphic",n,e)}_parseWMSUrl(t){const[e,n]=t.split("?"),i=n.split("&"),r={};for(const o of i){const[t,e]=o.split("=");r[t]=e}return{url:e,parameters:r}}_getWMSUrl(t,e,n){let i=this.url,r=!0;const o={service:"WMS",version:e.version,request:t,...e,...this.vendorParameters,...n},s=["transparent","time","elevation"];for(const[a,l]of Object.entries(o))s.includes(a)&&!l||(i+=r?"?":"&",r=!1,i+=this._getURLParameter(a,l,e));return encodeURI(i)}_getWMS130Parameters(t){const e={...t};return e.srs&&(e.crs=e.crs||e.srs,delete e.srs),e}_getURLParameter(t,e,n){switch(t){case"crs":"1.3.0"!==n.version?t="srs":this.substituteCRS84&&"EPSG:4326"===e&&(e="CRS:84");break;
2case"srs":"1.3.0"===n.version&&(t="crs");break;case"bbox":const i=this._flipBoundingBox(e,n);i&&(e=i);break;case"x":"1.3.0"===n.version&&(t="i");break;case"y":"1.3.0"===n.version&&(t="j")}return t=t.toUpperCase(),Array.isArray(e)?`${t}=${e.join(",")}`:`${t}=${e?String(e):""}`}_flipBoundingBox(t,e){if(!Array.isArray(t)||4!==t.length)return null;const n=t;return"1.3.0"===e.version&&this.flipCRS.includes(e.crs||"")&&!(this.substituteCRS84&&"EPSG:4326"===e.crs)?[n[1],n[0],n[3],n[2]]:n}async _fetchArrayBuffer(t){const e=await this.fetch(t),n=await e.arrayBuffer();return this._checkResponse(e,n),n}_checkResponse(t,e){const n=t.headers["content-type"];if(!t.ok||I.mimeTypes.includes(n)){const t=(0,u.y)(this.loadOptions,{wms:{throwOnError:!0}}),n=I.parseSync?.(e,t);throw new Error(n)}}_parseError(t){const e=I.parseSync?.(t,this.loadOptions);return new Error(e)}}class O extends l{static type="template";static testURL=t=>t.toLowerCase().includes("{");constructor(t){super(t)}async getMetadata(){throw new Error("ImageSource.getMetadata not implemented")}async getImage(t){const e=this.getGranularParameters(t),n=this.getURLFromTemplate(e),i=await this.fetch(n),r=await i.arrayBuffer();return await c.$.parse(r)}getGranularParameters(t){const[[e,n],[i,r]]=t.boundingBox;return{...t,east:e,north:n,south:r,west:i}}getURLFromTemplate(t){let e=this.props.url;for(const[n,i]of Object.entries(t))e=e.replace(`\${${n}}`,String(i)),e=e.replace(`{${n}}`,String(i));return e}}class D extends O{data;constructor(t){super(t),this.data=t.url}async getMetadata(){return await this.metadata()}async getImage(t){throw new Error("not implemented")}async metadata(){throw new Error("not implemented")}exportImage(t){throw new Error("not implemented")}metadataURL(t){return`${this.props.url}?f=pjson`}exportImageURL(t){const e=`bbox=${t.bbox[0]},${t.bbox[1]},${t.bbox[2]},${t.bbox[3]}`,n=`size=${t.width},${t.height}`,i={...t,bbox:e,size:n};return delete i.width,delete i.height,this.getUrl("exportImage",i)}getUrl(t,e,n){let i=`${this.props.url}/${t}`,r=!0;for(const[o,s]of Object.entries(e))i+=r?"?":"&",r=!1,Array.isArray(s)?i+=`${o.toUpperCase()}=${s.join(",")}`:i+=`${o.toUpperCase()}=${s?String(s):""}`;return i}async checkResponse(t){if(!t.ok)throw new Error("error")}}const k=[R,{type:"arcgis-image-server",testURL:t=>t.toLowerCase().includes("ImageServer"),create:t=>new D(t)}];function F(t){return function(t,e){const{type:n="auto"}=t,i="auto"===n?function(t,e){for(const n of e)if(n.testURL&&n.testURL(t))return n;return null}(t.url,e):function(t,e){for(const n of e)if(n.type===t)return n;return null}(n,e);if(!i)throw new Error("Not a valid image source type");return i.create(t)}(t,k)}var N=n(68945);const z=6378137*Math.PI;function U(t){const e=(0,N.Gw)(t);return e[0]=(e[0]/256-1)*z,e[1]=(e[1]/256-1)*z,e}const G={id:"imagery-layer",data:"",serviceType:"auto",srs:"auto",layers:{type:"array",compare:!0,value:[]},onMetadataLoad:{type:"function",value:()=>{}},onMetadataLoadError:{type:"function",value:console.error},onImageLoadStart:{type:"function",value:()=>{}},onImageLoad:{type:"function",value:()=>{}},onImageLoadError:{type:"function",compare:!1,value:(t,e)=>console.error(e,t)}};class V extends i.A{get isLoaded(){return 0===this.state?.loadCounter&&super.isLoaded}shouldUpdateState(){return!0}initializeState(){this.state._nextRequestId=0,this.state.lastRequestId=-1,this.state.loadCounter=0}updateState(t){let{changeFlags:e,props:n,oldProps:i}=t;const{viewport:o}=this.context;e.dataChanged||n.serviceType!==i.serviceType?(this.state.imageSource=this._createImageSource(n),this._loadMetadata(),this.debounce((()=>this.loadImage(o,"image source changed")),0)):(0,r.b)(n.layers,i.layers,1)?e.viewportChanged&&this.debounce((()=>this.loadImage(o,"viewport changed"))):this.debounce((()=>this.loadImage(o,"layers changed")),0)}finalizeState(){}renderLayers(){const{bounds:t,image:e,lastRequestParameters:n}=this.state;return e&&new s.A({...this.getSubLayerProps({id:"bitmap"}),_imageCoordinateSystem:"EPSG:4326"===n.srs?o.rf.LNGLAT:o.rf.CARTESIAN,bounds:t,image:e})}async getFeatureInfoText(t,e){const{lastRequestParameters:n}=this.state;if(n){return await(this.state.imageSource.getFeatureInfoText?.({...n,query_layers:n.layers,x:t,y:e,info_format:"application/vnd.ogc.gml"}))}return""}_createImageSource(t){if(t.data instanceof l)return t.data;if("string"===typeof t.data)return F({url:t.data,loadOptions:t.loadOptions,type:t.serviceType});throw new Error("invalid image source in props.data")}async _loadMetadata(){const{imageSource:t}=this.state;try{this.state.loadCounter++;const e=await t.getMetadata();this.state.imageSource===t&&this.getCurrentLayer()?.props.onMetadataLoad(e)}catch(e){this.getCurrentLayer()?.props.onMetadataLoadError(e)}finally{this.state.loadCounter--}}async loadImage(t,e){const{layers:n,serviceType:i}=this.props;if("wms"===i&&0===n.length)return;const r=t.getBounds(),{width:o,height:s}=t,a=this.getRequestId();let{srs:l}=this.props;"auto"===l&&(l=t.resolution?"EPSG:4326":"EPSG:3857");
vendor: 2,471 bytes, line 2
2const c={width:o,height:s,boundingBox:[[r[0],r[1]],[r[2],r[3]]],layers:n,crs:l};if("EPSG:3857"===l){const t=U([r[0],r[1]]),e=U([r[2],r[3]]);c.boundingBox=[t,e]}try{this.state.loadCounter++,this.props.onImageLoadStart(a);const t=await this.state.imageSource.getImage(c);this.state.lastRequestId<a&&(this.getCurrentLayer()?.props.onImageLoad(a),this.setState({image:t,bounds:r,lastRequestParameters:c,lastRequestId:a}))}catch(u){this.raiseError(u,"Load image"),this.getCurrentLayer()?.props.onImageLoadError(a,u)}finally{this.state.loadCounter--}}getRequestId(){return this.state._nextRequestId++}debounce(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:500;clearTimeout(this.state._timeoutId),this.state._timeoutId=setTimeout((()=>t()),e)}}V.layerName="WMSLayer",V.defaultProps=G;var j=n(39017);class H extends j.A{}H.layerName="GreatCircleLayer",H.defaultProps={getHeight:{type:"accessor",value:0},greatCircle:!0};const W=H;var q=n(34895),Z=n(34632),X=n(67099),K=n(77277),Q=n(57741),J=n(82111),Y=n(83647),$=n(45957),tt=n(25479),et=n(39481),nt=n(86182),it=n(4172),rt=n(30141),ot=n(47605);class st extends ot.A{getShaders(){const t=super.getShaders();return t.modules.push(it.R),{...t,vs:"#version 300 es\n#define SHADER_NAME simple-mesh-layer-vs\nuniform float sizeScale;\nuniform bool composeModelMatrix;\nuniform bool pickFeatureIds;\nin vec3 positions;\nin vec3 normals;\nin vec3 colors;\nin vec2 texCoords;\nin vec4 uvRegions;\nin vec3 featureIdsPickingColors;\nin vec4 instanceColors;\nin vec3 instancePickingColors;\nin vec3 instanceModelMatrixCol0;\nin vec3 instanceModelMatrixCol1;\nin vec3 instanceModelMatrixCol2;\nout vec2 vTexCoord;\nout vec3 cameraPosition;\nout vec3 normals_commonspace;\nout vec4 position_commonspace;\nout vec4 vColor;\nvec2 applyUVRegion(vec2 uv) {\n#ifdef HAS_UV_REGIONS\nreturn fract(uv) * (uvRegions.zw - uvRegions.xy) + uvRegions.xy;\n#else\nreturn uv;\n#endif\n}\nvoid main(void) {\nvec2 uv = applyUVRegion(texCoords);\ngeometry.uv = uv;\nif (pickFeatureIds) {\ngeometry.pickingColor = featureIdsPickingColors;\n} else {\ngeometry.pickingColor = instancePickingColors;\n}\nmat3 instanceModelMatrix = mat3(instanceModelMatrixCol0, instanceModelMatrixCol1, instanceModelMatrixCol2);\nvTexCoord = uv;\ncameraPosition = project_uCameraPosition;\nvColor = vec4(colors * instanceColors.rgb, instanceColors.a);\nvec3 pos = (instanceModelMatrix * positions) * sizeScale;\nvec3 projectedPosition = project_position(positions);
2\nposition_commonspace = vec4(projectedPosition, 1.0);\ngl_Position = project_common_position_to_clipspace(position_commonspace);\ngeometry.position = position_commonspace;\nnormals_commonspace = project_normal(instanceModelMatrix * normals);\ngeometry.normal = normals_commonspace;\nDECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n#ifdef MODULE_PBR\npbr_vPosition = geometry.position.xyz;\n#ifdef HAS_NORMALS\npbr_vNormal = geometry.normal;\n#endif\n#ifdef HAS_UV\npbr_vUV = uv;\n#else\npbr_vUV = vec2(0., 0.);\n#endif\ngeometry.uv = pbr_vUV;\n#endif\nDECKGL_FILTER_COLOR(vColor, geometry);\n}\n",fs:"#version 300 es\n#define SHADER_NAME simple-mesh-layer-fs\nprecision highp float;\nuniform bool hasTexture;\nuniform sampler2D sampler;\nuniform bool flatShading;\nuniform float opacity;\nin vec2 vTexCoord;\nin vec3 cameraPosition;\nin vec3 normals_commonspace;\nin vec4 position_commonspace;\nin vec4 vColor;\nout vec4 fragColor;\nvoid main(void) {\n#ifdef MODULE_PBR\nfragColor = vColor * pbr_filterColor(vec4(0));\ngeometry.uv = pbr_vUV;\nfragColor.a *= opacity;\n#else\ngeometry.uv = vTexCoord;\nvec3 normal;\nif (flatShading) {\nnormal = normalize(cross(dFdx(position_commonspace.xyz), dFdy(position_commonspace.xyz)));\n} else {\nnormal = normals_commonspace;\n}\nvec4 color = hasTexture ? texture(sampler, vTexCoord) : vColor;\nvec3 lightColor = lighting_getLightColor(color.rgb, cameraPosition, position_commonspace.xyz, normal);\nfragColor = vec4(lightColor, color.a * opacity);\n#endif\nDECKGL_FILTER_COLOR(fragColor, geometry);\n}\n"}}initializeState(){const{featureIds:t}=this.props;super.initializeState();const e=this.getAttributeManager();t&&e.add({featureIdsPickingColors:{type:"uint8",size:3,noAlloc:!0,update:this.calculateFeatureIdsPickingColors}})}updateState(t){super.updateState(t);const{props:e,oldProps:n}=t;e.pbrMaterial!==n.pbrMaterial&&this.updatePbrMaterialUniforms(e.pbrMaterial)}draw(t){const{featureIds:e}=this.props;this.state.model&&(this.state.model.setUniforms({u_Camera:this.state.model.uniforms.project_uCameraPosition,pickFeatureIds:Boolean(e)}),super.draw(t))}getModel(t){const{id:e,pbrMaterial:n}=this.props,i=this.parseMaterial(n,t);this.setState({parsedPBRMaterial:i});const r=this.getShaders();!function(t){const e=t.positions||t.POSITION,n=e.value.length/e.size;t.COLOR_0||t.colors||(t.colors={size:4,value:new Uint8Array(4*n).fill(255),normalized:!0})}(t.attributes);return new rt.K(this.context.device,{...this.getShaders(),id:e,geometry:t,bufferLayout:this.getAttributeManager().getBufferLayouts(),defines:{...r.defines,...i?.defines,HAS_UV_REGIONS:t.attributes.uvRegions?1:0},parameters:i?.parameters,isInstanced:!0})}updatePbrMaterialUniforms(t){const{model:e}=this.state;if(e){const{mesh:n}=this.props,i=this.parseMaterial(t,n);this.setState({parsedPBRMaterial:i}),e.setBindings(i.bindings),e.setUniforms(i.uniforms)}}parseMaterial(t,e){const n=Boolean(t.pbrMetallicRoughness&&t.pbrMetallicRoughness.baseColorTexture);return(0,nt.l)(this.context.device,{unlit:n,...t},{NORMAL:e.attributes.normals,TEXCOORD_0:e.attributes.texCoords},{pbrDebug:!1,lights:!0,useTangents:!1})}calculateFeatureIdsPickingColors(t){const e=this.props.featureIds,n=new Uint8ClampedArray(e.length*t.size),i=[];for(let r=0;r<e.length;r++)this.encodePickingColor(e[r],i),n[3*r]=i[0],n[3*r+1]=i[1],n[3*r+2]=i[2];t.value=n}finalizeState(t){super.finalizeState(t),this.state.parsedPBRMaterial?.generatedTextures.forEach((t=>t.destroy())),this.setState({parsedPBRMaterial:null})}}st.layerName="MeshLayer",st.defaultProps={pbrMaterial:{type:"object",value:null},featureIds:{type:"array",value:null,optional:!0}};const at=st;var lt=n(70889),ct=n(33128),ut=n(15183),ht=n(11728),dt=n(84584),pt=n(98953),ft=n(25195);const At=6378137,gt=6378137,mt=6356752.314245179;Math.max(At,gt,mt);function yt(t){return t}new ut.P;function _t(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:yt;return"longitude"in t?(e[0]=n(t.longitude),e[1]=n(t.latitude),e[2]=t.height):"x"in t?(e[0]=n(t.x),e[1]=n(t.y),e[2]=t.z):(e[0]=n(t[0]),e[1]=n(t[1]),e[2]=t[2]),e}function vt(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:yt;return"longitude"in e?(e.longitude=n(t[0]),e.latitude=n(t[1]),e.height=t[2]):"x"in e?(e.x=n(t[0]),e.y=n(t[1]),e.z=t[2]):(e[0]=n(t[0]),e[1]=n(t[1]),e[2]=t[2]),e}const bt=new ut.P,xt={up:{south:"east",north:"west",west:"south",east:"north"},down:{south:"west",north:"east",west:"north",east:"south"},south:{up:"west",down:"east",west:"down",east:"up"},north:{up:"east",down:"west",west:"up",east:"down"},west:{up:"north",down:"south",north:"down",south:"up"},east:{up:"south",down:"north",north:"up",south:"down"}},wt={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},Et={east:new ut.P,north:new ut.P,up:new ut.P,west:new ut.P,south:new ut.P,down:new ut.P},Ct=new ut.P,Tt=new ut.P,St=new ut.P;function Pt(t,e,n,i,r,o){const s=xt[e]&&xt[e][n];let a,l,c;(0,dt.v)(s&&(!i||i===s));const u=bt.copy(r);if((0,ft.aI)(u.x,0,1e-14)&&(0,ft.aI)(u.y,0,1e-14)){const t=Math.sign(u.z);a=Ct.fromArray(wt[e]),"east"!==e&&"west"!==e&&a.scale(t),l=Tt.fromArray(wt[n]),"east"!==n&&"west"!==n&&l.scale(t),c=St.fromArray(wt[i]),"east"!==i&&"west"!==i&&c.scale(t)}else{const{up:r,east:o,north:s}=Et;o.set(-u.y,u.x,0).normalize(),t.geodeticSurfaceNormal(u,r),s.copy(r).cross(o);const{down:h,west:d,south:p}=Et;h.copy(r).scale(-1),d.copy(o).scale(-1),p.copy(s).scale(-1),a=Et[e],l=Et[n],c=Et[i]}return o[0]=a.x,o[1]=a.y,o[2]=a.z,o[3]=0,o[4]=l.x,o[5]=l.y,o[6]=l.z,o[7]=0,o[8]=c.x,o[9]=c.y,o[10]=c.z,o[11]=0,o[12]=u.x,o[13]=u.y,o[14]=u.z,o[15]=1,o}const Mt=new ut.P,It=new ut.P,Bt=new ut.P;const Rt=new ut.P,Lt=new ut.P,Ot=new ut.P,Dt=new ut.P,kt=new ut.P,Ft=new ut.P;class Nt{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;this.centerToleranceSquared=ht.Ix,(0,dt.v)(t>=0),(0,dt.v)(e>=0),(0,dt.v)(n>=0),this.radii=new ut.P(t,e,n),this.radiiSquared=new ut.P(t*t,e*e,n*n),this.radiiToTheFourth=new ut.P(t*t*t*t,e*e*e*e,n*n*n*n),this.oneOverRadii=new ut.P(0===t?0:1/t,0===e?0:1/e,0===n?0:1/n),this.oneOverRadiiSquared=new ut.P(0===t?0:1/(t*t),0===e?0:1/(e*e),0===n?0:1/(n*n)),this.minimumRadius=Math.min(t,e,n),this.maximumRadius=Math.max(t,e,n),0!==this.radiiSquared.z&&(this.squaredXOverSquaredZ=this.radiiSquared.x/this.radiiSquared.z),Object.freeze(this)}equals(t){return this===t||Boolean(t&&this.radii.equals(t.radii))}toString(){return this.radii.toString()}cartographicToCartesian(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];const n=Lt,i=Ot,[,,r]=t;this.geodeticSurfaceNormalCartographic(t,n),i.copy(this.radiiSquared).scale(n);const o=Math.sqrt(n.dot(i));return i.scale(1/o),n.scale(r),i.add(n),i.to(e)}cartesianToCartographic(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];Ft.from(t);const n=this.scaleToGeodeticSurface(Ft,Dt);if(!n)return;const i=this.geodeticSurfaceNormal(n,Lt),r=kt;r.copy(Ft).subtract(n);return function(t,e){return vt(t,e,ft.$W._cartographicRadians?yt:ft.xW)}([Math.atan2(i.y,i.x),Math.asin(i.z),Math.sign(pt.Om(r,Ft))*pt.Bw(r)],e)}eastNorthUpToFixedFrame(t){return Pt(this,"east","north","up",t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:new ct.k)}localFrameToFixedFrame(t,e,n,i){return Pt(this,t,e,n,i,arguments.length>4&&void 0!==arguments[4]?arguments[4]:new ct.k)}geocentricSurfaceNormal(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];return Rt.from(t).normalize().to(e)}geodeticSurfaceNormalCartographic(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];const n=function(t){return _t(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],ft.$W._cartographicRadians?yt:ft.eh)}(t),i=n[0],r=n[1],o=Math.cos(r);return Rt.set(o*Math.cos(i),o*Math.sin(i),Math.sin(r)).normalize(),Rt.to(e)}geodeticSurfaceNormal(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];return Rt.from(t).scale(this.oneOverRadiiSquared).normalize().to(e)}scaleToGeodeticSurface(t,e){return function(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];const{oneOverRadii:i,oneOverRadiiSquared:r,centerToleranceSquared:o}=e;Mt.from(t);const s=Mt.x,a=Mt.y,l=Mt.z,c=i.x,u=i.y,h=i.z,d=s*s*c*c,p=a*a*u*u,f=l*l*h*h,A=d+p+f,g=Math.sqrt(1/A);
vendor: 35,912 bytes, line 2
2if(!Number.isFinite(g))return;const m=It;if(m.copy(t).scale(g),A<o)return m.to(n);const y=r.x,_=r.y,v=r.z,b=Bt;b.set(m.x*y*2,m.y*_*2,m.z*v*2);let x,w,E,C,T=(1-g)*Mt.len()/(.5*b.len()),S=0;do{T-=S,x=1/(1+T*y),w=1/(1+T*_),E=1/(1+T*v);const t=x*x,e=w*w,n=E*E;C=d*t+p*e+f*n-1,S=C/(-2*(d*(t*x)*y+p*(e*w)*_+f*(n*E)*v))}while(Math.abs(C)>ht.IU);return Mt.scale([x,w,E]).to(n)}(t,this,e)}scaleToGeocentricSurface(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];Dt.from(t);const n=Dt.x,i=Dt.y,r=Dt.z,o=this.oneOverRadiiSquared,s=1/Math.sqrt(n*n*o.x+i*i*o.y+r*r*o.z);return Dt.multiplyScalar(s).to(e)}transformPositionToScaledSpace(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];return Dt.from(t).scale(this.oneOverRadii).to(e)}transformPositionFromScaledSpace(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];return Dt.from(t).scale(this.radii).to(e)}getSurfaceNormalIntersectionWithZAxis(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[0,0,0];(0,dt.v)((0,ft.aI)(this.radii.x,this.radii.y,ht.Pq)),(0,dt.v)(this.radii.z>0),Dt.from(t);const i=Dt.z*(1-this.squaredXOverSquaredZ);if(!(Math.abs(i)>=this.radii.z-e))return Dt.set(0,0,i).to(n)}}Nt.WGS84=new Nt(At,gt,mt);var zt=n(1021),Ut=n(19804),Gt=n(50297);class Vt{item;previous;next;constructor(t,e,n){this.item=t,this.previous=e,this.next=n}}class jt{head=null;tail=null;_length=0;get length(){return this._length}add(t){const e=new Vt(t,this.tail,null);return this.tail?(this.tail.next=e,this.tail=e):(this.head=e,this.tail=e),++this._length,e}remove(t){t&&(t.previous&&t.next?(t.previous.next=t.next,t.next.previous=t.previous):t.previous?(t.previous.next=null,this.tail=t.previous):t.next?(t.next.previous=null,this.head=t.next):(this.head=null,this.tail=null),t.next=null,t.previous=null,--this._length)}splice(t,e){t!==e&&(this.remove(e),this._insert(t,e))}_insert(t,e){const n=t.next;t.next=e,this.tail===t?this.tail=e:n.previous=e,e.next=n,e.previous=t,++this._length}}class Ht{_list;_sentinel;_trimTiles;constructor(){this._list=new jt,this._sentinel=this._list.add("sentinel"),this._trimTiles=!1}reset(){this._list.splice(this._list.tail,this._sentinel)}touch(t){const e=t._cacheNode;e&&this._list.splice(this._sentinel,e)}add(t,e,n){e._cacheNode||(e._cacheNode=this._list.add(e),n&&n(t,e))}unloadTile(t,e,n){const i=e._cacheNode;i&&(this._list.remove(i),e._cacheNode=null,n&&n(t,e))}unloadTiles(t,e){const n=this._trimTiles;this._trimTiles=!1;const i=this._list,r=1024*t.maximumMemoryUsage*1024,o=this._sentinel;let s=i.head;for(;s!==o&&(t.gpuMemoryUsageInBytes>r||n);){const n=s.item;s=s.next,this.unloadTile(t,n,e)}}trim(){this._trimTiles=!0}}var Wt=n(21402);var qt=n(820);const Zt=new ut.P,Xt=new ut.P,Kt=new qt.R2([new qt.Zc,new qt.Zc,new qt.Zc,new qt.Zc,new qt.Zc,new qt.Zc]);function Qt(t,e){const{cameraDirection:n,cameraUp:i,height:r}=t,{metersPerUnit:o}=t.distanceScales,s=Yt(t,t.center),a=Nt.WGS84.eastNorthUpToFixedFrame(s),l=t.unprojectPosition(t.cameraPosition),c=Nt.WGS84.cartographicToCartesian(l,new ut.P),u=new ut.P(a.transformAsVector(new ut.P(n).scale(o))).normalize(),h=new ut.P(a.transformAsVector(new ut.P(i).scale(o))).normalize();!function(t){const e=t.getFrustumPlanes(),n=Jt(e.near,t.cameraPosition),i=Yt(t,n),r=Yt(t,t.cameraPosition,Xt);let o=0;Kt.planes[o++].fromPointNormal(i,Zt.copy(i).subtract(r));for(const s in e){if("near"===s)continue;const r=Yt(t,Jt(e[s],n,Xt),Xt);Kt.planes[o++].fromPointNormal(r,Zt.copy(i).subtract(r))}}(t);const d=t.constructor,{longitude:p,latitude:f,width:A,bearing:g,zoom:m}=t;return{camera:{position:c,direction:u,up:h},viewport:t,topDownViewport:new d({longitude:p,latitude:f,height:r,width:A,bearing:g,zoom:m,pitch:0}),height:r,cullingVolume:Kt,frameNumber:e,sseDenominator:1.15}}function Jt(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new ut.P;const i=t.normal.dot(e);return n.copy(t.normal).scale(t.distance-i).add(e),n}function Yt(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new ut.P;const i=t.unprojectPosition(e);return Nt.WGS84.cartographicToCartesian(i,n)}const $t=6356752.314245179,te=new ut.P;function ee(t,e){if(t instanceof qt.CB){const{halfAxes:n}=t,i=function(t){t.getColumn(0,te);const e=t.getColumn(1),n=t.getColumn(2),i=te.add(e).add(n);return i.len()}(n);return Math.log2($t/(i+e[2]))}if(t instanceof qt.ie){const{radius:n}=t;return Math.log2($t/(n+e[2]))}if(t.width&&t.height){const{width:e,height:n}=t;return(Math.log2(6378137/e)+Math.log2(6378137/n))/2}return 1}function ne(t,e,n){Nt.WGS84.cartographicToCartesian([t.xmax,t.ymax,t.zmax],te);const i=Math.sqrt(Math.pow(te[0]-n[0],2)+Math.pow(te[1]-n[1],2)+Math.pow(te[2]-n[2],2));return Math.log2($t/(i+e[2]))}const ie=0,re=1,oe=3,se=4,ae=5;var le,ce,ue,he;!function(t){t[t.ADD=1]="ADD",t[t.REPLACE=2]="REPLACE"}(le||(le={})),function(t){t.EMPTY="empty",t.SCENEGRAPH="scenegraph",t.POINTCLOUD="pointcloud",t.MESH="mesh"}(ce||(ce={})),function(t){t.I3S="I3S",t.TILES3D="TILES3D"}(ue||(ue={})),function(t){t.GEOMETRIC_ERROR="geometricError",t.MAX_SCREEN_THRESHOLD="maxScreenThreshold"}(he||(he={}));const de=1;var pe=n(68032),fe=n(63869);function Ae(t){return void 0!==t&&null!==t}const ge=new ut.P,me=new ut.P,ye=new ut.P,_e=new ut.P,ve=new ut.P,be=new ut.P,xe=new ut.P,we=new ut.P;function Ee(t,e,n){if((0,Wt.v)(t,"3D Tile: boundingVolume must be defined"),t.box)return Te(t.box,e,n);if(t.region)return function(t){const[e,n,i,r,o,s]=t,a=Nt.WGS84.cartographicToCartesian([(0,ft.uj)(e),(0,ft.uj)(r),o],ye),l=Nt.WGS84.cartographicToCartesian([(0,ft.uj)(i),(0,ft.uj)(n),s],_e),c=(new ut.P).addVectors(a,l).multiplyByScalar(.5);return Nt.WGS84.cartesianToCartographic(c,ve),Nt.WGS84.cartographicToCartesian([(0,ft.uj)(i),ve[1],ve[2]],be),Nt.WGS84.cartographicToCartesian([ve[0],(0,ft.uj)(r),ve[2]],xe),Nt.WGS84.cartographicToCartesian([ve[0],ve[1],s],we),Te([...c,...be.subtract(c),...xe.subtract(c),...we.subtract(c)],new ct.k)}(t.region);if(t.sphere)return function(t,e,n){const i=new ut.P(t[0],t[1],t[2]);e.transform(i,i);const r=e.getScale(me),o=Math.max(Math.max(r[0],r[1]),r[2]),s=t[3]*o;if(Ae(n))return n.center=i,n.radius=s,n;return new qt.ie(i,s)}(t.sphere,e,n);throw new Error("3D Tile: boundingVolume must contain a sphere, region, or box")}function Ce(t,e){if(t.box)return function(t){const e=Se(),{halfAxes:n}=t,i=new ut.P(n.getColumn(0)),r=new ut.P(n.getColumn(1)),o=new ut.P(n.getColumn(2));for(let s=0;s<2;s++){for(let n=0;n<2;n++){for(let n=0;n<2;n++)ge.copy(t.center),ge.add(i),ge.add(r),ge.add(o),Pe(e,ge),o.negate();r.negate()}i.negate()}return e}(e);if(t.region){const[e,n,i,r,o,s]=t.region;return[[(0,ft.uj)(e),(0,ft.uj)(n),o],[(0,ft.uj)(i),(0,ft.uj)(r),s]]}if(t.sphere)return function(t){const e=Se(),{center:n,radius:i}=t,r=Nt.WGS84.scaleToGeodeticSurface(n,ge);let o;o=r?Nt.WGS84.geodeticSurfaceNormal(r):new ut.P(0,0,1);let s=new ut.P(o[2],-o[1],0);s.len()>0?s.normalize():s=new ut.P(0,1,0);const a=s.clone().cross(o);for(const l of[s,a,o]){me.copy(l).scale(i);for(let t=0;t<2;t++)ge.copy(n),ge.add(me),Pe(e,ge),me.negate()}return e}(e);throw new Error("Unkown boundingVolume type")}function Te(t,e,n){const i=new ut.P(t[0],t[1],t[2]);e.transform(i,i);let r=[];if(10===t.length){const e=t.slice(3,6),n=new pe.P;n.fromArray(t,6);const i=new ut.P([1,0,0]),o=new ut.P([0,1,0]),s=new ut.P([0,0,1]);i.transformByQuaternion(n),i.scale(e[0]),o.transformByQuaternion(n),o.scale(e[1]),s.transformByQuaternion(n),s.scale(e[2]),r=[...i.toArray(),...o.toArray(),...s.toArray()]}else r=[...t.slice(3,6),...t.slice(6,9),...t.slice(9,12)];const o=e.transformAsVector(r.slice(0,3)),s=e.transformAsVector(r.slice(3,6)),a=e.transformAsVector(r.slice(6,9)),l=new fe.d([o[0],o[1],o[2],s[0],s[1],s[2],a[0],a[1],a[2]]);return Ae(n)?(n.center=i,n.halfAxes=l,n):new qt.CB(i,l)}function Se(){return[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]]}function Pe(t,e){Nt.WGS84.cartesianToCartographic(e,ge),t[0][0]=Math.min(t[0][0],ge[0]),t[0][1]=Math.min(t[0][1],ge[1]),t[0][2]=Math.min(t[0][2],ge[2]),t[1][0]=Math.max(t[1][0],ge[0]),t[1][1]=Math.max(t[1][1],ge[1]),t[1][2]=Math.max(t[1][2],ge[2])}new ut.P,new ut.P,new ct.k,new ut.P,new ut.P,new ut.P;function Me(t,e){if(t.dynamicScreenSpaceError&&t.dynamicScreenSpaceErrorComputedDensity){const n=t.dynamicScreenSpaceErrorComputedDensity,i=t.dynamicScreenSpaceErrorFactor,r=function(t,e){const n=t*e;return 1-Math.exp(-n*n)}(e,n)*i;return r}return 0}const Ie=new ut.P,Be=new ut.P,Re=new ut.P,Le=new ut.P,Oe=new ut.P,De=new ct.k,ke=new ct.k;function Fe(t,e){const{topDownViewport:n}=e,i=t.header.mbs[1],r=t.header.mbs[0],o=t.header.mbs[2],s=t.header.mbs[3],a=[...t.boundingVolume.center],l=n.unprojectPosition(n.cameraPosition);Nt.WGS84.cartographicToCartesian(l,Ie),Be.copy(Ie).subtract(a).normalize(),Nt.WGS84.eastNorthUpToFixedFrame(a,De),ke.copy(De).invert(),Re.copy(Ie).transform(ke);const c=Math.sqrt(Re[0]*Re[0]+Re[1]*Re[1]),u=c*c/Re[2];Le.copy([Re[0],Re[1],u]);const h=Le.transform(De).subtract(a).normalize(),d=Be.cross(h).normalize().scale(s).add(a),p=Nt.WGS84.cartesianToCartographic(d),f=n.project([r,i,o]),A=n.project(p);return Oe.copy(f).subtract(A).magnitude()}class Ne{_map=new Map;_array;_length;constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this._array=new Array(t),this._length=t}get length(){return this._length}set length(t){this._length=t,t>this._array.length&&(this._array.length=t)}get values(){return this._array}get(t){return(0,Wt.v)(t<this._array.length),this._array[t]}set(t,e){(0,Wt.v)(t>=0),t>=this.length&&(this.length=t+1),this._map.has(this._array[t])&&this._map.delete(this._array[t]),this._array[t]=e,this._map.set(e,t)}delete(t){const e=this._map.get(t);e>=0&&(this._array.splice(e,1),this._map.delete(t),this.length--)}peek(){return this._array[this._length-1]}push(t){if(!this._map.has(t)){const e=this.length++;this._array[e]=t,this._map.set(t,e)}}pop(){const t=this._array[--this.length];return this._map.delete(t),t}reserve(t){(0,Wt.v)(t>=0),t>this._array.length&&(this._array.length=t)}resize(t){(0,Wt.v)(t>=0),this.length=t}trim(t){null!==t&&void 0!==t||(t=this.length),this._array.length=t}reset(){this._array=[],this._map=new Map,this._length=0}find(t){return this._map.has(t)}}const ze={loadSiblings:!1,skipLevelOfDetail:!1,updateTransforms:!0,onTraversalEnd:()=>{},viewportTraversersMap:{},basePath:""};class Ue{options;root=null;selectedTiles={};requestedTiles={};emptyTiles={};lastUpdate=(new Date).getTime();updateDebounceTime=1e3;_traversalStack=new Ne;_emptyTraversalStack=new Ne;_frameNumber=null;traversalFinished(t){return!0}constructor(t){this.options={...ze,...t}}traverse(t,e,n){this.root=t,this.options={...this.options,...n},this.reset(),this.updateTile(t,e),this._frameNumber=e.frameNumber,this.executeTraversal(t,e)}reset(){this.requestedTiles={},this.selectedTiles={},this.emptyTiles={},this._traversalStack.reset(),this._emptyTraversalStack.reset()}executeTraversal(t,e){const n=this._traversalStack;for(t._selectionDepth=1,n.push(t);n.length>0;){const t=n.pop();let i=!1;this.canTraverse(t,e)&&(this.updateChildTiles(t,e),i=this.updateAndPushChildren(t,e,n,t.hasRenderContent?t._selectionDepth+1:t._selectionDepth));const r=t.parent,o=Boolean(!r||r._shouldRefine),s=!i;t.hasRenderContent?t.refine===le.ADD?(this.loadTile(t,e),this.selectTile(t,e)):t.refine===le.REPLACE&&(this.loadTile(t,e),s&&this.selectTile(t,e)):(this.emptyTiles[t.id]=t,this.loadTile(t,e),s&&this.selectTile(t,e)),this.touchTile(t,e),t._shouldRefine=i&&o}const i=(new Date).getTime();(this.traversalFinished(e)||i-this.lastUpdate>this.updateDebounceTime)&&(this.lastUpdate=i,this.options.onTraversalEnd(e))}updateChildTiles(t,e){const n=t.children;for(const i of n)this.updateTile(i,e)}updateAndPushChildren(t,e,n,i){const{loadSiblings:r,skipLevelOfDetail:o}=this.options,s=t.children;s.sort(this.compareDistanceToCamera.bind(this));const a=t.refine===le.REPLACE&&t.hasRenderContent&&!o;let l=!1,c=!0;for(const u of s)if(u._selectionDepth=i,u.isVisibleAndInRequestVolume?(n.find(u)&&n.delete(u),n.push(u),l=!0):(a||r)&&(this.loadTile(u,e),this.touchTile(u,e)),a){let t;if(t=!!u._inRequestVolume&&(u.hasRenderContent?u.contentAvailable:this.executeEmptyTraversal(u,e)),c=c&&t,!c)return!1}return l||(c=!1),c}updateTile(t,e){this.updateTileVisibility(t,e)}selectTile(t,e){this.shouldSelectTile(t)&&(t._selectedFrame=e.frameNumber,this.selectedTiles[t.id]=t)}loadTile(t,e){this.shouldLoadTile(t)&&(t._requestedFrame=e.frameNumber,t._priority=t._getPriority(),this.requestedTiles[t.id]=t)}touchTile(t,e){t.tileset._cache.touch(t),t._touchedFrame=e.frameNumber}canTraverse(t,e){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return!!t.hasChildren&&(t.hasTilesetContent?!t.contentExpired:!(!i&&!t.isVisibleAndInRequestVolume)&&this.shouldRefine(t,e,n))}shouldLoadTile(t){return t.hasUnloadedContent||t.contentExpired}shouldSelectTile(t){return t.contentAvailable&&!this.options.skipLevelOfDetail}shouldRefine(t,e){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=t._screenSpaceError;return n&&(i=t.getScreenSpaceError(e,!0)),i>t.tileset.memoryAdjustedScreenSpaceError}updateTileVisibility(t,e){const n=[];if(this.options.viewportTraversersMap)for(const i in this.options.viewportTraversersMap){this.options.viewportTraversersMap[i]===e.viewport.id&&n.push(i)}else n.push(e.viewport.id);t.updateVisibility(e,n)}compareDistanceToCamera(t,e){return t._distanceToCamera-e._distanceToCamera}anyChildrenVisible(t,e){let n=!1;for(const i of t.children)i.updateVisibility(e),n=n||i.isVisibleAndInRequestVolume;return n}executeEmptyTraversal(t,e){let n=!0;const i=this._emptyTraversalStack;for(i.push(t);i.length>0;){const t=i.pop(),r=!t.hasRenderContent&&this.canTraverse(t,e,!1,!1),o=!t.hasRenderContent&&0===t.children.length;if(r||t.contentAvailable||o||(n=!1),this.updateTile(t,e),t.isVisibleAndInRequestVolume||(this.loadTile(t,e),this.touchTile(t,e)),r){const e=t.children;for(const t of e)i.push(t)}}return n}}const Ge=new ut.P;class Ve{tileset;header;id;url;parent;refine;type;contentUrl;lodMetricType="geometricError";lodMetricValue=0;boundingVolume=null;content=null;contentState=ie;gpuMemoryUsageInBytes=0;children=[];depth=0;viewportIds=[];transform=new ct.k;extensions=null;implicitTiling=null;userData={};computedTransform;hasEmptyContent=!1;hasTilesetContent=!1;traverser=new Ue({});_cacheNode=null;_frameNumber=null;_expireDate=null;_expiredContent=null;_boundingBox=void 0;_distanceToCamera=0;_screenSpaceError=0;_visibilityPlaneMask;_visible=void 0;_contentBoundingVolume;_viewerRequestVolume;_initialTransform=new ct.k;_priority=0;_selectedFrame=0;_requestedFrame=0;_selectionDepth=0;_touchedFrame=0;_centerZDepth=0;_shouldRefine=!1;_stackLength=0;_visitedFrame=0;_inRequestVolume=!1;_lodJudge=null;constructor(t,e,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";this.header=e,this.tileset=t,this.id=i||e.id,this.url=e.url,this.parent=n,this.refine=this._getRefine(e.refine),this.type=e.type,this.contentUrl=e.contentUrl,this._initializeLodMetric(e),this._initializeTransforms(e),this._initializeBoundingVolumes(e),this._initializeContent(e),this._initializeRenderingState(e),Object.seal(this)}destroy(){this.header=null}isDestroyed(){return null===this.header}get selected(){return this._selectedFrame===this.tileset._frameNumber}get isVisible(){return this._visible}get isVisibleAndInRequestVolume(){return this._visible&&this._inRequestVolume}get hasRenderContent(){return!this.hasEmptyContent&&!this.hasTilesetContent}get hasChildren(){return this.children.length>0||this.header.children&&this.header.children.length>0}get contentReady(){return this.contentState===oe||this.hasEmptyContent}get contentAvailable(){return Boolean(this.contentReady&&this.hasRenderContent||this._expiredContent&&!this.contentFailed)}get hasUnloadedContent(){return this.hasRenderContent&&this.contentUnloaded}get contentUnloaded(){return this.contentState===ie}get contentExpired(){return this.contentState===se}get contentFailed(){return this.contentState===ae}get distanceToCamera(){return this._distanceToCamera}get screenSpaceError(){return this._screenSpaceError}get boundingBox(){return this._boundingBox||(this._boundingBox=Ce(this.header.boundingVolume,this.boundingVolume)),this._boundingBox}getScreenSpaceError(t,e){switch(this.tileset.type){case ue.I3S:return Fe(this,t);case ue.TILES3D:return function(t,e,n){const i=t.tileset,r=t.parent&&t.parent.lodMetricValue||t.lodMetricValue,o=n?r:t.lodMetricValue;if(0===o)return 0;const s=Math.max(t._distanceToCamera,1e-7),{height:a,sseDenominator:l}=e,{viewDistanceScale:c}=i.options;let u=o*a*(c||1)/(s*l);return u-=Me(i,s),u}(this,t,e);default:throw new Error("Unsupported tileset type")}}unselect(){this._selectedFrame=0}_getGpuMemoryUsageInBytes(){return this.content.gpuMemoryUsageInBytes||this.content.byteLength||0}_getPriority(){const t=this.tileset._traverser,{skipLevelOfDetail:e}=t.options,n=this.refine===le.ADD||e;if(n&&!this.isVisible&&void 0!==this._visible)return-1;if(this.tileset._frameNumber-this._touchedFrame>=1)return-1;if(this.contentState===ie)return-1;const i=this.parent,r=i&&(!n||0===this._screenSpaceError||i.hasTilesetContent)?i._screenSpaceError:this._screenSpaceError,o=t.root?t.root._screenSpaceError:0;return Math.max(o-r,0)}async loadContent(){if(this.hasEmptyContent)return!1;if(this.content)return!0;this.contentExpired&&(this._expireDate=null),this.contentState=re;const t=await this.tileset._requestScheduler.scheduleRequest(this.id,this._getPriority.bind(this));if(!t)return this.contentState=ie,!1;try{const t=this.tileset.getTileUrl(this.contentUrl),e=this.tileset.loader,n={...this.tileset.loadOptions,[e.id]:{...this.tileset.loadOptions[e.id],isTileset:"json"===this.type,...this._getLoaderSpecificOptions(e.id)}};return this.content=await(0,lt.H)(t,e,n),this.tileset.options.contentLoader&&await this.tileset.options.contentLoader(this),this._isTileset()&&this.tileset._initializeTileHeaders(this.content,this),this.contentState=oe,this._onContentLoaded(),!0}catch(e){throw this.contentState=ae,e}finally{t.done()}}unloadContent(){return this.content&&this.content.destroy&&this.content.destroy(),this.content=null,this.header.content&&this.header.content.destroy&&this.header.content.destroy(),this.header.content=null,this.contentState=ie,!0}updateVisibility(t,e){if(this._frameNumber===t.frameNumber)return;const n=this.parent,i=n?n._visibilityPlaneMask:qt.R2.MASK_INDETERMINATE;if(this.tileset._traverser.options.updateTransforms){const t=n?n.computedTransform:this.tileset.modelMatrix;this._updateTransform(t)}this._distanceToCamera=this.distanceToTile(t),this._screenSpaceError=this.getScreenSpaceError(t,!1),this._visibilityPlaneMask=this.visibility(t,i),this._visible=this._visibilityPlaneMask!==qt.R2.MASK_OUTSIDE,this._inRequestVolume=this.insideViewerRequestVolume(t),this._frameNumber=t.frameNumber,this.viewportIds=e}visibility(t,e){const{cullingVolume:n}=t,{boundingVolume:i}=this;return n.computeVisibilityWithPlaneMask(i,e)}contentVisibility(){return!0}distanceToTile(t){const e=this.boundingVolume;return Math.sqrt(Math.max(e.distanceSquaredTo(t.camera.position),0))}cameraSpaceZDepth(t){let{camera:e}=t;const n=this.boundingVolume;return Ge.subVectors(n.center,e.position),e.direction.dot(Ge)}insideViewerRequestVolume(t){const e=this._viewerRequestVolume;return!e||e.distanceSquaredTo(t.camera.position)<=0}updateExpiration(){if(void 0!==(t=this._expireDate)&&null!==t&&this.contentReady&&!this.hasEmptyContent){const t=Date.now();Date.lessThan(this._expireDate,t)&&(this.contentState=se,this._expiredContent=this.content)}var t}get extras(){return this.header.extras}_initializeLodMetric(t){"lodMetricType"in t?this.lodMetricType=t.lodMetricType:(this.lodMetricType=this.parent&&this.parent.lodMetricType||this.tileset.lodMetricType,console.warn("3D Tile: Required prop lodMetricType is undefined. Using parent lodMetricType")),"lodMetricValue"in t?this.lodMetricValue=t.lodMetricValue:(this.lodMetricValue=this.parent&&this.parent.lodMetricValue||this.tileset.lodMetricValue,console.warn("3D Tile: Required prop lodMetricValue is undefined. Using parent lodMetricValue"))}_initializeTransforms(t){this.transform=t.transform?new ct.k(t.transform):new ct.k;const e=this.parent,n=this.tileset,i=e&&e.computedTransform?e.computedTransform.clone():n.modelMatrix.clone();this.computedTransform=new ct.k(i).multiplyRight(this.transform);const r=e&&e._initialTransform?e._initialTransform.clone():new ct.k;this._initialTransform=new ct.k(r).multiplyRight(this.transform)}_initializeBoundingVolumes(t){this._contentBoundingVolume=null,this._viewerRequestVolume=null,this._updateBoundingVolume(t)}_initializeContent(t){this.content={_tileset:this.tileset,_tile:this},this.hasEmptyContent=!0,this.contentState=ie,this.hasTilesetContent=!1,t.contentUrl&&(this.content=null,this.hasEmptyContent=!1)}_initializeRenderingState(t){this.depth=t.level||(this.parent?this.parent.depth+1:0),this._shouldRefine=!1,this._distanceToCamera=0,this._centerZDepth=0,this._screenSpaceError=0,this._visibilityPlaneMask=qt.R2.MASK_INDETERMINATE,this._visible=void 0,this._inRequestVolume=!1,this._stackLength=0,this._selectionDepth=0,this._frameNumber=0,this._touchedFrame=0,this._visitedFrame=0,this._selectedFrame=0,this._requestedFrame=0,this._priority=0}_getRefine(t){return t||this.parent&&this.parent.refine||le.REPLACE}_isTileset(){return-1!==this.contentUrl.indexOf(".json")}_onContentLoaded(){switch(this.content&&this.content.type){case"vctr":case"geom":this.tileset._traverser.disableSkipLevelOfDetail=!0}this._isTileset()?this.hasTilesetContent=!0:this.gpuMemoryUsageInBytes=this._getGpuMemoryUsageInBytes()}_updateBoundingVolume(t){this.boundingVolume=Ee(t.boundingVolume,this.computedTransform,this.boundingVolume);const e=t.content;e&&(e.boundingVolume&&(this._contentBoundingVolume=Ee(e.boundingVolume,this.computedTransform,this._contentBoundingVolume)),t.viewerRequestVolume&&(this._viewerRequestVolume=Ee(t.viewerRequestVolume,this.computedTransform,this._viewerRequestVolume)))}_updateTransform(){const t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:new ct.k).clone().multiplyRight(this.transform);!t.equals(this.computedTransform)&&(this.computedTransform=t,this._updateBoundingVolume(this.header))}_getLoaderSpecificOptions(t){return"i3s"===t?{...this.tileset.options.i3s,_tileOptions:{attributeUrls:this.header.attributeUrls,textureUrl:this.header.textureUrl,textureFormat:this.header.textureFormat,textureLoaderOptions:this.header.textureLoaderOptions,materialDefinition:this.header.materialDefinition,isDracoGeometry:this.header.isDracoGeometry,mbs:this.header.mbs},_tilesetOptions:{store:this.tileset.tileset.store,attributeStorageInfo:this.tileset.tileset.attributeStorageInfo,fields:this.tileset.tileset.fields},isTileHeader:!1}:{assetGltfUpAxis:(e=this.tileset.tileset).asset&&e.asset.gltfUpAxis||"Y"};var e}}class je extends Ue{compareDistanceToCamera(t,e){return 0===e._distanceToCamera&&0===t._distanceToCamera?e._centerZDepth-t._centerZDepth:e._distanceToCamera-t._distanceToCamera}updateTileVisibility(t,e){if(super.updateTileVisibility(t,e),!t.isVisibleAndInRequestVolume)return;const n=t.children.length>0;if(t.hasTilesetContent&&n){const n=t.children[0];return this.updateTileVisibility(n,e),void(t._visible=n._visible)}if(this.meetsScreenSpaceErrorEarly(t,e))return void(t._visible=!1);const i=t.refine===le.REPLACE,r=t._optimChildrenWithinParent===de;i&&r&&n&&!this.anyChildrenVisible(t,e)&&(t._visible=!1)}meetsScreenSpaceErrorEarly(t,e){const{parent:n}=t;return!(!n||n.hasTilesetContent||n.refine!==le.ADD)&&!this.shouldRefine(t,e,!0)}}class He{frameNumberMap=new Map;register(t,e){const n=this.frameNumberMap.get(t)||new Map,i=n.get(e)||0;n.set(e,i+1),this.frameNumberMap.set(t,n)}deregister(t,e){const n=this.frameNumberMap.get(t);if(!n)return;const i=n.get(e)||1;n.set(e,i-1)}isZero(t,e){return 0===(this.frameNumberMap.get(t)?.get(e)||0)}}const We="REQUESTED",qe="COMPLETED",Ze="ERROR";class Xe{_statusMap;pendingTilesRegister=new He;constructor(){this._statusMap={}}add(t,e,n,i){if(!this._statusMap[e]){const{frameNumber:r,viewport:{id:o}}=i;this._statusMap[e]={request:t,callback:n,key:e,frameState:i,status:We},this.pendingTilesRegister.register(o,r),t().then((t=>{this._statusMap[e].status=qe;const{frameNumber:n,viewport:{id:r}}=this._statusMap[e].frameState;this.pendingTilesRegister.deregister(r,n),this._statusMap[e].callback(t,i)})).catch((t=>{this._statusMap[e].status=Ze;const{frameNumber:i,viewport:{id:r}}=this._statusMap[e].frameState;this.pendingTilesRegister.deregister(r,i),n(t)}))}}update(t,e){if(this._statusMap[t]){const{frameNumber:n,viewport:{id:i}}=this._statusMap[t].frameState;this.pendingTilesRegister.deregister(i,n);const{frameNumber:r,viewport:{id:o}}=e;this.pendingTilesRegister.register(o,r),this._statusMap[t].frameState=e}}find(t){return this._statusMap[t]}hasPendingTiles(t,e){return!this.pendingTilesRegister.isZero(t,e)}}class Ke extends Ue{_tileManager;constructor(t){super(t),this._tileManager=new Xe}traversalFinished(t){return!this._tileManager.hasPendingTiles(t.viewport.id,this._frameNumber||0)}shouldRefine(t,e){return t._lodJudge=function(t,e){if(0===t.lodMetricValue||isNaN(t.lodMetricValue))return"DIG";const n=2*Fe(t,e);return n<2?"OUT":!t.header.children||n<=t.lodMetricValue?"DRAW":t.header.children?"DIG":"OUT"}(t,e),"DIG"===t._lodJudge}updateChildTiles(t,e){const n=t.header.children||[],i=t.children,r=t.tileset;for(const o of n){const n=`${o.id}-${e.viewport.id}`,s=i&&i.find((t=>t.id===n));if(s)s&&this.updateTile(s,e);else{let i=()=>this._loadTile(o.id,r);this._tileManager.find(n)?this._tileManager.update(n,e):(r.tileset.nodePages&&(i=()=>r.tileset.nodePagesTile.formTileFromNodePages(o.id)),this._tileManager.add(i,n,(e=>this._onTileLoad(e,t,n)),e))}}return!1}async _loadTile(t,e){const{loader:n}=e,i=e.getTileUrl(`${e.url}/nodes/${t}`),r={...e.loadOptions,i3s:{...e.loadOptions.i3s,isTileHeader:!0}};return await(0,lt.H)(i,n,r)}_onTileLoad(t,e,n){const i=new Ve(e.tileset,t,e,n);e.children.push(i);const r=this._tileManager.find(i.id).frameState;this.updateTile(i,r),this._frameNumber===r.frameNumber&&(this.traversalFinished(r)||(new Date).getTime()-this.lastUpdate>this.updateDebounceTime)&&this.executeTraversal(i,r)}}const Qe={description:"",ellipsoid:Nt.WGS84,modelMatrix:new ct.k,throttleRequests:!0,maxRequests:64,maximumMemoryUsage:32,memoryCacheOverflow:1,maximumTilesSelected:0,debounceTime:0,onTileLoad:()=>{},onTileUnload:()=>{},onTileError:()=>{},onTraversalComplete:t=>t,contentLoader:void 0,viewDistanceScale:1,maximumScreenSpaceError:8,memoryAdjustedScreenSpaceError:!1,loadTiles:!0,updateTransforms:!0,viewportTraversersMap:null,loadOptions:{fetch:{}},attributions:[],basePath:"",i3s:{}},Je="Tiles In Tileset(s)",Ye="Tiles In Memory",$e="Tiles In View",tn="Tiles To Render",en="Tiles Loaded",nn="Tiles Loading",rn="Tiles Unloaded",on="Failed Tile Loads",sn="Points/Vertices",an="Tile Memory Use",ln="Maximum Screen Space Error";class cn{options;loadOptions;type;tileset;loader;url;basePath;modelMatrix;ellipsoid;lodMetricType;lodMetricValue;refine;root=null;roots={};asset={};description="";properties;extras=null;attributions={};credits={};stats;contentFormats={draco:!1,meshopt:!1,dds:!1,ktx2:!1};cartographicCenter=null;cartesianCenter=null;zoom=1;boundingVolume=null;dynamicScreenSpaceErrorComputedDensity=0;maximumMemoryUsage=32;gpuMemoryUsageInBytes=0;memoryAdjustedScreenSpaceError=0;_cacheBytes=0;_cacheOverflowBytes=0;_frameNumber=0;_queryParams={};_extensionsUsed=[];_tiles={};_pendingCount=0;selectedTiles=[];traverseCounter=0;geometricError=0;lastUpdatedVieports=null;_requestedTiles=[];_emptyTiles=[];frameStateData={};_traverser;_cache=new Ht;_requestScheduler;updatePromise=null;tilesetInitializationPromise;constructor(t,e){this.options={...Qe,...e},this.tileset=t,this.loader=t.loader,this.type=t.type,this.url=t.url,this.basePath=t.basePath||Ut.pD(this.url),this.modelMatrix=this.options.modelMatrix,this.ellipsoid=this.options.ellipsoid,this.lodMetricType=t.lodMetricType,this.lodMetricValue=t.lodMetricValue,this.refine=t.root.refine,this.loadOptions=this.options.loadOptions||{},this._traverser=this._initializeTraverser(),this._requestScheduler=new Gt.A({throttleRequests:this.options.throttleRequests,maxRequests:this.options.maxRequests}),this.memoryAdjustedScreenSpaceError=this.options.maximumScreenSpaceError,this._cacheBytes=1024*this.options.maximumMemoryUsage*1024,this._cacheOverflowBytes=1024*this.options.memoryCacheOverflow*1024,this.stats=new zt.A({id:this.url}),this._initializeStats(),this.tilesetInitializationPromise=this._initializeTileSet(t)}destroy(){this._destroy()}isLoaded(){return 0===this._pendingCount&&0!==this._frameNumber&&0===this._requestedTiles.length}get tiles(){return Object.values(this._tiles)}get frameNumber(){return this._frameNumber}get queryParams(){return new URLSearchParams(this._queryParams).toString()}setProps(t){this.options={...this.options,...t}}getTileUrl(t){if(t.startsWith("data:"))return t;let e=t;return this.queryParams.length&&(e=`${t}${t.includes("?")?"&":"?"}${this.queryParams}`),e}hasExtension(t){return Boolean(this._extensionsUsed.indexOf(t)>-1)}update(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this.tilesetInitializationPromise.then((()=>{!t&&this.lastUpdatedVieports?t=this.lastUpdatedVieports:this.lastUpdatedVieports=t,t&&this.doUpdate(t)}))}async selectTiles(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return await this.tilesetInitializationPromise,t&&(this.lastUpdatedVieports=t),this.updatePromise||(this.updatePromise=new Promise((t=>{setTimeout((()=>{this.lastUpdatedVieports&&this.doUpdate(this.lastUpdatedVieports),t(this._frameNumber),this.updatePromise=null}),this.options.debounceTime)}))),this.updatePromise}adjustScreenSpaceError(){this.gpuMemoryUsageInBytes<this._cacheBytes?this.memoryAdjustedScreenSpaceError=Math.max(this.memoryAdjustedScreenSpaceError/1.02,this.options.maximumScreenSpaceError):this.gpuMemoryUsageInBytes>this._cacheBytes+this._cacheOverflowBytes&&(this.memoryAdjustedScreenSpaceError*=1.02)}doUpdate(t){if("loadTiles"in this.options&&!this.options.loadTiles)return;if(this.traverseCounter>0)return;const e=t instanceof Array?t:[t];this._cache.reset(),this._frameNumber++,this.traverseCounter=e.length;const n=[];for(const i of e){const t=i.id;this._needTraverse(t)?n.push(t):this.traverseCounter--}for(const i of e){const t=i.id;if(this.roots[t]||(this.roots[t]=this._initializeTileHeaders(this.tileset,null)),!n.includes(t))continue;const e=Qt(i,this._frameNumber);this._traverser.traverse(this.roots[t],e,this.options)}}_needTraverse(t){let e=t;return this.options.viewportTraversersMap&&(e=this.options.viewportTraversersMap[t]),e===t}_onTraversalEnd(t){const e=t.viewport.id;this.frameStateData[e]||(this.frameStateData[e]={selectedTiles:[],_requestedTiles:[],_emptyTiles:[]});const n=this.frameStateData[e],i=Object.values(this._traverser.selectedTiles),[r,o]=function(t,e,n){if(0===n||t.length<=n)return[t,[]];const i=[],{longitude:r,latitude:o}=e.viewport;for(const[c,u]of t.entries()){const[t,e]=u.header.mbs,n=Math.abs(r-t),s=Math.abs(o-e),a=Math.sqrt(s*s+n*n);i.push([c,a])}const s=i.sort(((t,e)=>t[1]-e[1])),a=[];for(let c=0;c<n;c++)a.push(t[s[c][0]]);const l=[];for(let c=n;c<s.length;c++)l.push(t[s[c][0]]);return[a,l]}(i,t,this.options.maximumTilesSelected);n.selectedTiles=r;for(const s of o)s.unselect();n._requestedTiles=Object.values(this._traverser.requestedTiles),n._emptyTiles=Object.values(this._traverser.emptyTiles),this.traverseCounter--,this.traverseCounter>0||this._updateTiles()}_updateTiles(){this.selectedTiles=[],this._requestedTiles=[],this._emptyTiles=[];for(const t in this.frameStateData){const e=this.frameStateData[t];this.selectedTiles=this.selectedTiles.concat(e.selectedTiles),this._requestedTiles=this._requestedTiles.concat(e._requestedTiles),this._emptyTiles=this._emptyTiles.concat(e._emptyTiles)}this.selectedTiles=this.options.onTraversalComplete(this.selectedTiles);for(const t of this.selectedTiles)this._tiles[t.id]=t;this._loadTiles(),this._unloadTiles(),this._updateStats()}_tilesChanged(t,e){if(t.length!==e.length)return!0;const n=new Set(t.map((t=>t.id))),i=new Set(e.map((t=>t.id)));let r=t.filter((t=>!i.has(t.id))).length>0;return r=r||e.filter((t=>!n.has(t.id))).length>0,r}_loadTiles(){for(const t of this._requestedTiles)t.contentUnloaded&&this._loadTile(t)}_unloadTiles(){this._cache.unloadTiles(this,((t,e)=>t._unloadTile(e)))}_updateStats(){let t=0,e=0;for(const n of this.selectedTiles)n.contentAvailable&&n.content&&(t++,n.content.pointCount?e+=n.content.pointCount:e+=n.content.vertexCount);this.stats.get($e).count=this.selectedTiles.length,this.stats.get(tn).count=t,this.stats.get(sn).count=e,this.stats.get(ln).count=this.memoryAdjustedScreenSpaceError}async _initializeTileSet(t){this.type===ue.I3S&&(this.calculateViewPropsI3S(),t.root=await t.root),this.root=this._initializeTileHeaders(t,null),this.type===ue.TILES3D&&(this._initializeTiles3DTileset(t),this.calculateViewPropsTiles3D()),this.type===ue.I3S&&this._initializeI3STileset()}calculateViewPropsI3S(){const t=this.tileset.fullExtent;if(t){const{xmin:e,xmax:n,ymin:i,ymax:r,zmin:o,zmax:s}=t;return this.cartographicCenter=new ut.P(e+(n-e)/2,i+(r-i)/2,o+(s-o)/2),this.cartesianCenter=new ut.P,Nt.WGS84.cartographicToCartesian(this.cartographicCenter,this.cartesianCenter),void(this.zoom=ne(t,this.cartographicCenter,this.cartesianCenter))}const e=this.tileset.store?.extent;if(e){const[t,n,i,r]=e;return this.cartographicCenter=new ut.P(t+(i-t)/2,n+(r-n)/2,0),this.cartesianCenter=new ut.P,Nt.WGS84.cartographicToCartesian(this.cartographicCenter,this.cartesianCenter),void(this.zoom=function(t,e,n){const[i,r,o,s]=t;return ne({xmin:i,xmax:o,ymin:r,ymax:s,zmin:0,zmax:0},e,n)}(e,this.cartographicCenter,this.cartesianCenter))}console.warn("Extent is not defined in the tileset header"),this.cartographicCenter=new ut.P,this.zoom=1}calculateViewPropsTiles3D(){const t=this.root,{center:e}=t.boundingVolume;if(!e)return console.warn("center was not pre-calculated for the root tile"),this.cartographicCenter=new ut.P,void(this.zoom=1);0!==e[0]||0!==e[1]||0!==e[2]?(this.cartographicCenter=new ut.P,Nt.WGS84.cartesianToCartographic(e,this.cartographicCenter)):this.cartographicCenter=new ut.P(0,0,-Nt.WGS84.radii[0]),this.cartesianCenter=e,this.zoom=ee(t.boundingVolume,this.cartographicCenter)}_initializeStats(){this.stats.get(Je),this.stats.get(nn),this.stats.get(Ye),this.stats.get($e),this.stats.get(tn),this.stats.get(en),this.stats.get(rn),this.stats.get(on),this.stats.get(sn),this.stats.get(an,"memory"),this.stats.get(ln)}_initializeTileHeaders(t,e){const n=new Ve(this,t.root,e);if(e&&(e.children.push(n),n.depth=e.depth+1),this.type===ue.TILES3D){const t=[];for(t.push(n);t.length>0;){const e=t.pop();this.stats.get(Je).incrementCount();const n=e.header.children||[];for(const i of n){const n=new Ve(this,i,e);if(n.contentUrl?.includes("?session=")){const t=new URL(n.contentUrl).searchParams.get("session");t&&(this._queryParams.session=t)}e.children.push(n),n.depth=e.depth+1,t.push(n)}}}return n}_initializeTraverser(){let t;switch(this.type){case ue.TILES3D:t=je;break;case ue.I3S:t=Ke;break;default:t=Ue}return new t({basePath:this.basePath,onTraversalEnd:this._onTraversalEnd.bind(this)})}_destroyTileHeaders(t){this._destroySubtree(t)}async _loadTile(t){let e;try{this._onStartTileLoading(),e=await t.loadContent()}catch(n){this._onTileLoadError(t,n instanceof Error?n:new Error("load failed"))}finally{this._onEndTileLoading(),this._onTileLoad(t,e)}}_onTileLoadError(t,e){this.stats.get(on).incrementCount();const n=e.message||e.toString(),i=t.url;console.error(`A 3D tile failed to load: ${t.url} ${n}
2`),this.options.onTileError(t,n,i)}_onTileLoad(t,e){if(e){if(this.type===ue.I3S){const t=this.tileset?.nodePagesTile?.nodesInNodePages||0;this.stats.get(Je).reset(),this.stats.get(Je).addCount(t)}t&&t.content&&function(t,e){(0,Wt.v)(t),(0,Wt.v)(e);const{rtcCenter:n,gltfUpAxis:i}=e,{computedTransform:r,boundingVolume:{center:o}}=t;let s=new ct.k(r);switch(n&&s.translate(n),i){case"Z":default:break;case"Y":const t=(new ct.k).rotateX(Math.PI/2);s=s.multiplyRight(t);break;case"X":const e=(new ct.k).rotateY(-Math.PI/2);s=s.multiplyRight(e)}e.isQuantized&&s.translate(e.quantizedVolumeOffset).scale(e.quantizedVolumeScale);const a=new ut.P(o);e.cartesianModelMatrix=s,e.cartesianOrigin=a;const l=Nt.WGS84.cartesianToCartographic(a,new ut.P),c=Nt.WGS84.eastNorthUpToFixedFrame(a).invert();e.cartographicModelMatrix=c.multiplyRight(s),e.cartographicOrigin=l,e.coordinateSystem||(e.modelMatrix=e.cartographicModelMatrix)}(t,t.content),this.updateContentTypes(t),this._addTileToCache(t),this.options.onTileLoad(t)}}updateContentTypes(t){if(this.type===ue.I3S)switch(t.header.isDracoGeometry&&(this.contentFormats.draco=!0),t.header.textureFormat){case"dds":this.contentFormats.dds=!0;break;case"ktx2":this.contentFormats.ktx2=!0}else if(this.type===ue.TILES3D){const{extensionsRemoved:e=[]}=t.content?.gltf||{};e.includes("KHR_draco_mesh_compression")&&(this.contentFormats.draco=!0),e.includes("EXT_meshopt_compression")&&(this.contentFormats.meshopt=!0),e.includes("KHR_texture_basisu")&&(this.contentFormats.ktx2=!0)}}_onStartTileLoading(){this._pendingCount++,this.stats.get(nn).incrementCount()}_onEndTileLoading(){this._pendingCount--,this.stats.get(nn).decrementCount()}_addTileToCache(t){this._cache.add(this,t,(e=>e._updateCacheStats(t)))}_updateCacheStats(t){this.stats.get(en).incrementCount(),this.stats.get(Ye).incrementCount(),this.gpuMemoryUsageInBytes+=t.gpuMemoryUsageInBytes||0,this.stats.get(an).count=this.gpuMemoryUsageInBytes,this.options.memoryAdjustedScreenSpaceError&&this.adjustScreenSpaceError()}_unloadTile(t){this.gpuMemoryUsageInBytes-=t.gpuMemoryUsageInBytes||0,this.stats.get(Ye).decrementCount(),this.stats.get(rn).incrementCount(),this.stats.get(an).count=this.gpuMemoryUsageInBytes,this.options.onT
vendor: 19,739 bytes, line 2
2ileUnload(t),t.unloadContent()}_destroy(){const t=[];for(this.root&&t.push(this.root);t.length>0;){const e=t.pop();for(const n of e.children)t.push(n);this._destroyTile(e)}this.root=null}_destroySubtree(t){const e=t,n=[];for(n.push(e);n.length>0;){t=n.pop();for(const e of t.children)n.push(e);t!==e&&this._destroyTile(t)}e.children=[]}_destroyTile(t){this._cache.unloadTile(this,t),this._unloadTile(t),t.destroy()}_initializeTiles3DTileset(t){if(t.queryString){const e=new URLSearchParams(t.queryString),n=Object.fromEntries(e.entries());this._queryParams={...this._queryParams,...n}}if(this.asset=t.asset,!this.asset)throw new Error("Tileset must have an asset property.");if("0.0"!==this.asset.version&&"1.0"!==this.asset.version&&"1.1"!==this.asset.version)throw new Error("The tileset must be 3D Tiles version either 0.0 or 1.0 or 1.1.");"tilesetVersion"in this.asset&&(this._queryParams.v=this.asset.tilesetVersion),this.credits={attributions:this.options.attributions||[]},this.description=this.options.description||"",this.properties=t.properties,this.geometricError=t.geometricError,this._extensionsUsed=t.extensionsUsed||[],this.extras=t.extras}_initializeI3STileset(){this.loadOptions.i3s&&"token"in this.loadOptions.i3s&&(this._queryParams.token=this.loadOptions.i3s.token)}}const un="4.2.4",hn={COMPOSITE:"cmpt",POINT_CLOUD:"pnts",BATCHED_3D_MODEL:"b3dm",INSTANCED_3D_MODEL:"i3dm",GEOMETRY:"geom",VECTOR:"vect",GLTF:"glTF"};Object.keys(hn);function dn(t,e,n){(0,Wt.v)(t instanceof ArrayBuffer);const i=new TextDecoder("utf8"),r=new Uint8Array(t,e,n);return i.decode(r)}var pn=n(46315),fn=n(62967);const An={BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DOUBLE:5130},gn={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,...An},mn={[An.DOUBLE]:Float64Array,[An.FLOAT]:Float32Array,[An.UNSIGNED_SHORT]:Uint16Array,[An.UNSIGNED_INT]:Uint32Array,[An.UNSIGNED_BYTE]:Uint8Array,[An.BYTE]:Int8Array,[An.SHORT]:Int16Array,[An.INT]:Int32Array},yn={DOUBLE:An.DOUBLE,FLOAT:An.FLOAT,UNSIGNED_SHORT:An.UNSIGNED_SHORT,UNSIGNED_INT:An.UNSIGNED_INT,UNSIGNED_BYTE:An.UNSIGNED_BYTE,BYTE:An.BYTE,SHORT:An.SHORT,INT:An.INT},_n="Failed to convert GL type";class vn{static fromTypedArray(t){t=ArrayBuffer.isView(t)?t.constructor:t;for(const e in mn){if(mn[e]===t)return e}throw new Error(_n)}static fromName(t){const e=yn[t];if(!e)throw new Error(_n);return e}static getArrayType(t){switch(t){case An.UNSIGNED_SHORT_5_6_5:case An.UNSIGNED_SHORT_4_4_4_4:case An.UNSIGNED_SHORT_5_5_5_1:return Uint16Array;default:const e=mn[t];if(!e)throw new Error(_n);return e}}static getByteSize(t){return vn.getArrayType(t).BYTES_PER_ELEMENT}static validate(t){return Boolean(vn.getArrayType(t))}static createTypedArray(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3?arguments[3]:void 0;void 0===i&&(i=(e.byteLength-n)/vn.getByteSize(t));return new(vn.getArrayType(t))(e,n,i)}}class bn{json;buffer;featuresLength=0;_cachedTypedArrays={};constructor(t,e){this.json=t,this.buffer=e}getExtension(t){return this.json.extensions&&this.json.extensions[t]}hasProperty(t){return Boolean(this.json[t])}getGlobalProperty(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:gn.UNSIGNED_INT,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;const i=this.json[t];return i&&Number.isFinite(i.byteOffset)?this._getTypedArrayFromBinary(t,e,n,1,i.byteOffset):i}getPropertyArray(t,e,n){const i=this.json[t];return i&&Number.isFinite(i.byteOffset)?("componentType"in i&&(e=vn.fromName(i.componentType)),this._getTypedArrayFromBinary(t,e,n,this.featuresLength,i.byteOffset)):this._getTypedArrayFromArray(t,e,i)}getProperty(t,e,n,i,r){const o=this.json[t];if(!o)return o;const s=this.getPropertyArray(t,e,n);if(1===n)return s[i];for(let a=0;a<n;++a)r[a]=s[n*i+a];return r}_getTypedArrayFromBinary(t,e,n,i,r){const o=this._cachedTypedArrays;let s=o[t];return s||(s=vn.createTypedArray(e,this.buffer.buffer,this.buffer.byteOffset+r,i*n),o[t]=s),s}_getTypedArrayFromArray(t,e,n){const i=this._cachedTypedArrays;let r=i[t];return r||(r=vn.createTypedArray(e,n),i[t]=r),r}}const xn={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},wn={SCALAR:(t,e)=>t[e],VEC2:(t,e)=>[t[2*e+0],t[2*e+1]],VEC3:(t,e)=>[t[3*e+0],t[3*e+1],t[3*e+2]],VEC4:(t,e)=>[t[4*e+0],t[4*e+1],t[4*e+2],t[4*e+3]],MAT2:(t,e)=>[t[4*e+0],t[4*e+1],t[4*e+2],t[4*e+3]],MAT3:(t,e)=>[t[9*e+0],t[9*e+1],t[9*e+2],t[9*e+3],t[9*e+4],t[9*e+5],t[9*e+6],t[9*e+7],t[9*e+8]],MAT4:(t,e)=>[t[16*e+0],t[16*e+1],t[16*e+2],t[16*e+3],t[16*e+4],t[16*e+5],t[16*e+6],t[16*e+7],t[16*e+8],t[16*e+9],t[16*e+10],t[16*e+11],t[16*e+12],t[16*e+13],t[16*e+14],t[16*e+15]]},En={SCALAR:(t,e,n)=>{e[n]=t},VEC2:(t,e,n)=>{e[2*n+0]=t[0],e[2*n+1]=t[1]},VEC3:(t,e,n)=>{e[3*n+0]=t[0],e[3*n+1]=t[1],e[3*n+2]=t[2]},VEC4:(t,e,n)=>{e[4*n+0]=t[0],e[4*n+1]=t[1],e[4*n+2]=t[2],e[4*n+3]=t[3]},MAT2:(t,e,n)=>{e[4*n+0]=t[0],e[4*n+1]=t[1],e[4*n+2]=t[2],e[4*n+3]=t[3]},MAT3:(t,e,n)=>{e[9*n+0]=t[0],e[9*n+1]=t[1],e[9*n+2]=t[2],e[9*n+3]=t[3],e[9*n+4]=t[4],e[9*n+5]=t[5],e[9*n+6]=t[6],e[9*n+7]=t[7],e[9*n+8]=t[8],e[9*n+9]=t[9]},MAT4:(t,e,n)=>{e[16*n+0]=t[0],e[16*n+1]=t[1],e[16*n+2]=t[2],e[16*n+3]=t[3],e[16*n+4]=t[4],e[16*n+5]=t[5],e[16*n+6]=t[6],e[16*n+7]=t[7],e[16*n+8]=t[8],e[16*n+9]=t[9],e[16*n+10]=t[10],e[16*n+11]=t[11],e[16*n+12]=t[12],e[16*n+13]=t[13],e[16*n+14]=t[14],e[16*n+15]=t[15]}};const Cn=t=>void 0!==t;function Tn(t,e,n){if(!e)return null;let i=t.getExtension("3DTILES_batch_table_hierarchy");const r=e.HIERARCHY;return r&&(console.warn("3D Tile Parser: HIERARCHY is deprecated. Use 3DTILES_batch_table_hierarchy."),e.extensions=e.extensions||{},e.extensions["3DTILES_batch_table_hierarchy"]=r,i=r),i?function(t,e){let n,i,r;const o=t.instancesLength,s=t.classes;let a,l=t.classIds,c=t.parentCounts,u=t.parentIds,h=o;Cn(l.byteOffset)&&(l.componentType=defaultValue(l.componentType,GL.UNSIGNED_SHORT),l.type=AttributeType.SCALAR,r=getBinaryAccessor(l),l=r.createArrayBufferView(e.buffer,e.byteOffset+l.byteOffset,o));if(Cn(c))for(Cn(c.byteOffset)&&(c.componentType=defaultValue(c.componentType,GL.UNSIGNED_SHORT),c.type=AttributeType.SCALAR,r=getBinaryAccessor(c),c=r.createArrayBufferView(e.buffer,e.byteOffset+c.byteOffset,o)),a=new Uint16Array(o),h=0,n=0;n<o;++n)a[n]=h,h+=c[n];Cn(u)&&Cn(u.byteOffset)&&(u.componentType=defaultValue(u.componentType,GL.UNSIGNED_SHORT),u.type=AttributeType.SCALAR,r=getBinaryAccessor(u),u=r.createArrayBufferView(e.buffer,e.byteOffset+u.byteOffset,h));const d=s.length;for(n=0;n<d;++n){const t=s[n].length,i=s[n].instances,r=getBinaryProperties(t,i,e);s[n].instances=combine(r,i)}const p=new Array(d).fill(0),f=new Uint16Array(o);for(n=0;n<o;++n)i=l[n],f[n]=p[i],++p[i];const A={classes:s,classIds:l,classIndexes:f,parentCounts:c,parentIndexes:a,parentIds:u};return function(t){const e=t.classIds,n=e.length;for(let i=0;i<n;++i)Pn(t,i,stack)}(A),A}(i,n):null}function Sn(t,e,n){if(!t)return;const i=t.parentCounts;return t.parentIds?n(t,e):i>0?function(t,e,n){const i=t.classIds,r=t.parentCounts,o=t.parentIds,s=t.parentIndexes,a=i.length,l=scratchVisited;l.length=Math.max(l.length,a);const c=++marker,u=scratchStack;u.length=0,u.push(e);for(;u.length>0;){if(l[e=u.pop()]===c)continue;l[e]=c;const i=n(t,e);if(Cn(i))return i;const a=r[e],h=s[e];for(let t=0;t<a;++t){const n=o[h+t];n!==e&&u.push(n)}}return null}(t,e,n):function(t,e,n){let i=!0;for(;i;){const r=n(t,e);if(Cn(r))return r;const o=t.parentIds[e];i=o!==e,e=o}throw new Error("traverseHierarchySingleParent")}(t,e,n)}function Pn(t,e,n){const i=t.parentCounts,r=t.parentIds,o=t.parentIndexes,s=t.classIds.length;if(!Cn(r))return;assert(e<s,`Parent index ${e} exceeds the total number of instances: ${s}`),assert(-1===n.indexOf(e),"Circular dependency detected in the batch table hierarchy."),n.push(e);const a=Cn(i)?i[e]:1,l=Cn(i)?o[e]:e;for(let c=0;c<a;++c){const i=r[l+c];i!==e&&Pn(t,i,n)}n.pop(e)}function Mn(t){return void 0!==t&&null!==t}const In=(t,e)=>t,Bn={HIERARCHY:!0,extensions:!0,extras:!0};class Rn{json;binary;featureCount;_extensions;_properties;_binaryProperties;_hierarchy;constructor(t,e,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};(0,Wt.v)(n>=0),this.json=t||{},this.binary=e,this.featureCount=n,this._extensions=this.json?.extensions||{},this._properties={};for(const r in this.json)Bn[r]||(this._properties[r]=this.json[r]);this._binaryProperties=this._initializeBinaryProperties(),i["3DTILES_batch_table_hierarchy"]&&(this._hierarchy=Tn(this,this.json,this.binary))}getExtension(t){return this.json&&this.json.extensions&&this.json.extensions[t]}memorySizeInBytes(){return 0}isClass(t,e){if(this._checkBatchId(t),(0,Wt.v)("string"===typeof e,e),this._hierarchy){return Mn(Sn(this._hierarchy,t,((t,n)=>{const i=t.classIds[n];return t.classes[i].name===e})))}return!1}isExactClass(t,e){return(0,Wt.v)("string"===typeof e,e),this.getExactClassName(t)===e}getExactClassName(t){if(this._checkBatchId(t),this._hierarchy){const e=this._hierarchy.classIds[t];return this._hierarchy.classes[e].name}}hasProperty(t,e){return this._checkBatchId(t),(0,Wt.v)("string"===typeof e,e),Mn(this._properties[e])||this._hasPropertyInHierarchy(t,e)}getPropertyNames(t,e){this._checkBatchId(t),(e=Mn(e)?e:[]).length=0;const n=Object.keys(this._properties);return e.push(...n),this._hierarchy&&this._getPropertyNamesInHierarchy(t,e),e}getProperty(t,e){if(this._checkBatchId(t),(0,Wt.v)("string"===typeof e,e),this._binaryProperties){const n=this._binaryProperties[e];if(Mn(n))return this._getBinaryProperty(n,t)}const n=this._properties[e];if(Mn(n))return In(n[t]);if(this._hierarchy){const n=this._getHierarchyProperty(t,e);if(Mn(n))return n}}setProperty(t,e,n){const i=this.featureCount;if(this._checkBatchId(t),(0,Wt.v)("string"===typeof e,e),this._binaryProperties){const i=this._binaryProperties[e];if(i)return void this._setBinaryProperty(i,t,n)}if(this._hierarchy&&this._setHierarchyProperty(this,t,e,n))return;let r=this._properties[e];Mn(r)||(this._properties[e]=new Array(i),r=this._properties[e]),r[t]=In(n)}_checkBatchId(t){if(!(t>=0&&t<this.featureCount))throw new Error("batchId not in range [0, featureCount - 1].")}_getBinaryProperty(t,e){return t.unpack(t.typedArray,e)}_setBinaryProperty(t,e,n){t.pack(n,t.typedArray,e)}_initializeBinaryProperties(){let t=null;for(const e in this._properties){const n=this._properties[e],i=this._initializeBinaryProperty(e,n);i&&(t=t||{},t[e]=i)}return t}_initializeBinaryProperty(t,e){if("byteOffset"in e){const n=e;(0,Wt.v)(this.binary,`Property ${t} requires a batch table binary.`),(0,Wt.v)(n.type,`Property ${t} requires a type.`);const i=function(t,e,n,i){const{componentType:r}=t;(0,Wt.v)(t.componentType);const o="string"===typeof r?vn.fromName(r):r,s=xn[t.type],a=wn[t.type],l=En[t.type];return n+=t.byteOffset,{values:vn.createTypedArray(o,e,n,s*i),type:o,size:s,unpacker:a,packer:l}}(n,this.binary.buffer,0|this.binary.byteOffset,this.featureCount);return{typedArray:i.values,componentCount:i.size,unpack:i.unpacker,pack:i.packer}}return null}_hasPropertyInHierarchy(t,e){if(!this._hierarchy)return!1;const n=Sn(this._hierarchy,t,((t,n)=>{const i=t.classIds[n];return Mn(t.classes[i].instances[e])}));return Mn(n)}_getPropertyNamesInHierarchy(t,e){Sn(this._hierarchy,t,((t,n)=>{const i=t.classIds[n],r=t.classes[i].instances;for(const o in r)r.hasOwnProperty(o)&&-1===e.indexOf(o)&&e.push(o)}))}_getHierarchyProperty(t,e){return Sn(this._hierarchy,t,((t,n)=>{const i=t.classIds[n],r=t.classes[i],o=t.classIndexes[n],s=r.instances[e];return Mn(s)?Mn(s.typedArray)?this._getBinaryProperty(s,o):In(s[o]):null}))}_setHierarchyProperty(t,e,n,i){const r=Sn(this._hierarchy,e,((t,r)=>{const o=t.classIds[r],s=t.classes[o],a=t.classIndexes[r],l=s.instances[n];return!!Mn(l)&&((0,Wt.v)(r===e,`Inherited property "${n}" is read-only.`),Mn(l.typedArray)?this._setBinaryProperty(l,a,i):l[a]=In(i),!0)}));return Mn(r)}}const Ln=4;function On(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const i=new DataView(e);if(t.magic=i.getUint32(n,!0),n+=Ln,t.version=i.getUint32(n,!0),n+=Ln,t.byteLength=i.getUint32(n,!0),n+=Ln,1!==t.version)throw new Error(`3D Tile Version ${t.version} not supported`);return n}const Dn=4,kn="b3dm tile in legacy format.";function Fn(t,e,n){const i=new DataView(e);let r;t.header=t.header||{};let o=i.getUint32(n,!0);n+=Dn;let s=i.getUint32(n,!0);n+=Dn;let a=i.getUint32(n,!0);n+=Dn;let l=i.getUint32(n,!0);return n+=Dn,a>=570425344?(n-=2*Dn,r=o,a=s,l=0,o=0,s=0,console.warn(kn)):l>=570425344&&(n-=Dn,r=a,a=o,l=s,o=0,s=0,console.warn(kn)),t.header.featureTableJsonByteLength=o,t.header.featureTableBinaryByteLength=s,t.header.batchTableJsonByteLength=a,t.header.batchTableBinaryByteLength=l,t.header.batchLength=r,n}function Nn(t,e,n,i){return n=function(t,e,n){const{featureTableJsonByteLength:i,featureTableBinaryByteLength:r,batchLength:o}=t.header||{};if(t.featureTableJson={BATCH_LENGTH:o||0},i&&i>0){const r=dn(e,n,i);t.featureTableJson=JSON.parse(r)}return n+=i||0,t.featureTableBinary=new Uint8Array(e,n,r),n+=r||0,n}(t,e,n),n=function(t,e,n){const{batchTableJsonByteLength:i,batchTableBinaryByteLength:r}=t.header||{};if(i&&i>0){const o=dn(e,n,i);t.batchTableJson=JSON.parse(o),n+=i,r&&r>0&&(t.batchTableBinary=new Uint8Array(e,n,r),t.batchTableBinary=new Uint8Array(t.batchTableBinary),n+=r)}return n}(t,e,n),n}function zn(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];const n=t>>11&31,i=t>>5&63,r=31&t;return e[0]=n<<3,e[1]=i<<2,e[2]=r<<3,e}function Un(t,e,n){if(!e&&(!t||!t.batchIds||!n))return null;const{batchIds:i,isRGB565:r,pointCount:o=0}=t;if(i&&n){const t=new Uint8ClampedArray(3*o);for(let e=0;e<o;e++){const r=i[e],o=n.getProperty(r,"dimensions").map((t=>255*t));t[3*e]=o[0],t[3*e+1]=o[1],t[3*e+2]=o[2]}return{type:gn.UNSIGNED_BYTE,value:t,size:3,normalized:!0}}if(e&&r){const t=new Uint8ClampedArray(3*o);for(let n=0;n<o;n++){const i=zn(e[n]);t[3*n]=i[0],t[3*n+1]=i[1],t[3*n+2]=i[2]}return{type:gn.UNSIGNED_BYTE,value:t,size:3,normalized:!0}}return e&&e.length===3*o?{type:gn.UNSIGNED_BYTE,value:e,size:3,normalized:!0}:{type:gn.UNSIGNED_BYTE,value:e||new Uint8ClampedArray,size:4,normalized:!0}}var Gn=n(10042),Vn=n(72033),jn=n(28442),Hn=n(24879);class Wn extends Gn.M{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;super(2),(0,ft.cy)(t)&&1===arguments.length?this.copy(t):(ft.$W.debug&&((0,Vn.ws)(t),(0,Vn.ws)(e)),this[0]=t,this[1]=e)}set(t,e){return this[0]=t,this[1]=e,this.check()}copy(t){return this[0]=t[0],this[1]=t[1],this.check()}fromObject(t){return ft.$W.debug&&((0,Vn.ws)(t.x),(0,Vn.ws)(t.y)),this[0]=t.x,this[1]=t.y,this.check()}toObject(t){return t.x=this[0],t.y=this[1],t}get ELEMENTS(){return 2}horizontalAngle(){return Math.atan2(this.y,this.x)}verticalAngle(){return Math.atan2(this.x,this.y)}transform(t){return this.transformAsPoint(t)}transformAsPoint(t){return(0,jn.Z0)(this,this,t),this.check()}transformAsVector(t){return(0,Hn.B$)(this,this,t),this.check()}transformByMatrix3(t){return(0,jn.ei)(this,this,t),this.check()}transformByMatrix2x3(t){return(0,jn.l0)(this,this,t),this.check()}transformByMatrix2(t){return(0,jn.ZF)(this,this,t),this.check()}}new Wn,new ut.P,new Wn,new Wn,new Uint8Array(1);function qn(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:255;return(0,ft.qE)(t,0,e)/e*2-1}function Zn(t){return t<0?-1:1}function Xn(t,e,n,i){if(function(t,e){if(!t)throw new Error(`math.gl assertion failed. ${e}`)}(i),t<0||t>n||e<0||e>n)throw new Error(`x and y must be unsigned normalized integers between 0 and ${n}`);if(i.x=qn(t,n),i.y=qn(e,n),i.z=1-(Math.abs(i.x)+Math.abs(i.y)),i.z<0){const t=i.x;i.x=(1-Math.abs(i.y))*Zn(t),i.y=(1-Math.abs(t))*Zn(i.y)}return i.normalize()}function Kn(t,e,n){return Xn(t,e,255,n)}const Qn=new ut.P;function Jn(t,e,n){return t.isQuantized?n["3d-tiles"]&&n["3d-tiles"].decodeQuantizedPositions?(t.isQuantized=!1,function(t,e){const n=new ut.P,i=new Float32Array(3*t.pointCount);for(let r=0;r<t.pointCount;r++)n.set(e[3*r],e[3*r+1],e[3*r+2]).scale(1/t.quantizedRange).multiply(t.quantizedVolumeScale).add(t.quantizedVolumeOffset).toArray(i,3*r);return i}(t,e)):{type:gn.UNSIGNED_SHORT,value:e,size:3,normalized:!0}:e}async function Yn(t,e,n,i,r){n=Nn(t,e,n=Fn(t,e,n=On(t,e,n))),function(t){t.attributes={positions:null,colors:null,normals:null,batchIds:null},t.isQuantized=!1,t.isTranslucent=!1,t.isRGB565=!1,t.isOctEncoded16P=!1}(t);const{featureTable:o,batchTable:s}=function(t){const e=new bn(t.featureTableJson,t.featureTableBinary),n=e.getGlobalProperty("POINTS_LENGTH");if(!Number.isFinite(n))throw new Error("POINTS_LENGTH must be defined");e.featuresLength=n,t.featuresLength=n,t.pointsLength=n,t.pointCount=n,t.rtcCenter=e.getGlobalProperty("RTC_CENTER",gn.FLOAT,3);const i=function(t,e){let n=null;if(!t.batchIds&&e.hasProperty("BATCH_ID")&&(t.batchIds=e.getPropertyArray("BATCH_ID",gn.UNSIGNED_SHORT,1),t.batchIds)){const i=e.getGlobalProperty("BATCH_LENGTH");if(!i)throw new Error("Global property: BATCH_LENGTH must be defined when BATCH_ID is defined.");const{batchTableJson:r,batchTableBinary:o}=t;n=new Rn(r,o,i)}return n}(t,e);return{featureTable:e,batchTable:i}}(t);return await async function(t,e,n,i,r){let o,s,a;const l=t.batchTableJson&&t.batchTableJson.extensions&&t.batchTableJson.extensions["3DTILES_draco_point_compression"];l&&(a=l.properties);const c=e.getExtension("3DTILES_draco_point_compression");if(c){s=c.properties;const e=c.byteOffset,n=c.byteLength;if(!s||!Number.isFinite(e)||!n)throw new Error("Draco properties, byteOffset, and byteLength must be defined");o=(t.featureTableBinary||[]).slice(e,e+n),t.hasPositions=Number.isFinite(s.POSITION),t.hasColors=Number.isFinite(s.RGB)||Number.isFinite(s.RGBA),t.hasNormals=Number.isFinite(s.NORMAL),t.hasBatchIds=Number.isFinite(s.BATCH_ID),t.isTranslucent=Number.isFinite(s.RGBA)}if(!o)return!0;const u={buffer:o,properties:{...s,...a},featureTableProperties:s,batchTableProperties:a,dequantizeInShader:!1};return await async function(t,e,n,i){if(!i)return;const r={...n,draco:{...n?.draco,extraAttributes:e.batchTableProperties||{}}};delete r["3d-tiles"];const o=await(0,fn.N9)(e.buffer,pn.Vl,r,i),s=o.attributes.POSITION&&o.attributes.POSITION.value,a=o.attributes.COLOR_0&&o.attributes.COLOR_0.value,l=o.attributes.NORMAL&&o.attributes.NORMAL.value,c=o.attributes.BATCH_ID&&o.attributes.BATCH_ID.value,u=s&&o.attributes.POSITION.value.quantization,h=l&&o.attributes.NORMAL.value.quantization;if(u){const e=o.POSITION.data.quantization,n=e.range;t.quantizedVolumeScale=new ut.P(n,n,n),t.quantizedVolumeOffset=new ut.P(e.minValues),t.quantizedRange=(1<<e.quantizationBits)-1,t.isQuantizedDraco=!0}h&&(t.octEncodedRange=(1<<o.NORMAL.data.quantization.quantizationBits)-1,t.isOctEncodedDraco=!0);const d={};if(e.batchTableProperties)for(const p of Object.keys(e.batchTableProperties))o.attributes[p]&&o.attributes[p].value&&(d[p.toLowerCase()]=o.attributes[p].value);t.attributes={positions:s,colors:Un(t,a,void 0),normals:l,batchIds:c,...d}}(t,u,i,r)}(t,o,0,i,r),function(t,e,n){if(t.attributes=t.attributes||{positions:null,colors:null,normals:null,batchIds:null},!t.attributes.positions)if(e.hasProperty("POSITION"))t.attributes.positions=e.getPropertyArray("POSITION",gn.FLOAT,3);else if(e.hasProperty("POSITION_QUANTIZED")){const i=e.getPropertyArray("POSITION_QUANTIZED",gn.UNSIGNED_SHORT,3);if(t.isQuantized=!0,t.quantizedRange=65535,t.quantizedVolumeScale=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",gn.FLOAT,3),!t.quantizedVolumeScale)throw new Error("QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");if(t.quantizedVolumeOffset=e.getGlobalProperty("QUANTIZED_VOLUME_OF
2FSET",gn.FLOAT,3),!t.quantizedVolumeOffset)throw new Error("QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");t.attributes.positions=Jn(t,i,n)}if(!t.attributes.positions)throw new Error("Either POSITION or POSITION_QUANTIZED must be defined.")}(t,o,i),function(t,e,n){if(t.attributes=t.attributes||{positions:null,colors:null,normals:null,batchIds:null},!t.attributes.colors){let i=null;e.hasProperty("RGBA")?(i=e.getPropertyArray("RGBA",gn.UNSIGNED_BYTE,4),t.isTranslucent=!0):e.hasProperty("RGB")?i=e.getPropertyArray("RGB",gn.UNSIGNED_BYTE,3):e.hasProperty("RGB565")&&(i=e.getPropertyArray("RGB565",gn.UNSIGNED_SHORT,1),t.isRGB565=!0),t.attributes.colors=Un(t,i,n)}e.hasProperty("CONSTANT_RGBA")&&(t.constantRGBA=e.getGlobalProperty("CONSTANT_RGBA",gn.UNSIGNED_BYTE,4))}(t,o,s),function(t,e){if(t.attributes=t.attributes||{positions:null,colors:null,normals:null,batchIds:null},!t.attributes.normals){let n=null;e.hasProperty("NORMAL")?n=e.getPropertyArray("NORMAL",gn.FLOAT,3):e.hasProperty("NORMAL_OCT16P")&&(n=e.getPropertyArray("NORMAL_OCT16P",gn.UNSIGNED_BYTE,2),t.isOctEncoded16P=!0),t.attributes.normals=function(t,e){if(!e)return null;if(t.isOctEncoded16P){const n=new Float32Array(3*(t.pointsLength||0));for(let i=0;i<(t.pointsLength||0);i++)Kn(e[2*i],e[2*i+1],Qn),Qn.toArray(n,3*i);return{type:gn.FLOAT,size:2,value:n}}return{type:gn.FLOAT,size:2,value:e}}(t,n)}}(t,o),n}var $n=n(93594),ti=n(91431),ei=n(17071),ni=n(5738);const ii={URI:0,EMBEDDED:1};function ri(t,e,n,i){t.rotateYtoZ=!0;const r=(t.byteOffset||0)+(t.byteLength||0)-n;if(0===r)throw new Error("glTF byte length must be greater than 0.");return t.gltfUpAxis=i?.["3d-tiles"]&&i["3d-tiles"].assetGltfUpAxis?i["3d-tiles"].assetGltfUpAxis:"Y",t.gltfArrayBuffer=(0,ni._m)(e,n,r),t.gltfByteOffset=0,t.gltfByteLength=r,n%4===0||console.warn(`${t.type}: embedded glb is not aligned to a 4-byte boundary.`),(t.byteOffset||0)+(t.byteLength||0)}async function oi(t,e,n,i){const r=n?.["3d-tiles"]||{};if(function(t,e){switch(e){case ii.URI:if(t.gltfArrayBuffer){const e=new Uint8Array(t.gltfArrayBuffer,t.gltfByteOffset),n=(new TextDecoder).decode(e);t.gltfUrl=n.replace(/[\s\0]+$/,"")}delete t.gltfArrayBuffer,delete t.gltfByteOffset,delete t.gltfByteLength;break;case ii.EMBEDDED:break;default:throw new Error("b3dm: Illegal glTF format field")}}(t,e),r.loadGLTF){if(!i)return;if(t.gltfUrl){const{fetch:e}=i,r=await e(t.gltfUrl,n);t.gltfArrayBuffer=await r.arrayBuffer(),t.gltfByteOffset=0}if(t.gltfArrayBuffer){const e=await(0,fn.N9)(t.gltfArrayBuffer,$n.B,n,i);t.gltf=(0,ti.R)(e),t.gpuMemoryUsageInBytes=(0,ei.S3)(t.gltf),delete t.gltfArrayBuffer,delete t.gltfByteOffset,delete t.gltfByteLength}}}async function si(t,e,n,i,r){n=function(t,e,n,i){n=On(t,e,n),n=Fn(t,e,n),n=Nn(t,e,n),n=ri(t,e,n,i);const r=new bn(t.featureTableJson,t.featureTableBinary);return t.rtcCenter=r.getGlobalProperty("RTC_CENTER",gn.FLOAT,3),n}(t,e,n,i),await oi(t,ii.EMBEDDED,i,r);const o=t?.gltf?.extensions;return o&&o.CESIUM_RTC&&(t.rtcCenter=o.CESIUM_RTC.center),n}async function ai(t,e,n,i,r){return n=function(t,e,n,i){if(n=On(t,e,n),1!==t.version)throw new Error(`Instanced 3D Model version ${t.version} is not supported`);n=Fn(t,e,n);const r=new DataView(e);if(t.gltfFormat=r.getUint32(n,!0),n+=4,n=Nn(t,e,n),n=ri(t,e,n,i),!t?.header?.featureTableJsonByteLength||0===t.header.featureTableJsonByteLength)throw new Error("i3dm parser: featureTableJsonByteLength is zero.");const o=new bn(t.featureTableJson,t.featureTableBinary),s=o.getGlobalProperty("INSTANCES_LENGTH");if(o.featuresLength=s,!Number.isFinite(s))throw new Error("i3dm parser: INSTANCES_LENGTH must be defined");t.eastNorthUp=o.getGlobalProperty("EAST_NORTH_UP"),t.rtcCenter=o.getGlobalProperty("RTC_CENTER",gn.FLOAT,3);new Rn(t.batchTableJson,t.batchTableBinary,s);return function(t,e,n,i){const r=new Array(i),o=new ut.P,s=new ut.P,a=new ut.P,l=new ut.P,c=new fe.d,u=new pe.P,h=new ut.P,d={},p=new ct.k,f=[],A=[],g=[],m=[];for(let y=0;y<i;y++){let n;if(e.hasProperty("POSITION"))n=e.getProperty("POSITION",gn.FLOAT,3,y,o);else if(e.hasProperty("POSITION_QUANTIZED")){n=e.getProperty("POSITION_QUANTIZED",gn.UNSIGNED_SHORT,3,y,o);
vendor: 19,508 bytes, line 2
2const t=e.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",gn.FLOAT,3);if(!t)throw new Error("i3dm parser: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");const i=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",gn.FLOAT,3);if(!i)throw new Error("i3dm parser: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");const r=65535;for(let e=0;e<3;e++)n[e]=n[e]/r*i[e]+t[e]}if(!n)throw new Error("i3dm: POSITION or POSITION_QUANTIZED must be defined for each instance.");o.copy(n),d.translation=o,t.normalUp=e.getProperty("NORMAL_UP",gn.FLOAT,3,y,f),t.normalRight=e.getProperty("NORMAL_RIGHT",gn.FLOAT,3,y,A);const i=!1;if(t.normalUp){if(!t.normalRight)throw new Error("i3dm: Custom orientation requires both NORMAL_UP and NORMAL_RIGHT.");t.hasCustomOrientation=!0}else{if(t.octNormalUp=e.getProperty("NORMAL_UP_OCT32P",gn.UNSIGNED_SHORT,2,y,f),t.octNormalRight=e.getProperty("NORMAL_RIGHT_OCT32P",gn.UNSIGNED_SHORT,2,y,A),t.octNormalUp){if(!t.octNormalRight)throw new Error("i3dm: oct-encoded orientation requires NORMAL_UP_OCT32P and NORMAL_RIGHT_OCT32P");throw new Error("i3dm: oct-encoded orientation not implemented")}t.eastNorthUp?(Nt.WGS84.eastNorthUpToFixedFrame(o,p),p.getRotationMatrix3(c)):c.identity()}i&&(l.copy(s).cross(a).normalize(),c.setColumn(0,s),c.setColumn(1,a),c.setColumn(2,l)),u.fromMatrix3(c),d.rotation=u,h.set(1,1,1);const _=e.getProperty("SCALE",gn.FLOAT,1,y,g);Number.isFinite(_)&&h.multiplyByScalar(_);const v=e.getProperty("SCALE_NON_UNIFORM",gn.FLOAT,3,y,f);v&&h.scale(v),d.scale=h;let b=e.getProperty("BATCH_ID",gn.UNSIGNED_SHORT,1,y,m);void 0===b&&(b=y);const x=(new ct.k).fromQuaternion(d.rotation);p.identity(),p.translate(d.translation),p.multiplyRight(x),p.scale(d.scale);const w=p.clone();r[y]={modelMatrix:w,batchId:b}}t.instances=r}(t,o,0,s),n}(t,e,n,i),await oi(t,t.gltfFormat||0,i,r),n}async function li(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{shape:"tile3d"};switch(r.byteOffset=e,r.type=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const n=new DataView(t);return`${String.fromCharCode(n.getUint8(e+0))}${String.fromCharCode(n.getUint8(e+1))}${String.fromCharCode(n.getUint8(e+2))}${String.fromCharCode(n.getUint8(e+3))}`}(t,e),r.type){case hn.COMPOSITE:return await async function(t,e,n,i,r,o){n=On(t,e,n);const s=new DataView(e);for(t.tilesLength=s.getUint32(n,!0),n+=4,t.tiles=[];t.tiles.length<t.tilesLength&&(t.byteLength||0)-n>12;){const s={shape:"tile3d"};t.tiles.push(s),n=await o(e,n,i,r,s)}return n}(r,t,e,n,i,li);case hn.BATCHED_3D_MODEL:return await si(r,t,e,n,i);case hn.GLTF:return await async function(t,e,n,i){if(t.rotateYtoZ=!0,t.gltfUpAxis=n?.["3d-tiles"]?.assetGltfUpAxis?n["3d-tiles"].assetGltfUpAxis:"Y",n?.["3d-tiles"]?.loadGLTF){if(!i)return e.byteLength;const r=await(0,fn.N9)(e,$n.B,n,i);t.gltf=(0,ti.R)(r),t.gpuMemoryUsageInBytes=(0,ei.S3)(t.gltf)}else t.gltfArrayBuffer=e;return e.byteLength}(r,t,n,i);case hn.INSTANCED_3D_MODEL:return await ai(r,t,e,n,i);case hn.POINT_CLOUD:return await Yn(r,t,e,n,i);default:throw new Error(`3DTileLoader: unknown type ${r.type}`)}}async function ci(t,e,n,i){const r=Number.isFinite(e.bitstream)?e.bitstream:e.bufferView;if("number"!==typeof r)return;const o=t.bufferViews[r],s=t.buffers[o.buffer];if(!i?.baseUrl)throw new Error("Url is not provided");if(!i.fetch)throw new Error("fetch is not provided");if(s.uri){const t=`${i?.baseUrl||""}/${s.uri}`,n=await i.fetch(t),r=await n.arrayBuffer();return void(e.explicitBitstream=new Uint8Array(r,o.byteOffset,o.byteLength))}const a=t.buffers.slice(0,o.buffer).reduce(((t,e)=>t+e.byteLength),0);e.explicitBitstream=new Uint8Array(n.slice(a,a+s.byteLength),o.byteOffset,o.byteLength)}function ui(t){const e=new DataView(t);return e.getUint32(0,!0)+2**32*e.getUint32(4,!0)}const hi={dataType:null,batchType:null,id:"3d-tiles-subtree",name:"3D Tiles Subtree",module:"3d-tiles",version:un,extensions:["subtree"],mimeTypes:["application/octet-stream"],tests:["subtree"],parse:async function(t,e,n){if(1952609651!==new Uint32Array(t.slice(0,4))[0])throw new Error("Wrong subtree file magic number");if(1!==new Uint32Array(t.slice(4,8))[0])throw new Error("Wrong subtree file verson, must be 1");const i=ui(t.slice(8,16)),r=new Uint8Array(t,24,i),o=new TextDecoder("utf8").decode(r),s=JSON.parse(o),a=ui(t.slice(16,24));let l=new ArrayBuffer(0);if(a&&(l=t.slice(24+i)),await ci(s,s.tileAvailability,l,n),Array.isArray(s.contentAvailability))for(const c of s.contentAvailability)await ci(s,c,l,n);else await ci(s,s.contentAvailability,l,n);return await ci(s,s.childSubtreeAvailability,l,n),s},options:{}};var di=n(24990);globalThis.probe={};const pi=new di.t({id:"@probe.gl/log"});var fi=null;try{fi=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch(Dr){}function Ai(t,e,n){this.low=0|t,this.high=0|e,this.unsigned=!!n}function gi(t){return!0===(t&&t.__isLong__)}function mi(t){var e=Math.clz32(t&-t);return t?31-e:e}Ai.prototype.__isLong__,Object.defineProperty(Ai.prototype,"__isLong__",{value:!0}),Ai.isLong=gi;var yi={},_i={};function vi(t,e){var n,i,r;return e?(r=0<=(t>>>=0)&&t<256)&&(i=_i[t])?i:(n=xi(t,0,!0),r&&(_i[t]=n),n):(r=-128<=(t|=0)&&t<128)&&(i=yi[t])?i:(n=xi(t,t<0?-1:0,!1),r&&(yi[t]=n),n)}function bi(t,e){if(isNaN(t))return e?Bi:Ii;if(e){if(t<0)return Bi;if(t>=Si)return ki}else{if(t<=-Pi)return Fi;if(t+1>=Pi)return Di}return t<0?bi(-t,e).neg():xi(t%Ti|0,t/Ti|0,e)}function xi(t,e,n){return new Ai(t,e,n)}Ai.fromInt=vi,Ai.fromNumber=bi,Ai.fromBits=xi;var wi=Math.pow;function Ei(t,e,n){if(0===t.length)throw Error("empty string");if("number"===typeof e?(n=e,e=!1):e=!!e,"NaN"===t||"Infinity"===t||"+Infinity"===t||"-Infinity"===t)return e?Bi:Ii;if((n=n||10)<2||36<n)throw RangeError("radix");var i;if((i=t.indexOf("-"))>0)throw Error("interior hyphen");if(0===i)return Ei(t.substring(1),e,n).neg();for(var r=bi(wi(n,8)),o=Ii,s=0;s<t.length;s+=8){var a=Math.min(8,t.length-s),l=parseInt(t.substring(s,s+a),n);if(a<8){var c=bi(wi(n,a));o=o.mul(c).add(bi(l))}else o=(o=o.mul(r)).add(bi(l))}return o.unsigned=e,o}function Ci(t,e){return"number"===typeof t?bi(t,e):"string"===typeof t?Ei(t,e):xi(t.low,t.high,"boolean"===typeof e?e:t.unsigned)}Ai.fromString=Ei,Ai.fromValue=Ci;var Ti=4294967296,Si=Ti*Ti,Pi=Si/2,Mi=vi(1<<24),Ii=vi(0);Ai.ZERO=Ii;var Bi=vi(0,!0);Ai.UZERO=Bi;var Ri=vi(1);Ai.ONE=Ri;var Li=vi(1,!0);Ai.UONE=Li;var Oi=vi(-1);Ai.NEG_ONE=Oi;var Di=xi(-1,2147483647,!1);Ai.MAX_VALUE=Di;var ki=xi(-1,-1,!0);Ai.MAX_UNSIGNED_VALUE=ki;var Fi=xi(0,-2147483648,!1);Ai.MIN_VALUE=Fi;var Ni=Ai.prototype;Ni.toInt=function(){return this.unsigned?this.low>>>0:this.low},Ni.toNumber=function(){return this.unsigned?(this.high>>>0)*Ti+(this.low>>>0):this.high*Ti+(this.low>>>0)},Ni.toString=function(t){if((t=t||10)<2||36<t)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(Fi)){var e=bi(t),n=this.div(e),i=n.mul(e).sub(this);return n.toString(t)+i.toInt().toString(t)}return"-"+this.neg().toString(t)}for(var r=bi(wi(t,6),this.unsigned),o=this,s="";;){var a=o.div(r),l=(o.sub(a.mul(r)).toInt()>>>0).toString(t);if((o=a).isZero())return l+s;for(;l.length<6;)l="0"+l;s=""+l+s}},Ni.getHighBits=function(){return this.high},Ni.getHighBitsUnsigned=function(){return this.high>>>0},Ni.getLowBits=function(){return this.low},Ni.getLowBitsUnsigned=function(){return this.low>>>0},Ni.getNumBitsAbs=function(){if(this.isNegative())return this.eq(Fi)?64:this.neg().getNumBitsAbs();for(var t=0!=this.high?this.high:this.low,e=31;e>0&&0==(t&1<<e);e--);return 0!=this.high?e+33:e+1},Ni.isZero=function(){return 0===this.high&&0===this.low},Ni.eqz=Ni.isZero,Ni.isNegative=function(){return!this.unsigned&&this.high<0},Ni.isPositive=function(){return this.unsigned||this.high>=0},Ni.isOdd=function(){return 1===(1&this.low)},Ni.isEven=function(){return 0===(1&this.low)},Ni.equals=function(t){return gi(t)||(t=Ci(t)),(this.unsigned===t.unsigned||this.high>>>31!==1||t.high>>>31!==1)&&(this.high===t.high&&this.low===t.low)},Ni.eq=Ni.equals,Ni.notEquals=function(t){return!this.eq(t)},Ni.neq=Ni.notEquals,Ni.ne=Ni.notEquals,Ni.lessThan=function(t){return this.comp(t)<0},Ni.lt=Ni.lessThan,Ni.lessThanOrEqual=function(t){return this.comp(t)<=0},Ni.lte=Ni.lessThanOrEqual,Ni.le=Ni.lessThanOrEqual,Ni.greaterThan=function(t){return this.comp(t)>0},Ni.gt=Ni.greaterThan,Ni.greaterThanOrEqual=function(t){return this.comp(t)>=0},Ni.gte=Ni.greaterThanOrEqual,Ni.ge=Ni.greaterThanOrEqual,Ni.compare=function(t){if(gi(t)||(t=Ci(t)),this.eq(t))return 0;var e=this.isNegative(),n=t.isNegative();return e&&!n?-1:!e&&n?1:this.unsigned?t.high>>>0>this.high>>>0||t.high===this.high&&t.low>>>0>this.low>>>0?-1:1:this.sub(t).isNegative()?-1:1},Ni.comp=Ni.compare,Ni.negate=function(){return!this.unsigned&&this.eq(Fi)?Fi:this.not().add(Ri)},Ni.neg=Ni.negate,Ni.add=function(t){gi(t)||(t=Ci(t));var e=this.high>>>16,n=65535&this.high,i=this.low>>>16,r=65535&this.low,o=t.high>>>16,s=65535&t.high,a=t.low>>>16,l=0,c=0,u=0,h=0;return u+=(h+=r+(65535&t.low))>>>16,c+=(u+=i+a)>>>16,l+=(c+=n+s)>>>16,l+=e+o,xi((u&=65535)<<16|(h&=65535),(l&=65535)<<16|(c&=65535),this.unsigned)},Ni.subtract=function(t){return gi(t)||(t=Ci(t)),this.add(t.neg())},Ni.sub=Ni.subtract,Ni.multiply=function(t){if(this.isZero())return this;if(gi(t)||(t=Ci(t)),fi)return xi(fi.mul(this.low,this.high,t.low,t.high),fi.get_high(),this.unsigned);if(t.isZero())return this.unsigned?Bi:Ii;if(this.eq(Fi))return t.isOdd()?Fi:Ii;if(t.eq(Fi))return this.isOdd()?Fi:Ii;if(this.isNegative())return t.isNegative()?this.neg().mul(t.neg()):this.neg().mul(t).neg();if(t.isNegative())return this.mul(t.neg()).neg();if(this.lt(Mi)&&t.lt(Mi))return bi(this.toNumber()*t.toNumber(),this.unsigned);var e=this.high>>>16,n=65535&this.high,i=this.low>>>16,r=65535&this.low,o=t.high>>>16,s=65535&t.high,a=t.low>>>16,l=65535&t.low,c=0,u=0,h=0,d=0;return h+=(d+=r*l)>>>16,u+=(h+=i*l)>>>16,h&=65535,u+=(h+=r*a)>>>16,c+=(u+=n*l)>>>16,u&=65535,c+=(u+=i*a)>>>16,u&=65535,c+=(u+=r*s)>>>16,c+=e*l+n*a+i*s+r*o,xi((h&=65535)<<16|(d&=65535),(c&=65535)<<16|(u&=65535),this.unsigned)},Ni.mul=Ni.multiply,Ni.divide=function(t){if(gi(t)||(t=Ci(t)),t.isZero())throw Error("division by zero");var e,n,i;if(fi)return this.unsigned||-2147483648!==this.high||-1!==t.low||-1!==t.high?xi((this.unsigned?fi.div_u:fi.div_s)(this.low,this.high,t.low,t.high),fi.get_high(),this.unsigned):this;if(this.isZero())return this.unsigned?Bi:Ii;if(this.unsigned){if(t.unsigned||(t=t.toUnsigned()),t.gt(this))return Bi;if(t.gt(this.shru(1)))return Li;i=Bi}else{if(this.eq(Fi))return t.eq(Ri)||t.eq(Oi)?Fi:t.eq(Fi)?Ri:(e=this.shr(1).div(t).shl(1)).eq(Ii)?t.isNegative()?Ri:Oi:(n=this.sub(t.mul(e)),i=e.add(n.div(t)));if(t.eq(Fi))return this.unsigned?Bi:Ii;if(this.isNegative())return t.isNegative()?this.neg().div(t.neg()):this.neg().div(t).neg();if(t.isNegative())return this.div(t.neg()).neg();i=Ii}for(n=this;n.gte(t);){e=Math.max(1,Math.floor(n.toNumber()/t.toNumber()));for(var r=Math.ceil(Math.log(e)/Math.LN2),o=r<=48?1:wi(2,r-48),s=bi(e),a=s.mul(t);a.isNegative()||a.gt(n);)a=(s=bi(e-=o,this.unsigned)).mul(t);s.isZero()&&(s=Ri),i=i.add(s),n=n.sub(a)}return i},Ni.div=Ni.divide,Ni.modulo=function(t){return gi(t)||(t=Ci(t)),fi?xi((this.unsigned?fi.rem_u:fi.rem_s)(this.low,this.high,t.low,t.high),fi.get_high(),this.unsigned):this.sub(this.div(t).mul(t))},Ni.mod=Ni.modulo,Ni.rem=Ni.modulo,Ni.not=function(){return xi(~this.low,~this.high,this.unsigned)},Ni.countLeadingZeros=function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32},Ni.clz=Ni.countLeadingZeros,Ni.countTrailingZeros=function(){return this.low?mi(this.low):mi(this.high)+32},Ni.ctz=Ni.countTrailingZeros,Ni.and=function(t){return gi(t)||(t=Ci(t)),xi(this.low&t.low,this.high&t.high,this.unsigned)},Ni.or=function(t){return gi(t)||(t=Ci(t)),xi(this.low|t.low,this.high|t.high,this.unsigned)},Ni.xor=function(t){return gi(t)||(t=Ci(t)),xi(this.low^t.low,this.high^t.high,this.unsigned)},Ni.shiftLeft=function(t){return gi(t)&&(t=t.toInt()),0===(t&=63)?this:t<32?xi(this.low<<t,this.high<<t|this.low>>>32-t,this.unsigned):xi(0,this.low<<t-32,this.unsigned)},Ni.shl=Ni.shiftLeft,Ni.shiftRight=function(t){return gi(t)&&(t=t.toInt()),0===(t&=63)?this:t<32?xi(this.low>>>t|this.high<<32-t,this.high>>t,this.unsigned):xi(this.high>>t-32,this.high>=0?0:-1,this.unsigned)},Ni.shr=Ni.shiftRight,Ni.shiftRightUnsigned=function(t){return gi(t)&&(t=t.toInt()),0===(t&=63)?this:t<32?xi(this.low>>>t|this.high<<32-t,this.high>>>t,this.unsigned):xi(32===t?this.high:this.high>>>t-32,0,this.unsigned)},Ni.shru=Ni.shiftRightUnsigned,Ni.shr_u=Ni.shiftRightUnsigned,Ni.rotateLeft=function(t){var e;return gi(t)&&(t=t.toInt()),0===(t&=63)?this:32===t?xi(this.high,this.low,this.unsigned):t<32?(e=32-t,xi(this.low<<t|this.high>>>e,this.high<<t|this.low>>>e,this.unsigned)):(e=32-(t-=32),xi(this.high<<t|this.low>>>e,this.low<<t|this.high>>>e,this.unsigned))},Ni.rotl=Ni.rotateLeft,Ni.rotateRight=function(t){var e;return gi(t)&&(t=t.toInt()),0===(t&=63)?this:32===t?xi(this.high,this.low,this.unsigned):t<32?(e=32-t,xi(this.high<<e|this.low>>>t,this.low<<e|this.high>>>t,this.unsigned)):(e=32-(t-=32),xi(this.low<<e|this.high>>>t,this.high<<e|this.low>>>t,this.unsigned))},Ni.rotr=Ni.rotateRight,Ni.toSigned=function(){return this.unsigned?xi(this.low,this.high,!1):this},Ni.toUnsigned=function(){return this.unsigned?this:xi(this.low,this.high,!0)},Ni.toBytes=function(t){return t?this.toBytesLE():this.toBytesBE()},Ni.toBytesLE=function(){var t=this.high,e=this.low;return[255&e,e>>>8&255,e>>>16&255,e>>>24,255&t,t>>>8&255,t>>>16&255,t>>>24]},Ni.toBytesBE=function(){var t=this.high,e=this.low;return[t>>>24,t>>>16&255,t>>>8&255,255&t,e>>>24,e>>>16&255,e>>>8&255,255&e]},Ai.fromBytes=function(t,e,n){return n?Ai.fromBytesLE(t,e):Ai.fromBytesBE(t,e)},Ai.fromBytesLE=function(t,e){return new Ai(t[0]|t[1]<<8|t[2]<<16|t[3]<<24,t[4]|t[5]<<8|t[6]<<16|t[7]<<24,e)},Ai.fromBytesBE=function(t,e){return new Ai(t[4]<<24|t[5]<<16|t[6]<<8|t[7],t[0]<<24|t[1]<<16|t[2]<<8|t[3],e)};const zi=Ai,Ui=16;function Gi(t){"X"===t&&(t="");const e=t.padEnd(Ui,"0");return zi.fromString(e,!0,16)}const Vi=3,ji=61,Hi=180/Math.PI;function Wi(t,e,n){const i=1<<e;return[(t[0]+n[0])/i,(t[1]+n[1])/i]}function qi(t){return t>=.5?1/3*(4*t*t-1):1/3*(1-4*(1-t)*(1-t))}function Zi(t){return[qi(t[0]),qi(t[1])]}function Xi(t,e){let[n,i]=e;switch(t){case 0:return[1,n,i];case 1:return[-n,1,i];case 2:return[-n,-i,1];case 3:return[-1,-i,-n];case 4:return[i,-1,-n];case 5:return[i,n,-1];default:throw new Error("Invalid face")}}function Ki(t){let[e,n,i]=t;const r=Math.atan2(i,Math.sqrt(e*e+n*n));return[Math.atan2(n,e)*Hi,r*Hi]}function Qi(t,e,n,i){if(0===i){1===n&&(e[0]=t-1-e[0],e[1]=t-1-e[1]);const i=e[0];e[0]=e[1],e[1]=i}}function Ji(t){const e=function(t){if(t.indexOf("/")>0)return t;const e=Gi(t);return function(t){if(t.isZero())return"";let e=t.toString(2);for(;e.length<Vi+ji;)e="0"+e;const n=e.lastIndexOf("1"),i=e.substring(0,3),r=e.substring(3,n),o=r.length/2,s=zi.fromString(i,!0,2).toString(10);let a="";if(0!==o)for(a=zi.fromString(r,!0,2).toString(4);a.length<o;)a="0"+a;return`${s}/${a}`}(e)}(t);return function(t){if(0===t.length)throw new Error(`Invalid Hilbert quad key ${t}`);const e=t.split("/"),n=parseInt(e[0],10),i=e[1],r=i.length;let o=0;const s=[0,0];for(let a=r-1;a>=0;a--){o=r-a;const t=i[a];let e=0,n=0;"1"===t?n=1:"2"===t?(e=1,n=1):"3"===t&&(e=1);const l=Math.pow(2,o-1);Qi(l,s,e,n),s[0]+=l*e,s[1]+=l*n}if(n%2===1){const t=s[0];s[0]=s[1],s[1]=t}return{face:n,ij:s,level:o}}(e)}const Yi=100;function $i(t){const{face:e,ij:n,level:i}=t,r=[[0,0],[0,1],[1,1],[1,0],[0,0]],o=Math.max(1,Math.ceil(Yi*Math.pow(2,-i))),s=new Float64Array(4*o*2+2);let a=0,l=0;for(let c=0;c<4;c++){const t=r[c].slice(0),u=r[c+1],h=(u[0]-t[0])/o,d=(u[1]-t[1])/o;for(let r=0;r<o;r++){t[0]+=h,t[1]+=d;const r=Ki(Xi(e,Zi(Wi(n,i,t))));Math.abs(r[1])>89.999&&(r[0]=l);const o=r[0]-l;r[0]+=o>180?-360:o<-180?360:0,s[a++]=r[0],s[a++]=r[1],l=r[0]}}return s[a++]=s[0],s[a++]=s[1],s}function tr(t){if(t.length%2!==0)throw new Error("Invalid corners");const e=[],n=[];for(let i=0;i<t.length;i+=2)e.push(t[i]),n.push(t[i+1]);return e.sort(((t,e)=>t-e)),n.sort(((t,e)=>t-e)),{west:e[0],east:e[e.length-1],north:n[n.length-1],south:n[0]}}function er(t,e){const n=e?.minimumHeight||0,i=e?.maximumHeight||0,r=function(t){let e;if(2===t.face||5===t.face){let n=null,i=0;for(let e=0;e<4;e++){const r=$i(Ji(`${t.face}/${e}`));"undefined"!==typeof n&&null!==n||(n=new Float64Array(4*r.length)),n.set(r,i),i+=r.length}e=tr(n)}else e=tr($i(t));return e}(Ji(t)),o=r.west,s=r.south,a=r.east,l=r.north,c=[];return c.push(new ut.P(o,l,n)),c.push(new ut.P(a,l,n)),c.push(new ut.P(a,s,n)),c.push(new ut.P(o,s,n)),c.push(new ut.P(o,l,i)),c.push(new ut.P(a,l,i)),c.push(new ut.P(a,s,i)),c.push(new ut.P(o,s,i)),c}function nr(t){return function(t){const e=Zi(Wi(t.ij,t.level,[.5,.5]));return Ki(Xi(t.face,e))}(Ji(t))}function ir(t){const e=t.token,n={minimumHeight:t.minimumHeight,maximumHeight:t.maximumHeight},i=er(e,n),r=nr(e),o=r[0],s=r[1],a=Nt.WGS84.cartographicToCartesian([o,s,n.maximumHeight]),l=new ut.P(a[0],a[1],a[2]);i.push(l);const c=(0,qt.ZZ)(i);return[...c.center,...c.halfAxes]}const rr={QUADTREE:4,OCTREE:8};function or(t,e,n){if(t?.box){const i=function(t,e){const n=function(t){return t.and(t.not().add(1))}(t).shiftRightUnsigned(2);return t.add(zi.fromNumber(2*e+1-4).multiply(n))}(Gi(t.s2VolumeInfo.token),e),r=function(t){if(t.isZero())return"X";let e=t.countTrailingZeros();e=(e-e%4)/4;const n=e;e*=4;const i=t.shiftRightUnsigned(e).toString(16).replace(/0+$/,"");return Array(17-n-i.length).join("0")+i}(i),o={...t.s2VolumeInfo};if(o.token=r,"OCTREE"===n){const e=t.s2VolumeInfo,n=e.maximumHeight-e.minimumHeight,i=n/2,r=e.minimumHeight+n/2;e.minimumHeight=r-i,e.maximumHeight=r+i}return{box:ir(o),s2VolumeInfo:o}}}async function sr(t){const{implicitOptions:e,parentData:n={mortonIndex:0,x:0,y:0,z:0},childIndex:i=0,s2VolumeBox:r,loaderOptions:o}=t;let{subtree:s,level:a=0,globalData:l={level:0,mortonIndex:0,x:0,y:0,z:0}}=t;const{subdivisionScheme:c,subtreeLevels:u,maximumLevel:h,contentUrlTemplate:d,subtreesUriTemplate:p,basePath:f}=e,A={children:[],lodMetricValue:0,contentUrl:""};if(!h)return pi.once(`Missing 'maximumLevel' or 'availableLevels' property. The subtree ${d} won't be loaded...`),A;const g=a+l.level;if(g>h)return A;const m=rr[c],y=Math.log2(m),_=1&i,v=i>>1&1,b=i>>2&1,x=(m**a-1)/(m-1);let w=cr(n.mortonIndex,i,y),E=x+w,C=cr(n.x,_,1),T=cr(n.y,v,1),S=cr(n.z,b,1),P=!1;a>
2=u&&(P=ar(s.childSubtreeAvailability,w));const M=cr(l.x,C,a),I=cr(l.y,T,a),B=cr(l.z,S,a);if(P){const t=ur(`${f}/${p}`,g,M,I,B);s=await(0,lt.H)(t,hi,o),l={mortonIndex:w,x:C,y:T,z:S,level:a},w=0,E=0,C=0,T=0,S=0,a=0}if(!ar(s.tileAvailability,E))return A;ar(s.contentAvailability,E)&&(A.contentUrl=ur(d,g,M,I,B));const R=a+1,L={mortonIndex:w,x:C,y:T,z:S};for(let O=0;O<m;O++){const t=or(r,O,c),n=await sr({subtree:s,implicitOptions:e,loaderOptions:o,parentData:L,childIndex:O,level:R,globalData:{...l},s2VolumeBox:t});if(n.contentUrl||n.children.length){const t=lr(n,g+1,{childTileX:C,childTileY:T,childTileZ:S},e,r);A.children.push(t)}}return A}function ar(t,e){let n;return Array.isArray(t)?(n=t[0],t.length>1&&pi.once('Not supported extension "3DTILES_multiple_contents" has been detected')):n=t,"constant"in n?Boolean(n.constant):!!n.explicitBitstream&&function(t,e){const n=Math.floor(t/8),i=t%8;return 1===(e[n]>>i&1)}(e,n.explicitBitstream)}function lr(t,e,n,i,r){const{basePath:o,refine:s,getRefine:a,lodMetricType:l,getTileType:c,rootLodMetricValue:u,rootBoundingVolume:h}=i,d=t.contentUrl&&t.contentUrl.replace(`${o}/`,""),p=u/2**e,f=function(t,e,n){if(e.region){const{childTileX:i,childTileY:r,childTileZ:o}=n,[s,a,l,c,u,h]=e.region,d=2**t,p=(l-s)/d,f=(c-a)/d,A=(h-u)/d,[g,m]=[s+p*i,s+p*(i+1)],[y,_]=[a+f*r,a+f*(r+1)],[v,b]=[u+A*o,u+A*(o+1)];return{region:[g,y,m,_,v,b]}}if(e.box)return e;throw new Error(`Unsupported bounding volume type ${JSON.stringify(e)}`)}(e,r?.box?{box:r.box}:h,n);return{children:t.children,contentUrl:t.contentUrl,content:{uri:d},id:t.contentUrl,refine:a(s),type:c(t),lodMetricType:l,lodMetricValue:p,geometricError:p,transform:t.transform,boundingVolume:f}}function cr(t,e,n){return(t<<n)+e}function ur(t,e,n,i,r){const o=function(t){const e={};for(const n in t)e[`{${n}}`]=t[n];return e}({level:e,x:n,y:i,z:r});return t.replace(/{level}|{x}|{y}|{z}/gi,(t=>o[t]))}function hr(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(!e)return ce.EMPTY;const n=e.split("?")[0].split(".").pop();switch(n){case"pnts":return ce.POINTCLOUD;case"i3dm":case"b3dm":case"glb":case"gltf":return ce.SCENEGRAPH;default:return n||ce.EMPTY}}function dr(t){switch(t){case"REPLACE":case"replace":return le.REPLACE;case"ADD":case"add":return le.ADD;default:return t}}function pr(t,e){if(/^[a-z][0-9a-z+.-]*:/i.test(e)){const n=new URL(t,`${e}/`);return decodeURI(n.toString())}return t.startsWith("/")?t:Ut.hd(e,t)}function fr(t,e){if(!t)return null;let n;if(t.content){const i=t.content.uri||t.content?.url;"undefined"!==typeof i&&(n=pr(i,e))}return{...t,id:n,contentUrl:n,lodMetricType:he.GEOMETRIC_ERROR,lodMetricValue:t.geometricError,transformMatrix:t.transform,type:hr(t,n),refine:dr(t.refine)}}async function Ar(t,e,n,i,r){const{subdivisionScheme:o,maximumLevel:s,availableLevels:a,subtreeLevels:l,subtrees:{uri:c}}=i,u=pr(ur(c,0,0,0,0),n),h=await(0,lt.H)(u,hi,r),d=t.content?.uri,p=d?pr(d,n):"",f=e?.root?.refine,A=t.geometricError,g=t.boun
vendor: 22,491 bytes, line 2
2dingVolume.extensions?.["3DTILES_bounding_volume_S2"];if(g){const e={box:ir(g),s2VolumeInfo:g};t.boundingVolume=e}const m=t.boundingVolume,y={contentUrlTemplate:p,subtreesUriTemplate:c,subdivisionScheme:o,subtreeLevels:l,maximumLevel:Number.isFinite(a)?a-1:s,refine:f,basePath:n,lodMetricType:he.GEOMETRIC_ERROR,rootLodMetricValue:A,rootBoundingVolume:m,getTileType:hr,getRefine:dr};return await async function(t,e,n,i,r){if(!t)return null;const{children:o,contentUrl:s}=await sr({subtree:n,implicitOptions:i,loaderOptions:r});let a,l=null;s&&(a=s,l={uri:s.replace(`${e}/`,"")});const c={...t,id:a,contentUrl:a,lodMetricType:he.GEOMETRIC_ERROR,lodMetricValue:t.geometricError,transformMatrix:t.transform,type:hr(t,a),refine:dr(t.refine),content:l||t.content,children:o};return c}(t,n,h,y,r)}function gr(t){return t?.extensions?.["3DTILES_implicit_tiling"]||t?.implicitTiling}const mr={dataType:null,batchType:null,id:"3d-tiles",name:"3D Tiles",module:"3d-tiles",version:un,extensions:["cmpt","pnts","b3dm","i3dm"],mimeTypes:["application/octet-stream"],tests:["cmpt","pnts","b3dm","i3dm"],parse:async function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;const i=e["3d-tiles"]||{};let r;r="auto"===i.isTileset?n?.url&&-1!==n.url.indexOf(".json"):i.isTileset;return r?async function(t,e,n){const i=JSON.parse((new TextDecoder).decode(t)),r=n?.url||"",o=function(t){return Ut.pD(t)}(r),s=await async function(t,e,n){let i=null;const r=gr(t.root);i=r&&t.root?await Ar(t.root,t,e,r,n):fr(t.root,e);const o=[];for(o.push(i);o.length>0;){const i=o.pop()||{},r=i.children||[],s=[];for(const a of r){const i=gr(a);let r;r=i?await Ar(a,t,e,i,n):fr(a,e),r&&(s.push(r),o.push(r))}i.children=s}return i}(i,o,e||{}),a={...i,shape:"tileset3d",loader:mr,url:r,queryString:n?.queryString||"",basePath:o,root:s||i.root,type:ue.TILES3D,lodMetricType:he.GEOMETRIC_ERROR,lodMetricValue:i.root?.geometricError||0};return a}(t,e,n):async function(t,e,n){const i={content:{shape:"tile3d",featureIds:null}},r=0;return await li(t,r,e,n,i.content),i.content}(t,e,n)},options:{"3d-tiles":{loadGLTF:!0,decodeQuantizedPositions:!1,isTileset:"auto",assetGltfUpAxis:null}}};const yr=[0],_r={getPointColor:{type:"accessor",value:[0,0,0,255]},pointSize:1,data:"",loader:mr,onTilesetLoad:{type:"function",value:t=>{}},onTileLoad:{type:"function",value:t=>{}},onTileUnload:{type:"function",value:t=>{}},onTileError:{type:"function",value:(t,e,n)=>{}},_getMeshColor:{type:"function",value:t=>[255,255,255]}};class vr extends i.A{initializeState(){"onTileLoadFail"in this.props&&$.A.removed("onTileLoadFail","onTileError")(),this.state={layerMap:{},tileset3d:null,activeViewports:{},lastUpdatedViewports:null}}get isLoaded(){return Boolean(this.state?.tileset3d?.isLoaded()&&super.isLoaded)}shouldUpdateState(t){let{changeFlags:e}=t;return e.somethingChanged}updateState(t){let{props:e,oldProps:n,changeFlags:i}=t;if(e.data&&e.data!==n.data&&this._loadTileset(e.data),i.viewportChanged){const{activeViewports:t}=this.state;Object.keys(t).length&&(this._updateTileset(t),this.state.lastUpdatedViewports=t,this.state.activeViewports={})}if(i.propsChanged){const{layerMap:t}=this.state;for(const e in t)t[e].needsUpdate=!0}}activateViewport(t){const{activeViewports:e,lastUpdatedViewports:n}=this.state;this.internalState.viewport=t,e[t.id]=t;const i=n?.[t.id];i&&t.equals(i)||(this.setChangeFlags({viewportChanged:!0}),this.setNeedsUpdate())}getPickingInfo(t){let{info:e,sourceLayer:n}=t;const i=n&&n.props.tile;return e.picked&&(e.object=i),e.sourceTile=i,e}filterSubLayer(t){let{layer:e,viewport:n}=t;const{tile:i}=e.props,{id:r}=n;return i.selected&&i.viewportIds.includes(r)}_updateAutoHighlight(t){const e=t.sourceTile,n=this.state.layerMap[e?.id];n&&n.layer&&n.layer.updateAutoHighlight(t)}async _loadTileset(t){const{loadOptions:e={}}=this.props,n=this.props.loader||this.props.loaders,i=Array.isArray(n)?n[0]:n,r={loadOptions:{...e}};let o=t;if(i.preload){const n=await i.preload(t,e);n.url&&(o=n.url),n.headers&&(r.loadOptions.fetch={...r.loadOptions.fetch,headers:n.headers}),Object.assign(r,n)}const s=await(0,lt.H)(o,i,r.loadOptions),a=new cn(s,{onTileLoad:this._onTileLoad.bind(this),onTileUnload:this._onTileUnload.bind(this),onTileError:this.props.onTileError,...r});this.setState({tileset3d:a,layerMap:{}}),this._updateTileset(this.state.activeViewports),this.props.onTilesetLoad(a)}_onTileLoad(t){const{lastUpdatedViewports:e}=this.state;this.props.onTileLoad(t),this._updateTileset(e),this.setNeedsUpdate()}_onTileUnload(t){delete this.state.layerMap[t.id],this.props.onTileUnload(t)}_updateTileset(t){if(!t)return;const{tileset3d:e}=this.state,{timeline:n}=this.context,i=Object.keys(t).length;n&&i&&e&&e.selectTiles(Object.values(t)).then((t=>{this.state.frameNumber!==t&&this.setState({frameNumber:t})}))}_getSubLayer(t,e){if(!t.content)return null;switch(t.type){case ce.POINTCLOUD:return this._makePointCloudLayer(t,e);case ce.SCENEGRAPH:return this._make3DModelLayer(t);case ce.MESH:return this._makeSimpleMeshLayer(t,e);default:throw new Error(`Tile3DLayer: Failed to render layer of type ${t.content.type}`)}}_makePointCloudLayer(t,e){const{attributes:n,pointCount:i,constantRGBA:r,cartographicOrigin:s,modelMatrix:a}=t.content,{positions:l,normals:c,colors:u}=n;if(!l)return null;const h=e&&e.props.data||{header:{vertexCount:i},attributes:{POSITION:l,NORMAL:c,COLOR_0:u}},{pointSize:d,getPointColor:p}=this.props;return new(this.getSubLayerClass("pointcloud",tt.A))({pointSize:d},this.getSubLayerProps({id:"pointcloud"}),{id:`${this.id}-pointcloud-${t.id}`,tile:t,data:h,coordinateSystem:o.rf.METER_OFFSETS,coordinateOrigin:s,modelMatrix:a,getColor:r||p,_offset:0})}_make3DModelLayer(t){const{gltf:e,instances:n,cartographicOrigin:i,modelMatrix:r}=t.content;return new(this.getSubLayerClass("scenegraph",et.A))({_lighting:"pbr"},this.getSubLayerProps({id:"scenegraph"}),{id:`${this.id}-scenegraph-${t.id}`,tile:t,data:n||yr,scenegraph:e,coordinateSystem:o.rf.METER_OFFSETS,coordinateOrigin:i,modelMatrix:r,getTransformMatrix:t=>t.modelMatrix,getPosition:[0,0,0],_offset:0})}_makeSimpleMeshLayer(t,e){const n=t.content,{attributes:i,indices:r,modelMatrix:s,cartographicOrigin:a,coordinateSystem:l=o.rf.METER_OFFSETS,material:c,featureIds:u}=n,{_getMeshColor:h}=this.props,d=e&&e.props.mesh||new Y.V({topology:"triangle-list",attributes:xr(i),indices:r});return new(this.getSubLayerClass("mesh",at))(this.getSubLayerProps({id:"mesh"}),{id:`${this.id}-mesh-${t.id}`,tile:t,mesh:d,data:yr,getColor:h(t),pbrMaterial:c,modelMatrix:s,coordinateOrigin:a,coordinateSystem:l,featureIds:u,_offset:0})}renderLayers(){const{tileset3d:t,layerMap:e}=this.state;return t?t.tiles.map((t=>{const n=e[t.id]=e[t.id]||{tile:t};let{layer:i}=n;return t.selected&&(i?n.needsUpdate&&(i=this._getSubLayer(t,i),n.needsUpdate=!1):i=this._getSubLayer(t)),n.layer=i,i})).filter(Boolean):null}}vr.defaultProps=_r,vr.layerName="Tile3DLayer";const br=vr;function xr(t){const e={};return e.positions={...t.positions,value:new Float32Array(t.positions.value)},t.normals&&(e.normals=t.normals),t.texCoords&&(e.texCoords=t.texCoords),t.colors&&(e.colors=t.colors),t.uvRegions&&(e.uvRegions=t.uvRegions),e}const wr={dataType:null,batchType:null,name:"Terrain",id:"terrain",module:"terrain",version:"4.2.4",worker:!0,extensions:["png","pngraw","jpg","jpeg","gif","webp","bmp"],mimeTypes:["image/png","image/jpeg","image/gif","image/webp","image/bmp"],options:{terrain:{tesselator:"auto",bounds:void 0,meshMaxError:10,elevationDecoder:{rScaler:1,gScaler:0,bScaler:0,offset:0},skirtHeight:void 0}}};var Er=n(50854);const Cr=[1],Tr={...X.A.defaultProps,elevationData:Er.cS,texture:{...Er.cS,optional:!0},meshMaxError:{type:"number",value:4},bounds:{type:"array",value:null,optional:!0,compare:!0},color:{type:"color",value:[255,255,255]},elevationDecoder:{type:"object",value:{rScaler:1,gScaler:0,bScaler:0,offset:0}},workerUrl:"",wireframe:!1,material:!0,loaders:[wr]};function Sr(t){return Array.isArray(t)?t.join(";"):t||""}class Pr extends i.A{updateState(t){let{props:e,oldProps:n}=t;const i=e.elevationData!==n.elevationData;if(i){const{elevationData:t}=e,n=t&&(Array.isArray(t)||t.includes("{x}")&&t.includes("{y}"));this.setState({isTiled:n})}const r=i||e.meshMaxError!==n.meshMaxError||e.elevationDecoder!==n.elevationDecoder||e.bounds!==n.bounds;if(!this.state.isTiled&&r){const t=this.loadTerrain(e);this.setState({terrain:t})}e.workerUrl&&$.A.removed("workerUrl","loadOptions.terrain.workerUrl")()}loadTerrain(t){let{elevationData:e,bounds:n,elevationDecoder:i,meshMaxError:r,signal:o}=t;if(!e)return null;let s=this.getLoadOptions();s={...s,terrain:{skirtHeight:this.state.isTiled?2*r:0,...s?.terrain,bounds:n,meshMaxError:r,elevationDecoder:i}};const{fetch:a}=this.props;return a(e,{propName:"elevationData",layer:this,loadOptions:s,signal:o})}getTiledTerrainData(t){const{elevationData:e,fetch:n,texture:i,elevationDecoder:r,meshMaxError:o}=this.props,{viewport:s}=this.context,a=(0,Er.g8)(e,t),l=i&&(0,Er.g8)(i,t),{signal:c}=t;let u=[0,0],h=[0,0];if(s.isGeospatial){const e=t.bbox;u=s.projectFlat([e.west,e.south]),h=s.projectFlat([e.east,e.north])}else{const e=t.bbox;u=[e.left,e.bottom],h=[e.right,e.top]}const d=[u[0],u[1],h[0],h[1]],p=this.loadTerrain({elevationData:a,bounds:d,elevationDecoder:r,meshMaxError:o,signal:c}),f=l?n(l,{propName:"texture",layer:this,loaders:[],signal:c}).catch((t=>null)):Promise.resolve(null);return Promise.all([p,f])}renderSubLayers(t){const e=this.getSubLayerClass("mesh",ot.A),{color:n,wireframe:i,material:r}=this.props,{data:s}=t;if(!s)return null;const[a,l]=s;return new e(t,{data:Cr,mesh:a,texture:l,_instanced:!1,coordinateSystem:o.rf.CARTESIAN,getPosition:t=>[0,0,0],getColor:n,wireframe:i,material:r})}onViewportLoad(t){if(!t)return;const{zRange:e}=this.state,n=t.map((t=>t.content)).filter(Boolean).map((t=>t[0].header.boundingBox.map((t=>t[2]))));if(0===n.length)return;const i=Math.min(...n.map((t=>t[0]))),r=Math.max(...n.map((t=>t[1])));(!e||i<e[0]||r>e[1])&&this.setState({zRange:[i,r]})}renderLayers(){const{color:t,material:e,elevationData:n,texture:i,wireframe:r,meshMaxError:o,elevationDecoder:s,tileSize:a,maxZoom:l,minZoom:c,extent:u,maxRequests:h,onTileLoad:d,onTileUnload:p,onTileError:f,maxCacheSize:A,maxCacheByteSize:g,refinementStrategy:m}=this.props;if(this.state.isTiled)return new X.A(this.getSubLayerProps({id:"tiles"}),{getTileData:this.getTiledTerrainData.bind(this),renderSubLayers:this.renderSubLayers.bind(this),updateTriggers:{getTileData:{elevationData:Sr(n),texture:Sr(i),meshMaxError:o,elevationDecoder:s}},onViewportLoad:this.onViewportLoad.bind(this),zRange:this.state.zRange||null,tileSize:a,maxZoom:l,minZoom:c,extent:u,maxRequests:h,onTileLoad:d,onTileUnload:p,onTileError:f,maxCacheSize:A,maxCacheByteSize:g,refinementStrategy:m});if(!n)return null;return new(this.getSubLayerClass("mesh",ot.A))(this.getSubLayerProps({id:"mesh"}),{data:Cr,mesh:this.state.terrain,texture:i,_instanced:!1,getPosition:t=>[0,0,0],getColor:t,material:e,wireframe:r})}}Pr.defaultProps=Tr,Pr.layerName="TerrainLayer";const Mr=Pr;var Ir=n(40973),Br=n(16389),Rr=n(49793),Lr=n(61299),Or=n(24101)},40973:(t,e,n)=>{"use strict";n.d(e,{A:()=>ct});var i=n(4896),r=n(45957),o=n(94514),s=n(30202),a=n(33128),l=n(3348);function c(t,e,n){const i=u(t),r=Object.keys(i).filter((t=>i[t]!==Array));return function(t,e,n){const{pointPositionsCount:i,pointFeaturesCount:r,linePositionsCount:o,linePathsCount:s,lineFeaturesCount:a,polygonPositionsCount:l,polygonObjectsCount:c,polygonRingsCount:u,polygonFeaturesCount:f,propArrayTypes:g,coordLength:y}=e,{numericPropKeys:_=[],PositionDataType:v=Float32Array,triangulate:b=!0}=n,x=t[0]&&"id"in t[0],w=t.length>65535?Uint32Array:Uint16Array,E={type:"Point",positions:new v(i*y),globalFeatureIds:new w(i),featureIds:r>65535?new Uint32Array(i):new Uint16Array(i),numericProps:{},properties:[],fields:[]},C={type:"LineString",pathIndices:o>65535?new Uint32Array(s+1):new Uint16Array(s+1),positions:new v(o*y),globalFeatureIds:new w(o),featureIds:a>65535?new Uint32Array(o):new Uint16Array(o),numericProps:{},properties:[],fields:[]},T={type:"Polygon",polygonIndices:l>65535?new Uint32Array(c+1):new Uint16Array(c+1),primitivePolygonIndices:l>65535?new Uint32Array(u+1):new Uint16Array(u+1),positions:new v(l*y),globalFeatureIds:new w(l),featureIds:f>65535?new Uint32Array(l):new Uint16Array(l),numericProps:{},properties:[],fields:[]};b&&(T.triangles=[]);for(const h of[E,C,T])for(const t of _){const e=g[t];h.numericProps[t]=new e(h.positions.length/y)}C.pathIndices[s]=o,T.polygonIndices[c]=l,T.primitivePolygonIndices[u]=l;const S={pointPosition:0,pointFeature:0,linePosition:0,linePath:0,lineFeature:0,polygonPosition:0,polygonObject:0,polygonRing:0,polygonFeature:0,feature:0};for(const A of t){const t=A.geometry,e=A.properties||{};switch(t.type){case"Point":h(t,E,S,y,e),E.properties.push(m(e,_)),x&&E.fields.push({id:A.id}),S.pointFeature++;break;case"LineString":d(t,C,S,y,e),C.properties.push(m(e,_)),x&&C.fields.push({id:A.id}),S.lineFeature++;break;case"Polygon":p(t,T,S,y,e),T.properties.push(m(e,_)),x&&T.fields.push({id:A.id}),S.polygonFeature++;break;default:throw new Error("Invalid geometry type")}S.feature++}return function(t,e,n,i){const r={shape:"binary-feature-collection",points:{...t,positions:{value:t.positions,size:i},globalFeatureIds:{value:t.globalFeatureIds,size:1},featureIds:{value:t.featureIds,size:1},numericProps:A(t.numericProps,1)},lines:{...e,positions:{value:e.positions,size:i},pathIndices:{value:e.pathIndices,size:1},globalFeatureIds:{value:e.globalFeatureIds,size:1},featureIds:{value:e.featureIds,size:1},numericProps:A(e.numericProps,1)},polygons:{...n,positions:{value:n.positions,size:i},polygonIndices:{value:n.polygonIndices,size:1},primitivePolygonIndices:{value:n.primitivePolygonIndices,size:1},globalFeatureIds:{value:n.globalFeatureIds,size:1},featureIds:{value:n.featureIds,size:1},numericProps:A(n.numericProps,1)}};r.polygons&&n.triangles&&(r.polygons.triangles={value:new Uint32Array(n.triangles),size:1});return r}(E,C,T,y)}(t,{propArrayTypes:i,...e},{numericPropKeys:n&&n.numericPropKeys||r,PositionDataType:n?n.PositionDataType:Float32Array,triangulate:!n||n.triangulate})}function u(t){const e={};for(const n of t)if(n.properties)for(const t in n.properties){const i=n.properties[t];e[t]=y(i,e[t])}return e}function h(t,e,n,i,r){e.positions.set(t.data,n.pointPosition*i);const o=t.data.length/i;g(e,r,n.pointPosition,o),e.globalFeatureIds.fill(n.feature,n.pointPosition,n.pointPosition+o),e.featureIds.fill(n.pointFeature,n.pointPosition,n.pointPosition+o),n.pointPosition+=o}function d(t,e,n,i,r){e.positions.set(t.data,n.linePosition*i);const o=t.data.length/i;g(e,r,n.linePosition,o),e.globalFeatureIds.fill(n.feature,n.linePosition,n.linePosition+o),e.featureIds.fill(n.lineFeature,n.linePosition,n.linePosition+o);for(let s=0,a=t.indices.length;s<a;++s){const r=t.indices[s],o=s===a-1?t.data.length:t.indices[s+1];e.pathIndices[n.linePath++]=n.linePosition,n.linePosition+=(o-r)/i}}function p(t,e,n,i,r){e.positions.set(t.data,n.polygonPosition*i);const o=t.data.length/i;g(e,r,n.polygonPosition,o),e.globalFeatureIds.fill(n.feature,n.polygonPosition,n.polygonPosition+o),e.featureIds.fill(n.polygonFeature,n.polygonPosition,n.polygonPosition+o);for(let s=0,a=t.indices.length;s<a;++s){const r=n.polygonPosition;e.polygonIndices[n.polygonObject++]=r;const o=t.areas[s],a=t.indices[s],l=t.indices[s+1];for(let s=0,c=a.length;s<c;++s){const r=a[s],o=s===c-1?void 0===l?t.data.length:l[0]:a[s+1];e.primitivePolygonIndices[n.polygonRing++]=n.polygonPosition,n.polygonPosition+=(o-r)/i}f(e,o,a,{startPosition:r,endPosition:n.polygonPosition,coordLength:i})}}function f(t,e,n,i){let{startPosition:r,endPosition:o,coordLength:s}=i;if(!t.triangles)return;const a=r*s,c=o*s,u=t.positions.subarray(a,c),h=n[0],d=n.slice(1).map((t=>(t-h)/s)),p=(0,l.hY)(u,d,s,e);for(let l=0,f=p.length;l<f;++l)t.triangles.push(r+p[l])}function A(t,e){const n={};for(const i in t)n[i]={value:t[i],size:e};return n}function g(t,e,n,i){for(const r in t.numericProps)if(r in e){const o=e[r];t.numericProps[r].fill(o,n,n+i)}}function m(t,e){const n={};for(const i in t)e.includes(i)||(n[i]=t[i]);return n}function y(t,e){return e!==Array&&Number.isFinite(t)?e===Float64Array||Math.fround(t)!==t?Float64Array:Float32Array:Array}var _=n(15361);function v(t){let e=0;for(let n,i,r=0,o=t.length-1;r<t.length;o=r++)n=t[r],i=t[o],e+=(i[0]-n[0])*(n[1]+i[1]);return e}function b(t,e,n){e&&n&&(1===t?e.id=n.readVarint():2===t?function(t,e){const n=t.readVarint()+t.pos;for(;t.pos<n;){const n=e._keys[t.readVarint()],i=e._values[t.readVarint()];e.properties[n]=i}}(n,e):3===t?e.type=n.readVarint():4===t&&(e._geometry=n.pos))}class x{properties;extent;type;id;_pbf;_geometry;_keys;_values;static get types(){return["Unknown","Point","LineString","Polygon"]}constructor(t,e,n,i,r){this.properties={},this.extent=n,this.type=0,this.id=null,this._pbf=t,this._geometry=-1,this._keys=i,this._values=r,t.readFields(b,this,e)}loadGeometry(){const t=this._pbf;t.pos=this._geometry;const e=t.readVarint()+t.pos;let n=1,i=0,r=0,o=0;const s=[];let a;for(;t.pos<e;){if(i<=0){const e=t.readVarint();n=7&e,i=e>>3}if(i--,1===n||2===n)r+=t.readSVarint(),o+=t.readSVarint(),1===n&&(a&&s.push(a),a=[]),a&&a.push([r,o]);else{if(7!==n)throw new Error(`unknown command ${n}`);a&&a.push(a[0].slice())}}return a&&s.push(a),s}bbox(){const t=this._pbf;t.pos=this._geometry;const e=t.readVarint()+t.pos;let n=1,i=0,r=0,o=0,s=1/0,a=-1/0,l=1/0,c=-1/0;for(;t.pos<e;){if(i<=0){const e=t.readVarint();n=7&e,i=e>>3}if(i--,1===n||2===n)r+=t.readSVarint(),o+=t.readSVarint(),r<s&&(s=r),r>a&&(a=r),o<l&&(l=o),o>c&&(c=o);else if(7!==n)throw new Error(`unknown command ${n}`)}return[s,l,a,c]}_toGeoJSON(t){let e,n,i=this.loadGeometry(),r=x.types[this.type];switch(this.type){case 1:const r=[];for(e=0;e<i.length;e++)r[e]=i[e][0];i=r,t(i,this);break;case 2:for(e=0;e<i.length;e++)t(i[e],this);break;case 3:for(i=function(t){const e=t.length;if(e<=1)return[t];const n=[];let i,r;for(let o=0;o<e;o++){const e=v(t[o]);0!==e&&(void 0===r&&(r=e<0),r===e<0?(i&&n.push(i),i=[t[o]]):i&&i.push(t[o]))}return i&&n.push(i),n}(i),e=0;e<i.length;e++)for(n=0;n<i[e].length;n++)t(i[e][n],this)}1===i.length?i=i[0]:r=`Multi${r}`;const o={type:"Feature",geometry:{type:r,coordinates:i},properties:this.properties};return null!==this.id&&(o.id=this.id),o}toGeoJSON(t){if("function"===typeof t)return this._toGeoJSON(t);const{x:e,y:n,z:i}=t,r=this.extent*Math.pow(2,i),o=this.extent*e,s=this.extent*n;return this._toGeoJSON((function(t){for(let e=0;e<t.length;e++){const n=t[e];n[0]=360*(n[0]+o)/r-180;const i=180-360*(n[1]+s)/r;n[1]=360/Math.PI*Math.atan(Math.exp(i*Math.PI/180))-90}}))}}class w{version;name;extent;length;_pbf;_keys;_values;_features;constructor(t,e){this.version=1,this.name="",this.extent=4096,this.length=0,this._pbf=t,this._keys=[],this._values=[],this._features=[],t.readFields(E,this,e),this.length=this._features.length}feature(t){if(t<0||t>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[t];const e=this._pbf.readVarint()+this._pbf.pos;return new x(this._pbf,e,this.extent,this._keys,this._values)}}function E(t,e,n){e&&n&&(15===t?e.version=n.readVarint():1===t?e.name=n.readString():5===t?e.extent=n.readVarint():2===t?e._features.push(n.pos):3===t?e._keys.push(n.readString()):4===t&&e._values.push(function(t){let e=null;const n=t.readVarint()+t.pos;for(;t.pos<n;){const n=t.readVarint()>>3;e=1===n?t.readString():2===n?t.readFloat():3===n?t.readDouble():4===n?t.readVarint64():5===n?t.readVarint():6===n?t.readSVarint():7===n?t.readBoolean():null}return e}(n)))}class C{layers;constructor(t,e){this.layers=t.readFields(T,{},e)}}function T(t,e,n){if(3===t&&n){const t=new w(n,n.readVarint()+n.pos);t.length&&e&&(e[t.name]=t)}}function S(t){const e=t.indices.length,n="Polygon";if(e<=1)return{type:n,data:t.data,areas:[[(0,l.IC)(t.data)]],indices:[t.indices]};const i=[],r=[];let o,s=[],a=[],c=0;for(let u,h,d=0;d<e;d++){h=t.indices[d]-c,u=t.indices[d+1]-c||t.data.length;const e=t.data.slice(h,u),n=(0,l.IC)(e);if(0!==n)void 0===o&&(o=n<0),o===n<0?(a.length&&(i.push(s),r.push(a)),a=[h],s=[n]):(s.push(n),a.push(h));else{const e=t.data.slice(0,h),n=t.data.slice(u);t.data=e.concat(n),c+=u-h}}return s&&i.push(s),a.length&&r.push(a),{type:n,areas:i,indices:r,data:t.data}}function P(t,e,n){e&&n&&(1===t?e.id=n.readVarint():2===t?function(t,e){const n=t.readVarint()+t.pos;for(;t.pos<n;){const n=e._keys[t.readVarint()],i=e._values[t.readVarint()];e.properties[n]=i}}(n,e):3===t?e.type=n.readVarint():4===t&&(e._geometry=n.pos))}let M,I,B,R,L,O,D;class k{properties;extent;type;id;_pbf;_geometry;_keys;_values;_geometryInfo;constructor(t,e,n,i,r,o){this.properties={},this.extent=n,this.type=0,this.id=null,this._pbf=t,this._geometry=-1,this._keys=i,this._values=r,this._geometryInfo=o,t.readFields(P,this,e)}loadGeometry(){const t=this._pbf;t.pos=this._geometry,M=t.readVarint()+t.pos,I=1,R=0,L=0,O=0,D=0;const e=[],n=[];for(;t.pos<M;)if(R<=0&&(B=t.readVarint(),I=7&B,R=B>>3),R--,1===I||2===I)L+=t.readSVarint(),O+=t.readSVarint(),1===I&&e.push(D),n.push(L,O),D+=2;else{if(7!==I)throw new Error(`unknown command ${I}`);if(D>0){const t=e[e.length-1];n.push(n[t],n[t+1]),D+=2}}return{data:n,indices:e}}_toBinaryCoordinates(t){const e=this.loadGeometry();let n;t(e.data,this);switch(this.type){case 1:this._geometryInfo.pointFeaturesCount++,this._geometryInfo.pointPositionsCount+=e.indices.length,n={type:"Point",...e};break;case 2:this._geometryInfo.lineFeaturesCount++,this._geometryInfo.linePathsCount+=e.indices.length,this._geometryInfo.linePositionsCount+=e.data.length/2,n={type:"LineString",...e};break;case 3:n=S(e),this._geometryInfo.polygonFeaturesCount++,this._geometryInfo.polygonObjectsCount+=n.indices.length;for(const t of n.indices)this._geometryInfo.polygonRingsCount+=t.length;this._geometryInfo.polygonPositionsCount+=n.data.length/2;break;default:throw new Error(`Invalid geometry type: ${this.type}`)}const i={type:"Feature",geometry:n,properties:this.properties};return null!==this.id&&(i.id=this.id),i}toBinaryCoordinates(t){if("function"===typeof t)return this._toBinaryCoordinates(t);const{x:e,y:n,z:i}=t,r=this.extent*Math.pow(2,i),o=this.extent*e,s=this.extent*n;return this._toBinaryCoordinates((t=>function(t,e,n,i){for(let r=0,o=t.length;r<o;r+=2){t[r]=360*(t[r]+e)/i-180;const o=180-360*(t[r+1]+n)/i;
2t[r+1]=360/Math.PI*Math.atan(Math.exp(o*Math.PI/180))-90}}(t,o,s,r)))}}class F{version;name;extent;length;_pbf;_keys;_values;_features;constructor(t,e){this.version=1,this.name="",this.extent=4096,this.length=0,this._pbf=t,this._keys=[],this._values=[],this._features=[],t.readFields(N,this,e),this.length=this._features.length}feature(t,e){if(t<0||t>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[t];const n=this._pbf.readVarint()+this._pbf.pos;return new k(this._pbf,n,this.extent,this._keys,this._values,e)}}function N(t,e,n){e&&n&&(15===t?e.version=n.readVarint():1===t?e.name=n.readString():5===t?e.extent=n.readVarint():2===t?e._features.push(n.pos):3===t?e._keys.push(n.readString()):4===t&&e._values.push(function(t){let e=null;const n=t.readVarint()+t.pos;for(;t.pos<n;){const n=t.readVarint()>>3;e=1===n?t.readString():2===n?t.readFloat():3===n?t.readDouble():4===n?t.readVarint64():5===n?t.readVarint():6===n?t.readSVarint():7===n?t.readBoolean():null}return e}(n)))}class z{layers;constructor(t,e){this.layers=t.readFields(U,{},e)}}function U(t,e,n){if(3===t&&n){const t=new F(n,n.readVarint()+n.pos);t.length&&e&&(e[t.name]=t)}}function G(t,e){const n=function(t){if(!t?.mvt)throw new Error("mvt options required");const e="wgs84"===t.mvt?.coordinates,{tileIndex:n}=t.mvt,i=n&&Number.isFinite(n.x)&&Number.isFinite(n.y)&&Number.isFinite(n.z);if(e&&!i)throw new Error("MVT Loader: WGS84 coordinates need tileIndex property");return t.mvt}(e),i=e?.gis?.format||e?.mvt?.shape||e?.shape;switch(i){case"columnar-table":return{shape:"columnar-table",data:V(t,n)};case"geojson-table":return{shape:"geojson-table",type:"FeatureCollection",features:j(t,n)};case"geojson":return j(t,n);case"binary-geometry":case"binary":return V(t,n);default:throw new Error(i||"undefined shape")}}function V(t,e){const[n,i]=function(t,e){const n=[],i={coordLength:2,pointPositionsCount:0,pointFeaturesCount:0,linePositionsCount:0,linePathsCount:0,lineFeaturesCount:0,polygonPositionsCount:0,polygonObjectsCount:0,polygonRingsCount:0,polygonFeaturesCount:0};if(t.byteLength<=0)return[n,i];const r=new z(new _(t)),o=e&&Array.isArray(e.layers)?e.layers:Object.keys(r.layers);return o.forEach((t=>{const o=r.layers[t];if(o)for(let r=0;r<o.length;r++){const s=W(o.feature(r,i),e,t);n.push(s)}})),[n,i]}(t,e),r=c(n,i);return r.byteLength=t.byteLength,r}function j(t,e){if(t.byteLength<=0)return[];const n=[],i=new C(new _(t));return(Array.isArray(e.layers)?e.layers:Object.keys(i.layers)).forEach((t=>{const r=i.layers[t];if(r)for(let i=0;i<r.length;i++){const o=H(r.feature(i),e,t);n.push(o)}})),n}function H(t,e,n){const i=t.toGeoJSON("wgs84"===e.coordinates?e.tileIndex:q);return e.layerProperty&&(i.properties[e.layerProperty]=n),i}function W(t,e,n){const i=t.toBinaryCoordinates("wgs84"===e.coordinates?e.tileIndex:Z);return e.layerProperty&&i.properties&&(i.properties[e.layerProperty]=n),i}function q(t,e){const{extent:n}=e;for(let i=0;i<t.length;i++){const e=t[i];e[0]/=n,e[1]/=n}}function Z(t,e){const{extent:n}=e;for(let i=0,r=t.length;i<r;++i)t[i]/=n}const X={dataType:null,batchType:null,name:"Mapbox Vector Tile",id:"mvt",module:"mvt",version:"4.2.4",extensions:["mvt","pbf"],mimeTypes:["application/vnd.mapbox-vector-tile","application/x-protobuf"],worker:!0,category:"geometry",options:{mvt:{shape:"geojson",coordinates:"local",layerProperty:"layerName",layers:void 0,tileIndex:null}}};var K=n(78547),Q=n(25195);const J={Point:Y,MultiPoint:function(t,e,n){return $(t,e,n)},LineString:tt,MultiLineString:function(t,e,n){return t.map((t=>tt(t,e,n)))},Polygon:et,MultiPolygon:function(t,e,n){return t.map((t=>et(t,e,n)))}};function Y(t,e,n){let[i,r]=t,[o,s]=e;const a=(0,Q.Cc)(o[0],s[0],i),l=(0,Q.Cc)(o[1],s[1],r);return n.unprojectFlat([a,l])}function $(t,e,n){return t.map((t=>Y(t,e,n)))}function tt(t,e,n){return $(t,e,n)}function et(t,e,n){return t.map((t=>$(t,e,n)))}const nt=["points","lines","polygons"];function it(t,e,n,i){const r=t.featureIds.value;if(!r.length)return-1;let o=0,s=r[r.length-1]+1;if(i){const e=function(t,e){if(!t.__layers){const e={},{properties:n}=t;
vendor: 23,088 bytes, line 2
2for(let t=0;t<n.length;t++){const{layerName:i}=n[t];i&&(e[i]?e[i][1]=t:e[i]=[t,t])}t.__layers=e}return t.__layers[e]}(t,i);if(!e)return-1;o=e[0],s=e[1]+1}let a=-1;if(e in t.numericProps){const i=t.numericProps[e].value.findIndex(((t,e)=>t===n&&r[e]>=o&&r[e]<s));return i>=0?t.globalFeatureIds.value[i]:-1}return e?a=rt(t.properties,(t=>t[e]===n),o,s):t.fields&&(a=rt(t.fields,(t=>t.id===n),o,s)),a>=0?function(t,e){if(!t.__ids){const e=[],n=t.featureIds.value,i=t.globalFeatureIds.value;for(let t=0;t<n.length;t++)e[n[t]]=i[t];t.__ids=e}return t.__ids[e]}(t,a):-1}function rt(t,e,n,i){for(let r=n;r<i;r++)if(e(t[r],r))return r;return-1}var ot=n(67099),st=n(50854);const at={...o.A.defaultProps,data:st.cS,onDataLoad:{type:"function",value:null,optional:!0,compare:!1},uniqueIdProperty:"",highlightedFeatureId:null,loaders:[X],binary:!0};class lt extends ot.A{initializeState(){super.initializeState();const t=void 0===this.context.viewport.resolution&&this.props.binary;this.setState({binary:t,data:null,tileJSON:null,hoveredFeatureId:null,hoveredFeatureLayerName:null})}get isLoaded(){return Boolean(this.state?.data&&super.isLoaded)}updateState(t){let{props:e,oldProps:n,context:i,changeFlags:r}=t;r.dataChanged&&this._updateTileData(),this.state?.data&&(super.updateState({props:e,oldProps:n,context:i,changeFlags:r}),this._setWGS84PropertyForTiles());const{highlightColor:o}=e;o!==n.highlightColor&&Array.isArray(o)&&this.setState({highlightColor:o})}async _updateTileData(){let t=this.props.data,e=null;if("string"!==typeof t||(0,st.Ar)(t))t&&"object"===typeof t&&"tilejson"in t&&(e=t);else{const{onDataLoad:i,fetch:r}=this.props;this.setState({data:null,tileJSON:null});try{e=await r(t,{propName:"data",layer:this,loaders:[]})}catch(n){this.raiseError(n,"loading TileJSON"),t=null}i&&i(e,{propName:"data",layer:this})}e&&(t=e.tiles),this.setState({data:t,tileJSON:e})}_getTilesetOptions(){const t=super._getTilesetOptions(),e=this.state.tileJSON,{minZoom:n,maxZoom:i}=this.props;return e&&(Number.isFinite(e.minzoom)&&e.minzoom>n&&(t.minZoom=e.minzoom),Number.isFinite(e.maxzoom)&&(!Number.isFinite(i)||e.maxzoom<i)&&(t.maxZoom=e.maxzoom)),t}renderLayers(){return this.state?.data?super.renderLayers():null}getTileData(t){const{data:e,binary:n}=this.state,{index:i,signal:r}=t,o=(0,st.g8)(e,t);if(!o)return Promise.reject("Invalid URL");let s=this.getLoadOptions();const{fetch:a}=this.props;return s={...s,mimeType:"application/x-protobuf",mvt:{...s?.mvt,coordinates:this.context.viewport.resolution?"wgs84":"local",tileIndex:i},gis:n?{format:"binary"}:{}},a(o,{propName:"data",layer:this,loadOptions:s,signal:r})}renderSubLayers(t){const{x:e,y:n,z:l}=t.tile.index,c=Math.pow(2,l),u=512/c,h=-u,d=512*e/c,p=512*(1-n/c),f=(new a.k).scale([u,h,1]);t.autoHighlight=!1,this.context.viewport.resolution||(t.modelMatrix=f,t.coordinateOrigin=[d,p,0],t.coordinateSystem=i.rf.CARTESIAN,t.extensions=[...t.extensions||[],new s.A]);const A=super.renderSubLayers(t);return!this.state.binary||A instanceof o.A||r.A.warn("renderSubLayers() must return GeoJsonLayer when using binary:true")(),A}_updateAutoHighlight(t){const{uniqueIdProperty:e}=this.props,{hoveredFeatureId:n,hoveredFeatureLayerName:i}=this.state,r=t.object;let o=null,s=null;r&&(o=ut(r,e),s=ht(r));let{highlightColor:a}=this.props;"function"===typeof a&&(a=a(t)),n===o&&i===s||this.setState({highlightColor:a,hoveredFeatureId:o,hoveredFeatureLayerName:s})}_isWGS84(){return Boolean(this.context.viewport.resolution)}getPickingInfo(t){const e=super.getPickingInfo(t);if(this.state.binary&&-1!==e.index){const{data:n}=t.sourceLayer.props;e.object=(0,K.K)(n,{globalFeatureId:e.index})}return e.object&&!this._isWGS84()&&(e.object=pt(e.object,e.tile.bbox,this.context.viewport)),e}getSubLayerPropsByTile(t){return{highlightedObjectIndex:this.getHighlightedObjectIndex(t),highlightColor:this.state.highlightColor}}getHighlightedObjectIndex(t){const{hoveredFeatureId:e,hoveredFeatureLayerName:n,binary:i}=this.state,{uniqueIdProperty:r,highlightedFeatureId:o}=this.props,s=t.content,a=dt(o);if(!(dt(e)||a))return-1;const l=a?o:e;return Array.isArray(s)?s.findIndex((t=>{const e=ut(t,r)===l,i=a||ht(t)===n;return e&&i})):s&&i?function(t,e,n,i){for(const r of nt){const o=t[r]&&it(t[r],e,n,i);if(o>=0)return o}return-1}(s,r,l,a?"":n):-1}_pickObjects(t){const{deck:e,viewport:n}=this.context,i=n.width,r=n.height,o=n.x,s=n.y,a=[this.id];return e.pickObjects({x:o,y:s,width:i,height:r,layerIds:a,maxObjects:t})}getRenderedFeatures(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;const e=this._pickObjects(t),n=new Set,i=[];for(const r of e){const t=ut(r.object,this.props.uniqueIdProperty);void 0===t?i.push(r.object):n.has(t)||(n.add(t),i.push(r.object))}return i}_setWGS84PropertyForTiles(){const t="dataInWGS84";this.state.tileset.selectedTiles.forEach((e=>{e.hasOwnProperty(t)||Object.defineProperty(e,t,{get:()=>{if(!e.content)return null;if(this.state.binary&&Array.isArray(e.content)&&!e.content.length)return[];const{bbox:t}=e;if(void 0===e._contentWGS84&&(0,st.NV)(t)){const n=this.state.binary?(0,K.K)(e.content):e.content;e._contentWGS84=n.map((e=>pt(e,t,this.context.viewport)))}return e._contentWGS84}})}))}}lt.layerName="MVTLayer",lt.defaultProps=at;const ct=lt;function ut(t,e){return t.properties&&e?t.properties[e]:"id"in t?t.id:void 0}function ht(t){return t.properties?.layerName||null}function dt(t){return void 0!==t&&null!==t&&""!==t}function pt(t,e,n){const i={...t,geometry:{type:t.geometry.type}};return Object.defineProperty(i.geometry,"coordinates",{get:()=>{const i=function(t,e,n){const i=[n.projectFlat([e.west,e.north]),n.projectFlat([e.east,e.south])];return{...t,coordinates:J[t.type](t.coordinates,i,n)}}(t.geometry,e,n);return i.coordinates}}),i}},34632:(t,e,n)=>{"use strict";n.d(e,{A:()=>l});var i=n(49793),r=n(68945);const o=512;function s(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;const[n,i]=function(t,e){let n=0,i=0,r=1<<t.length;const s=r/o;for(let o=0;o<t.length;o++){r>>=1;const e=parseInt(t[o]);e%2&&(n|=r),e>1&&(i|=r)}return[[n/s,o-i/s],[(n+e)/s,o-(i+e)/s]]}(t,e),[s,a]=(0,r.iV)(n),[l,c]=(0,r.iV)(i);return[l,a,l,c,s,c,s,a,l,a]}class a extends i.A{indexToBounds(){const{data:t,extruded:e,getQuadkey:n}=this.props,i=e?.99:1;return{data:t,_normalize:!1,positionFormat:"XY",getPolygon:(t,e)=>s(n(t,e),i),updateTriggers:{getPolygon:i}}}}a.layerName="QuadkeyLayer",a.defaultProps={getQuadkey:{type:"accessor",value:t=>t.quadkey}};const l=a},34895:(t,e,n)=>{"use strict";n.d(e,{A:()=>y});var i=n(49793),r=n(63573);const o=3,s=61,a=180/Math.PI;function l(t,e,n){const i=1<<e;return[(t[0]+n[0])/i,(t[1]+n[1])/i]}function c(t){return t>=.5?1/3*(4*t*t-1):1/3*(1-4*(1-t)*(1-t))}function u(t){return[c(t[0]),c(t[1])]}function h(t,e){let[n,i]=e;switch(t){case 0:return[1,n,i];case 1:return[-n,1,i];case 2:return[-n,-i,1];case 3:return[-1,-i,-n];case 4:return[i,-1,-n];case 5:return[i,n,-1];default:throw new Error("Invalid face")}}function d(t){let[e,n,i]=t;const r=Math.atan2(i,Math.sqrt(e*e+n*n));return[Math.atan2(n,e)*a,r*a]}function p(t,e,n,i){if(0===i){1===n&&(e[0]=t-1-e[0],e[1]=t-1-e[1]);const i=e[0];e[0]=e[1],e[1]=i}}const f=100;function A(t){if("string"===typeof t){if(t.indexOf("/")>0)return t;t=function(t){const e=t.padEnd(16,"0");return r.fromString(e,16)}(t)}return function(t){let e=r.fromString(t,!0,10).toString(2);for(;e.length<o+s;)e="0"+e;const n=e.lastIndexOf("1"),i=e.substring(0,3),a=e.substring(3,n),l=a.length/2,c=r.fromString(i,!0,2).toString(10);let u=r.fromString(a,!0,2).toString(4);for(;u.length<l;)u="0"+u;return`${c}/${u}`}(t.toString())}function g(t){return function(t){let{face:e,ij:n,level:i}=t;const r=[[0,0],[0,1],[1,1],[1,0],[0,0]],o=Math.max(1,Math.ceil(f*Math.pow(2,-i))),s=new Float64Array(4*o*2+2);let a=0,c=0;for(let p=0;p<4;p++){const t=r[p].slice(0),f=r[p+1],A=(f[0]-t[0])/o,g=(f[1]-t[1])/o;for(let r=0;r<o;r++){t[0]+=A,t[1]+=g;const r=d(h(e,u(l(n,i,t))));Math.abs(r[1])>89.999&&(r[0]=c);const o=r[0]-c;r[0]+=o>180?-360:o<-180?360:0,s[a++]=r[0],s[a++]=r[1],c=r[0]}}return s[a++]=s[0],s[a++]=s[1],s}(function(t){const e=t.split("/"),n=parseInt(e[0],10),i=e[1],r=i.length,o=[0,0];let s;for(let a=r-1;a>=0;a--){s=r-a;const t=i[a];let e=0,n=0;"1"===t?n=1:"2"===t?(e=1,n=1):"3"===t&&(e=1);const l=Math.pow(2,s-1);p(l,o,e,n),o[0]+=l*e,o[1]+=l*n}if(n%2===1){const t=o[0];o[0]=o[1],o[1]=t}return{face:n,ij:o,level:s}}(A(t)))}class m extends i.A{indexToBounds(){const{data:t,getS2Token:e}=this.props;return{data:t,_normalize:!1,positionFormat:"XY",getPolygon:(t,n)=>g(e(t,n))}}}m.layerName="S2Layer",m.defaultProps={getS2Token:{type:"accessor",value:t=>t.token}};const y=m},67099:(t,e,n)=>{"use strict";n.d(e,{A:()=>u});var i=n(89522),r=n(8729),o=n(94514),s=n(61299),a=n(50854);const l={TilesetClass:s.TL,data:{type:"data",value:[]},dataComparator:a.cS.equal,renderSubLayers:{type:"function",value:t=>new o.A(t)},getTileData:{type:"function",optional:!0,value:null},onViewportLoad:{type:"function",optional:!0,value:null},onTileLoad:{type:"function",value:t=>{}},onTileUnload:{type:"function",value:t=>{}},onTileError:{type:"function",value:t=>console.error(t)},extent:{type:"array",optional:!0,value:null,compare:!0},tileSize:512,maxZoom:null,minZoom:0,maxCacheSize:null,maxCacheByteSize:null,refinementStrategy:s.UK,zRange:null,maxRequests:6,debounceTime:0,zoomOffset:0};class c extends i.A{initializeState(){this.state={tileset:null,isLoaded:!1}}finalizeState(){this.state?.tileset?.finalize()}get isLoaded(){return Boolean(this.state?.tileset?.selectedTiles?.every((t=>t.isLoaded&&t.layers&&t.layers.every((t=>t.isLoaded)))))}shouldUpdateState(t){let{changeFlags:e}=t;return e.somethingChanged}updateState(t){let{changeFlags:e}=t,{tileset:n}=this.state;const i=e.propsOrDataChanged||e.updateTriggersChanged,r=e.dataChanged||e.updateTriggersChanged&&(e.updateTriggersChanged.all||e.updateTriggersChanged.getTileData);n?i&&(n.setOptions(this._getTilesetOptions()),r?n.reloadAll():n.tiles.forEach((t=>{t.layers=null}))):(n=new this.props.TilesetClass(this._getTilesetOptions()),this.setState({tileset:n})),this._updateTileset()}_getTilesetOptions(){const{tileSize:t,maxCacheSize:e,maxCacheByteSize:n,refinementStrategy:i,extent:r,maxZoom:o,minZoom:s,maxRequests:a,debounceTime:l,zoomOffset:c}=this.props;return{maxCacheSize:e,maxCacheByteSize:n,maxZoom:o,minZoom:s,tileSize:t,refinementStrategy:i,extent:r,maxRequests:a,debounceTime:l,zoomOffset:c,getTileData:this.getTileData.bind(this),onTileLoad:this._onTileLoad.bind(this),onTileError:this._onTileError.bind(this),onTileUnload:this._onTileUnload.bind(this)}}_updateTileset(){const t=this.state.tileset,{zRange:e,modelMatrix:n}=this.props,i=t.update(this.context.viewport,{zRange:e,modelMatrix:n}),{isLoaded:r}=t,o=this.state.isLoaded!==r,s=this.state.frameNumber!==i;r&&(o||s)&&this._onViewportLoad(),s&&this.setState({frameNumber:i}),this.state.isLoaded=r}_onViewportLoad(){const{tileset:t}=this.state,{onViewportLoad:e}=this.props;e&&e(t.selectedTiles)}_onTileLoad(t){this.props.onTileLoad(t),t.layers=null,this.setNeedsUpdate()}_onTileError(t,e){this.props.onTileError(t),e.layers=null,this.setNeedsUpdate()}_onTileUnload(t){this.props.onTileUnload(t)}getTileData(t){const{data:e,getTileData:n,fetch:i}=this.props,{signal:r}=t;return t.url="string"===typeof e||Array.isArray(e)?(0,a.g8)(e,t):null,n?n(t):i&&t.url?i(t.url,{propName:"data",layer:this,signal:r}):null}renderSubLayers(t){return this.props.renderSubLayers(t)}getSubLayerPropsByTile(t){return null}getPickingInfo(t){const e=t.sourceLayer,n=e.props.tile,i=t.info;return i.picked&&(i.tile=n),i.sourceTile=n,i.sourceTileSubLayer=e,i}_updateAutoHighlight(t){t.sourceTileSubLayer.updateAutoHighlight(t)}renderLayers(){return this.state.tileset.tiles.map((t=>{const e=this.getSubLayerPropsByTile(t);if(t.isLoaded||t.content)if(t.layers)e&&t.layers[0]&&Object.keys(e).some((n=>t.layers[0].props[n]!==e[n]))&&(t.layers=t.layers.map((t=>t.clone(e))));else{const n=this.renderSubLayers({...this.props,...this.getSubLayerProps({id:t.id,updateTriggers:this.props.updateTriggers}),data:t.content,_offset:0,tile:t});t.layers=(0,r.B)(n,Boolean).map((n=>n.clone({tile:t,...e})))}else;return t.layers}))}filterSubLayer(t){let{layer:e,cullRect:n}=t;const{tile:i}=e.props;return this.state.tileset.isTileVisible(i,n)}}c.defaultProps=l,c.layerName="TileLayer";const u=c},24101:(t,e,n)=>{"use strict";n.d(e,{I:()=>i});class i{constructor(t){this.index=t,this.isVisible=!1,this.isSelected=!1,this.parent=null,this.children=[],this.content=null,this._loader=void 0,this._abortController=null,this._loaderId=0,this._isLoaded=!1,this._isCancelled=!1,this._needsReload=!1}get bbox(){return this._bbox}set bbox(t){this._bbox||(this._bbox=t,this.boundingBox="west"in t?[[t.west,t.south],[t.east,t.north]]:[[t.left,t.top],[t.right,t.bottom]])}get data(){return this.isLoading&&this._loader?this._loader.then((()=>this.data)):this.content}get isLoaded(){return this._isLoaded&&!this._needsReload}get isLoading(){return Boolean(this._loader)&&!this._isCancelled}get needsReload(){return this._needsReload||this._isCancelled}get byteLength(){const t=this.content?this.content.byteLength:0;return Number.isFinite(t)||console.error("byteLength not defined in tile data"),t}async _loadData(t){let{getData:e,requestScheduler:n,onLoad:i,onError:r}=t;const{index:o,id:s,bbox:a,userData:l,zoom:c}=this,u=this._loaderId;this._abortController=new AbortController;const{signal:h}=this._abortController,d=await n.scheduleRequest(this,(t=>t.isSelected?1:-1));if(!d)return void(this._isCancelled=!0);if(this._isCancelled)return void d.done();let p,f=null;try{f=await e({index:o,id:s,bbox:a,userData:l,zoom:c,signal:h})}catch(A){p=A||!0}finally{d.done()}u===this._loaderId&&(this._loader=void 0,this.content=f,!this._isCancelled||f?(this._isLoaded=!0,this._isCancelled=!1,p?r(p,this):i(this)):this._isLoaded=!1)}loadData(t){return this._isLoaded=!1,this._isCancelled=!1,this._needsReload=!1,this._loaderId++,this._loader=this._loadData(t),this._loader}setNeedsReload(){this.isLoading&&(this.abort(),this._loader=void 0),this._needsReload=!0}abort(){this.isLoaded||(this._isCancelled=!0,this._abortController?.abort())}}},61299:(t,e,n)=>{"use strict";n.d(e,{UK:()=>d,TL:()=>A});var i=n(50297),r=n(33128),o=n(25195),s=n(24101),a=n(50854);function l(t,e){if(t===e)return!0;if(Array.isArray(t)){const n=t.length;if(!e||e.length!==n)return!1;for(let i=0;i<n;i++)if(t[i]!==e[i])return!1;return!0}return!1}const c=2,u="never",h="no-overlap",d="best-available",p={[d]:function(t){for(const e of t)e.state=0;for(const e of t)e.isSelected&&!g(e)&&m(e);for(const e of t)e.isVisible=Boolean(e.state&c)},[h]:function(t){for(const n of t)n.state=0;for(const n of t)n.isSelected&&g(n);const e=Array.from(t).sort(((t,e)=>t.zoom-e.zoom));for(const n of e)if(n.isVisible=Boolean(n.state&c),n.children&&(n.isVisible||1&n.state))for(const t of n.children)t.state=1;else n.isSelected&&m(n)},[u]:()=>{}},f={extent:null,tileSize:512,maxZoom:null,minZoom:null,maxCacheSize:null,maxCacheByteSize:null,refinementStrategy:"best-available",zRange:null,maxRequests:6,debounceTime:0,zoomOffset:0,onTileLoad:()=>{},onTileUnload:()=>{},onTileError:()=>{}};class A{constructor(t){this._getCullBounds=function(t){let e,n={};return i=>{for(const r in i)if(!l(i[r],n[r])){e=t(i),n=i;break}return e}}(a.ws),this.opts={...f,...t},this.setOptions(this.opts),this.onTileLoad=t=>{this.opts.onTileLoad?.(t),null!=this.opts.maxCacheByteSize&&(this._cacheByteSize+=t.byteLength,this._resizeCache())},this._requestScheduler=new i.A({throttleRequests:this.opts.maxRequests>0||this.opts.debounceTime>0,maxRequests:this.opts.maxRequests,debounceTime:this.opts.debounceTime}),this._cache=new Map,this._tiles=[],this._dirty=!1,this._cacheByteSize=0,this._viewport=null,this._zRange=null,this._selectedTiles=null,this._frameNumber=0,this._modelMatrix=new r.k,this._modelMatrixInverse=new r.k}get tiles(){return this._tiles}get selectedTiles(){return this._selectedTiles}get isLoaded(){return null!==this._selectedTiles&&this._selectedTiles.every((t=>t.isLoaded))}get needsReload(){return null!==this._selectedTiles&&this._selectedTiles.some((t=>t.needsReload))}setOptions(t){Object.assign(this.opts,t),Number.isFinite(t.maxZoom)&&(this._maxZoom=Math.floor(t.maxZoom)),Number.isFinite(t.minZoom)&&(this._minZoom=Math.ceil(t.minZoom))}finalize(){for(const t of this._cache.values())t.isLoading&&t.abort();this._cache.clear(),this._tiles=[],this._selectedTiles=null}reloadAll(){for(const t of this._cache.keys()){const e=this._cache.get(t);this._selectedTiles&&this._selectedTiles.includes(e)?e.setNeedsReload():this._cache.delete(t)}}update(t){let{zRange:e,modelMatrix:n}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{zRange:null,modelMatrix:null};const i=n?new r.k(n):new r.k,s=!i.equals(this._modelMatrix);if(this._viewport&&t.equals(this._viewport)&&(0,o.aI)(this._zRange,e)&&!s)this.needsReload&&(this._selectedTiles=this._selectedTiles.map((t=>this._getTile(t.index,!0))));else{s&&(this._modelMatrixInverse=i.clone().invert(),this._modelMatrix=i),this._viewport=t,this._zRange=e;const n=this.getTileIndices({viewport:t,maxZoom:this._maxZoom,minZoom:this._minZoom,zRange:e,modelMatrix:this._modelMatrix,modelMatrixInverse:this._modelMatrixInverse});this._selectedTiles=n.map((t=>this._getTile(t,!0))),this._dirty&&this._rebuildTree()}const a=this.updateTileStates();return this._pruneRequests(),this._dirty&&this._resizeCache(),a&&this._frameNumber++,this._frameNumber}isTileVisible(t,e){if(!t.isVisible)return!1;if(e&&this._viewport){const n=this._getCullBounds({viewport:this._viewport,z:this._zRange,cullRect:e}),{bbox:i}=t;for(const[t,e,r,o]of n){let n;if("west"in i)n=i.west<r&&i.east>t&&i.south<o&&i.north>e;else{const s=Math.min(i.top,i.bottom),a=Math.max(i.top,i.bottom);n=i.left<r&&i.right>t&&s<o&&a>e}if(n)return!0}return!1}return!0}getTileIndices(t){let{viewport:e,maxZoom:n,minZoom:i,zRange:r,modelMatrix:o,modelMatrixInverse:s}=t;const{tileSize:l,extent:c,zoomOffset:u}=this.opts;return(0,a.Om)({viewport:e,maxZoom:n,minZoom:i,zRange:r,tileSize:l,extent:c,modelMatrix:o,modelMatrixInverse:s,zoomOffset:u})}getTileId(t){return`${t.x}-${t.y}-${t.z}`}getTileZoom(t){return t.z}getTileMetadata(t){const{tileSize:e}=this.opts;return{bbox:(0,a.bR)(this._viewport,t.x,t.y,t.z,e)}}getParentIndex(t){return{x:Math.floor(t.x/2),y:Math.floor(t.y/2),z:t.z-1}}updateTileStates(){const t=this.opts.refinementStrategy||d,e=new Array(this._cache.size);let n=0;for(const i of this._cache.values())e[n++]=i.isVisible,i.isSelected=!1,i.isVisible=!1;for(const i of this._selectedTiles)i.isSelected=!0,i.isVisible=!0;("function"===typeof t?t:p[t])(Array.from(this._cache.values())),n=0;for(const i of this._cache.values())if(e[n++]!==i.isVisible)return!0;return!1}_pruneRequests(){const{maxRequests:t=0}=this.opts,e=[];let n=0;for(const i of this._cache.values())i.isLoading&&(n++,i.isSelected||i.isVisible||e.push(i));for(;t>0&&n>t&&e.length>0;){e.shift().abort(),n--}}_rebuildTree(){const{_cache:t}=this;for(const e of t.values())e.parent=null,e.children&&(e.children.length=0);for(const e of t.values()){const t=this._getNearestAncestor(e);e.parent=t,t?.children&&t.children.push(e)}}_resizeCache(){const{_cache:t,opts:e}=this,n=e.maxCacheSize??(null!=e.maxCacheByteSize?1/0:5*this.selectedTiles.length),i=e.maxCacheByteSize??1/0;if(t.size>n||this._cacheByteSize>i){for(const[r,o]of t)if(o.isVisible||o.isSelected||(this._cacheByteSize-=null!=e.maxCacheByteSize?o.byteLength:0,t.delete(r),this.opts.onTileUnload?.(o)),t.size<=n&&this._cacheByteSize<=i)break;this._rebuildTree(),this._dirty=!0}this._dirty&&(this._tiles=Array.from(this._cache.values()).sort(((t,e)=>t.zoom-e.zoom)),this._dirty=!1)}_getTile(t,e){const n=this.getTileId(t);let i=this._cache.get(n),r=!1;return!i&&e?(i=new s.I(t),Object.assign(i,this.getTileMetadata(i.index)),Object.assign(i,{id:n,zoom:this.getTileZoom(i.index)}),r=!0,this._cache.set(n,i),this._dirty=!0):i&&i.needsReload&&(r=!0),i&&r&&i.loadData({getData:this.opts.getTileData,requestScheduler:this._requestScheduler,onLoad:this.onTileLoad,onError:this.opts.onTileError}),i}_getNearestAncestor(t){const{_minZoom:e=0}=this;let n=t.index;for(;this.getTileZoom(n)>e;){n=this.getParentIndex(n);const t=this._getTile(n);if(t)return t}return null}}function g(t){let e=t;for(;e;){if(e.isLoaded||e.content)return e.state|=c,!0;e=e.parent}return!1}function m(t){for(const e of t.children)e.isLoaded||e.content?e.state|=c:m(e)}},50854:(t,e,n)=>{"use strict";n.d(e,{ws:()=>M,Om:()=>k,g8:()=>P,NV:()=>N,Ar:()=>F,uY:()=>R,bR:()=>O,cS:()=>T});var i=n(33128),r=n(5279),o=n(4896),s=n(98953),a=n(7964);const l=Math.PI/180,c=180/Math.PI,u=6370972,h=256;function d(){const t=4018225162502676e-20,e=Math.PI/180*h;return{unitsPerMeter:[t,t,t],unitsPerMeter2:[0,0,0],metersPerUnit:[24886.609375,24886.609375,24886.609375],unitsPerDegree:[e,e,t],unitsPerDegree2:[0,0,0],degreesPerUnit:[1/e,1/e,24886.609375]}}class p extends r.A{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{latitude:e=0,longitude:n=0,zoom:r=0,nearZMultiplier:o=.1,farZMultiplier:s=2,resolution:a=10}=t;let{height:c,altitude:u=1.5}=t;c=c||1,u=Math.max(.75,u);const h=(new i.k).lookAt({eye:[0,-u,0],up:[0,0,1]}),p=Math.pow(2,r);h.rotateX(e*l),h.rotateZ(-n*l),h.scale(p/c);const f=Math.atan(.5/u),A=512*p/c;super({...t,height:c,viewMatrix:h,longitude:n,latitude:e,zoom:r,distanceScales:d(),fovyRadians:2*f,focalDistance:u,near:o,far:Math.min(2,1/A+1)*u*s}),this.latitude=e,this.longitude=n,this.resolution=a}get projectionMode(){return o.Kx.GLOBE}getDistanceScales(){return this.distanceScales}getBounds(){const t={targetZ:(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).z||0},e=this.unproject([0,this.height/2],t),n=this.unproject([this.width/2,0],t),i=this.unproject([this.width,this.height/2],t),r=this.unproject([this.width/2,this.height],t);return i[0]<this.longitude&&(i[0]+=360),e[0]>this.longitude&&(e[0]-=360),[Math.min(e[0],i[0],n[0],r[0]),Math.min(e[1],i[1],n[1],r[1]),Math.max(e[0],i[0],n[0],r[0]),Math.max(e[1],i[1],n[1],r[1])]}unproject(t){let{topLeft:e=!0,targetZ:n}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const[i,r,o]=t,a=e?r:this.height-r,{pixelUnprojectionMatrix:l}=this;let c;if(Number.isFinite(o))c=f(l,[i,a,o,1]);else{const t=f(l,[i,a,-1,1]),e=f(l,[i,a,1,1]),r=((n||0)/u+1)*h,o=s.uE(s.jb([],t,e)),d=s.uE(t),p=s.uE(e),A=4*((4*d*p-(o-d-p)**2)/16)/o,g=(Math.sqrt(d-A)-Math.sqrt(Math.max(0,r*r-A)))/Math.sqrt(o);c=s.Cc([],t,e,g)}const[d,p,A]=this.unprojectPosition(c);return Number.isFinite(o)?[d,p,A]:Number.isFinite(n)?[d,p,n]:[d,p]}projectPosition(t){const[e,n,i=0]=t,r=e*l,o=n*l,s=Math.cos(o),a=(i/u+1)*h;return[Math.sin(r)*s*a,-Math.cos(r)*s*a,Math.sin(o)*a]}unprojectPosition(t){const[e,n,i]=t,r=s.Il(t),o=Math.asin(i/r);return[Math.atan2(e,-n)*c,o*c,(r/h-1)*u]}projectFlat(t){return t}unprojectFlat(t){return t}panByPosition(t,e){const n=this.unproject(e);return{longitude:t[0]-n[0]+this.longitude,latitude:t[1]-n[1]+this.latitude}}}function f(t,e){const n=a.Z0([],e,t);return a.hs(n,n,1/n[3]),n}var A=n(2816),g=n(820),m=n(68945
vendor: 5,514 bytes, line 2
2);const y=512,_=3,v=[[.5,.5],[0,0],[0,1],[1,0],[1,1]],b=v.concat([[0,.5],[.5,0],[1,.5],[.5,1]]),x=b.concat([[.25,.5],[.75,.5]]);class w{constructor(t,e,n){this.x=t,this.y=e,this.z=n}get children(){if(!this._children){const t=2*this.x,e=2*this.y,n=this.z+1;this._children=[new w(t,e,n),new w(t,e+1,n),new w(t+1,e,n),new w(t+1,e+1,n)]}return this._children}update(t){const{viewport:e,cullingVolume:n,elevationBounds:i,minZ:r,maxZ:o,bounds:s,offset:a,project:l}=t,c=this.getBoundingVolume(i,a,l);if(s&&!this.insideBounds(s))return!1;if(n.computeVisibility(c)<0)return!1;if(!this.childVisible){let{z:t}=this;if(t<o&&t>=r){const n=c.distanceTo(e.cameraPosition)*e.scale/e.height;t+=Math.floor(Math.log2(n))}if(t>=o)return this.selected=!0,!0}this.selected=!1,this.childVisible=!0;for(const u of this.children)u.update(t);return!0}getSelected(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];if(this.selected&&t.push(this),this._children)for(const e of this._children)e.getSelected(t);return t}insideBounds(t){let[e,n,i,r]=t;const o=Math.pow(2,this.z),s=y/o;return this.x*s<i&&this.y*s<r&&(this.x+1)*s>e&&(this.y+1)*s>n}getBoundingVolume(t,e,n){if(n){const e=this.z<1?x:this.z<2?b:v,i=[];for(const r of e){const e=R(this.x+r[0],this.y+r[1],this.z);e[2]=t[0],i.push(n(e)),t[0]!==t[1]&&(e[2]=t[1],i.push(n(e)))}return(0,g.ZZ)(i)}const i=Math.pow(2,this.z),r=y/i,o=this.x*r+e*y,s=y-(this.y+1)*r;return new g.dO([o,s,t[0]],[o+r,s+r,t[1]])}}const E=512,C=[-1/0,-1/0,1/0,1/0],T={type:"object",value:null,validate:(t,e)=>e.optional&&null===t||"string"===typeof t||Array.isArray(t)&&t.every((t=>"string"===typeof t)),equal:(t,e)=>{if(t===e)return!0;if(!Array.isArray(t)||!Array.isArray(e))return!1;const n=t.length;if(n!==e.length)return!1;for(let i=0;i<n;i++)if(t[i]!==e[i])return!1;return!0}};function S(t,e){const n=[e.transformAsPoint([t[0],t[1]]),e.transformAsPoint([t[2],t[1]]),e.transformAsPoint([t[0],t[3]]),e.transformAsPoint([t[2],t[3]])];return[Math.min(...n.map((t=>t[0]))),Math.min(...n.map((t=>t[1]))),Math.max(...n.map((t=>t[0]))),Math.max(...n.map((t=>t[1])))]}function P(t,e){if(!t||!t.length)return null;const{index:n,id:i}=e;if(Array.isArray(t)){t=t[(r=i,Math.abs(r.split("").reduce(((t,e)=>(t<<5)-t+e.charCodeAt(0)|0),0))%t.length)]}var r;let o=t;for(const s of Object.keys(n)){const t=new RegExp(`{${s}}`,"g");o=o.replace(t,String(n[s]))}return Number.isInteger(n.y)&&Number.isInteger(n.z)&&(o=o.replace(/\{-y\}/g,String(Math.pow(2,n.z)-n.y-1))),o}function M(t){let{viewport:e,z:n,cullRect:i}=t;return(e.subViewports||[e]).map((t=>I(t,n||0,i)))}function I(t,e,n){if(!Array.isArray(e)){const i=n.x-t.x,r=n.y-t.y,{width:o,height:s}=n,a={targetZ:e},l=t.unproject([i,r],a),c=t.unproject([i+o,r],a),u=t.unproject([i,r+s],a),h=t.unproject([i+o,r+s],a);return[Math.min(l[0],c[0],u[0],h[0]),Math.min(l[1],c[1],u[1],h[1]),Math.max(l[0],c[0],u[0],h[0]),Math.max(l[1],c[1],u[1],h[1])]}const i=I(t,e[0],n),r=I(t,e[1],n);return[Math.min(i[0],r[0]),Math.min(i[1],r[1]),Math.max(i[2],r[2]),Math.max(i[3],r[3])]}function B(t,e){return Math.pow(2,t)*E/e}function R(t,e,n){const i=B(n,E),r=t/i*360-180,o=Math.PI-2*Math.PI*e/i;return[r,180/Math.PI*Math.atan(.5*(Math.exp(o)-Math.exp(-o)))]}function L(t,e,n,i){const r=B(n,i);return[t/r*E,e/r*E]}function O(t,e,n,i){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:E;if(t.isGeospatial){const[t,r]=R(e,n,i),[o,s]=R(e+1,n+1,i);return{west:t,north:r,east:o,south:s}}const[o,s]=L(e,n,i,r),[a,l]=L(e+1,n+1,i,r);return{left:o,top:s,right:a,bottom:l}}function D(t,e,n,i,r){const o=function(t,e,n){let i;if(e&&2===e.length){const[n,r]=e,o=t.getBounds({z:n}),s=t.getBounds({z:r});i=[Math.min(o[0],s[0]),Math.min(o[1],s[1]),Math.max(o[2],s[2]),Math.max(o[3],s[3])]}else i=t.getBounds();return t.isGeospatial?[Math.max(i[0],n[0]),Math.max(i[1],n[1]),Math.min(i[2],n[2]),Math.min(i[3],n[3])]:[Math.max(Math.min(i[0],n[2]),n[0]),Math.max(Math.min(i[1],n[3]),n[1]),Math.min(Math.max(i[2],n[0]),n[2]),Math.min(Math.max(i[3],n[1]),n[3])]}(t,null,i),s=B(e,n),[a,l,c,u]=function(t,e,n){if(n)return S(t,n).map((t=>t*e/E));return t.map((t=>t*e/E))}(o,s,r),h=[];for(let d=Math.floor(a);d<c;d++)for(let t=Math.floor(l);t<u;t++)h.push({x:d,y:t,z:e});return h}function k(t){let{viewport:e,maxZoom:n,minZoom:i,zRange:r,extent:o,tileSize:s=E,modelMatrix:a,modelMatrixInverse:l,zoomOffset:c=0}=t,u=e.isGeospatial?Math.round(e.zoom+Math.log2(E/s))+c:Math.ceil(e.zoom)+c;if("number"===typeof i&&Number.isFinite(i)&&u<i){if(!o)return[];u=i}"number"===typeof n&&Number.isFinite(n)&&u>n&&(u=n);let h=o;return a&&l&&o&&!e.isGeospatial&&(h=S(o,a)),e.isGeospatial?function(t,e,n,i){const r=t instanceof p&&t.resolution?t.projectPosition:null,o=Object.values(t.getFrustumPlanes()).map((t=>{let{normal:e,distance:n}=t;return new g.Zc(e.clone().negate(),n)})),s=new g.R2(o),a=t.distanceScales.unitsPerMeter[2],l=n&&n[0]*a||0,c=n&&n[1]*a||0,u=t instanceof A.A&&t.pitch<=60?e:0;if(i){const[t,e,n,r]=i,o=(0,m.Gw)([t,r]),s=(0,m.Gw)([n,e]);i=[o[0],y-o[1],s[0],y-s[1]]}const h=new w(0,0,0),d={viewport:t,project:r,cullingVolume:s,elevationBounds:[l,c],minZ:u,maxZ:e,bounds:i,offset:0};if(h.update(d),t instanceof A.A&&t.subViewports&&t.subViewports.length>1){for(d.offset=-1;h.update(d)&&!(--d.offset<-_););for(d.offset=1;h.update(d)&&!(++d.offset>_););}return h.getSelected()}(e,u,r,o):D(e,u,s,h||C,l)}function F(t){return/(?=.*{z})(?=.*{x})(?=.*({y}|{-y}))/.test(t)}function N(t){return Number.isFinite(t.west)&&Number.isFinite(t.north)&&Number.isFinite(t.east)&&Number.isFinite(t.south)}},
vendor: 6,725 bytes, line 2
277277:(t,e,n)=>{"use strict";n.d(e,{A:()=>o});var i=n(97091);class r extends i.A{getShaders(){const t=super.getShaders();return t.inject={"vs:#decl":"uniform float trailLength;\nin float instanceTimestamps;\nin float instanceNextTimestamps;\nout float vTime;\n","vs:#main-end":"vTime = instanceTimestamps + (instanceNextTimestamps - instanceTimestamps) * vPathPosition.y / vPathLength;\n","fs:#decl":"uniform bool fadeTrail;\nuniform float trailLength;\nuniform float currentTime;\nin float vTime;\n","fs:#main-start":"if(vTime > currentTime || (fadeTrail && (vTime < currentTime - trailLength))) {\n discard;\n}\n","fs:DECKGL_FILTER_COLOR":"if(fadeTrail) {\n color.a *= 1.0 - (currentTime - vTime) / trailLength;\n}\n"},t}initializeState(){super.initializeState();this.getAttributeManager().addInstanced({timestamps:{size:1,accessor:"getTimestamps",shaderAttributes:{instanceTimestamps:{vertexOffset:0},instanceNextTimestamps:{vertexOffset:1}}}})}draw(t){const{fadeTrail:e,trailLength:n,currentTime:i}=this.props;t.uniforms={...t.uniforms,fadeTrail:e,trailLength:n,currentTime:i},super.draw(t)}}r.layerName="TripsLayer",r.defaultProps={fadeTrail:!0,trailLength:{type:"number",value:120,min:0},currentTime:{type:"number",value:0,min:0},getTimestamps:{type:"accessor",value:t=>t.timestamps}};const o=r},54340:(t,e,n)=>{"use strict";function i(t){if(!t)throw new Error(`JSON conversion error ${arguments.length>1&&void 0!==arguments[1]?arguments[1]:""}`)}function r(t,e){const n=function(t){if("string"===typeof t){let e=s[t];return e||(e=t.split("."),s[t]=e),e}return Array.isArray(t)?t:[t]}(e);let i=t;for(const r of n)i=o(i)?i[r]:void 0;return i}function o(t){return null!==t&&"object"===typeof t}n.d(e,{A:()=>C});const s={};var a=n(1386);const l={"||":(t,e)=>t||e,"&&":(t,e)=>t&&e,"|":(t,e)=>t|e,"^":(t,e)=>t^e,"&":(t,e)=>t&e,"==":(t,e)=>t==e,"!=":(t,e)=>t!=e,"===":(t,e)=>t===e,"!==":(t,e)=>t!==e,"<":(t,e)=>t<e,">":(t,e)=>t>e,"<=":(t,e)=>t<=e,">=":(t,e)=>t>=e,"<<":(t,e)=>t<<e,">>":(t,e)=>t>>e,">>>":(t,e)=>t>>>e,"+":(t,e)=>t+e,"-":(t,e)=>t-e,"*":(t,e)=>t*e,"/":(t,e)=>t/e,"%":(t,e)=>t%e},c={"-":t=>-t,"+":t=>+t,"~":t=>~t,"!":t=>!t};function u(t,e){return t.map((function(t){return d(t,e)}))}function h(t,e){const n=d(t.object,e);let i;if(i=t.computed?d(t.property,e):t.property.name,/^__proto__|prototype|constructor$/.test(i))throw Error(`Access to member "${i}" disallowed.`);return[n,n[i]]}function d(t,e){const n=t;switch(n.type){case"ArrayExpression":return u(n.elements,e);case"BinaryExpression":return l[n.operator](d(n.left,e),d(n.right,e));case"CallExpression":let t,i,r;if("MemberExpression"===n.callee.type?(r=h(n.callee,e),t=r[0],i=r[1]):i=d(n.callee,e),"function"!==typeof i)return;return i.apply(t,u(n.arguments,e));case"ConditionalExpression":return d(n.test,e)?d(n.consequent,e):d(n.alternate,e);case"Identifier":return e[n.name];case"Literal":return n.value;case"LogicalExpression":return"||"===n.operator?d(n.left,e)||d(n.right,e):"&&"===n.operator?d(n.left,e)&&d(n.right,e):l[n.operator](d(n.left,e),d(n.right,e));case"MemberExpression":return h(n,e)[1];case"ThisExpression":return e;case"UnaryExpression":return c[n.operator](d(n.argument,e));default:return}}const p={"-":t=>t};function f(t,e){if(t in p)return p[t];let n;const i=a(t);return"Identifier"===i.type?n=e=>r(e,t):(A(i,(t=>{if("CallExpression"===t.type)throw new Error("Function calls not allowed in JSON expressions")})),n=t=>d(i,t)),p[t]=n,n}function A(t,e){if(Array.isArray(t))t.forEach((t=>A(t,e)));else if(t&&"object"===typeof t){t.type&&e(t);for(const n in t)A(t[n],e)}}const g="@@=",m="@@#",y="@@function",_=t=>t&&"object"===typeof t;class v{constructor(){this.typeKey="@@type",this.functionKey=y,this.log=console,this.classes={},this.reactComponents={},this.enumerations={},this.constants={},this.functions={},this.React=null,this.convertFunction=f,this.preProcessClassProps=(t,e)=>e,this.postProcessConvertedJson=t=>t;for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];for(const i of e)this.merge(i)}merge(t){for(const e in t)switch(e){case"layers":case"views":Object.assign(this.classes,t[e]);break;default:if(e in this){const n=t[e];this[e]=_(this[e])?Object.assign(this[e],n):n}}}validate(t){return i(!this.typeKey||"string"===typeof this.typeKey),i(_(this.classes)),!0}}function b(t){return t.replace(g,"")}function x(t,e){const n={};for(const r in t){let e=t[r];"string"===typeof(i=e)&&i.startsWith(g)&&(e=b(e),e=f(e)),n[r]=e}var i;return n}function w(t,e,n){const i=n.classes[t],r=n.reactComponents[t];if(!i&&!r){const{log:i}=n;if(i){const n=JSON.stringify(e,null,0).slice(0,40);i.warn(`JSON converter: No registered class of type ${t}(${n}...) `)}return null}return i?function(t,e,n){n.preProcessClassProps&&(e=n.preProcessClassProps(t,e,n));return e=x(e),new t(e)}(i,e,n):function(t,e,n){const{React:i}=n,{children:r=[]}=e;delete e.children,n.preProcessClassProps&&(e=n.preProcessClassProps(t,e,n));return e=x(e),i.createElement(t,e,r)}(r,e,n)}const E=t=>t&&"object"===typeof t;class C{constructor(t){this.log=console,this.onJSONChange=()=>{},this.json=null,this.convertedJson=null,this.setProps(t)}finalize(){}setProps(t){"configuration"in t&&(this.configuration=t.configuration instanceof v?t.configuration:new v(t.configuration)),"onJSONChange"in t&&(this.onJSONChange=t.onJSONChange)}mergeConfiguration(t){this.configuration.merge(t)}convert(t){if(!t||t===this.json)return this.convertedJson;this.json=t;const e=function(t){return"string"===typeof t?JSON.parse(t):t}(t);let n=function(t,e){return e=new v(e),T(t,"",e)}(e,this.configuration);return n=this.configuration.postProcessConvertedJson(n),this.convertedJson=n,n}convertJson(t){return this.convert(t)}}function T(t,e,n){return Array.isArray(t)?t.map(((t,e)=>T(t,String(e),n))):function(t,e){const{typeKey:n}=e,i=E(t)&&Boolean(t[n]);return i}(t,n)?function(t,e){const{typeKey:n}=e,i=t[n];let r={...t};return delete r[n],r=S(r,e),w(i,r,e)}(t,n):E(t)?y in t?function(t,e){const{functionKey:n}=e,i=t[n];let r={...t};return delete r[n],r=S(r,e),function(t,e,n){const i=n.functions[t];if(!i){const{log:i}=n;if(i){const n=JSON.stringify(e,null,0).slice(0,40);i.warn(`JSON converter: No registered function ${t}(${n}...) `)}return null}return i(e)}(i,r,e)}(t,n):S(t,n):"string"===typeof t?function(t,e,n){if(t.startsWith(g)&&n.convertFunction)return t=t.replace(g,""),n.convertFunction(t,n);if(t.startsWith(m)){if(t=t.replace(m,""),n.constants[t])return n.constants[t];const[e,i]=t.split(".");return n.enumerations[e][i]}return t}(t,0,n):t}function S(t,e){i(E(t));const n={};for(const i in t){const r=t[i];n[i]=T(r,0,e)}return n}},39017:(t,e,n)=>{"use strict";n.d(e,{A:()=>d});var i=n(14939),r=n(57941),o=n(22108),s=n(4896),a=n(83647),l=n(30141
vendor: 10,020 bytes, line 2
2);const c=[0,0,0,255],u={getSourcePosition:{type:"accessor",value:t=>t.sourcePosition},getTargetPosition:{type:"accessor",value:t=>t.targetPosition},getSourceColor:{type:"accessor",value:c},getTargetColor:{type:"accessor",value:c},getWidth:{type:"accessor",value:1},getHeight:{type:"accessor",value:1},getTilt:{type:"accessor",value:0},greatCircle:!1,numSegments:{type:"number",value:50,min:1},widthUnits:"pixels",widthScale:{type:"number",value:1,min:0},widthMinPixels:{type:"number",value:0,min:0},widthMaxPixels:{type:"number",value:Number.MAX_SAFE_INTEGER,min:0}};class h extends i.A{getBounds(){return this.getAttributeManager()?.getBounds(["instanceSourcePositions","instanceTargetPositions"])}getShaders(){return super.getShaders({vs:"#version 300 es\n#define SHADER_NAME arc-layer-vertex-shader\nin vec3 positions;\nin vec4 instanceSourceColors;\nin vec4 instanceTargetColors;\nin vec3 instanceSourcePositions;\nin vec3 instanceSourcePositions64Low;\nin vec3 instanceTargetPositions;\nin vec3 instanceTargetPositions64Low;\nin vec3 instancePickingColors;\nin float instanceWidths;\nin float instanceHeights;\nin float instanceTilts;\nuniform bool greatCircle;\nuniform bool useShortestPath;\nuniform float numSegments;\nuniform float opacity;\nuniform float widthScale;\nuniform float widthMinPixels;\nuniform float widthMaxPixels;\nuniform int widthUnits;\nout vec4 vColor;\nout vec2 uv;\nout float isValid;\nfloat paraboloid(float distance, float sourceZ, float targetZ, float ratio) {\nfloat deltaZ = targetZ - sourceZ;\nfloat dh = distance * instanceHeights;\nif (dh == 0.0) {\nreturn sourceZ + deltaZ * ratio;\n}\nfloat unitZ = deltaZ / dh;\nfloat p2 = unitZ * unitZ + 1.0;\nfloat dir = step(deltaZ, 0.0);\nfloat z0 = mix(sourceZ, targetZ, dir);\nfloat r = mix(ratio, 1.0 - ratio, dir);\nreturn sqrt(r * (p2 - r)) * dh + z0;\n}\nvec2 getExtrusionOffset(vec2 line_clipspace, float offset_direction, float width) {\nvec2 dir_screenspace = normalize(line_clipspace * project_uViewportSize);\ndir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);\nreturn dir_screenspace * offset_direction * width / 2.0;\n}\nfloat getSegmentRatio(float index) {\nreturn smoothstep(0.0, 1.0, index / (numSegments - 1.0));\n}\nvec3 interpolateFlat(vec3 source, vec3 target, float segmentRatio) {\nfloat distance = length(source.xy - target.xy);\nfloat z = paraboloid(distance, source.z, target.z, segmentRatio);\nfloat tiltAngle = radians(instanceTilts);\nvec2 tiltDirection = normalize(target.xy - source.xy);\nvec2 tilt = vec2(-tiltDirection.y, tiltDirection.x) * z * sin(tiltAngle);\nreturn vec3(\nmix(source.xy, target.xy, segmentRatio) + tilt,\nz * cos(tiltAngle)\n);\n}\nfloat getAngularDist (vec2 source, vec2 target) {\nvec2 sourceRadians = radians(source);\nvec2 targetRadians = radians(target);\nvec2 sin_half_delta = sin((sourceRadians - targetRadians) / 2.0);\nvec2 shd_sq = sin_half_delta * sin_half_delta;\nfloat a = shd_sq.y + cos(sourceRadians.y) * cos(targetRadians.y) * shd_sq.x;\nreturn 2.0 * asin(sqrt(a));\n}\nvec3 interpolateGreatCircle(vec3 source, vec3 target, vec3 source3D, vec3 target3D, float angularDist, float t) {\nvec2 lngLat;\nif(abs(angularDist - PI) < 0.001) {\nlngLat = (1.0 - t) * source.xy + t * target.xy;\n} else {\nfloat a = sin((1.0 - t) * angularDist);\nfloat b = sin(t * angularDist);\nvec3 p = source3D.yxz * a + target3D.yxz * b;\nlngLat = degrees(vec2(atan(p.y, -p.x), atan(p.z, length(p.xy))));\n}\nfloat z = paraboloid(angularDist * EARTH_RADIUS, source.z, target.z, t);\nreturn vec3(lngLat, z);\n}\nvoid main(void) {\ngeometry.worldPosition = instanceSourcePositions;\ngeometry.worldPositionAlt = instanceTargetPositions;\nfloat segmentIndex = positions.x;\nfloat segmentRatio = getSegmentRatio(segmentIndex);\nfloat prevSegmentRatio = getSegmentRatio(max(0.0, segmentIndex - 1.0));\nfloat nextSegmentRatio = getSegmentRatio(min(numSegments - 1.0, segmentIndex + 1.0));\nfloat indexDir = mix(-1.0, 1.0, step(segmentIndex, 0.0));\nisValid = 1.0;\nuv = vec2(segmentRatio, positions.y);\ngeometry.uv = uv;\ngeometry.pickingColor = instancePickingColors;\nvec4 curr;\nvec4 next;\nvec3 source;\nvec3 target;\nif ((greatCircle || project_uProjectionMode == PROJECTION_MODE_GLOBE) && project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\nsource = project_globe_(vec3(instanceSourcePositions.xy, 0.0));\ntarget = project_globe_(vec3(instanceTargetPositions.xy, 0.0));\nfloat angularDist = getAngularDist(instanceSourcePositions.xy, instanceTargetPositions.xy);\nvec3 prevPos = interpolateGreatCircle(instanceSourcePositions, instanceTargetPositions, source, target, angularDist, prevSegmentRatio);\nvec3 currPos = interpolateGreatCircle(instanceSourcePositions, instanceTargetPositions, source, target, angularDist, segmentRatio);\nvec3 nextPos = interpolateGreatCircle(instanceSourcePositions, instanceTargetPositions, source, target, angularDist, nextSegmentRatio);\nif (abs(currPos.x - prevPos.x) > 180.0) {\nindexDir = -1.0;\nisValid = 0.0;\n} else if (abs(currPos.x - nextPos.x) > 180.0) {\nindexDir = 1.0;\nisValid = 0.0;\n}\nnextPos = indexDir < 0.0 ? prevPos : nextPos;\nnextSegmentRatio = indexDir < 0.0 ? prevSegmentRatio : nextSegmentRatio;\nif (isValid == 0.0) {\nnextPos.x += nextPos.x > 0.0 ? -360.0 : 360.0;\nfloat t = ((currPos.x > 0.0 ? 180.0 : -180.0) - currPos.x) / (nextPos.x - currPos.x);\ncurrPos = mix(currPos, nextPos, t);\nsegmentRatio = mix(segmentRatio, nextSegmentRatio, t);\n}\nvec3 currPos64Low = mix(instanceSourcePositions64Low, instanceTargetPositions64Low, segmentRatio);\nvec3 nextPos64Low = mix(instanceSourcePositions64Low, instanceTargetPositions64Low, nextSegmentRatio);\ncurr = project_position_to_clipspace(currPos, currPos64Low, vec3(0.0), geometry.position);\nnext = project_position_to_clipspace(nextPos, nextPos64Low, vec3(0.0));\n} else {\nvec3 source_world = instanceSourcePositions;\nvec3 target_world = instanceTargetPositions;\nif (useShortestPath) {\nsource_world.x = mod(source_world.x + 180., 360.0) - 180.;\ntarget_world.x = mod(target_world.x + 180., 360.0) - 180.;\nfloat deltaLng = target_world.x - source_world.x;\nif (deltaLng > 180.) target_world.x -= 360.;\nif (deltaLng < -180.) source_world.x -= 360.;\n}\nsource = project_position(source_world, instanceSourcePositions64Low);\ntarget = project_position(target_world, instanceTargetPositions64Low);\nfloat antiMeridianX = 0.0;\nif (useShortestPath) {\nif (project_uProjectionMode == PROJECTION_MODE_WEB_MERCATOR_AUTO_OFFSET) {\nantiMeridianX = -(project_uCoordinateOrigin.x + 180.) / 360. * TILE_SIZE;\n}\nfloat thresholdRatio = (antiMeridianX - source.x) / (target.x - source.x);\nif (prevSegmentRatio <= thresholdRatio && nextSegmentRatio > thresholdRatio) {\nisValid = 0.0;\nindexDir = sign(segmentRatio - thresholdRatio);\nsegmentRatio = thresholdRatio;\n}\n}\nnextSegmentRatio = indexDir < 0.0 ? prevSegmentRatio : nextSegmentRatio;\nvec3 currPos = interpolateFlat(source, target, segmentRatio);\nvec3 nextPos = interpolateFlat(source, target, nextSegmentRatio);\nif (useShortestPath) {\nif (nextPos.x < antiMeridianX) {\ncurrPos.x += TILE_SIZE;\nnextPos.x += TILE_SIZE;\n}\n}\ncurr = project_common_position_to_clipspace(vec4(currPos, 1.0));\nnext = project_common_position_to_clipspace(vec4(nextPos, 1.0));\ngeometry.position = vec4(currPos, 1.0);\n}\nfloat widthPixels = clamp(\nproject_size_to_pixel(instanceWidths * widthScale, widthUnits),\nwidthMinPixels, widthMaxPixels\n);\nvec3 offset = vec3(\ngetExtrusionOffset((next.xy - curr.xy) * indexDir, positions.y, widthPixels),\n0.0);\nDECKGL_FILTER_SIZE(offset, geometry);\nDECKGL_FILTER_GL_POSITION(curr, geometry);\ngl_Position = curr + vec4(project_pixel_size_to_clipspace(offset.xy), 0.0, 0.0);\nvec4 color = mix(instanceSourceColors, instanceTargetColors, segmentRatio);\nvColor = vec4(color.rgb, color.a * opacity);\nDECKGL_FILTER_COLOR(vColor, geometry);\n}\n",fs:"#version 300 es\n#define SHADER_NAME arc-layer-fragment-shader\nprecision highp float;\nin vec4 vColor;\nin vec2 uv;\nin float isValid;\nout vec4 fragColor;\nvoid main(void) {\nif (isValid == 0.0) {\ndiscard;\n}\nfragColor = vColor;\ngeometry.uv = uv;\nDECKGL_FILTER_COLOR(fragColor, geometry);\n}\n",modules:[r.A,o.A]})}get wrapLongitude(){return!1}initializeState(){this.getAttributeManager().addInstanced({instanceSourcePositions:{size:3,type:"float64",fp64:this.use64bitPositions(),transition:!0,accessor:"getSourcePosition"},instanceTargetPositions:{size:3,type:"float64",fp64:this.use64bitPositions(),transition:!0,accessor:"getTargetPosition"},instanceSourceColors:{size:this.props.colorFormat.length,type:"unorm8",transition:!0,accessor:"getSourceColor",defaultValue:c},instanceTargetColors:{size:this.props.colorFormat.length,type:"unorm8",transition:!0,accessor:"getTargetColor",defaultValue:c},instanceWidths:{size:1,transition:!0,accessor:"getWidth",defaultValue:1},instanceHeights:{size:1,transition:!0,accessor:"getHeight",defaultValue:1},instanceTilts:{size:1,transition:!0,accessor:"getTilt",defaultValue:0}})}updateState(t){super.updateState(t);const{props:e,oldProps:n,changeFlags:i}=t;(i.extensionsChanged||e.numSegments!==n.numSegments)&&(this.state.model?.destroy(),this.state.model=this._getModel(),this.getAttributeManager().invalidateAll())}draw(t){let{uniforms:e}=t;const{widthUnits:n,widthScale:i,widthMinPixels:r,widthMaxPixels:o,greatCircle:a,wrapLongitude:l}=this.props,c=this.state.model;c.setUniforms(e),c.setUniforms({greatCircle:a,widthUnits:s.p5[n],widthScale:i,widthMinPixels:r,widthMaxPixels:o,useShortestPath:l}),c.draw(this.context.renderPass)}_getModel(){const{numSegments:t}=this.props;let e=[];for(let i=0;i<t;i++)e=e.concat([i,1,0,i,-1,0]);const n=new l.K(this.context.device,{...this.getShaders(),id:this.props.id,bufferLayout:this.getAttributeManager().getBufferLayouts(),geometry:new a.V({topology:"triangle-strip",attributes:{positions:{size:3,value:new Float32Array(e)}}}),isInstanced:!0});return n.setUniforms({numSegments:t}),n}}h.layerName="ArcLayer",h.defaultProps=u;const d=h},
vendor: 3,476 bytes, line 2
259969:(t,e,n)=>{"use strict";n.d(e,{A:()=>g});var i=n(4896),r=n(14939),o=n(57941),s=n(22108),a=n(30141),l=n(68945),c=n(25195);const u=new Uint32Array([0,2,1,0,3,2]),h=new Float32Array([0,1,0,0,1,0,1,1]);function d(t,e){if(!e)return function(t){const e=new Float64Array(12);for(let n=0;n<t.length;n++)e[3*n+0]=t[n][0],e[3*n+1]=t[n][1],e[3*n+2]=t[n][2]||0;return{vertexCount:6,positions:e,indices:u,texCoords:h}}(t);const n=Math.max(Math.abs(t[0][0]-t[3][0]),Math.abs(t[1][0]-t[2][0])),i=Math.max(Math.abs(t[1][1]-t[0][1]),Math.abs(t[2][1]-t[3][1])),r=Math.ceil(n/e)+1,o=Math.ceil(i/e)+1,s=(r-1)*(o-1)*6,a=new Uint32Array(s),l=new Float32Array(r*o*2),c=new Float64Array(r*o*3);let d=0,f=0;for(let u=0;u<r;u++){const e=u/(r-1);for(let n=0;n<o;n++){const i=n/(o-1),r=p(t,e,i);c[3*d+0]=r[0],c[3*d+1]=r[1],c[3*d+2]=r[2]||0,l[2*d+0]=e,l[2*d+1]=1-i,u>0&&n>0&&(a[f++]=d-o,a[f++]=d-o-1,a[f++]=d-1,a[f++]=d-o,a[f++]=d-1,a[f++]=d),d++}}return{vertexCount:s,positions:c,indices:a,texCoords:l}}function p(t,e,n){return(0,c.Cc)((0,c.Cc)(t[0],t[1],n),(0,c.Cc)(t[3],t[2],n),e)}const f={image:{type:"image",value:null,async:!0},bounds:{type:"array",value:[1,0,0,1],compare:!0},_imageCoordinateSystem:i.rf.DEFAULT,desaturate:{type:"number",min:0,max:1,value:0},transparentColor:{type:"color",value:[0,0,0,0]},tintColor:{type:"color",value:[255,255,255]},textureParameters:{type:"object",ignore:!0,value:null}};class A extends r.A{getShaders(){return super.getShaders({vs:"#version 300 es\n#define SHADER_NAME bitmap-layer-vertex-shader\n\nin vec2 texCoords;\nin vec3 positions;\nin vec3 positions64Low;\n\nout vec2 vTexCoord;\nout vec2 vTexPos;\n\nuniform float coordinateConversion;\n\nconst vec3 pickingColor = vec3(1.0, 0.0, 0.0);\n\nvoid main(void) {\n geometry.worldPosition = positions;\n geometry.uv = texCoords;\n geometry.pickingColor = pickingColor;\n\n gl_Position = project_position_to_clipspace(positions, positions64Low, vec3(0.0), geometry.position);\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n vTexCoord = texCoords;\n\n if (coordinateConversion < -0.5) {\n vTexPos = geometry.position.xy + project_uCommonOrigin.xy;\n } else if (coordinateConversion > 0.5) {\n vTexPos = geometry.worldPosition.xy;\n }\n\n vec4 color = vec4(0.0);\n DECKGL_FILTER_COLOR(color, geometry);\n}\n",fs:"#version 300 es\n#define SHADER_NAME bitmap-layer-fragment-shader\n\n#ifdef GL_ES\nprecision highp float;\n#endif\n\nuniform sampler2D bitmapTexture;\n\nin vec2 vTexCoord;\nin vec2 vTexPos;\n\nout vec4 fragColor;\n\nuniform float desaturate;\nuniform vec4 transparentColor;\nuniform vec3 tintColor;\nuniform float opacity;\n\nuniform float coordinateConversion;\nuniform vec4 bounds;\n\n/* projection utils */\nconst float TILE_SIZE = 512.0;\nconst float PI = 3.1415926536;\nconst float WORLD_SCALE = TILE_SIZE / PI / 2.0;\n\n// from degrees to Web Mercator\nvec2 lnglat_to_mercator(vec2 lnglat) {\n float x = lnglat.x;\n float y = clamp(lnglat.y, -89.9, 89.9);\n return vec2(\n radians(x) + PI,\n PI + log(tan(PI * 0.25 + radians(y) * 0.5))\n ) * WORLD_SCALE;\n}\n\n// from Web Mercator to degrees\nvec2 mercator_to_lnglat(vec2 xy) {\n xy /= WORLD_SCALE;\n return degrees(vec2(\n xy.x - PI,\n atan(exp(xy.y - PI)) * 2.0 - PI * 0.5\n ));\n}\n/* End projection utils */\n\n// apply desaturation\nvec3 color_desaturate(vec3 color) {\n float luminance = (color.r + color.g + color.b) * 0.333333333;\n return mix(color, vec3(luminance), desaturate);\n}
2\n\n// apply tint\nvec3 color_tint(vec3 color) {\n return color * tintColor;\n}\n\n// blend with background color\nvec4 apply_opacity(vec3 color, float alpha) {\n if (transparentColor.a == 0.0) {\n return vec4(color, alpha);\n }\n float blendedAlpha = alpha + transparentColor.a * (1.0 - alpha);\n float highLightRatio = alpha / blendedAlpha;\n vec3 blendedRGB = mix(transparentColor.rgb, color, highLightRatio);\n return vec4(blendedRGB, blendedAlpha);\n}\n\nvec2 getUV(vec2 pos) {\n return vec2(\n (pos.x - bounds[0]) / (bounds[2] - bounds[0]),\n (pos.y - bounds[3]) / (bounds[1] - bounds[3])\n );\n}\n\n\nvec3 packUVsIntoRGB(vec2 uv) {\n // Extract the top 8 bits. We want values to be truncated down so we can add a fraction\n vec2 uv8bit = floor(uv * 256.);\n\n // Calculate the normalized remainders of u and v parts that do not fit into 8 bits\n // Scale and clamp to 0-1 range\n vec2 uvFraction = fract(uv * 256.);\n vec2 uvFraction4bit = floor(uvFraction * 16.);\n\n // Remainder can be encoded in blue channel, encode as 4 bits for pixel coordinates\n float fractions = uvFraction4bit.x + uvFraction4bit.y * 16.;\n\n return vec3(uv8bit, fractions) / 255.;\n}\n\n\nvoid main(void) {\n vec2 uv = vTexCoord;\n if (coordinateConversion < -0.5) {\n vec2 lnglat = mercator_to_lnglat(vTexPos);\n uv = getUV(lnglat);\n } else if (coordinateConversion > 0.5) {\n vec2 commonPos = lnglat_to_mercator(vTexPos);\n uv = getUV(commonPos);\n }\n vec4 bitmapColor = texture(bitmapTexture, uv);\n\n fragColor = apply_opacity(color_tint(color_desaturate(bitmapColor.rgb)), bitmapColor.a * opacity);\n\n geometry.uv = uv;\n DECKGL_FILTER_COLOR(fragColor, geometry);\n\n if (bool(picking.isActive) && !bool(picking.isAttribute)) {\n // Since instance information is not used, we can use picking color for pixel index\n fragColor.rgb = packUVsIntoRGB(uv);\n }\n}\n",modules:[o.A,s.A]})}initializeState(){const t=this.getAttributeManager();t.remove(["instancePickingColors"]);const e=!0;t.add({indices:{size:1,isIndexed:!0,update:t=>t.value=this.state.mesh.indices,noAlloc:e},positions:{size:3,type:"float64",fp64:this.use64bitPositions(),update:t=>t.value=this.state.mesh.positions,noAlloc:e},texCoords:{size:2,update:t=>t.value=this.state.mesh.texCoords,noAlloc:e}})}updateState(t){let{props:e,oldProps:n,changeFlags:i}=t;const r=this.getAttributeManager();if(i.extensionsChanged&&(this.state.model?.destroy(),this.state.model=this._getModel(),r.invalidateAll()),e.bounds!==n.bounds){const t=this.state.mesh,e=this._createMesh();this.state.model.setVertexCount(e.vertexCount);for(const n in e)t&&t[n]!==e[n]&&r.invalidate(n);this.setState({mesh:e,...this._getCoordinateUniforms()})}else e._imageCoordinateSystem!==n._imageCoordinateSystem&&this.setState(this._getCoordinateUniforms())}getPickingInfo(t){const{image:e}=this.props,n=t.info;if(!n.color||!e)return n.bitmap=null,n;const{width:i,height:r}=e;n.index=0;const o=function(t){const[e,n,i]=t;return[(e+(15&i)/16)/256,(n+(240&i)/256)/256]}(n.color);return n.bitmap={size:{width:i,height:r},uv:o,pixel:[Math.floor(o[0]*i),Math.floor(o[1]*r)]},n}disablePickingIndex(){this.setState({disablePicking:!0})}restorePickingColors(){this.setState({disablePicking:!1})}_updateAutoHighlight(t){super._updateAutoHighlight({...t,color:this.encodePickingColor(0)})}_createMesh(){const{bounds:t}=this.props;let e=t;return m(t)&&(e=[[t[0],t[1]],[t[0],t[3]],[t[2],t[3]],[t[2],t[1]]]),d(e,this.context.viewport.resolution)}_getModel(){return new a.K(this.context.device,{...this.getShaders(),id:this.props.id,bufferLayout:this.getAttributeManager().getBufferLayouts(),topology:"triangle-list",isInstanced:!1})}draw(t){const{uniforms:e,moduleParameters:n}=t,{model:i,coordinateConversion:r,bounds:o,disablePicking:s}=this.state,{image:a,desaturate:l,transparentColor:c,tintColor:u}=this.props;n.picking.isActive&&s||a&&i&&(i.setUniforms(e),i.setBindings({bitmapTexture:a}),i.setUniforms({desaturate:l,transparentColor:c.map((t=>t/255)),tintColor:u.slice(0,3).map((t=>t/255)),coordinateConversion:r,bounds:o}),i.draw(this.context.renderPass))}_getCoordinateUniforms(){const{LNGLAT:t,CARTESIAN:e,DEFAULT:n}=i.rf;let{_imageCoordinateSystem:r}=this.props;if(r!==n){const{bounds:n}=this.props;if(!m(n))throw new Error("_imageCoordinateSystem only supports rectangular bounds");const i=this.context.viewport.resolution?t:e;if(r=r===t?t:e,r===t&&i===e)return{coordinateConversion:-1,bounds:n};if(r===e&&i===t){const t=(0,l.Gw)([n[0],n[1]]),e=(0,l.Gw)([n[2],n[3]]);return{coordinateConversion:1,bounds:[t[0],t[1],e[0],e[1]]}}}return{coordinateConversion:0,bounds:[0,0,0,0]}}}A.layerName="BitmapLayer",A.defaultProps=f;const g=A;function m(t){return Number.isFinite(t[0])}},86044:(t,e,n)=>{"use strict";n.d(e,{A:()=>g});var i=n(14939),r=n(57941),o=n(63351),s=n(22108),a=n(4896),l=n(30141),c=n(45957),u=n(83647),h=n(3348
vendor: 8,189 bytes, line 2
2);class d extends u.V{constructor(t){const{indices:e,attributes:n}=function(t){const{radius:e,height:n=1,nradial:i=10}=t;let{vertices:r}=t;r&&(c.A.assert(r.length>=i),r=r.flatMap((t=>[t[0],t[1]])),(0,h.UD)(r,h.rJ.COUNTER_CLOCKWISE));const o=n>0,s=i+1,a=o?3*s+1:i,l=2*Math.PI/i,u=new Uint16Array(o?3*i*2:0),d=new Float32Array(3*a),p=new Float32Array(3*a);let f=0;if(o){for(let t=0;t<s;t++){const o=t*l,s=t%i,a=Math.sin(o),c=Math.cos(o);for(let t=0;t<2;t++)d[f+0]=r?r[2*s]:c*e,d[f+1]=r?r[2*s+1]:a*e,d[f+2]=(.5-t)*n,p[f+0]=r?r[2*s]:c,p[f+1]=r?r[2*s+1]:a,f+=3}d[f+0]=d[f-3],d[f+1]=d[f-2],d[f+2]=d[f-1],f+=3}for(let c=o?0:1;c<s;c++){const t=Math.floor(c/2)*Math.sign(.5-c%2),o=t*l,s=(t+i)%i,a=Math.sin(o),u=Math.cos(o);d[f+0]=r?r[2*s]:u*e,d[f+1]=r?r[2*s+1]:a*e,d[f+2]=n/2,p[f+2]=1,f+=3}if(o){let t=0;for(let e=0;e<i;e++)u[t++]=2*e+0,u[t++]=2*e+2,u[t++]=2*e+0,u[t++]=2*e+1,u[t++]=2*e+1,u[t++]=2*e+3}return{indices:u,attributes:{POSITION:{size:3,value:d},NORMAL:{size:3,value:p}}}}(t);super({...t,indices:e,attributes:n})}}const p=[0,0,0,255],f={diskResolution:{type:"number",min:4,value:20},vertices:null,radius:{type:"number",min:0,value:1e3},angle:{type:"number",value:0},offset:{type:"array",value:[0,0]},coverage:{type:"number",min:0,max:1,value:1},elevationScale:{type:"number",min:0,value:1},radiusUnits:"meters",lineWidthUnits:"meters",lineWidthScale:1,lineWidthMinPixels:0,lineWidthMaxPixels:Number.MAX_SAFE_INTEGER,extruded:!0,wireframe:!1,filled:!0,stroked:!1,flatShading:!1,getPosition:{type:"accessor",value:t=>t.position},getFillColor:{type:"accessor",value:p},getLineColor:{type:"accessor",value:p},getLineWidth:{type:"accessor",value:1},getElevation:{type:"accessor",value:1e3},material:!0,getColor:{deprecatedFor:["getFillColor","getLineColor"]}};class A extends i.A{getShaders(){const t={},{flatShading:e}=this.props;return e&&(t.FLAT_SHADING=1),super.getShaders({vs:"#version 300 es\n#define SHADER_NAME column-layer-vertex-shader\nin vec3 positions;\nin vec3 normals;\nin vec3 instancePositions;\nin float instanceElevations;\nin vec3 instancePositions64Low;\nin vec4 instanceFillColors;\nin vec4 instanceLineColors;\nin float instanceStrokeWidths;\nin vec3 instancePickingColors;\nuniform float opacity;\nuniform float radius;\nuniform float angle;\nuniform vec2 offset;\nuniform bool extruded;\nuniform bool stroked;\nuniform bool isStroke;\nuniform float coverage;\nuniform float elevationScale;\nuniform float edgeDistance;\nuniform float widthScale;\nuniform float widthMinPixels;\nuniform float widthMaxPixels;\nuniform int radiusUnits;\nuniform int widthUnits;\nout vec4 vColor;\n#ifdef FLAT_SHADING\nout vec4 position_commonspace;\n#endif\nvoid main(void) {\ngeometry.worldPosition = instancePositions;\nvec4 color = isStroke ? instanceLineColors : instanceFillColors;\nmat2 rotationMatrix = mat2(cos(angle), sin(angle), -sin(angle), cos(angle));\nfloat elevation = 0.0;\nfloat strokeOffsetRatio = 1.0;\nif (extruded) {\nelevation = instanceElevations * (positions.z + 1.0) / 2.0 * elevationScale;\n} else if (stroked) {\nfloat widthPixels = clamp(\nproject_size_to_pixel(instanceStrokeWidths * widthScale, widthUnits),\nwidthMinPixels, widthMaxPixels) / 2.0;\nfloat halfOffset = project_pixel_size(widthPixels) / project_size(edgeDistance * coverage * radius);\nif (isStroke) {\nstrokeOffsetRatio -= sign(positions.z) * halfOffset;\n} else {\nstrokeOffsetRatio -= halfOffset;\n}\n}\nfloat shouldRender = float(color.a > 0.0 && instanceElevations >= 0.0);\nfloat dotRadius = radius * coverage * shouldRender;\ngeometry.pickingColor = instancePickingColors;\nvec3 centroidPosition = vec3(instancePositions.xy, instancePositions.z + elevation);\nvec3 centroidPosition64Low = instancePositions64Low;\nvec2 offset = (rotationMatrix * positions.xy * strokeOffsetRatio + offset) * dotRadius;\nif (radiusUnits == UNIT_METERS) {\noffset = project_size(offset);\n}\nvec3 pos = vec3(offset, 0.);\nDECKGL_FILTER_SIZE(pos, geometry);\ngl_Position = project_position_to_clipspace(centroidPosition, centroidPosition64Low, pos, geometry.position);\ngeometry.normal = project_normal(vec3(rotationMatrix * normals.xy, normals.z));\nDECKGL_FILTER_GL_POSITION(gl_Position, geometry);\nif (extruded && !isStroke) {\n#ifdef FLAT_SHADING\nposition_commonspace = geometry.position;\nvColor = vec4(color.rgb, color.a * opacity);\n#else\nvec3 lightColor = lighting_getLightColor(color.rgb, project_uCameraPosition, geometry.position.xyz, geometry.normal);\nvColor = vec4(lightColor, color.a * opacity);\n#endif\n} else {\nvColor = vec4(color.rgb, color.a * opacity);\n}\nDECKGL_FILTER_COLOR(vColor, geometry);\n}\n",fs:"#version 300 es\n#define SHADER_NAME column-layer-fragment-shader\nprecision highp float;\nuniform vec3 project_uCameraPosition;\nuniform bool extruded;\nuniform bool isStroke;\nout vec4 fragColor;\nin vec4 vColor;\n#ifdef FLAT_SHADING\nin vec4 position_commonspace;\n#endif\nvoid main(void) {\nfragColor = vColor;\ngeometry.uv = vec2(0.);\n#ifdef FLAT_SHADING\nif (extruded && !isStroke && !bool(picking.isActive)) {\nvec3 normal = normalize(cross(dFdx(position_commonspace.xyz), dFdy(position_commonspace.xyz)));\nfragColor.rgb = lighting_getLightColor(vColor.rgb, project_uCameraPosition, position_commonspace.xyz, normal);\n}\n#endif\nDECKGL_FILTER_COLOR(fragColor, geometry);\n}\n",defines:t,modules:[r.A,e?o.p:o.K,s.A]})}initializeState(){this.getAttributeManager().addInstanced({instancePositions:{size:3,type:"float64",fp64:this.use64bitPositions(),transition:!0,accessor:"getPosition"},instanceElevations:{size:1,transition:!0,accessor:"getElevation"},instanceFillColors:{size:this.props.colorFormat.length,type:"unorm8",transition:!0,accessor:"getFillColor",defaultValue:p},instanceLineColors:{size:this.props.colorFormat.length,type:"unorm8",transition:!0,accessor:"getLineColor",defaultValue:p},instanceStrokeWidths:{size:1,accessor:"getLineWidth",transition:!0}})}updateState(t){super.updateState(t);const{props:e,oldProps:n,changeFlags:i}=t,r=i.extensionsChanged||e.flatShading!==n.flatShading;r&&(this.state.models?.forEach((t=>t.destroy())),this.setState(this._getModels()),this.getAttributeManager().invalidateAll());const o=this.getNumInstances();this.state.fillModel.setInstanceCount(o),this.state.wireframeModel.setInstanceCount(o),(r||e.diskResolution!==n.diskResolution||e.vertices!==n.vertices||(e.extruded||e.stroked)!==(n.extruded||n.stroked))&&this._updateGeometry(e)}getGeometry(t,e,n){const i=new d({radius:1,height:n?2:0,vertices:e,nradial:t});let r=0;if(e)for(let o=0;o<t;o++){const n=e[o];r+=Math.sqrt(n[0]*n[0]+n[1]*n[1])/t}else r=1;return this.setState({edgeDistance:Math.cos(Math.PI/t)*r}),i}_getModels(){const t=this.getShaders(),e=this.getAttributeManager().getBufferLayouts(),n=new l.K(this.context.device,{...t,id:`${this.props.id}-fill`,bufferLayout:e,isInstanced:!0}),i=new l.K(this.context.device,{...t,id:`${this.props.id}-wireframe`,bufferLayout:e,isInstanced:!0});return{fillModel:n,wireframeModel:i,models:[i,n]}}_updateGeometry(t){let{diskResolution:e,vertices:n,extruded:i,stroked:r}=t;const o=this.getGeometry(e,n,i||r);this.setState({fillVertexCount:o.attributes.POSITION.value.length/3});const s=this.state.fillModel,a=this.state.wireframeModel;s.setGeometry(o),s.setTopology("triangle-strip"),s.setIndexBuffer(null),a.setGeometry(o),a.setTopology("line-list")}draw(t){let{uniforms:e}=t;const{lineWidthUnits:n,lineWidthScale:i,lineWidthMinPixels:r,lineWidthMaxPixels:o,radiusUnits:s,elevationScale:l,extruded:c,filled:u,stroked:h,wireframe:d,offset:p,coverage:f,radius:A,angle:g}=this.props,m=this.state.fillModel,y=this.state.wireframeModel,{fillVertexCount:_,edgeDistance:v}=this.state,b={...e,radius:A,angle:g/180*Math.PI,offset:p,extruded:c,stroked:h,coverage:f,elevationScale:l,edgeDistance:v,radiusUnits:a.p5[s],widthUnits:a.p5[n],widthScale:i,widthMinPixels:r,widthMaxPixels:o};c&&d&&(y.setUniforms(b),y.setUniforms({isStroke:!0}),y.draw(this.context.renderPass)),m.setUniforms(b),u&&(m.setVertexCount(_),m.setUniforms({isStroke:!1}),m.draw(this.context.renderPass)),!c&&h&&(m.setVertexCount(2*_/3),m.setUniforms({isStroke:!0}),m.draw(this.context.renderPass))}}A.layerName="ColumnLayer",A.defaultProps=f;const g=A},
vendor: 3,427 bytes, line 2
297650:(t,e,n)=>{"use strict";n.d(e,{A:()=>a});var i=n(4896),r=n(18839),o=n(86044);class s extends o.A{_updateGeometry(){const t=new r.c9;this.state.fillModel.setGeometry(t)}draw(t){let{uniforms:e}=t;const{elevationScale:n,extruded:r,offset:o,coverage:s,cellSize:a,angle:l,radiusUnits:c}=this.props,u=this.state.fillModel;u.setUniforms(e),u.setUniforms({radius:a/2,radiusUnits:i.p5[c],angle:l,offset:o,extruded:r,coverage:s,elevationScale:n,edgeDistance:1,isStroke:!1}),u.draw(this.context.renderPass)}}s.layerName="GridCellLayer",s.defaultProps={cellSize:{type:"number",min:0,value:1e3},offset:{type:"array",value:[1,1]}};const a=s},94514:(t,e,n)=>{"use strict";n.d(e,{A:()=>E});var i=n(89522),r=n(45527);var o=n(10623),s=n(46909),a=n(48754),l=n(97091),c=n(56605);const u={circle:{type:s.A,props:{filled:"filled",stroked:"stroked",lineWidthMaxPixels:"lineWidthMaxPixels",lineWidthMinPixels:"lineWidthMinPixels",lineWidthScale:"lineWidthScale",lineWidthUnits:"lineWidthUnits",pointRadiusMaxPixels:"radiusMaxPixels",pointRadiusMinPixels:"radiusMinPixels",pointRadiusScale:"radiusScale",pointRadiusUnits:"radiusUnits",pointAntialiasing:"antialiasing",pointBillboard:"billboard",getFillColor:"getFillColor",getLineColor:"getLineColor",getLineWidth:"getLineWidth",getPointRadius:"getRadius"}},icon:{type:o.A,props:{iconAtlas:"iconAtlas",iconMapping:"iconMapping",iconSizeMaxPixels:"sizeMaxPixels",iconSizeMinPixels:"sizeMinPixels",iconSizeScale:"sizeScale",iconSizeUnits:"sizeUnits",iconAlphaCutoff:"alphaCutoff",iconBillboard:"billboard",getIcon:"getIcon",getIconAngle:"getAngle",getIconColor:"getColor",getIconPixelOffset:"getPixelOffset",getIconSize:"getSize"}},text:{type:a.A,props:{textSizeMaxPixels:"sizeMaxPixels",textSizeMinPixels:"sizeMinPixels",textSizeScale:"sizeScale",textSizeUnits:"sizeUnits",textBackground:"background",textBackgroundPadding:"backgroundPadding",textFontFamily:"fontFamily",textFontWeight:"fontWeight",textLineHeight:"lineHeight",textMaxWidth:"maxWidth",textOutlineColor:"outlineColor",textOutlineWidth:"outlineWidth",textWordBreak:"wordBreak",textCharacterSet:"characterSet",textBillboard:"billboard",textFontSettings:"fontSettings",getText:"getText",getTextAngle:"getAngle",getTextColor:"getColor",getTextPixelOffset:"getPixelOffset",getTextSize:"getSize",getTextAnchor:"getTextAnchor",getTextAlignmentBaseline:"getAlignmentBaseline",getTextBackgroundColor:"getBackgroundColor",getTextBorderColor:"getBorderColor",getTextBorderWidth:"getBorderWidth"}}},h={type:l.A,props:{lineWidthUnits:"widthUnits",lineWidthScale:"widthScale",lineWidthMinPixels:"widthMinPixels",lineWidthMaxPixels:"widthMaxPixels",lineJointRounded:"jointRounded",lineCapRounded:"capRounded",lineMiterLimit:"miterLimit",lineBillboard:"billboard",getLineColor:"getColor",getLineWidth:"getWidth"}},d={type:c.A,props:{extruded:"extruded",filled:"filled",wireframe:"wireframe",elevationScale:"elevationScale",material:"material",_full3d:"_full3d",getElevation:"getElevation",getFillColor:"getFillColor",getLineColor:"getLineColor"}};function p(t){let{type:e,props:n}=t;const i={};for(const r in n)i[r]=e.defaultProps[n[r]];return i}function f(t,e){const{transitions:n,updateTriggers:i}=t.props,r={updateTriggers:{},transitions:n&&{getPosition:n.geometry}};for(const o in e){const s=e[o];let a=t.props[o];o.startsWith("get")&&(a=t.getSubLayerAccessor(a),r.updateTriggers[s]=i[o],n&&(r.transitions[s]=n[o])),r[s]=a}return r}var A=n(45957
vendor: 7,929 bytes, line 2
2);function g(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i={pointFeatures:[],lineFeatures:[],polygonFeatures:[],polygonOutlineFeatures:[]},{startRow:r=0,endRow:o=t.length}=n;for(let s=r;s<o;s++){const n=t[s],{geometry:r}=n;if(r)if("GeometryCollection"===r.type){A.A.assert(Array.isArray(r.geometries),"GeoJSON does not have geometries array");const{geometries:t}=r;for(let r=0;r<t.length;r++){m(t[r],i,e,n,s)}}else m(r,i,e,n,s)}return i}function m(t,e,n,i,r){const{type:o,coordinates:s}=t,{pointFeatures:a,lineFeatures:l,polygonFeatures:c,polygonOutlineFeatures:u}=e;if(function(t,e){let n=y[t];A.A.assert(n,`Unknown GeoJSON type ${t}`);for(;e&&--n>0;)e=e[0];return e&&Number.isFinite(e[0])}(o,s))switch(o){case"Point":a.push(n({geometry:t},i,r));break;case"MultiPoint":s.forEach((t=>{a.push(n({geometry:{type:"Point",coordinates:t}},i,r))}));break;case"LineString":l.push(n({geometry:t},i,r));break;case"MultiLineString":s.forEach((t=>{l.push(n({geometry:{type:"LineString",coordinates:t}},i,r))}));break;case"Polygon":c.push(n({geometry:t},i,r)),s.forEach((t=>{u.push(n({geometry:{type:"LineString",coordinates:t}},i,r))}));break;case"MultiPolygon":s.forEach((t=>{c.push(n({geometry:{type:"Polygon",coordinates:t}},i,r)),t.forEach((t=>{u.push(n({geometry:{type:"LineString",coordinates:t}},i,r))}))}))}else A.A.warn(`${o} coordinates are malformed`)()}const y={Point:1,MultiPoint:2,LineString:2,MultiLineString:3,Polygon:3,MultiPolygon:4};function _(t){return t.geometry.coordinates}function v(t,e){const n={points:{},lines:{},polygons:{},polygonsOutline:{}},{points:i,lines:r,polygons:o}=t,s=function(t,e){const n={points:null,lines:null,polygons:null};for(const i in n){const r=t[i].globalFeatureIds.value;n[i]=new Uint8ClampedArray(3*r.length);const o=[];for(let t=0;t<r.length;t++)e(r[t],o),n[i][3*t+0]=o[0],n[i][3*t+1]=o[1],n[i][3*t+2]=o[2]}return n}(t,e);return n.points.data={length:i.positions.value.length/i.positions.size,attributes:{...i.attributes,getPosition:i.positions,instancePickingColors:{size:3,value:s.points}},properties:i.properties,numericProps:i.numericProps,featureIds:i.featureIds},n.lines.data={length:r.pathIndices.value.length-1,startIndices:r.pathIndices.value,attributes:{...r.attributes,getPath:r.positions,instancePickingColors:{size:3,value:s.lines}},properties:r.properties,numericProps:r.numericProps,featureIds:r.featureIds},n.lines._pathType="open",n.polygons.data={length:o.polygonIndices.value.length-1,startIndices:o.polygonIndices.value,attributes:{...o.attributes,getPolygon:o.positions,pickingColors:{size:3,value:s.polygons}},properties:o.properties,numericProps:o.numericProps,featureIds:o.featureIds},n.polygons._normalize=!1,o.triangles&&(n.polygons.data.attributes.indices=o.triangles.value),n.polygonsOutline.data={length:o.primitivePolygonIndices.value.length-1,startIndices:o.primitivePolygonIndices.value,attributes:{...o.attributes,getPath:o.positions,instancePickingColors:{size:3,value:s.polygons}},properties:o.properties,numericProps:o.numericProps,featureIds:o.featureIds},n.polygonsOutline._pathType="open",n}const b=["points","linestrings","polygons"],x={...p(u.circle),...p(u.icon),...p(u.text),...p(h),...p(d),stroked:!0,filled:!0,extruded:!1,wireframe:!1,_full3d:!1,iconAtlas:{type:"object",value:null},iconMapping:{type:"object",value:{}},getIcon:{type:"accessor",value:t=>t.properties.icon},getText:{type:"accessor",value:t=>t.properties.text},pointType:"circle",getRadius:{deprecatedFor:"getPointRadius"}};class w extends i.A{initializeState(){this.state={layerProps:{},features:{},featuresDiff:{}}}updateState(t){let{props:e,changeFlags:n}=t;if(!n.dataChanged)return;const{data:i}=this.props,r=i&&"points"in i&&"polygons"in i&&"lines"in i;this.setState({binary:r}),r?this._updateStateBinary({props:e,changeFlags:n}):this._updateStateJSON({props:e,changeFlags:n})}_updateStateBinary(t){let{props:e,changeFlags:n}=t;const i=v(e.data,this.encodePickingColor);this.setState({layerProps:i})}_updateStateJSON(t){let{props:e,changeFlags:n}=t;const i=function(t){if(Array.isArray(t))return t;switch(A.A.assert(t.type,"GeoJSON does not have type"),t.type){case"Feature":return[t];case"FeatureCollection":return A.A.assert(Array.isArray(t.features),"GeoJSON does not have features array"),t.features;default:return[{geometry:t}]}}(e.data),o=this.getSubLayerRow.bind(this);let s={};const a={};if(Array.isArray(n.dataChanged)){const t=this.state.features;for(const e in t)s[e]=t[e].slice(),a[e]=[];for(const e of n.dataChanged){const n=g(i,o,e);for(const i in t)a[i].push((0,r.J)({data:s[i],getIndex:t=>t.__source.index,dataRange:e,replace:n[i]}))}}else s=g(i,o);const l=function(t,e){const n={points:{},lines:{},polygons:{},polygonsOutline:{}},{pointFeatures:i,lineFeatures:r,polygonFeatures:o,polygonOutlineFeatures:s}=t;return n.points.data=i,n.points._dataDiff=e.pointFeatures&&(()=>e.pointFeatures),n.points.getPosition=_,n.lines.data=r,n.lines._dataDiff=e.lineFeatures&&(()=>e.lineFeatures),n.lines.getPath=_,n.polygons.data=o,n.polygons._dataDiff=e.polygonFeatures&&(()=>e.polygonFeatures),n.polygons.getPolygon=_,n.polygonsOutline.data=s,n.polygonsOutline._dataDiff=e.polygonOutlineFeatures&&(()=>e.polygonOutlineFeatures),n.polygonsOutline.getPath=_,n}(s,a);this.setState({features:s,featuresDiff:a,layerProps:l})}getPickingInfo(t){const e=super.getPickingInfo(t),{index:n,sourceLayer:i}=e;return e.featureType=b.find((t=>i.id.startsWith(`${this.id}-${t}-`))),n>=0&&i.id.startsWith(`${this.id}-points-text`)&&this.state.binary&&(e.index=this.props.data.points.globalFeatureIds.value[n]),e}_updateAutoHighlight(t){const e=`${this.id}-points-`,n="points"===t.featureType;for(const i of this.getSubLayers())i.id.startsWith(e)===n&&i.updateAutoHighlight(t)}_renderPolygonLayer(){const{extruded:t,wireframe:e}=this.props,{layerProps:n}=this.state,i="polygons-fill",r=this.shouldRenderSubLayer(i,n.polygons?.data)&&this.getSubLayerClass(i,d.type);if(r){const o=f(this,d.props),s=t&&e;return s||delete o.getLineColor,o.updateTriggers.lineColors=s,new r(o,this.getSubLayerProps({id:i,updateTriggers:o.updateTriggers}),n.polygons)}return null}_renderLineLayers(){const{extruded:t,stroked:e}=this.props,{layerProps:n}=this.state,i="polygons-stroke",r="linestrings",o=!t&&e&&this.shouldRenderSubLayer(i,n.polygonsOutline?.data)&&this.getSubLayerClass(i,h.type),s=this.shouldRenderSubLayer(r,n.lines?.data)&&this.getSubLayerClass(r,h.type);if(o||s){const t=f(this,h.props);return[o&&new o(t,this.getSubLayerProps({id:i,updateTriggers:t.updateTriggers}),n.polygonsOutline),s&&new s(t,this.getSubLayerProps({id:r,updateTriggers:t.updateTriggers}),n.lines)]}return null}_renderPointLayers(){const{pointType:t}=this.props,{layerProps:e,binary:n}=this.state;let{highlightedObjectIndex:i}=this.props;!n&&Number.isFinite(i)&&(i=e.points.data.findIndex((t=>t.__source.index===i)));const r=new Set(t.split("+")),o=[];for(const s of r){const t=`points-${s}`,r=u[s],a=r&&this.shouldRenderSubLayer(t,e.points?.data)&&this.getSubLayerClass(t,r.type);if(a){const l=f(this,r.props);let c=e.points;if("text"===s&&n){const{instancePickingColors:t,...e}=c.data.attributes;c={...c,data:{...c.data,attributes:e}}}o.push(new a(l,this.getSubLayerProps({id:t,updateTriggers:l.updateTriggers,highlightedObjectIndex:i}),c))}}return o}renderLayers(){const{extruded:t}=this.props,e=this._renderPolygonLayer();return[!t&&e,this._renderLineLayers(),this._renderPointLayers(),t&&e]}getSubLayerAccessor(t){const{binary:e}=this.state;return e&&"function"===typeof t?(e,n)=>{const{data:i,index:r}=n,o=function(t,e){if(!t)return null;const n="startIndices"in t?t.startIndices[e]:e,i=t.featureIds.value[n];return-1!==n?function(t,e,n){const i={properties:{...t.properties[e]}};for(const r in t.numericProps)i.properties[r]=t.numericProps[r].value[n];return i}(t,i,n):null}(i,r);return t(o,n)}:super.getSubLayerAccessor(t)}}w.layerName="GeoJsonLayer",w.defaultProps=x;const E=w},
210623:(t,e,n)=>{"use strict";n.d(e,{A:()=>x});var i=n(14939),r=n(57941),o=n(22108),s=n(4896),a=n(45957),l=n(30141),c=n(83647);var u=n(70889),h=n(61281
vendor: 10,494 bytes, line 2
2);const d=()=>{},p={minFilter:"linear",mipmapFilter:"linear",magFilter:"linear",addressModeU:"clamp-to-edge",addressModeV:"clamp-to-edge"},f={x:0,y:0,width:0,height:0};function A(t,e,n,i){const r=Math.min(n/e.width,i/e.height),o=Math.floor(e.width*r),s=Math.floor(e.height*r);return 1===r?{data:e,width:o,height:s}:(t.canvas.height=s,t.canvas.width=o,t.clearRect(0,0,o,s),t.drawImage(e,0,0,e.width,e.height,0,0,o,s),{data:t.canvas,width:o,height:s})}function g(t){return t&&(t.id||t.url)}function m(t,e,n){for(let i=0;i<e.length;i++){const{icon:r,xOffset:o}=e[i];t[g(r)]={...r,x:o,y:n}}}class y{constructor(t,e){let{onUpdate:n=d,onError:i=d}=e;this._loadOptions=null,this._texture=null,this._externalTexture=null,this._mapping={},this._textureParameters=null,this._pendingCount=0,this._autoPacking=!1,this._xOffset=0,this._yOffset=0,this._rowHeight=0,this._buffer=4,this._canvasWidth=1024,this._canvasHeight=0,this._canvas=null,this.device=t,this.onUpdate=n,this.onError=i}finalize(){this._texture?.delete()}getTexture(){return this._texture||this._externalTexture}getIconMapping(t){const e=this._autoPacking?g(t):t;return this._mapping[e]||f}setProps(t){let{loadOptions:e,autoPacking:n,iconAtlas:i,iconMapping:r,textureParameters:o}=t;e&&(this._loadOptions=e),void 0!==n&&(this._autoPacking=n),r&&(this._mapping=r),i&&(this._texture?.delete(),this._texture=null,this._externalTexture=i),o&&(this._textureParameters=o)}get isLoaded(){return 0===this._pendingCount}packIcons(t,e){if(!this._autoPacking||"undefined"===typeof document)return;const n=Object.values(function(t,e,n){if(!t||!e)return null;n=n||{};const i={},{iterable:r,objectInfo:o}=(0,h.X)(t);for(const s of r){o.index++;const t=e(s,o),r=g(t);if(!t)throw new Error("Icon is missing.");if(!t.url)throw new Error("Icon url is missing.");i[r]||n[r]&&t.url===n[r].url||(i[r]={...t,source:s,sourceIndex:o.index})}return i}(t,e,this._mapping)||{});if(n.length>0){const{mapping:t,xOffset:e,yOffset:i,rowHeight:r,canvasHeight:o}=function(t){let{icons:e,buffer:n,mapping:i={},xOffset:r=0,yOffset:o=0,rowHeight:s=0,canvasWidth:a}=t,l=[];for(let u=0;u<e.length;u++){const t=e[u];if(!i[g(t)]){const{height:e,width:c}=t;r+c+n>a&&(m(i,l,o),r=0,o=s+o+n,s=0,l=[]),l.push({icon:t,xOffset:r}),r=r+c+n,s=Math.max(s,e)}}return l.length>0&&m(i,l,o),{mapping:i,rowHeight:s,xOffset:r,yOffset:o,canvasWidth:a,canvasHeight:(c=s+o+n,Math.pow(2,Math.ceil(Math.log2(c))))};var c}({icons:n,buffer:this._buffer,canvasWidth:this._canvasWidth,mapping:this._mapping,rowHeight:this._rowHeight,xOffset:this._xOffset,yOffset:this._yOffset});this._rowHeight=r,this._mapping=t,this._xOffset=e,this._yOffset=i,this._canvasHeight=o,this._texture||(this._texture=this.device.createTexture({format:"rgba8unorm",width:this._canvasWidth,height:this._canvasHeight,sampler:this._textureParameters||p})),this._texture.height!==this._canvasHeight&&(this._texture=function(t,e,n,i){const{width:r,height:o,device:s}=t,a=s.createTexture({format:"rgba8unorm",width:e,height:n,sampler:i}),l=s.createCommandEncoder();return l.copyTextureToTexture({source:t,destination:a,width:r,height:o}),l.finish(),t.destroy(),a}(this._texture,this._canvasWidth,this._canvasHeight,this._textureParameters||p)),this.onUpdate(),this._canvas=this._canvas||document.createElement("canvas"),this._loadIcons(n)}}_loadIcons(t){const e=this._canvas.getContext("2d",{willReadFrequently:!0});for(const n of t)this._pendingCount++,(0,u.H)(n.url,this._loadOptions).then((t=>{const i=g(n),r=this._mapping[i],{x:o,y:s,width:a,height:l}=r,{data:c,width:u,height:h}=A(e,t,a,l);this._texture.setSubImageData({data:c,x:o+(a-u)/2,y:s+(l-h)/2,width:u,height:h}),r.width=u,r.height=h,this._texture.generateMipmap(),this.onUpdate()})).catch((t=>{this.onError({url:n.url,source:n.source,sourceIndex:n.sourceIndex,loadOptions:this._loadOptions,error:t})})).finally((()=>{this._pendingCount--}))}}const _=[0,0,0,255],v={iconAtlas:{type:"image",value:null,async:!0},iconMapping:{type:"object",value:{},async:!0},sizeScale:{type:"number",value:1,min:0},billboard:!0,sizeUnits:"pixels",sizeMinPixels:{type:"number",min:0,value:0},sizeMaxPixels:{type:"number",min:0,value:Number.MAX_SAFE_INTEGER},alphaCutoff:{type:"number",value:.05,min:0,max:1},getPosition:{type:"accessor",value:t=>t.position},getIcon:{type:"accessor",value:t=>t.icon},getColor:{type:"accessor",value:_},getSize:{type:"accessor",value:1},getAngle:{type:"accessor",value:0},getPixelOffset:{type:"accessor",value:[0,0]},onIconError:{type:"function",value:null,optional:!0},textureParameters:{type:"object",ignore:!0,value:null}};class b extends i.A{getShaders(){return super.getShaders({vs:"#version 300 es\n#define SHADER_NAME icon-layer-vertex-shader\nin vec2 positions;\nin vec3 instancePositions;\nin vec3 instancePositions64Low;\nin float instanceSizes;\nin float instanceAngles;\nin vec4 instanceColors;\nin vec3 instancePickingColors;\nin vec4 instanceIconFrames;\nin float instanceColorModes;\nin vec2 instanceOffsets;\nin vec2 instancePixelOffset;\nuniform float sizeScale;\nuniform vec2 iconsTextureDim;\nuniform float sizeMinPixels;\nuniform float sizeMaxPixels;\nuniform bool billboard;\nuniform int sizeUnits;\nout float vColorMode;\nout vec4 vColor;\nout vec2 vTextureCoords;\nout vec2 uv;\nvec2 rotate_by_angle(vec2 vertex, float angle) {\nfloat angle_radian = angle * PI / 180.0;\nfloat cos_angle = cos(angle_radian);\nfloat sin_angle = sin(angle_radian);\nmat2 rotationMatrix = mat2(cos_angle, -sin_angle, sin_angle, cos_angle);\nreturn rotationMatrix * vertex;\n}\nvoid main(void) {\ngeometry.worldPosition = instancePositions;\ngeometry.uv = positions;\ngeometry.pickingColor = instancePickingColors;\nuv = positions;\nvec2 iconSize = instanceIconFrames.zw;\nfloat sizePixels = clamp(\nproject_size_to_pixel(instanceSizes * sizeScale, sizeUnits),\nsizeMinPixels, sizeMaxPixels\n);\nfloat instanceScale = iconSize.y == 0.0 ? 0.0 : sizePixels / iconSize.y;\nvec2 pixelOffset = positions / 2.0 * iconSize + instanceOffsets;\npixelOffset = rotate_by_angle(pixelOffset, instanceAngles) * instanceScale;\npixelOffset += instancePixelOffset;\npixelOffset.y *= -1.0;\nif (billboard) {\ngl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, vec3(0.0), geometry.position);\nDECKGL_FILTER_GL_POSITION(gl_Position, geometry);\nvec3 offset = vec3(pixelOffset, 0.0);\nDECKGL_FILTER_SIZE(offset, geometry);\ngl_Position.xy += project_pixel_size_to_clipspace(offset.xy);\n} else {\nvec3 offset_common = vec3(project_pixel_size(pixelOffset), 0.0);\nDECKGL_FILTER_SIZE(offset_common, geometry);\ngl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, offset_common, geometry.position);\nDECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n}\nvTextureCoords = mix(\ninstanceIconFrames.xy,\ninstanceIconFrames.xy + iconSize,\n(positions.xy + 1.0) / 2.0\n) / iconsTextureDim;\nvColor = instanceColors;\nDECKGL_FILTER_COLOR(vColor, geometry);\nvColorMode = instanceColorModes;\n}\n",fs:"#version 300 es\n#define SHADER_NAME icon-layer-fragment-shader\nprecision highp float;\nuniform float opacity;\nuniform sampler2D iconsTexture;\nuniform float alphaCutoff;\nin float vColorMode;\nin vec4 vColor;\nin vec2 vTextureCoords;\nin vec2 uv;\nout vec4 fragColor;\nvoid main(void) {\ngeometry.uv = uv;\nvec4 texColor = texture(iconsTexture, vTextureCoords);\nvec3 color = mix(texColor.rgb, vColor.rgb, vColorMode);\nfloat a = texColor.a * opacity * vColor.a;\nif (a < alphaCutoff) {\ndiscard;\n}\nfragColor = vec4(color, a);\nDECKGL_FILTER_COLOR(fragColor, geometry);\n}\n",modules:[r.A,o.A]})}initializeState(){this.state={iconManager:new y(this.context.device,{onUpdate:this._onUpdate.bind(this),onError:this._onError.bind(this)})};this.getAttributeManager().addInstanced({instancePositions:{size:3,type:"float64",fp64:this.use64bitPositions(),transition:!0,accessor:"getPosition"},instanceSizes:{size:1,transition:!0,accessor:"getSize",defaultValue:1},instanceOffsets:{size:2,accessor:"getIcon",transform:this.getInstanceOffset},instanceIconFrames:{size:4,accessor:"getIcon",transform:this.getInstanceIconFrame},instanceColorModes:{size:1,type:"uint8",accessor:"getIcon",transform:this.getInstanceColorMode},instanceColors:{size:this.props.colorFormat.length,type:"unorm8",transition:!0,accessor:"getColor",defaultValue:_},instanceAngles:{size:1,transition:!0,accessor:"getAngle"},instancePixelOffset:{size:2,transition:!0,accessor:"getPixelOffset"}})}updateState(t){super.updateState(t);const{props:e,oldProps:n,changeFlags:i}=t,r=this.getAttributeManager(),{iconAtlas:o,iconMapping:s,data:a,getIcon:l,textureParameters:c}=e,{iconManager:u}=this.state;if("string"===typeof o)return;const h=o||this.internalState.isAsyncPropLoading("iconAtlas");u.setProps({loadOptions:e.loadOptions,autoPacking:!h,iconAtlas:o,iconMapping:h?s:null,textureParameters:c}),h?n.iconMapping!==e.iconMapping&&r.invalidate("getIcon"):(i.dataChanged||i.updateTriggersChanged&&(i.updateTriggersChanged.all||i.updateTriggersChanged.getIcon))&&u.packIcons(a,l),i.extensionsChanged&&(this.state.model?.destroy(),this.state.model=this._getModel(),r.invalidateAll())}get isLoaded(){return super.isLoaded&&this.state.iconManager.isLoaded}finalizeState(t){super.finalizeState(t),this.state.iconManager.finalize()}draw(t){let{uniforms:e}=t;const{sizeScale:n,sizeMinPixels:i,sizeMaxPixels:r,sizeUnits:o,billboard:a,alphaCutoff:l}=this.props,{iconManager:c}=this.state,u=c.getTexture();if(u){const t=this.state.model;t.setBindings({iconsTexture:u}),t.setUniforms(e),t.setUniforms({iconsTextureDim:[u.width,u.height],sizeUnits:s.p5[o],sizeScale:n,sizeMinPixels:i,sizeMaxPixels:r,billboard:a,alphaCutoff:l}),t.draw(this.context.renderPass)}}_getModel(){return new l.K(this.context.device,{...this.getShaders(),id:this.props.id,bufferLayout:this.getAttributeManager().getBufferLayouts(),geometry:new c.V({topology:"triangle-strip",attributes:{positions:{size:2,value:new Float32Array([-1,-1,1,-1,-1,1,1,1])}}}),isInstanced:!0})}_onUpdate(){this.setNeedsRedraw()}_onError(t){const e=this.getCurrentLayer()?.props.onIconError;e?e(t):a.A.error(t.error.message)()}getInstanceOffset(t){const{width:e,height:n,anchorX:i=e/2,anchorY:r=n/2}=this.state.iconManager.getIconMapping(t);return[e/2-i,n/2-r]}getInstanceColorMode(t){return this.state.iconManager.getIconMapping(t).mask?1:0}getInstanceIconFrame(t){const{x:e,y:n,width:i,height:r}=this.state.iconManager.getIconMapping(t);return[e,n,i,r]}}b.defaultProps=v,b.layerName="IconLayer";const x=b},
vendor: 1,635 bytes, line 2
228246:(t,e,n)=>{"use strict";n.r(e),n.d(e,{ArcLayer:()=>i.A,BitmapLayer:()=>r.A,ColumnLayer:()=>c.A,GeoJsonLayer:()=>p.A,GridCellLayer:()=>u.A,IconLayer:()=>o.A,LineLayer:()=>s.A,PathLayer:()=>h.A,PointCloudLayer:()=>a.A,PolygonLayer:()=>d.A,ScatterplotLayer:()=>l.A,SolidPolygonLayer:()=>A.A,TextLayer:()=>f.A,_MultiIconLayer:()=>g.A,_TextBackgroundLayer:()=>m.A});var i=n(39017),r=n(59969),o=n(10623),s=n(55296),a=n(25479),l=n(46909),c=n(86044),u=n(97650),h=n(97091),d=n(16249),p=n(94514),f=n(48754),A=n(56605),g=n(29736),m=n(90458)},55296:(t,e,n)=>{"use strict";n.d(e,{A:()=>h});var i=n(14939),r=n(57941),o=n(22108),s=n(4896),a=n(83647),l=n(30141);const c={getSourcePosition:{type:"accessor",value:t=>t.sourcePosition},getTargetPosition:{type:"accessor",value:t=>t.targetPosition},getColor:{type:"accessor",value:[0,0,0,255]},getWidth:{type:"accessor",value:1},widthUnits:"pixels",widthScale:{type:"number",value:1,min:0},widthMinPixels:{type:"number",value:0,min:0},widthMaxPixels:{type:"number",value:Number.MAX_SAFE_INTEGER,min:0}};class u extends i.A{getBounds(){return this.getAttributeManager()?.getBounds(["instanceSourcePositions","instanceTargetPositions"])}getShaders(){return super.getShaders({vs:"#version 300 es\n#define SHADER_NAME line-layer-vertex-shader\nin vec3 positions;\nin vec3 instanceSourcePositions;\nin vec3 instanceTargetPositions;\nin vec3 instanceSourcePositions64Low;\nin vec3 instanceTargetPositions64Low;\nin vec4 instanceColors;\nin vec3 instancePickingColors;\nin float instanceWidths;\nuniform float opacity;\nuniform float widthScale;\nuniform float widthMinPixels;\nuniform float widthMaxPixels;
2\nuniform float useShortestPath;\nuniform int widthUnits;\nout vec4 vColor;\nout vec2 uv;\nvec2 getExtrusionOffset(vec2 line_clipspace, float offset_direction, float width) {\nvec2 dir_screenspace = normalize(line_clipspace * project_uViewportSize);\ndir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);\nreturn dir_screenspace * offset_direction * width / 2.0;\n}\nvec3 splitLine(vec3 a, vec3 b, float x) {\nfloat t = (x - a.x) / (b.x - a.x);\nreturn vec3(x, mix(a.yz, b.yz, t));\n}\nvoid main(void) {\ngeometry.worldPosition = instanceSourcePositions;\ngeometry.worldPositionAlt = instanceTargetPositions;\nvec3 source_world = instanceSourcePositions;\nvec3 target_world = instanceTargetPositions;\nvec3 source_world_64low = instanceSourcePositions64Low;\nvec3 target_world_64low = instanceTargetPositions64Low;\nif (useShortestPath > 0.5 || useShortestPath < -0.5) {\nsource_world.x = mod(source_world.x + 180., 360.0) - 180.;\ntarget_world.x = mod(target_world.x + 180., 360.0) - 180.;\nfloat deltaLng = target_world.x - source_world.x;\nif (deltaLng * useShortestPath > 180.) {\nsource_world.x += 360. * useShortestPath;\nsource_world = splitLine(source_world, target_world, 180. * useShortestPath);\nsource_world_64low = vec3(0.0);\n} else if (deltaLng * useShortestPath < -180.) {\ntarget_world.x += 360. * useShortestPath;\ntarget_world = splitLine(source_world, target_world, 180. * useShortestPath);\ntarget_world_64low = vec3(0.0);\n} else if (useShortestPath < 0.) {\ngl_Position = vec4(0.);\nreturn;\n}\n}\nvec4 source_commonspace;\nvec4 target_commonspace;\nvec4 source = project_position_to_clipspace(source_world, source_world_64low, vec3(0.), source_commonspace);\nvec4 target = project_position_to_clipspace(target_world, target_world_64low, vec3(0.), target_commonspace);\nfloat segmentIndex = positions.x;\nvec4 p = mix(source, target, segmentIndex);\ngeometry.position = mix(source_commonspace, target_commonspace, segmentIndex);\nuv = positions.xy;\ngeometry.uv = uv;\ngeometry.pickingColor = instancePickingColors;\nfloat widthPixels = clamp(\nproject_size_to_pixel(instanceWidths * widthScale, widthUnits),\nwidthMinPixels, widthMaxPixels\n);\nvec3 offset = vec3(\ngetExtrusionOffset(target.xy - source.xy, positions.y, widthPixels),\n0.0);\nDECKGL_FILTER_SIZE(offset, geometry);\nDECKGL_FILTER_GL_POSITION(p, geometry);\ngl_Position = p + vec4(project_pixel_size_to_clipspace(offset.xy), 0.0, 0.0);\nvColor = vec4(instanceColors.rgb, instanceColors.a * opacity);\nDECKGL_FILTER_COLOR(vColor, geometry);\n}\n",fs:"#version 300 es\n#define SHADER_NAME line-layer-fragment-shader\nprecision highp float;\nin vec4 vColor;\nin vec2 uv;\nout vec4 fragColor;\nvoid main(void) {\ngeometry.uv = uv;\nfragColor = vColor;\nDECKGL_FILTER_COLOR(fragColor, geometry);\n}\n",modules:[r.A,o.A]})}get wrapLongitude(){return!1}initializeState(){this.getAttributeManager().addInstanced({instanceSourcePositions:{size:3,type:"float64",fp64:this.use64bitPositions(),transition:!0,accessor:"getSourcePosition"},instanceTargetPositions:{size:3,type:"float64",fp64:this.use64bitPositions(),transition:!0,accessor:"getTargetPosition"},instanceColors:{size:this.props.colorFormat.length,type:"unorm8",transition:!0,accessor:"getColor",defaultValue:[0,0,0,255]},instanceWidths:{size:1,transition:!0,accessor:"getWidth",defaultValue:1}})}updateState(t){super.updateState(t),t.changeFlags.extensionsChanged&&(this.state.model?.destroy(),this.state.model=this._getModel(),this.getAttributeManager().invalidateAll())}draw(t){let{uniforms:e}=t;const{widthUnits:n,widthScale:i,widthMinPixels:r,widthMaxPixels:o,wrapLongitude:a}=this.props,l=this.state.model;l.setUniforms(e),l.setUniforms({widthUnits:s.p5[n],widthScale:i,widthMinPixels:r,widthMaxPixels:o,useShortestPath:a?1:0}),l.draw(this.context.renderPass),a&&(l.setUniforms({useShortestPath:-1}),l.draw(this.context.renderPass))}_getModel(){return new l.K(this.context.device,{...this.getShaders(),id:this.props.id,bufferLayout:this.getAttributeManager().getBufferLayouts(),geometry:new a.V({topology:"triangle-strip",attributes:{positions:{size:3,value:new Float32Array([0,-1,0,0,1,0,1,-1,0,1,1,0])}}}),isInstanced:!0})}}u.layerName="LineLayer",u.defaultProps=c;const h=u},97091:(t,e,n)=>{"use strict";n.d(e,{A:()=>m});var i=n(14939),r=n(57941),o=n(22108),s=n(4896),a=n(83647),l=n(30141),c=n(39611),u=n(3348
vendor: 9,407 bytes, line 2
2);class h extends c.A{constructor(t){super({...t,attributes:{positions:{size:3,padding:18,initialize:!0,type:t.fp64?Float64Array:Float32Array},segmentTypes:{size:1,type:Uint8ClampedArray}}})}get(t){return this.attributes[t]}getGeometryFromBuffer(t){return this.normalize?super.getGeometryFromBuffer(t):null}normalizeGeometry(t){return this.normalize?function(t,e,n,i){let r;if(Array.isArray(t[0])){const n=t.length*e;r=new Array(n);for(let i=0;i<t.length;i++)for(let n=0;n<e;n++)r[i*e+n]=t[i][n]||0}else r=t;return n?(0,u.Mk)(r,{size:e,gridResolution:n}):i?(0,u.Iy)(r,{size:e}):r}(t,this.positionSize,this.opts.resolution,this.opts.wrapLongitude):t}getGeometrySize(t){if(d(t)){let e=0;for(const n of t)e+=this.getGeometrySize(n);return e}const e=this.getPathLength(t);return e<2?0:this.isClosed(t)?e<3?0:e+2:e}updateGeometryAttributes(t,e){if(0!==e.geometrySize)if(t&&d(t))for(const n of t){const t=this.getGeometrySize(n);e.geometrySize=t,this.updateGeometryAttributes(n,e),e.vertexStart+=t}else this._updateSegmentTypes(t,e),this._updatePositions(t,e)}_updateSegmentTypes(t,e){const n=this.attributes.segmentTypes,i=!!t&&this.isClosed(t),{vertexStart:r,geometrySize:o}=e;n.fill(0,r,r+o),i?(n[r]=4,n[r+o-2]=4):(n[r]+=1,n[r+o-2]+=2),n[r+o-1]=4}_updatePositions(t,e){const{positions:n}=this.attributes;if(!n||!t)return;const{vertexStart:i,geometrySize:r}=e,o=new Array(3);for(let s=i,a=0;a<r;s++,a++)this.getPointOnPath(t,a,o),n[3*s]=o[0],n[3*s+1]=o[1],n[3*s+2]=o[2]}getPathLength(t){return t.length/this.positionSize}getPointOnPath(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];const{positionSize:i}=this;e*i>=t.length&&(e+=1-t.length/i);const r=e*i;return n[0]=t[r],n[1]=t[r+1],n[2]=3===i&&t[r+2]||0,n}isClosed(t){if(!this.normalize)return Boolean(this.opts.loop);const{positionSize:e}=this,n=t.length-e;return t[0]===t[n]&&t[1]===t[n+1]&&(2===e||t[2]===t[n+2])}}function d(t){return Array.isArray(t[0])}const p=[0,0,0,255],f={widthUnits:"meters",widthScale:{type:"number",min:0,value:1},widthMinPixels:{type:"number",min:0,value:0},widthMaxPixels:{type:"number",min:0,value:Number.MAX_SAFE_INTEGER},jointRounded:!1,capRounded:!1,miterLimit:{type:"number",min:0,value:4},billboard:!1,_pathType:null,getPath:{type:"accessor",value:t=>t.path},getColor:{type:"accessor",value:p},getWidth:{type:"accessor",value:1},rounded:{deprecatedFor:["jointRounded","capRounded"]}},A={enter:(t,e)=>e.length?e.subarray(e.length-t.length):t};class g extends i.A{getShaders(){return super.getShaders({vs:"#version 300 es\n#define SHADER_NAME path-layer-vertex-shader\nin vec2 positions;\nin float instanceTypes;\nin vec3 instanceStartPositions;\nin vec3 instanceEndPositions;\nin vec3 instanceLeftPositions;\nin vec3 instanceRightPositions;\nin vec3 instanceLeftPositions64Low;\nin vec3 instanceStartPositions64Low;\nin vec3 instanceEndPositions64Low;\nin vec3 instanceRightPositions64Low;\nin float instanceStrokeWidths;\nin vec4 instanceColors;\nin vec3 instancePickingColors;\nuniform float widthScale;\nuniform float widthMinPixels;\nuniform float widthMaxPixels;\nuniform float jointType;\nuniform float capType;\nuniform float miterLimit;\nuniform bool billboard;\nuniform int widthUnits;\nuniform float opacity;\nout vec4 vColor;\nout vec2 vCornerOffset;\nout float vMiterLength;\nout vec2 vPathPosition;\nout float vPathLength;\nout float vJointType;\nconst float EPSILON = 0.001;\nconst vec3 ZERO_OFFSET = vec3(0.0);\nfloat flipIfTrue(bool flag) {\nreturn -(float(flag) * 2. - 1.);\n}\nvec3 getLineJoinOffset(\nvec3 prevPoint, vec3 currPoint, vec3 nextPoint,\nvec2 width\n) {\nbool isEnd = positions.x > 0.0;\nfloat sideOfPath = positions.y;\nfloat isJoint = float(sideOfPath == 0.0);\nvec3 deltaA3 = (currPoint - prevPoint);\nvec3 deltaB3 = (nextPoint - currPoint);\nmat3 rotationMatrix;\nbool needsRotation = !billboard && project_needs_rotation(currPoint, rotationMatrix);\nif (needsRotation) {\ndeltaA3 = deltaA3 * rotationMatrix;\ndeltaB3 = deltaB3 * rotationMatrix;\n}\nvec2 deltaA = deltaA3.xy / width;\nvec2 deltaB = deltaB3.xy / width;\nfloat lenA = length(deltaA);\nfloat lenB = length(deltaB);\nvec2 dirA = lenA > 0. ? normalize(deltaA) : vec2(0.0, 0.0);\nvec2 dirB = lenB > 0. ? normalize(deltaB) : vec2(0.0, 0.0);\nvec2 perpA = vec2(-dirA.y, dirA.x);\nvec2 perpB = vec2(-dirB.y, dirB.x);\nvec2 tangent = dirA + dirB;\ntangent = length(tangent) > 0. ? normalize(tangent) : perpA;\nvec2 miterVec = vec2(-tangent.y, tangent.x);\nvec2 dir = isEnd ? dirA : dirB;\nvec2 perp = isEnd ? perpA : perpB;\nfloat L = isEnd ? lenA : lenB;\nfloat sinHalfA = abs(dot(miterVec, perp));\nfloat cosHalfA = abs(dot(dirA, miterVec));\nfloat turnDirection = flipIfTrue(dirA.x * dirB.y >= dirA.y * dirB.x);\nfloat cornerPosition = sideOfPath * turnDirection;\nfloat miterSize = 1.0 / max(sinHalfA, EPSILON);\nmiterSize = mix(\nmin(miterSize, max(lenA, lenB) / max(cosHalfA, EPSILON)),\nmiterSize,\nstep(0.0, cornerPosition)\n);\nvec2 offsetVec = mix(miterVec * miterSize, perp, step(0.5, cornerPosition))\n* (sideOfPath + isJoint * turnDirection);\nbool isStartCap = lenA == 0.0 || (!isEnd && (instanceTypes == 1.0 || instanceTypes == 3.0));\nbool isEndCap = lenB == 0.0 || (isEnd && (instanceTypes == 2.0 || instanceTypes == 3.0));\nbool isCap = isStartCap || isEndCap;\nif (isCap) {\noffsetVec = mix(perp * sideOfPath, dir * capType * 4.0 * flipIfTrue(isStartCap), isJoint);\nvJointType = capType;\n} else {\nvJointType = jointType;\n}\nvPathLength = L;\nvCornerOffset = offsetVec;\nvMiterLength = dot(vCornerOffset, miterVec * turnDirection);\nvMiterLength = isCap ? isJoint : vMiterLength;\nvec2 offsetFromStartOfPath = vCornerOffset + deltaA * float(isEnd);\nvPathPosition = vec2(\ndot(offsetFromStartOfPath, perp),\ndot(offsetFromStartOfPath, dir)\n);\ngeometry.uv = vPathPosition;\nfloat isValid = step(instanceTypes, 3.5);\nvec3 offset = vec3(offsetVec * width * isValid, 0.0);\nif (needsRotation) {\noffset = rotationMatrix * offset;\n}\nreturn offset;\n}\nvoid clipLine(inout vec4 position, vec4 refPosition) {\nif (position.w < EPSILON) {\nfloat r = (EPSILON - refPosition.w) / (position.w - refPosition.w);\nposition = refPosition + (position - refPosition) * r;\n}\n}\nvoid main() {\ngeometry.pickingColor = instancePickingColors;\nvColor = vec4(instanceColors.rgb, instanceColors.a * opacity);\nfloat isEnd = positions.x;\nvec3 prevPosition = mix(instanceLeftPositions, instanceStartPositions, isEnd);\nvec3 prevPosition64Low = mix(instanceLeftPositions64Low, instanceStartPositions64Low, isEnd);\nvec3 currPosition = mix(instanceStartPositions, instanceEndPositions, isEnd);\nvec3 currPosition64Low = mix(instanceStartPositions64Low, instanceEndPositions64Low, isEnd);\nvec3 nextPosition = mix(instanceEndPositions, instanceRightPositions, isEnd);\nvec3 nextPosition64Low = mix(instanceEndPositions64Low, instanceRightPositions64Low, isEnd);\ngeometry.worldPosition = currPosition;\nvec2 widthPixels = vec2(clamp(\nproject_size_to_pixel(instanceStrokeWidths * widthScale, widthUnits),\nwidthMinPixels, widthMaxPixels) / 2.0);\nvec3 width;\nif (billboard) {\nvec4 prevPositionScreen = project_position_to_clipspace(prevPosition, prevPosition64Low, ZERO_OFFSET);\nvec4 currPositionScreen = project_position_to_clipspace(currPosition, currPosition64Low, ZERO_OFFSET, geometry.position);\nvec4 nextPositionScreen = project_position_to_clipspace(nextPosition, nextPosition64Low, ZERO_OFFSET);\nclipLine(prevPositionScreen, currPositionScreen);\nclipLine(nextPositionScreen, currPositionScreen);\nclipLine(currPositionScreen, mix(nextPositionScreen, prevPositionScreen, isEnd));\nwidth = vec3(widthPixels, 0.0);\nDECKGL_FILTER_SIZE(width, geometry);\nvec3 offset = getLineJoinOffset(\nprevPositionScreen.xyz / prevPositionScreen.w,\ncurrPositionScreen.xyz / currPositionScreen.w,\nnextPositionScreen.xyz / nextPositionScreen.w,\nproject_pixel_size_to_clipspace(width.xy)\n);\nDECKGL_FILTER_GL_POSITION(currPositionScreen, geometry);\ngl_Position = vec4(currPositionScreen.xyz + offset * currPositionScreen.w, currPositionScreen.w);\n} else {\nprevPosition = project_position(prevPosition, prevPosition64Low);\ncurrPosition = project_position(currPosition, currPosition64Low);\nnextPosition = project_position(nextPosition, nextPosition64Low);\nwidth = vec3(project_pixel_size(widthPixels), 0.0);\nDECKGL_FILTER_SIZE(width, geometry);\nvec3 offset = getLineJoinOffset(prevPosition, currPosition, nextPosition, width.xy);\ngeometry.position = vec4(currPosition + offset, 1.0);\ngl_Position = project_common_position_to_clipspace(geometry.position);\nDECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n}\nDECKGL_FILTER_COLOR(vColor, geometry);\n}\n",fs:"#version 300 es\n#define SHADER_NAME path-layer-fragment-shader\nprecision highp float;\nuniform float miterLimit;\nin vec4 vColor;\nin vec2 vCornerOffset;\nin float vMiterLength;\nin vec2 vPathPosition;\nin float vPathLength;\nin float vJointType;\nout vec4 fragColor;\nvoid main(void) {\ngeometry.uv = vPathPosition;\nif (vPathPosition.y < 0.0 || vPathPosition.y > vPathLength) {\nif (vJointType > 0.5 && length(vCornerOffset) > 1.0) {\ndiscard;\n}\nif (vJointType < 0.5 && vMiterLength > miterLimit + 1.0) {\ndiscard;\n}\n}\nfragColor = vColor;\nDECKGL_FILTER_COLOR(fragColor, geometry);\n}\n",modules:[r.A,o.A]})}get wrapLongitude(){return!1}getBounds(){return this.getAttributeManager()?.getBounds(["vertexPositions"])}initializeState(){
vendor: 3,996 bytes, line 2
2const t=!0;this.getAttributeManager().addInstanced({vertexPositions:{size:3,vertexOffset:1,type:"float64",fp64:this.use64bitPositions(),transition:A,accessor:"getPath",update:this.calculatePositions,noAlloc:t,shaderAttributes:{instanceLeftPositions:{vertexOffset:0},instanceStartPositions:{vertexOffset:1},instanceEndPositions:{vertexOffset:2},instanceRightPositions:{vertexOffset:3}}},instanceTypes:{size:1,type:"uint8",update:this.calculateSegmentTypes,noAlloc:t},instanceStrokeWidths:{size:1,accessor:"getWidth",transition:A,defaultValue:1},instanceColors:{size:this.props.colorFormat.length,type:"unorm8",accessor:"getColor",transition:A,defaultValue:p},instancePickingColors:{size:4,type:"uint8",accessor:(t,e)=>{let{index:n,target:i}=e;return this.encodePickingColor(t&&t.__source?t.__source.index:n,i)}}}),this.setState({pathTesselator:new h({fp64:this.use64bitPositions()})})}updateState(t){super.updateState(t);const{props:e,changeFlags:n}=t,i=this.getAttributeManager();if(n.dataChanged||n.updateTriggersChanged&&(n.updateTriggersChanged.all||n.updateTriggersChanged.getPath)){const{pathTesselator:t}=this.state,r=e.data.attributes||{};t.updateGeometry({data:e.data,geometryBuffer:r.getPath,buffers:r,normalize:!e._pathType,loop:"loop"===e._pathType,getGeometry:e.getPath,positionFormat:e.positionFormat,wrapLongitude:e.wrapLongitude,resolution:this.context.viewport.resolution,dataChanged:n.dataChanged}),this.setState({numInstances:t.instanceCount,startIndices:t.vertexStarts}),n.dataChanged||i.invalidateAll()}n.extensionsChanged&&(this.state.model?.destroy(),this.state.model=this._getModel(),i.invalidateAll())}getPickingInfo(t){const e=super.getPickingInfo(t),{index:n}=e,i=this.props.data;return i[0]&&i[0].__source&&(e.object=i.find((t=>t.__source.index===n))),e}disablePickingIndex(t){const e=this.props.data;if(e[0]&&e[0].__source)for(let n=0;n<e.length;n++)e[n].__source.index===t&&this._disablePickingIndex(n);else super.disablePickingIndex(t)}draw(t){let{uniforms:e}=t;const{jointRounded:n,capRounded:i,billboard:r,miterLimit:o,widthUnits:a,widthScale:l,widthMinPixels:c,widthMaxPixels:u}=this.props,h=this.state.model;h.setUniforms(e),h.setUniforms({jointType:Number(n),capType:Number(i),billboard:r,widthUnits:s.p5[a],widthScale:l,miterLimit:o,widthMinPixels:c,widthMaxPixels:u}),h.draw(this.context.renderPass)}_getModel(){return new l.K(this.context.device,{...this.getShaders(),id:this.props.id,bufferLayout:this.getAttributeManager().getBufferLayouts(),geometry:new a.V({topology:"triangle-list",attributes:{indices:new Uint16Array([0,1,2,1,4,2,1,3,4,3,5,4]),positions:{value:new Float32Array([0,0,0,-1,0,1,1,-1,1,1,1,0]),size:2}}}),isInstanced:!0})}calculatePositions(t){const{pathTesselator:e}=this.state;t.startIndices=e.vertexStarts,t.value=e.get("positions")}calculateSegmentTypes(t){const{pathTesselator:e}=this.state;t.startIndices=e.vertexStarts,t.value=e.get("segmentTypes")}}g.defaultProps=f,g.layerName="PathLayer";const m=g},25479:(t,e,n)=>{"use strict";n.d(e,{A:()=>f});var i=n(14939),r=n(57941),o=n(63351),s=n(22108),a=n(4896),l=n(30141),c=n(83647);const u=[0,0,0,255],h=[0,0,1],d={sizeUnits:"pixels",pointSize:{type:"number",min:0,value:10},getPosition:{type:"accessor",value:t=>t.position},getNormal:{type:"accessor",value:h},getColor:{type:"accessor",value:u},material:!0,radiusPixels:{deprecatedFor:"pointSize"}};class p extends i.A{getShaders(){return super.getShaders({vs:"#version 300 es\n#define SHADER_NAME point-cloud-layer-vertex-shader\nin vec3 positions;\nin vec3 instanceNormals;\nin vec4 instanceColors;\nin vec3 instancePositions;\nin vec3 instancePositions64Low;\nin vec3 instancePickingColors;\nuniform float opacity;\nuniform float radiusPixels;\nuniform int sizeUnits;\nout vec4 vColor;\nout vec2 unitPosition;\nvoid main(void) {\ngeometry.worldPosition = instancePositions;\ngeometry.normal = project_normal(instanceNormals);\nunitPosition = positions.xy;\ngeometry.uv = unitPosition;\ngeometry.pickingColor = instancePickingColors;
2\nvec3 offset = vec3(positions.xy * project_size_to_pixel(radiusPixels, sizeUnits), 0.0);\nDECKGL_FILTER_SIZE(offset, geometry);\ngl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, vec3(0.), geometry.position);\nDECKGL_FILTER_GL_POSITION(gl_Position, geometry);\ngl_Position.xy += project_pixel_size_to_clipspace(offset.xy);\nvec3 lightColor = lighting_getLightColor(instanceColors.rgb, project_uCameraPosition, geometry.position.xyz, geometry.normal);\nvColor = vec4(lightColor, instanceColors.a * opacity);\nDECKGL_FILTER_COLOR(vColor, geometry);\n}\n",fs:"#version 300 es\n#define SHADER_NAME point-cloud-layer-fragment-shader\nprecision highp float;\nin vec4 vColor;\nin vec2 unitPosition;\nout vec4 fragColor;\nvoid main(void) {\ngeometry.uv = unitPosition;\nfloat distToCenter = length(unitPosition);\nif (distToCenter > 1.0) {\ndiscard;\n}\nfragColor = vColor;\nDECKGL_FILTER_COLOR(fragColor, geometry);\n}\n",modules:[r.A,o.K,s.A]})}initializeState(){this.getAttributeManager().addInstanced({instancePositions:{size:3,type:"float64",fp64:this.use64bitPositions(),transition:!0,accessor:"getPosition"},instanceNormals:{size:3,transition:!0,accessor:"getNormal",defaultValue:h},instanceColors:{size:this.props.colorFormat.length,type:"unorm8",transition:!0,accessor:"getColor",defaultValue:u}})}updateState(t){const{changeFlags:e,props:n}=t;super.updateState(t),e.extensionsChanged&&(this.state.model?.destroy(),this.state.model=this._getModel(),this.getAttributeManager().invalidateAll()),e.dataChanged&&function(t){const{header:e,attributes:n}=t;if(e&&n&&(t.length=e.vertexCount,n.POSITION&&(n.instancePositions=n.POSITION),n.NORMAL&&(n.instanceNormals=n.NORMAL),n.COLOR_0)){const{size:t,value:e}=n.COLOR_0;n.instanceColors={size:t,type:"unorm8",value:e}}}(n.data)}draw(t){let{uniforms:e}=t;const{pointSize:n,sizeUnits:i}=this.props,r=this.state.model;r.setUniforms(e),r.setUniforms({sizeUnits:a.p5[i],radiusPixels:n}),r.draw(this.context.renderPass)}_getModel(){const t=[];for(let e=0;e<3;e++){const n=e/3*Math.PI*2;t.push(2*Math.cos(n),2*Math.sin(n),0)}return new l.K(this.context.device,{...this.getShaders(),id:this.props.id,bufferLayout:this.getAttributeManager().getBufferLayouts(),geometry:new c.V({topology:"triangle-list",attributes:{positions:new Float32Array(t)}}),isInstanced:!0})}}p.layerName="PointCloudLayer",p.defaultProps=d;const f=p},16249:(t,e,n)=>{"use strict";n.d(e,{A:()=>p});var i=n(89522),r=n(45957),o=n(61281),s=n(56605),a=n(97091),l=n(2275),c=n(45527);const u=[0,0,0,255],h={stroked:!0,filled:!0,extruded:!1,elevationScale:1,wireframe:!1,_normalize:!0,_windingOrder:"CW",lineWidthUnits:"meters",lineWidthScale:1,lineWidthMinPixels:0,lineWidthMaxPixels:Number.MAX_SAFE_INTEGER,lineJointRounded:!1,lineMiterLimit:4,getPolygon:{type:"accessor",value:t=>t.polygon},getFillColor:{type:"accessor",value:[0,0,0,255]},getLineColor:{type:"accessor",value:u},getLineWidth:{type:"accessor",value:1},getElevation:{type:"accessor",value:1e3},material:!0};class d extends i.A{initializeState(){this.state={paths:[],pathsDiff:null},this.props.getLineDashArray&&r.A.removed("getLineDashArray","PathStyleExtension")()}updateState(t){let{changeFlags:e}=t;const n=e.dataChanged||e.updateTriggersChanged&&(e.updateTriggersChanged.all||e.updateTriggersChanged.getPolygon);if(n&&Array.isArray(e.dataChanged)){const t=this.state.paths.slice(),n=e.dataChanged.map((e=>(0,c.J)({data:t,getIndex:t=>t.__source.index,dataRange:e,replace:this._getPaths(e)})));this.setState({paths:t,pathsDiff:n})}else n&&this.setState({paths:this._getPaths(),pathsDiff:null})}_getPaths(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{data:e,getPolygon:n,positionFormat:i,_normalize:r}=this.props,s=[],a="XY"===i?2:3,{startRow:c,endRow:u}=t,{iterable:h,objectInfo:d}=(0,o.X)(e,c,u);for(const o of h){d.index++;let t=n(o,d);r&&(t=l.S8(t,a));const{holeIndices:e}=t,i=t.positions||t;if(e)for(let n=0;n<=e.length;n++){const t=i.slice(e[n-1]||0,e[n]||i.length);s.push(this.getSubLayerRow({path:t},o,d.index))}else s.push(this.getSubLayerRow({path:i},o,d.index))}return s}renderLayers(){const{data:t,_dataDiff:e,stroked:n,filled:i,extruded:r,wireframe:o,_normalize:l,_windingOrder:c,elevationScale:h,transitions:d,positionFormat:p}=this.props,{lineWidthUnits:f,lineWidthScale:A,lineWidthMinPixels:g,lineWidthMaxPixels:m,lineJointRounded:y,lineMiterLimit:_,lineDashJustified:v}=this.props,{getFillColor:b,getLineColor:x,getLineWidth:w,getLineDashArray:E,getElevation:C,getPolygon:T,updateTriggers:S,material:P}=this.props,{paths:M,pathsDiff:I}=this.state,B=this.getSubLayerClass("fill",s.A),R=this.getSubLayerClass("stroke",a.A),L=this.shouldRenderSubLayer("fill",M)&&new B({_dataDiff:e,extruded:r,elevationScale:h,filled:i,wireframe:o,_normalize:l,_windingOrder:c,getElevation:C,getFillColor:b,getLineColor:r&&o?x:u,material:P,transitions:d}
vendor: 9,404 bytes, line 2
2,this.getSubLayerProps({id:"fill",updateTriggers:S&&{getPolygon:S.getPolygon,getElevation:S.getElevation,getFillColor:S.getFillColor,lineColors:r&&o,getLineColor:S.getLineColor}}),{data:t,positionFormat:p,getPolygon:T});return[!r&&L,!r&&n&&this.shouldRenderSubLayer("stroke",M)&&new R({_dataDiff:I&&(()=>I),widthUnits:f,widthScale:A,widthMinPixels:g,widthMaxPixels:m,jointRounded:y,miterLimit:_,dashJustified:v,_pathType:"loop",transitions:d&&{getWidth:d.getLineWidth,getColor:d.getLineColor,getPath:d.getPolygon},getColor:this.getSubLayerAccessor(x),getWidth:this.getSubLayerAccessor(w),getDashArray:this.getSubLayerAccessor(E)},this.getSubLayerProps({id:"stroke",updateTriggers:S&&{getWidth:S.getLineWidth,getColor:S.getLineColor,getDashArray:S.getLineDashArray}}),{data:M,positionFormat:p,getPath:t=>t.path}),r&&L]}}d.layerName="PolygonLayer",d.defaultProps=h;const p=d},46909:(t,e,n)=>{"use strict";n.d(e,{A:()=>d});var i=n(14939),r=n(57941),o=n(22108),s=n(4896),a=n(83647),l=n(30141);const c=[0,0,0,255],u={radiusUnits:"meters",radiusScale:{type:"number",min:0,value:1},radiusMinPixels:{type:"number",min:0,value:0},radiusMaxPixels:{type:"number",min:0,value:Number.MAX_SAFE_INTEGER},lineWidthUnits:"meters",lineWidthScale:{type:"number",min:0,value:1},lineWidthMinPixels:{type:"number",min:0,value:0},lineWidthMaxPixels:{type:"number",min:0,value:Number.MAX_SAFE_INTEGER},stroked:!1,filled:!0,billboard:!1,antialiasing:!0,getPosition:{type:"accessor",value:t=>t.position},getRadius:{type:"accessor",value:1},getFillColor:{type:"accessor",value:c},getLineColor:{type:"accessor",value:c},getLineWidth:{type:"accessor",value:1},strokeWidth:{deprecatedFor:"getLineWidth"},outline:{deprecatedFor:"stroked"},getColor:{deprecatedFor:["getFillColor","getLineColor"]}};class h extends i.A{getShaders(){return super.getShaders({vs:"#version 300 es\n#define SHADER_NAME scatterplot-layer-vertex-shader\nin vec3 positions;\nin vec3 instancePositions;\nin vec3 instancePositions64Low;\nin float instanceRadius;\nin float instanceLineWidths;\nin vec4 instanceFillColors;\nin vec4 instanceLineColors;\nin vec3 instancePickingColors;\nuniform float opacity;\nuniform float radiusScale;\nuniform float radiusMinPixels;\nuniform float radiusMaxPixels;\nuniform float lineWidthScale;\nuniform float lineWidthMinPixels;\nuniform float lineWidthMaxPixels;\nuniform float stroked;\nuniform bool filled;\nuniform bool antialiasing;\nuniform bool billboard;\nuniform int radiusUnits;\nuniform int lineWidthUnits;\nout vec4 vFillColor;\nout vec4 vLineColor;\nout vec2 unitPosition;\nout float innerUnitRadius;\nout float outerRadiusPixels;\nvoid main(void) {\ngeometry.worldPosition = instancePositions;\nouterRadiusPixels = clamp(\nproject_size_to_pixel(radiusScale * instanceRadius, radiusUnits),\nradiusMinPixels, radiusMaxPixels\n);\nfloat lineWidthPixels = clamp(\nproject_size_to_pixel(lineWidthScale * instanceLineWidths, lineWidthUnits),\nlineWidthMinPixels, lineWidthMaxPixels\n);\nouterRadiusPixels += stroked * lineWidthPixels / 2.0;\nfloat edgePadding = antialiasing ? (outerRadiusPixels + SMOOTH_EDGE_RADIUS) / outerRadiusPixels : 1.0;\nunitPosition = edgePadding * positions.xy;\ngeometry.uv = unitPosition;\ngeometry.pickingColor = instancePickingColors;\ninnerUnitRadius = 1.0 - stroked * lineWidthPixels / outerRadiusPixels;\nif (billboard) {\ngl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, vec3(0.0), geometry.position);\nDECKGL_FILTER_GL_POSITION(gl_Position, geometry);\nvec3 offset = edgePadding * positions * outerRadiusPixels;\nDECKGL_FILTER_SIZE(offset, geometry);\ngl_Position.xy += project_pixel_size_to_clipspace(offset.xy);\n} else {\nvec3 offset = edgePadding * positions * project_pixel_size(outerRadiusPixels);\nDECKGL_FILTER_SIZE(offset, geometry);\ngl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, offset, geometry.position);\nDECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n}\nvFillColor = vec4(instanceFillColors.rgb, instanceFillColors.a * opacity);\nDECKGL_FILTER_COLOR(vFillColor, geometry);\nvLineColor = vec4(instanceLineColors.rgb, instanceLineColors.a * opacity);\nDECKGL_FILTER_COLOR(vLineColor, geometry);\n}\n",fs:"#version 300 es\n#define SHADER_NAME scatterplot-layer-fragment-shader\nprecision highp float;\nuniform bool filled;\nuniform float stroked;\nuniform bool antialiasing;\nin vec4 vFillColor;\nin vec4 vLineColor;\nin vec2 unitPosition;\nin float innerUnitRadius;\nin float outerRadiusPixels;\nout vec4 fragColor;\nvoid main(void) {\ngeometry.uv = unitPosition;\nfloat distToCenter = length(unitPosition) * outerRadiusPixels;\nfloat inCircle = antialiasing ?\nsmoothedge(distToCenter, outerRadiusPixels) :\nstep(distToCenter, outerRadiusPixels);\nif (inCircle == 0.0) {\ndiscard;\n}\nif (stroked > 0.5) {\nfloat isLine = antialiasing ?\nsmoothedge(innerUnitRadius * outerRadiusPixels, distToCenter) :\nstep(innerUnitRadius * outerRadiusPixels, distToCenter);\nif (filled) {\nfragColor = mix(vFillColor, vLineColor, isLine);\n} else {\nif (isLine == 0.0) {\ndiscard;\n}\nfragColor = vec4(vLineColor.rgb, vLineColor.a * isLine);\n}\n} else if (!filled) {\ndiscard;\n} else {\nfragColor = vFillColor;\n}\nfragColor.a *= inCircle;\nDECKGL_FILTER_COLOR(fragColor, geometry);\n}\n",modules:[r.A,o.A]})}initializeState(){this.getAttributeManager().addInstanced({instancePositions:{size:3,type:"float64",fp64:this.use64bitPositions(),transition:!0,accessor:"getPosition"},instanceRadius:{size:1,transition:!0,accessor:"getRadius",defaultValue:1},instanceFillColors:{size:this.props.colorFormat.length,transition:!0,type:"unorm8",accessor:"getFillColor",defaultValue:[0,0,0,255]},instanceLineColors:{size:this.props.colorFormat.length,transition:!0,type:"unorm8",accessor:"getLineColor",defaultValue:[0,0,0,255]},instanceLineWidths:{size:1,transition:!0,accessor:"getLineWidth",defaultValue:1}})}updateState(t){super.updateState(t),t.changeFlags.extensionsChanged&&(this.state.model?.destroy(),this.state.model=this._getModel(),this.getAttributeManager().invalidateAll())}draw(t){let{uniforms:e}=t;const{radiusUnits:n,radiusScale:i,radiusMinPixels:r,radiusMaxPixels:o,stroked:a,filled:l,billboard:c,antialiasing:u,lineWidthUnits:h,lineWidthScale:d,lineWidthMinPixels:p,lineWidthMaxPixels:f}=this.props,A=this.state.model;A.setUniforms(e),A.setUniforms({stroked:a?1:0,filled:l,billboard:c,antialiasing:u,radiusUnits:s.p5[n],radiusScale:i,radiusMinPixels:r,radiusMaxPixels:o,lineWidthUnits:s.p5[h],lineWidthScale:d,lineWidthMinPixels:p,lineWidthMaxPixels:f}),A.draw(this.context.renderPass)}_getModel(){return new l.K(this.context.device,{...this.getShaders(),id:this.props.id,bufferLayout:this.getAttributeManager().getBufferLayouts(),geometry:new a.V({topology:"triangle-strip",attributes:{positions:{size:3,value:new Float32Array([-1,-1,0,1,-1,0,-1,1,0,1,1,0])}}}),isInstanced:!0})}}h.defaultProps=u,h.layerName="ScatterplotLayer";const d=h},2275:(t,e,n)=>{"use strict";n.d(e,{$q:()=>A,A4:()=>c,Dt:()=>l,S8:()=>d});var i=n(35008),r=n(3348);const o=r.rJ.CLOCKWISE,s=r.rJ.COUNTER_CLOCKWISE,a={isClosed:!0};function l(t){return"positions"in t?t.positions:t}function c(t){return"holeIndices"in t?t.holeIndices:null}function u(t,e,n,i,o){let s=e;const l=n.length;for(let r=0;r<l;r++)for(let e=0;e<i;e++)t[s++]=n[r][e]||0;if(!function(t){const e=t[0],n=t[t.length-1];return e[0]===n[0]&&e[1]===n[1]&&e[2]===n[2]}(n))for(let r=0;r<i;r++)t[s++]=n[0][r]||0;return a.start=e,a.end=s,a.size=i,(0,r.UD)(t,o,a),s}function h(t,e,n,i){let o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,s=arguments.length>5?arguments[5]:void 0,l=arguments.length>6?arguments[6]:void 0;s=s||n.length;const c=s-o;if(c<=0)return e;let u=e;for(let r=0;r<c;r++)t[u++]=n[o+r];if(!function(t,e,n,i){for(let r=0;r<e;r++)if(t[n+r]!==t[i-e+r])return!1;return!0}(n,i,o,s))for(let r=0;r<i;r++)t[u++]=n[o+r];return a.start=e,a.end=u,a.size=i,(0,r.UD)(t,l,a),u}function d(t,e){!function(t){if(t=t&&t.positions||t,!Array.isArray(t)&&!ArrayBuffer.isView(t))throw new Error("invalid polygon")}(t);const n=[],i=[];if("positions"in t){const{positions:r,holeIndices:a}=t;if(a){let t=0;for(let l=0;l<=a.length;l++)t=h(n,t,r,e,a[l-1],a[l],0===l?o:s),i.push(t);return i.pop(),{positions:n,holeIndices:i}}t=r}if(!function(t){return Array.isArray(t[0])}(t))return h(n,0,t,e,0,n.length,o),n;if(!function(t){return t.length>=1&&t[0].length>=2&&Number.isFinite(t[0][0])}(t)){let r=0;for(const[a,l]of t.entries())r=u(n,r,l,e,0===a?o:s),i.push(r);return i.pop(),{positions:n,holeIndices:i}}return u(n,0,t,e,o),n}function p(t,e,n){const i=t.length/3;let r=0;for(let o=0;o<i;o++){const s=(o+1)%i;r+=t[3*o+e]*t[3*s+n],r-=t[3*s+e]*t[3*o+n]}return Math.abs(r/2)}function f(t,e,n,i){const r=t.length/3;for(let o=0;o<r;o++){const r=3*o,s=t[r+0],a=t[r+1],l=t[r+2];t[r+e]=s,t[r+n]=a,t[r+i]=l}}function A(t,e,n,r){let o=c(t);o&&(o=o.map((t=>t/e)));let s=l(t);const a=r&&3===e;if(n){const t=s.length;s=s.slice();const i=[];for(let r=0;r<t;r+=e){i[0]=s[r],i[1]=s[r+1],a&&(i[2]=s[r+2]);const t=n(i);s[r]=t[0],s[r+1]=t[1],a&&(s[r+2]=t[2])}}if(a){const t=p(s,0,1),e=p(s,0,2),i=p(s,1,2);if(!t&&!e&&!i)return[];t>e&&t>i||(e>i?(n||(s=s.slice()),f(s,0,2,1)):(n||(s=s.slice()),f(s,2,0,1)))}return i(s,o,e)}},56605:(t,e,n)=>{"use strict";n.d(e,{A:()=>x});var i=n(14939),r=n(57941),o=n(63351),s=n(22108),a=n(4896),l=n(30141),c=n(83647),u=n(2275),h=n(39611),d=n(3348
vendor: 10,843 bytes, line 2
2);class p extends h.A{constructor(t){const{fp64:e,IndexType:n=Uint32Array}=t;super({...t,attributes:{positions:{size:3,type:e?Float64Array:Float32Array},vertexValid:{type:Uint16Array,size:1},indices:{type:n,size:1}}})}get(t){const{attributes:e}=this;return"indices"===t?e.indices&&e.indices.subarray(0,this.vertexCount):e[t]}updateGeometry(t){super.updateGeometry(t);const e=this.buffers.indices;if(e)this.vertexCount=(e.value||e).length;else if(this.data&&!this.getGeometry)throw new Error("missing indices buffer")}normalizeGeometry(t){if(this.normalize){const e=u.S8(t,this.positionSize);return this.opts.resolution?(0,d.wk)(u.Dt(e),u.A4(e),{size:this.positionSize,gridResolution:this.opts.resolution,edgeTypes:!0}):this.opts.wrapLongitude?(0,d.Eg)(u.Dt(e),u.A4(e),{size:this.positionSize,maxLatitude:86,edgeTypes:!0}):e}return t}getGeometrySize(t){if(f(t)){let e=0;for(const n of t)e+=this.getGeometrySize(n);return e}return u.Dt(t).length/this.positionSize}getGeometryFromBuffer(t){return this.normalize||!this.buffers.indices?super.getGeometryFromBuffer(t):null}updateGeometryAttributes(t,e){if(t&&f(t))for(const n of t){const t=this.getGeometrySize(n);e.geometrySize=t,this.updateGeometryAttributes(n,e),e.vertexStart+=t,e.indexStart=this.indexStarts[e.geometryIndex+1]}else{const n=t;this._updateIndices(n,e),this._updatePositions(n,e),this._updateVertexValid(n,e)}}_updateIndices(t,e){let{geometryIndex:n,vertexStart:i,indexStart:r}=e;const{attributes:o,indexStarts:s,typedArrayManager:a}=this;let l=o.indices;if(!l||!t)return;let c=r;const h=u.$q(t,this.positionSize,this.opts.preproject,this.opts.full3d);l=a.allocate(l,r+h.length,{copy:!0});for(let u=0;u<h.length;u++)l[c++]=h[u]+i;s[n+1]=r+h.length,o.indices=l}_updatePositions(t,e){let{vertexStart:n,geometrySize:i}=e;const{attributes:{positions:r},positionSize:o}=this;if(!r||!t)return;const s=u.Dt(t);for(let a=n,l=0;l<i;a++,l++){const t=s[l*o],e=s[l*o+1],n=o>2?s[l*o+2]:0;r[3*a]=t,r[3*a+1]=e,r[3*a+2]=n}}_updateVertexValid(t,e){let{vertexStart:n,geometrySize:i}=e;const{positionSize:r}=this,o=this.attributes.vertexValid,s=t&&u.A4(t);if(t&&t.edgeTypes?o.set(t.edgeTypes,n):o.fill(1,n,n+i),s)for(let a=0;a<s.length;a++)o[n+s[a]/r-1]=0;o[n+i-1]=0}}function f(t){return Array.isArray(t)&&t.length>0&&!Number.isFinite(t[0])}const A="uniform bool extruded;\nuniform bool isWireframe;\nuniform float elevationScale;\nuniform float opacity;\nin vec4 fillColors;\nin vec4 lineColors;\nin vec3 pickingColors;\nout vec4 vColor;\nstruct PolygonProps {\nvec3 positions;\nvec3 positions64Low;\nvec3 normal;\nfloat elevations;\n};\nvec3 project_offset_normal(vec3 vector) {\nif (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT ||\nproject_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSETS) {\nreturn normalize(vector * project_uCommonUnitsPerWorldUnit);\n}\nreturn project_normal(vector);\n}\nvoid calculatePosition(PolygonProps props) {\nvec3 pos = props.positions;\nvec3 pos64Low = props.positions64Low;\nvec3 normal = props.normal;\nvec4 colors = isWireframe ? lineColors : fillColors;\ngeometry.worldPosition = props.positions;\ngeometry.pickingColor = pickingColors;\nif (extruded) {\npos.z += props.elevations * elevationScale;\n}\ngl_Position = project_position_to_clipspace(pos, pos64Low, vec3(0.), geometry.position);\nDECKGL_FILTER_GL_POSITION(gl_Position, geometry);\nif (extruded) {\n#ifdef IS_SIDE_VERTEX\nnormal = project_offset_normal(normal);\n#else\nnormal = project_normal(normal);\n#endif\ngeometry.normal = normal;\nvec3 lightColor = lighting_getLightColor(colors.rgb, project_uCameraPosition, geometry.position.xyz, geometry.normal);\nvColor = vec4(lightColor, colors.a * opacity);\n} else {\nvColor = vec4(colors.rgb, colors.a * opacity);\n}\nDECKGL_FILTER_COLOR(vColor, geometry);\n}\n",g=`#version 300 es\n#define SHADER_NAME solid-polygon-layer-vertex-shader\nin vec3 vertexPositions;\nin vec3 vertexPositions64Low;\nin float elevations;\n${A}\nvoid main(void) {\nPolygonProps props;\nprops.positions = vertexPositions;\nprops.positions64Low = vertexPositions64Low;\nprops.elevations = elevations;\nprops.normal = vec3(0.0, 0.0, 1.0);\ncalculatePosition(props);\n}\n`,m=`#version 300 es\n#define SHADER_NAME solid-polygon-layer-vertex-shader-side\n#define IS_SIDE_VERTEX\nin vec2 positions;\nin vec3 vertexPositions;\nin vec3 nextVertexPositions;\nin vec3 vertexPositions64Low;\nin vec3 nextVertexPositions64Low;\nin float elevations;\nin float instanceVertexValid;\n${A}\nvoid main(void) {\nif(instanceVertexValid < 0.5){\ngl_Position = vec4(0.);\nreturn;\n}\nPolygonProps props;\nvec3 pos;\nvec3 pos64Low;\nvec3 nextPos;\nvec3 nextPos64Low;\n#if RING_WINDING_ORDER_CW == 1\npos = vertexPositions;\npos64Low = vertexPositions64Low;\nnextPos = nextVertexPositions;\nnextPos64Low = nextVertexPositions64Low;\n#else\npos = nextVertexPositions;\npos64Low = nextVertexPositions64Low;\nnextPos = vertexPositions;\nnextPos64Low = vertexPositions64Low;\n#endif\nprops.positions = mix(pos, nextPos, positions.x);\nprops.positions64Low = mix(pos64Low, nextPos64Low, positions.x);\nprops.normal = vec3(\npos.y - nextPos.y + (pos64Low.y - nextPos64Low.y),\nnextPos.x - pos.x + (nextPos64Low.x - pos64Low.x),\n0.0);\nprops.elevations = elevations * positions.y;\ncalculatePosition(props);\n}\n`,y=[0,0,0,255],_={filled:!0,extruded:!1,wireframe:!1,_normalize:!0,_windingOrder:"CW",_full3d:!1,elevationScale:{type:"number",min:0,value:1},getPolygon:{type:"accessor",value:t=>t.polygon},getElevation:{type:"accessor",value:1e3},getFillColor:{type:"accessor",value:y},getLineColor:{type:"accessor",value:y},material:!0},v={enter:(t,e)=>e.length?e.subarray(e.length-t.length):t};class b extends i.A{getShaders(t){return super.getShaders({vs:"top"===t?g:m,fs:"#version 300 es\n#define SHADER_NAME solid-polygon-layer-fragment-shader\nprecision highp float;\nin vec4 vColor;\nout vec4 fragColor;\nvoid main(void) {\nfragColor = vColor;\ngeometry.uv = vec2(0.);\nDECKGL_FILTER_COLOR(fragColor, geometry);\n}\n",defines:{RING_WINDING_ORDER_CW:this.props._normalize||"CCW"!==this.props._windingOrder?1:0},modules:[r.A,o.K,s.A]})}get wrapLongitude(){return!1}getBounds(){return this.getAttributeManager()?.getBounds(["vertexPositions"])}initializeState(){const{viewport:t}=this.context;let{coordinateSystem:e}=this.props;const{_full3d:n}=this.props;let i;t.isGeospatial&&e===a.rf.DEFAULT&&(e=a.rf.LNGLAT),e===a.rf.LNGLAT&&(i=n?t.projectPosition.bind(t):t.projectFlat.bind(t)),this.setState({numInstances:0,polygonTesselator:new p({preproject:i,fp64:this.use64bitPositions(),IndexType:Uint32Array})});const r=this.getAttributeManager(),o=!0;r.remove(["instancePickingColors"]),r.add({indices:{size:1,isIndexed:!0,update:this.calculateIndices,noAlloc:o},vertexPositions:{size:3,type:"float64",stepMode:"dynamic",fp64:this.use64bitPositions(),transition:v,accessor:"getPolygon",update:this.calculatePositions,noAlloc:o,shaderAttributes:{nextVertexPositions:{vertexOffset:1}}},instanceVertexValid:{size:1,type:"uint16",stepMode:"instance",update:this.calculateVertexValid,noAlloc:o},elevations:{size:1,stepMode:"dynamic",transition:v,accessor:"getElevation"},fillColors:{size:this.props.colorFormat.length,type:"unorm8",stepMode:"dynamic",transition:v,accessor:"getFillColor",defaultValue:y},lineColors:{size:this.props.colorFormat.length,type:"unorm8",stepMode:"dynamic",transition:v,accessor:"getLineColor",defaultValue:y},pickingColors:{size:4,type:"uint8",stepMode:"dynamic",accessor:(t,e)=>{let{index:n,target:i}=e;return this.encodePickingColor(t&&t.__source?t.__source.index:n,i)}}})}getPickingInfo(t){const e=super.getPickingInfo(t),{index:n}=e,i=this.props.data;return i[0]&&i[0].__source&&(e.object=i.find((t=>t.__source.index===n))),e}disablePickingIndex(t){const e=this.props.data;if(e[0]&&e[0].__source)for(let n=0;n<e.length;n++)e[n].__source.index===t&&this._disablePickingIndex(n);else super.disablePickingIndex(t)}draw(t){let{uniforms:e}=t;const{extruded:n,filled:i,wireframe:r,elevationScale:o}=this.props,{topModel:s,sideModel:a,wireframeModel:l,polygonTesselator:c}=this.state,u={...e,extruded:Boolean(n),elevationScale:o};l&&r&&(l.setInstanceCount(c.instanceCount-1),l.setUniforms(u),l.draw(this.context.renderPass)),a&&i&&(a.setInstanceCount(c.instanceCount-1),a.setUniforms(u),a.draw(this.context.renderPass)),s&&i&&(s.setVertexCount(c.vertexCount),s.setUniforms(u),s.draw(this.context.renderPass))}updateState(t){super.updateState(t),this.updateGeometry(t);const{props:e,oldProps:n,changeFlags:i}=t,r=this.getAttributeManager();(i.extensionsChanged||e.filled!==n.filled||e.extruded!==n.extruded)&&(this.state.models?.forEach((t=>t.destroy())),this.setState(this._getModels()),r.invalidateAll())}updateGeometry(t){let{props:e,oldProps:n,changeFlags:i}=t;if(i.dataChanged||i.updateTriggersChanged&&(i.updateTriggersChanged.all||i.updateTriggersChanged.getPolygon)){const{polygonTesselator:t}=this.state,n=e.data.attributes||{};t.updateGeometry({data:e.data,normalize:e._normalize,geometryBuffer:n.getPolygon,buffers:n,getGeometry:e.getPolygon,positionFormat:e.positionFormat,wrapLongitude:e.wrapLongitude,resolution:this.context.viewport.resolution,fp64:this.use64bitPositions(),dataChanged:i.dataChanged,full3d:e._full3d}),this.setState({numInstances:t.instanceCount,startIndices:t.vertexStarts}),i.dataChanged||this.getAttributeManager().invalidateAll()}}_getModels(){const{id:t,filled:e,extruded:n}=this.props;let i,r,o;if(e){const e=this.getShaders("top");e.defines.NON_INSTANCED_MODEL=1;const n=this.getAttributeManager().getBufferLayouts({isInstanced:!1});i=new l.K(this.context.device,{...e,id:`${t}-top`,topology:"triangle-list",uniforms:{isWireframe:!1},bufferLayout:n,isIndexed:!0,userData:{excludeAttributes:{instanceVertexValid:!0}}})}if(n){const e=this.getAttributeManager().getBufferLayouts({isInstanced:!0});r=new l.K(this.context.device,{...this.getShaders("side"),id:`${t}-side`,bufferLayout:e,uniforms:{isWireframe:!1},geometry:new c.V({topology:"triangle-strip",attributes:{positions:{size:2,value:new Float32Array([1,0,0,0,1,1,0,1])}}}),isInstanced:!0,userData:{excludeAttributes:{indices:!0}}}),o=new l.K(this.context.device,{...this.getShaders("side"),id:`${t}-wireframe`,bufferLayout:e,uniforms:{isWireframe:!0},geometry:new c.V({topology:"line-strip",attributes:{positions:{size:2,value:new Float32Array([1,0,0,0,0,1,1,1])}}}),isInstanced:!0,userData:{excludeAttributes:{indices:!0}}})}return{models:[r,o,i].filter(Boolean),topModel:i,sideModel:r,wireframeModel:o}}calculateIndices(t){const{polygonTesselator:e}=this.state;t.startIndices=e.indexStarts,t.value=e.get("indices")}calculatePositions(t){const{polygonTesselator:e}=this.state;t.startIndices=e.vertexStarts,t.value=e.get("positions")}calculateVertexValid(t){t.value=this.state.polygonTesselator.get("vertexValid")}}b.defaultProps=_,b.layerName="SolidPolygonLayer";const x=b},2
vendor: 2,600 bytes, line 2
29736:(t,e,n)=>{"use strict";n.d(e,{A:()=>l});var i=n(45957),r=n(10623);const o=.75,s=[];class a extends r.A{getShaders(){return{...super.getShaders(),fs:"#version 300 es\n#define SHADER_NAME multi-icon-layer-fragment-shader\nprecision highp float;\nuniform float opacity;\nuniform sampler2D iconsTexture;\nuniform float gamma;\nuniform bool sdf;\nuniform float alphaCutoff;\nuniform float sdfBuffer;\nuniform float outlineBuffer;\nuniform vec4 outlineColor;\nin vec4 vColor;\nin vec2 vTextureCoords;\nin vec2 uv;\nout vec4 fragColor;\nvoid main(void) {\ngeometry.uv = uv;\nif (!bool(picking.isActive)) {\nfloat alpha = texture(iconsTexture, vTextureCoords).a;\nvec4 color = vColor;\nif (sdf) {\nfloat distance = alpha;\nalpha = smoothstep(sdfBuffer - gamma, sdfBuffer + gamma, distance);\nif (outlineBuffer > 0.0) {\nfloat inFill = alpha;\nfloat inBorder = smoothstep(outlineBuffer - gamma, outlineBuffer + gamma, distance);\ncolor = mix(outlineColor, vColor, inFill);\nalpha = inBorder;\n}\n}\nfloat a = alpha * color.a;\nif (a < alphaCutoff) {\ndiscard;\n}\nfragColor = vec4(color.rgb, a * opacity);\n}\nDECKGL_FILTER_COLOR(fragColor, geometry);\n}\n"}}initializeState(){super.initializeState();this.getAttributeManager().addInstanced({instanceOffsets:{size:2,accessor:"getIconOffsets"},instancePickingColors:{type:"uint8",size:3,accessor:(t,e)=>{let{index:n,target:i}=e;return this.encodePickingColor(n,i)}}})}updateState(t){super.updateState(t);const{props:e,oldProps:n}=t;let{outlineColor:r}=e;r!==n.outlineColor&&(r=r.map((t=>t/255)),r[3]=Number.isFinite(r[3])?r[3]:1,this.setState({outlineColor:r})),!e.sdf&&e.outlineWidth&&i.A.warn(`${this.id}: fontSettings.sdf is required to render outline`)()}draw(t){const{sdf:e,smoothing:n,outlineWidth:i}=this.props,{outlineColor:r}=this.state,s=i?Math.max(n,o*(1-i)):-1;if(t.uniforms={...t.uniforms,sdfBuffer:o,outlineBuffer:s,gamma:n,sdf:Boolean(e),outlineColor:r},super.draw(t),e&&i){const{iconManager:t}=this.state,e=t.getTexture(),n=this.state.model;e&&(n.setUniforms({outlineBuffer:o}),n.draw(this.context.renderPass))}}getInstanceOffset(t){return t?Array.from(t).flatMap((t=>super.getInstanceOffset(t))):s}getInstanceColorMode(t){return 1}getInstanceIconFrame(t){return t?Array.from(t).flatMap((t=>super.getInstanceIconFrame(t))):s}}a.defaultProps={getIconOffsets:{type:"accessor",value:t=>t.offsets},alphaCutoff:.001,smoothing:.1,outlineWidth:0,outlineColor:{type:"color",value:[0,0,0,255]}},a.layerName="MultiIconLayer";const l=a},90458:(t,e,n)=>{"use strict";n.d(e,{A:()=>h});var i=n(14939),r=n(57941),o=n(22108),s=n(4896),a=n(83647),l=n(30141
vendor: 5,342 bytes, line 2
2);const c={billboard:!0,sizeScale:1,sizeUnits:"pixels",sizeMinPixels:0,sizeMaxPixels:Number.MAX_SAFE_INTEGER,padding:{type:"array",value:[0,0,0,0]},getPosition:{type:"accessor",value:t=>t.position},getSize:{type:"accessor",value:1},getAngle:{type:"accessor",value:0},getPixelOffset:{type:"accessor",value:[0,0]},getBoundingRect:{type:"accessor",value:[0,0,0,0]},getFillColor:{type:"accessor",value:[0,0,0,255]},getLineColor:{type:"accessor",value:[0,0,0,255]},getLineWidth:{type:"accessor",value:1}};class u extends i.A{getShaders(){return super.getShaders({vs:"#version 300 es\n#define SHADER_NAME text-background-layer-vertex-shader\nin vec2 positions;\nin vec3 instancePositions;\nin vec3 instancePositions64Low;\nin vec4 instanceRects;\nin float instanceSizes;\nin float instanceAngles;\nin vec2 instancePixelOffsets;\nin float instanceLineWidths;\nin vec4 instanceFillColors;\nin vec4 instanceLineColors;\nin vec3 instancePickingColors;\nuniform bool billboard;\nuniform float opacity;\nuniform float sizeScale;\nuniform float sizeMinPixels;\nuniform float sizeMaxPixels;\nuniform vec4 padding;\nuniform int sizeUnits;\nout vec4 vFillColor;\nout vec4 vLineColor;\nout float vLineWidth;\nout vec2 uv;\nout vec2 dimensions;\nvec2 rotate_by_angle(vec2 vertex, float angle) {\nfloat angle_radian = radians(angle);\nfloat cos_angle = cos(angle_radian);\nfloat sin_angle = sin(angle_radian);\nmat2 rotationMatrix = mat2(cos_angle, -sin_angle, sin_angle, cos_angle);\nreturn rotationMatrix * vertex;\n}\nvoid main(void) {\ngeometry.worldPosition = instancePositions;\ngeometry.uv = positions;\ngeometry.pickingColor = instancePickingColors;\nuv = positions;\nvLineWidth = instanceLineWidths;\nfloat sizePixels = clamp(\nproject_size_to_pixel(instanceSizes * sizeScale, sizeUnits),\nsizeMinPixels, sizeMaxPixels\n);\ndimensions = instanceRects.zw * sizePixels + padding.xy + padding.zw;\nvec2 pixelOffset = (positions * instanceRects.zw + instanceRects.xy) * sizePixels + mix(-padding.xy, padding.zw, positions);\npixelOffset = rotate_by_angle(pixelOffset, instanceAngles);\npixelOffset += instancePixelOffsets;\npixelOffset.y *= -1.0;\nif (billboard) {\ngl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, vec3(0.0), geometry.position);\nDECKGL_FILTER_GL_POSITION(gl_Position, geometry);\nvec3 offset = vec3(pixelOffset, 0.0);\nDECKGL_FILTER_SIZE(offset, geometry);\ngl_Position.xy += project_pixel_size_to_clipspace(offset.xy);\n} else {\nvec3 offset_common = vec3(project_pixel_size(pixelOffset), 0.0);\nDECKGL_FILTER_SIZE(offset_common, geometry);\ngl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, offset_common, geometry.position);\nDECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n}\nvFillColor = vec4(instanceFillColors.rgb, instanceFillColors.a * opacity);\nDECKGL_FILTER_COLOR(vFillColor, geometry);\nvLineColor = vec4(instanceLineColors.rgb, instanceLineColors.a * opacity);\nDECKGL_FILTER_COLOR(vLineColor, geometry);\n}\n",fs:"#version 300 es\n#define SHADER_NAME text-background-layer-fragment-shader\nprecision highp float;\nuniform bool stroked;\nin vec4 vFillColor;\nin vec4 vLineColor;\nin float vLineWidth;\nin vec2 uv;\nin vec2 dimensions;\nout vec4 fragColor;\nvoid main(void) {\ngeometry.uv = uv;\nvec2 pixelPosition = uv * dimensions;\nif (stroked) {\nfloat distToEdge = min(\nmin(pixelPosition.x, dimensions.x - pixelPosition.x),\nmin(pixelPosition.y, dimensions.y - pixelPosition.y)\n);\nfloat isBorder = smoothedge(distToEdge, vLineWidth);\nfragColor = mix(vFillColor, vLineColor, isBorder);\n} else {\nfragColor = vFillColor;\n}\nDECKGL_FILTER_COLOR(fragColor, geometry);\n}\n",modules:[r.A,o.A]})}initializeState(){this.getAttributeManager().addInstanced({instancePositions:{size:3,type:"float64",fp64:this.use64bitPositions(),transition:!0,accessor:"getPosition"},instanceSizes:{size:1,transition:!0,accessor:"getSize",defaultValue:1},instanceAngles:{size:1,transition:!0,accessor:"getAngle"},instanceRects:{size:4,accessor:"getBoundingRect"},instancePixelOffsets:{size:2,transition:!0,accessor:"getPixelOffset"},instanceFillColors:{size:4,transition:!0,type:"unorm8",accessor:"getFillColor",defaultValue:[0,0,0,255]},instanceLineColors:{size:4,transition:!0,type:"unorm8",accessor:"getLineColor",defaultValue:[0,0,0,255]},instanceLineWidths:{size:1,transition:!0,accessor:"getLineWidth",defaultValue:1}})}updateState(t){super.updateState(t);const{changeFlags:e}=t;e.extensionsChanged&&(this.state.model?.destroy(),this.state.model=this._getModel(),this.getAttributeManager().invalidateAll())}draw(t){let{uniforms:e}=t;const{billboard:n,sizeScale:i,sizeUnits:r,sizeMinPixels:o,sizeMaxPixels:a,getLineWidth:l}=this.props;let{padding:c}=this.props;c.length<4&&(c=[c[0],c[1],c[0],c[1]]);const u=this.state.model;u.setUniforms(e),u.setUniforms({billboard:n,stroked:Boolean(l),padding:c,sizeUnits:s.p5[r],sizeScale:i,sizeMinPixels:o,sizeMaxPixels:a}),u.draw(this.context.renderPass)}_getModel(){return new l.K(this.context.device,{...this.getShaders(),id:this.props.id,bufferLayout:this.getAttributeManager().getBufferLayouts(),geometry:new a.V({topology:"triangle-fan-webgl",vertexCount:4,attributes:{positions:{size:2,value:new Float32Array([0,0,1,0,1,1,0,1])}}}),isInstanced:!0})}}u.defaultProps=c,u.layerName="TextBackgroundLayer";const h=u},
vendor: 6,332 bytes, line 2
248754:(t,e,n)=>{"use strict";n.d(e,{A:()=>M});var i=n(89522),r=n(45957),o=n(61281),s=n(29736);const a=1e20;class l{constructor(){let{fontSize:t=24,buffer:e=3,radius:n=8,cutoff:i=.25,fontFamily:r="sans-serif",fontWeight:o="normal",fontStyle:s="normal"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.buffer=e,this.cutoff=i,this.radius=n;const a=this.size=t+4*e,l=this._createCanvas(a),c=this.ctx=l.getContext("2d",{willReadFrequently:!0});c.font=`${s} ${o} ${t}px ${r}`,c.textBaseline="alphabetic",c.textAlign="left",c.fillStyle="black",this.gridOuter=new Float64Array(a*a),this.gridInner=new Float64Array(a*a),this.f=new Float64Array(a),this.z=new Float64Array(a+1),this.v=new Uint16Array(a)}_createCanvas(t){const e=document.createElement("canvas");return e.width=e.height=t,e}draw(t){const{width:e,actualBoundingBoxAscent:n,actualBoundingBoxDescent:i,actualBoundingBoxLeft:r,actualBoundingBoxRight:o}=this.ctx.measureText(t),s=Math.ceil(n),l=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(o-r))),u=Math.min(this.size-this.buffer,s+Math.ceil(i)),h=l+2*this.buffer,d=u+2*this.buffer,p=Math.max(h*d,0),f=new Uint8ClampedArray(p),A={data:f,width:h,height:d,glyphWidth:l,glyphHeight:u,glyphTop:s,glyphLeft:0,glyphAdvance:e};if(0===l||0===u)return A;const{ctx:g,buffer:m,gridInner:y,gridOuter:_}=this;g.clearRect(m,m,l,u),g.fillText(t,m,m+s);const v=g.getImageData(m,m,l,u);_.fill(a,0,p),y.fill(0,0,p);for(let c=0;c<u;c++)for(let t=0;t<l;t++){const e=v.data[4*(c*l+t)+3]/255;if(0===e)continue;const n=(c+m)*h+t+m;if(1===e)_[n]=0,y[n]=a;else{const t=.5-e;_[n]=t>0?t*t:0,y[n]=t<0?t*t:0}}c(_,0,0,h,d,h,this.f,this.v,this.z),c(y,m,m,l,u,h,this.f,this.v,this.z);for(let a=0;a<p;a++){const t=Math.sqrt(_[a])-Math.sqrt(y[a]);f[a]=Math.round(255-255*(t/this.radius+this.cutoff))}return A}}function c(t,e,n,i,r,o,s,a,l){for(let c=e;c<e+i;c++)u(t,n*o+c,o,r,s,a,l);for(let c=n;c<n+r;c++)u(t,c*o+e,1,i,s,a,l)}function u(t,e,n,i,r,o,s){o[0]=0,s[0]=-a,s[1]=a,r[0]=t[e];for(let l=1,c=0,u=0;l<i;l++){r[l]=t[e+l*n];const i=l*l;do{const t=o[c];u=(r[l]-r[t]+i-t*t)/(l-t)/2}while(u<=s[c]&&--c>-1);c++,o[c]=l,s[c]=u,s[c+1]=a}for(let a=0,l=0;a<i;a++){for(;s[l+1]<a;)l++;const i=o[l],c=a-i;t[e+a*n]=r[i]+c*c}}const h=32,d=[];function p(t,e,n,i){let r=0;for(let o=e;o<n;o++){const e=t[o];r+=i[e]?.layoutWidth||0}return r}function f(t,e,n,i,r,o){let s=e,a=0;for(let l=e;l<n;l++){const e=p(t,l,l+1,r);a+e>i&&(s<l&&o.push(l),s=l,a=0),a+=e}return a}function A(t,e,n,i){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,o=arguments.length>5?arguments[5]:void 0;void 0===o&&(o=t.length);const s=[];return"break-all"===e?f(t,r,o,n,i,s):function(t,e,n,i,r,o){let s=e,a=e,l=e,c=0;for(let u=e;u<n;u++)if(" "===t[u]?l=u+1:" "!==t[u+1]&&u+1!==n||(l=u+1),l>a){let e=p(t,a,l,r);c+e>i&&(s<a&&(o.push(a),s=a,c=0),e>i&&(e=f(t,a,l,i,r,o),s=o[o.length-1])),a=l,c+=e}}(t,r,o,n,i,s),s}function g(t,e,n,i,o,s){let a=0,l=0;for(let c=e;c<n;c++){const e=t[c],n=i[e];n?(l||(l=n.layoutHeight),o[c]=a+n.layoutWidth/2,a+=n.layoutWidth):(r.A.warn(`Missing character: ${e} (${e.codePointAt(0)})`)(),o[c]=a,a+=h)}s[0]=a,s[1]=l}class m{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:5;this._cache={},this._order=[],this.limit=t}get(t){const e=this._cache[t];return e&&(this._deleteOrder(t),this._appendOrder(t)),e}set(t,e){this._cache[t]?(this.delete(t),this._cache[t]=e,this._appendOrder(t)):(Object.keys(this._cache).length===this.limit&&this.delete(this._order[0]),this._cache[t]=e,this._appendOrder(t))}delete(t){this._cache[t]&&(delete this._cache[t],this._deleteOrder(t))}_deleteOrder(t){const e=this._order.indexOf(t);e>=0&&this._order.splice(e,1)}_appendOrder(t){this._order.push(t)}}const y={fontFamily:"Monaco, monospace",fontWeight:"normal",characterSet:function(){const t=[];for(let e=32;e<128;e++)t.push(String.fromCharCode(e));return t}(),fontSize:64,buffer:4,sdf:!1,cutoff:.25,radius:12,smoothing:.1};let _=new m(3);function v(t,e){for(let n=0;n<t.length;n++)e.data[4*n+3]=t[n]}function b(t,e,n,i){t.font=`${i} ${n}px ${e}`,t.fillStyle="#000",t.textBaseline="alphabetic",t.textAlign="left"}class x{constructor(){this.props={...y}}get atlas(){return this._atlas}get mapping(){return this._atlas&&this._atlas.mapping}get scale(){const{fontSize:t,buffer:e}=this.props;return(1.2*t+2*e)/t}setProps(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object.assign(this.props,t),this._key=this._getKey();const e=function(t,e){let n;n="string"===typeof e?new Set(Array.from(e)):new Set(e);const i=_.get(t);if(!i)return n;for(const r in i.mapping)n.has(r)&&n.delete(r);return n}(this._key,this.props.characterSet),n=_.get(this._key);if(n&&0===e.size)return void(this._atlas!==n&&(this._atlas=n));const i=this._generateFontAtlas(e,n);this._atlas=i,_.set(this._key,i)}_generateFontAtlas(t,e){const{fontFamily:n,fontWeight:i,fontSize:r,buffer:o,sdf:s,radius:a,cutoff:c}=this.props;let u=e&&e.data;u||(u=document.createElement("canvas"),u.width=1024);const h=u.getContext("2d",{willReadFrequently:!0});b(h,n,r,i);const{mapping:d,canvasHeight:p,xOffset:f,yOffset:A}=function(t){let{characterSet:e,getFontWidth:n,fontHeight:i,buffer:r,maxCanvasWidth:o,mapping:s={},xOffset:a=0,yOffset:l=0}=t,c=0,u=a;const h=i+2*r;for(const p of e)if(!s[p]){const t=n(p);u+t+2*r>o&&(u=0,c++),s[p]={x:u+r,y:l+c*h+r,width:t,height:h,layoutWidth:t,layoutHeight:i},u+=t+2*r}return{mapping:s,xOffset:u,yOffset:l+c*h,canvasHeight:(d=l+(c+1)*h,Math.pow(2,Math.ceil(Math.log2(d))))};var d}({getFontWidth:t=>h.measureText(t).width,fontHeight:1.2*r,buffer:o,characterSet:t,maxCanvasWidth:1024,...e&&{mapping:e.mapping,xOffset:e.xOffset,yOffset:e.yOffset}});if(u.height!==p){const t=h.getImageData(0,0,u.width,u.height);u.height=p,h.putImageData(t,0,0)}if(b(h,n,r,i),s){const e=new l({fontSize:r,buffer:o,radius:a,cutoff:c,fontFamily:n,fontWeight:`${i}`});for(const n of t){const{data:t,width:i,height:o,glyphTop:s}=e.draw(n);d[n].width=i,d[n].layoutOffsetY=.9*r-s;const a=h.createImageData(i,o);v(t,a),h.putImageData(a,d[n].x,d[n].y)}}else for(const l of t)h.fillText(l,d[l].x,d[l].y+o+.9*r);return{xOffset:f,yOffset:A,mapping:d,data:u,width:u.width,height:u.height}}_getKey(){const{fontFamily:t,fontWeight:e,fontSize:n,buffer:i,sdf:r,radius:o,cutoff:s}=this.props;return r?`${t} ${e} ${n} ${i} ${o} ${s}`:`${t} ${e} ${n} ${i}`}}var w=n(90458
vendor: 6,970 bytes, line 2
2);const E={start:1,middle:0,end:-1},C={top:1,center:0,bottom:-1},T=[0,0,0,255],S={billboard:!0,sizeScale:1,sizeUnits:"pixels",sizeMinPixels:0,sizeMaxPixels:Number.MAX_SAFE_INTEGER,background:!1,getBackgroundColor:{type:"accessor",value:[255,255,255,255]},getBorderColor:{type:"accessor",value:T},getBorderWidth:{type:"accessor",value:0},backgroundPadding:{type:"array",value:[0,0,0,0]},characterSet:{type:"object",value:y.characterSet},fontFamily:y.fontFamily,fontWeight:y.fontWeight,lineHeight:1,outlineWidth:{type:"number",value:0,min:0},outlineColor:{type:"color",value:T},fontSettings:{type:"object",value:{},compare:1},wordBreak:"break-word",maxWidth:{type:"number",value:-1},getText:{type:"accessor",value:t=>t.text},getPosition:{type:"accessor",value:t=>t.position},getColor:{type:"accessor",value:T},getSize:{type:"accessor",value:32},getAngle:{type:"accessor",value:0},getTextAnchor:{type:"accessor",value:"middle"},getAlignmentBaseline:{type:"accessor",value:"center"},getPixelOffset:{type:"accessor",value:[0,0]},backgroundColor:{deprecatedFor:["background","getBackgroundColor"]}};class P extends i.A{constructor(){super(...arguments),this.getBoundingRect=(t,e)=>{let{size:[n,i]}=this.transformParagraph(t,e);const{fontSize:r}=this.state.fontAtlasManager.props;n/=r,i/=r;const{getTextAnchor:o,getAlignmentBaseline:s}=this.props;return[(E["function"===typeof o?o(t,e):o]-1)*n/2,(C["function"===typeof s?s(t,e):s]-1)*i/2,n,i]},this.getIconOffsets=(t,e)=>{const{getTextAnchor:n,getAlignmentBaseline:i}=this.props,{x:r,y:o,rowWidth:s,size:[a,l]}=this.transformParagraph(t,e),c=E["function"===typeof n?n(t,e):n],u=C["function"===typeof i?i(t,e):i],h=r.length,d=new Array(2*h);let p=0;for(let f=0;f<h;f++){const t=(1-c)*(a-s[f])/2;d[p++]=(c-1)*a/2+t+r[f],d[p++]=(u-1)*l/2+o[f]}return d}}initializeState(){this.state={styleVersion:0,fontAtlasManager:new x},this.props.maxWidth>0&&r.A.warn("v8.9 breaking change: TextLayer maxWidth is now relative to text size")()}updateState(t){const{props:e,oldProps:n,changeFlags:i}=t;(i.dataChanged||i.updateTriggersChanged&&(i.updateTriggersChanged.all||i.updateTriggersChanged.getText))&&this._updateText();(this._updateFontAtlas()||e.lineHeight!==n.lineHeight||e.wordBreak!==n.wordBreak||e.maxWidth!==n.maxWidth)&&this.setState({styleVersion:this.state.styleVersion+1})}getPickingInfo(t){let{info:e}=t;return e.object=e.index>=0?this.props.data[e.index]:null,e}_updateFontAtlas(){const{fontSettings:t,fontFamily:e,fontWeight:n}=this.props,{fontAtlasManager:i,characterSet:r}=this.state,o={...t,characterSet:r,fontFamily:e,fontWeight:n};if(!i.mapping)return i.setProps(o),!0;for(const s in o)if(o[s]!==i.props[s])return i.setProps(o),!0;return!1}_updateText(){const{data:t,characterSet:e}=this.props,n=t.attributes?.getText;let i,{getText:r}=this.props,s=t.startIndices;const a="auto"===e&&new Set;if(n&&s){const{texts:e,characterCount:o}=function(t){let{value:e,length:n,stride:i,offset:r,startIndices:o,characterSet:s}=t;const a=e.BYTES_PER_ELEMENT,l=i?i/a:1,c=r?r/a:0,u=o[n]||Math.ceil((e.length-c)/l),h=s&&new Set,d=new Array(n);let p=e;if(l>1||c>0){p=new(0,e.constructor)(u);for(let t=0;t<u;t++)p[t]=e[t*l+c]}for(let f=0;f<n;f++){const t=o[f],e=o[f+1]||u,n=p.subarray(t,e);d[f]=String.fromCodePoint.apply(null,n),h&&n.forEach(h.add,h)}if(h)for(const f of h)s.add(String.fromCodePoint(f));return{texts:d,characterCount:u}}({...ArrayBuffer.isView(n)?{value:n}:n,length:t.length,startIndices:s,characterSet:a});i=o,r=(t,n)=>{let{index:i}=n;return e[i]}}else{const{iterable:e,objectInfo:n}=(0,o.X)(t);s=[0],i=0;for(const t of e){n.index++;const e=Array.from(r(t,n)||"");a&&e.forEach(a.add,a),i+=e.length,s.push(i)}}this.setState({getText:r,startIndices:s,numInstances:i,characterSet:a||e})}transformParagraph(t,e){const{fontAtlasManager:n}=this.state,i=n.mapping,r=this.state.getText,{wordBreak:o,lineHeight:s,maxWidth:a}=this.props;return function(t,e,n,i,r){const o=Array.from(t),s=o.length,a=new Array(s),l=new Array(s),c=new Array(s),u=("break-word"===n||"break-all"===n)&&isFinite(i)&&i>0,h=[0,0],p=[0,0];let f=0,m=0,y=0;for(let _=0;_<=s;_++){const t=o[_];if("\n"!==t&&_!==s||(y=_),y>m){const t=u?A(o,n,i,r,m,y):d;for(let n=0;n<=t.length;n++){const i=0===n?m:t[n-1],s=n<t.length?t[n]:y;g(o,i,s,r,a,p);for(let t=i;t<s;t++){const e=o[t],n=r[e]?.layoutOffsetY||0;l[t]=f+p[1]/2+n,c[t]=p[0]}f+=p[1]*e,h[0]=Math.max(h[0],p[0])}m=y}"\n"===t&&(a[m]=0,l[m]=0,c[m]=0,m++)}return h[1]=f,{x:a,y:l,rowWidth:c,size:h}}(r(t,e)||"",s,o,a*n.props.fontSize,i)}renderLayers(){const{startIndices:t,numInstances:e,getText:n,fontAtlasManager:{scale:i,atlas:r,mapping:o},styleVersion:a}=this.state,{data:l,_dataDiff:c,getPosition:u,getColor:h,getSize:d,getAngle:p,getPixelOffset:f,getBackgroundColor:A,getBorderColor:g,getBorderWidth:m,backgroundPadding:_,background:v,billboard:b,fontSettings:x,outlineWidth:E,outlineColor:C,sizeScale:T,sizeUnits:S,sizeMinPixels:P,sizeMaxPixels:M,transitions:I,updateTriggers:B}=this.props,R=this.getSubLayerClass("characters",s.A),L=this.getSubLayerClass("background",w.A);return[v&&new L({getFillColor:A,getLineColor:g,getLineWidth:m,padding:_,getPosition:u,getSize:d,getAngle:p,getPixelOffset:f,billboard:b,sizeScale:T,sizeUnits:S,sizeMinPixels:P,sizeMaxPixels:M,transitions:I&&{getPosition:I.getPosition,getAngle:I.getAngle,getSize:I.getSize,getFillColor:I.getBackgroundColor,getLineColor:I.getBorderColor,getLineWidth:I.getBorderWidth,getPixelOffset:I.getPixelOffset}},this.getSubLayerProps({id:"background",updateTriggers:{getPosition:B.getPosition,getAngle:B.getAngle,getSize:B.getSize,getFillColor:B.getBackgroundColor,getLineColor:B.getBorderColor,getLineWidth:B.getBorderWidth,getPixelOffset:B.getPixelOffset,getBoundingRect:{getText:B.getText,getTextAnchor:B.getTextAnchor,getAlignmentBaseline:B.getAlignmentBaseline,styleVersion:a}}}),{data:l.attributes&&l.attributes.background?{length:l.length,attributes:l.attributes.background}:l,_dataDiff:c,autoHighlight:!1,getBoundingRect:this.getBoundingRect}),new R({sdf:x.sdf,smoothing:Number.isFinite(x.smoothing)?x.smoothing:y.smoothing,outlineWidth:E/(x.radius||y.radius),outlineColor:C,iconAtlas:r,iconMapping:o,getPosition:u,getColor:h,getSize:d,getAngle:p,getPixelOffset:f,billboard:b,sizeScale:T*i,sizeUnits:S,sizeMinPixels:P*i,sizeMaxPixels:M*i,transitions:I&&{getPosition:I.getPosition,getAngle:I.getAngle,getColor:I.getColor,getSize:I.getSize,getPixelOffset:I.getPixelOffset}},this.getSubLayerProps({id:"characters",updateTriggers:{all:B.getText,getPosition:B.getPosition,getAngle:B.getAngle,getColor:B.getColor,getSize:B.getSize,getPixelOffset:B.getPixelOffset,getIconOffsets:{getTextAnchor:B.getTextAnchor,getAlignmentBaseline:B.getAlignmentBaseline,styleVersion:a}}}),{data:l,_dataDiff:c,startIndices:t,numInstances:e,getIconOffsets:this.getIconOffsets,getIcon:n})]}static set fontAtlasCacheLimit(t){!function(t){r.A.assert(Number.isFinite(t)&&t>=3,"Invalid cache limit"),_=new m(t)}(t)}}P.defaultProps=S,P.layerName="TextLayer";const M=P},
vendor: 11,729 bytes, line 2
245527:(t,e,n)=>{"use strict";function i(t){let{data:e,getIndex:n,dataRange:i,replace:r}=t;const{startRow:o=0,endRow:s=1/0}=i,a=e.length;let l=a,c=a;for(let d=0;d<a;d++){const t=n(e[d]);if(l>d&&t>=o&&(l=d),t>=s){c=d;break}}let u=l;const h=c-l!==r.length?e.slice(c):void 0;for(let d=0;d<r.length;d++)e[u++]=r[d];if(h){for(let t=0;t<h.length;t++)e[u++]=h[t];e.length=u}return{startRow:l,endRow:l+r.length}}n.d(e,{J:()=>i})},41260:(t,e,n)=>{"use strict";n.r(e),n.d(e,{ScenegraphLayer:()=>r.A,SimpleMeshLayer:()=>i.A});var i=n(47605),r=n(39481)},39481:(t,e,n)=>{"use strict";n.d(e,{A:()=>N});var i=n(14939),r=n(57941),o=n(22108),s=n(45957),a=n(4172),l=n(99294),c=n(25077),u=n(33128),h=n(15183);class d{id;matrix=new u.k;display=!0;position=new h.P;rotation=new h.P;scale=new h.P(1,1,1);userData={};props={};constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{id:e}=t;this.id=e||(0,l.L)(this.constructor.name),this._setScenegraphNodeProps(t)}getBounds(){return null}destroy(){}delete(){this.destroy()}setProps(t){return this._setScenegraphNodeProps(t),this}toString(){return`{type: ScenegraphNode, id: ${this.id})}`}setPosition(t){return(0,c.v)(3===t.length,"setPosition requires vector argument"),this.position=t,this}setRotation(t){return(0,c.v)(3===t.length,"setRotation requires vector argument"),this.rotation=t,this}setScale(t){return(0,c.v)(3===t.length,"setScale requires vector argument"),this.scale=t,this}setMatrix(t){!(arguments.length>1&&void 0!==arguments[1])||arguments[1]?this.matrix.copy(t):this.matrix=t}setMatrixComponents(t){const{position:e,rotation:n,scale:i,update:r=!0}=t;return e&&this.setPosition(e),n&&this.setRotation(n),i&&this.setScale(i),r&&this.updateMatrix(),this}updateMatrix(){const t=this.position,e=this.rotation,n=this.scale;return this.matrix.identity(),this.matrix.translate(t),this.matrix.rotateXYZ(e),this.matrix.scale(n),this}update(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{position:e,rotation:n,scale:i}=t;return e&&this.setPosition(e),n&&this.setRotation(n),i&&this.setScale(i),this.updateMatrix(),this}getCoordinateUniforms(t,e){(0,c.v)(t),e=e||this.matrix;const n=new u.k(t).multiplyRight(e),i=n.invert(),r=i.transpose();return{viewMatrix:t,modelMatrix:e,objectMatrix:e,worldMatrix:n,worldInverseMatrix:i,worldInverseTransposeMatrix:r}}_setScenegraphNodeProps(t){"display"in t&&(this.display=t.display),"position"in t&&this.setPosition(t.position),"rotation"in t&&this.setRotation(t.rotation),"scale"in t&&this.setScale(t.scale),"matrix"in t&&this.setMatrix(t.matrix),Object.assign(this.props,t)}}var p=n(44261);class f extends d{children;constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t=Array.isArray(t)?{children:t}:t;const{children:e=[]}=t;p.R.assert(e.every((t=>t instanceof d)),"every child must an instance of ScenegraphNode"),super(t),this.children=e}getBounds(){const t=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]];return this.traverse(((e,n)=>{let{worldMatrix:i}=n;const r=e.getBounds();if(!r)return;const[o,s]=r,a=new h.P(o).add(s).divide([2,2,2]);i.transformAsPoint(a,a);const l=new h.P(s).subtract(o).divide([2,2,2]);i.transformAsVector(l,l);for(let c=0;c<8;c++){const e=new h.P(1&c?-1:1,2&c?-1:1,4&c?-1:1).multiply(l).add(a);for(let n=0;n<3;n++)t[0][n]=Math.min(t[0][n],e[n]),t[1][n]=Math.max(t[1][n],e[n])}})),Number.isFinite(t[0][0])?t:null}destroy(){this.children.forEach((t=>t.destroy())),this.removeAll(),super.destroy()}add(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];for(const i of e)Array.isArray(i)?this.add(...i):this.children.push(i);return this}remove(t){const e=this.children,n=e.indexOf(t);return n>-1&&e.splice(n,1),this}removeAll(){return this.children=[],this}traverse(t){let{worldMatrix:e=new u.k}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=new u.k(e).multiplyRight(this.matrix);for(const i of this.children)i instanceof f?i.traverse(t,{worldMatrix:n}):t(i,{worldMatrix:n})}}class A extends d{model;bounds=null;managedResources;constructor(t){super(t),this.model=t.model,this.managedResources=t.managedResources||[],this.bounds=t.bounds||null,this.setProps(t)}getBounds(){return this.bounds}destroy(){this.model&&(this.model.destroy(),this.model=null),this.managedResources.forEach((t=>t.destroy())),this.managedResources=[]}draw(t){return this.model.draw(t)}}var g=n(83647),m=n(68032);const y={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},_={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};class v{name;startTime=0;playing=!0;speed=1;channels=[];constructor(t){Object.assign(this,t)}animate(t){if(!this.playing)return;const e=(t/1e3-this.startTime)*this.speed;this.channels.forEach((t=>{let{sampler:n,target:i,path:r}=t;!function(t,e,n,i){let{input:r,interpolation:o,output:s}=e;const a=r[r.length-1],l=t%a,u=r.findIndex((t=>t>=l)),h=Math.max(0,u-1);if(!Array.isArray(n[i]))switch(i){case"translation":n[i]=[0,0,0];break;case"rotation":n[i]=[0,0,0,1];break;case"scale":n[i]=[1,1,1];break;default:p.R.warn(`Bad animation path ${i}`)()}(0,c.v)(n[i].length===s[h].length);const d=r[h],f=r[u];switch(o){case"STEP":!function(t,e,n){for(let i=0;i<n.length;i++)t[e][i]=n[i]}(n,i,s[h]);break;case"LINEAR":if(f>d){const t=(l-d)/(f-d);!function(t,e,n,i,r){if("rotation"===e){E.slerp({start:n,target:i,ratio:r});for(let n=0;n<E.length;n++)t[e][n]=E[n]}else for(let o=0;o<n.length;o++)t[e][o]=r*i[o]+(1-r)*n[o]}(n,i,s[h],s[u],t)}break;case"CUBICSPLINE":if(f>d){const t=(l-d)/(f-d),e=f-d;!function(t,e,n){let{p0:i,outTangent0:r,inTangent1:o,p1:s,tDiff:a,ratio:l}=n;for(let c=0;c<t[e].length;c++){const n=r[c]*a,u=o[c]*a;t[e][c]=(2*Math.pow(l,3)-3*Math.pow(l,2)+1)*i[c]+(Math.pow(l,3)-2*Math.pow(l,2)+l)*n+(-2*Math.pow(l,3)+3*Math.pow(l,2))*s[c]+(Math.pow(l,3)-Math.pow(l,2))*u}}(n,i,{p0:s[3*h+1],outTangent0:s[3*h+2],inTangent1:s[3*u+0],p1:s[3*u+1],tDiff:e,ratio:t})}break;default:p.R.warn(`Interpolation ${o} not supported`)()}}(e,n,i,r),function(t,e){e.matrix.identity(),t.translation&&e.matrix.translate(t.translation);if(t.rotation){const n=w.fromQuaternion(t.rotation);e.matrix.multiplyRight(n)}t.scale&&e.matrix.scale(t.scale)}(i,i._node)}))}}class b{animations;constructor(t){this.animations=t.animations.map(((e,n)=>{const i=e.name||`Animation-${n}`,r=e.samplers.map((e=>{let{input:n,interpolation:i="LINEAR",output:r}=e;return{input:x(t.accessors[n]),interpolation:i,output:x(t.accessors[r])}})),o=e.channels.map((e=>{let{sampler:n,target:i}=e;return{sampler:r[n],target:t.nodes[i.node],path:i.path}}));return new v({name:i,channels:o})}))}animate(t){this.setTime(t)}setTime(t){this.animations.forEach((e=>e.animate(t)))}getAnimations(){return this.animations}}function x(t){if(!t._animation){const e=_[t.componentType],n=y[t.type],i=n*t.count,{buffer:r,byteOffset:o}=t.bufferView.data,s=new e(r,o+(t.byteOffset||0),i);if(1===n)t._animation=Array.from(s);else{const e=[];for(let t=0;t<s.length;t+=n)e.push(Array.from(s.slice(t,t+n)));t._animation=e}}return t._animation}const w=new u.k;const E=new m.P;var C=n(30141),T=n(86182);function S(t,e){return`#version 300 es\n${e}`}const P={modelOptions:{},pbrDebug:!1,imageBasedLightingEnvironment:null,lights:!0,useTangents:!1};class M{device;options;gltf;constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.device=t,this.options={...P,...e}}instantiate(t){this.gltf=t;return(t.scenes||[]).map((t=>this.createScene(t)))}createAnimator(){return Array.isArray(this.gltf.animations)?new b(this.gltf):null}createScene(t){const e=(t.nodes||[]).map((t=>this.createNode(t)));return new f({id:t.name||t.id,children:e})}createNode(t){if(!t._node){const e=(t.children||[]).map((t=>this.createNode(t)));t.mesh&&e.push(this.createMesh(t.mesh));const n=new f({id:t.name||t.id,children:e});if(t.matrix)n.setMatrix(t.matrix);else{if(n.matrix.identity(),t.translation&&n.matrix.translate(t.translation),t.rotation){const e=(new u.k).fromQuaternion(t.rotation);n.matrix.multiplyRight(e)}t.scale&&n.matrix.scale(t.scale)}t._node=n}return t._node}createMesh(t){if(!t._mesh){const e=(t.primitives||[]).map(((e,n)=>this.createPrimitive(e,n,t))),n=new f({id:t.name||t.id,children:e});t._mesh=n}return t._mesh}createPrimitive(t,e,n){const i=t.name||`${n.name||n.id}-primitive-${e}`,r=function(t){switch(t){case I.POINTS:return"point-list";case I.LINES:return"line-list";case I.LINE_STRIP:return"line-strip";case I.LINE_LOOP:return"line-loop-webgl";case I.TRIANGLES:return"triangle-list";case I.TRIANGLE_STRIP:return"triangle-strip";case I.TRIANGLE_FAN:return"triangle-fan-webgl";default:throw new Error(t)}}(t.mode||4),o=t.indices?t.indices.count:this.getVertexCount(t.attributes),s=function(t,e){const{id:n,geometry:i,material:r,vertexCount:o,materialOptions:s,modelOptions:l}=e,c=(0,T.l)(t,r,i.attributes,s);p.R.info(4,"createGLTFModel defines: ",c.defines)();const u={id:n,geometry:i,topology:i.topology,vertexCount:o,modules:[a.R],vs:S(0,"\n#pragma vscode_glsllint_stage: vert\n#if (__VERSION__ < 300)\n #define _attr attribute\n#else\n #define _attr in\n#endif\n\n // _attr vec4 POSITION;\n _attr vec4 positions;\n\n #ifdef HAS_NORMALS\n // _attr vec4 NORMAL;\n _attr vec4 normals;\n #endif\n\n #ifdef HAS_TANGENTS\n _attr vec4 TANGENT;\n #endif\n\n #ifdef HAS_UV\n // _attr vec2 TEXCOORD_0;\n _attr vec2 texCoords;\n #endif\n\n void main(void) {\n vec4 _NORMAL = vec4(0.);\n vec4 _TANGENT = vec4(0.);\n vec2 _TEXCOORD_0 = vec2(0.);\n\n #ifdef HAS_NORMALS\n _NORMAL = normals;\n #endif\n\n #ifdef HAS_TANGENTS\n _TANGENT = TANGENT;\n #endif\n\n #ifdef HAS_UV\n _TEXCOORD_0 = texCoords;\n #endif\n\n pbr_setPositionNormalTangentUV(positions, _NORMAL, _TANGENT, _TEXCOORD_0);\n gl_Position = u_MVPMatrix * positions;\n }\n"),fs:S(0,"\n#pragma vscode_glsllint_stage: frag\n#if (__VERSION__ < 300)\n #define fragmentColor gl_FragColor\n#else\n out vec4 fragmentColor;\n#endif\n\n void main(void) {\n vec3 pos = pbr_vPosition;\n fragmentColor = pbr_filterColor(vec4(1.0));\n }\n"),...l,bindings:{...c.bindings,...l.bindings},defines:{...c.defines,...l.defines},parameters:{depthWriteEnabled:!0,depthCompare:"less",depthFormat:"depth24plus",cullMode:"back",...c.parameters,...l.parameters},uniforms:{...c.uniforms,...l.uniforms}},h=new C.K(t,u);return new A({managedResources:[],model:h})}(this.device,{id:i,geometry:this.createGeometry(i,t,r),material:t.material,materialOptions:this.options,modelOptions:this.options.modelOptions,vertexCount:o});return s.bounds=[t.attributes.POSITION.min,t.attributes.POSITION.max],s}getVertexCount(t){throw new Error("getVertexCount not implemented")}createGeometry(t,e,n){const i={};for(const[r,o]of Object.entries(e.attributes)){const{components:t,size:e,value:n}=o;i[r]={size:e??t,value:n}}return new g.V({id:t,topology:n,indices:e.indices.value,attributes:i})}createBuffer(t,e){t.bufferView||(t.bufferView={});const{bufferView:n}=t;return n.lumaBuffers||(n.lumaBuffers={}),n.lumaBuffers[e]||(n.lumaBuffers[e]=this.device.createBuffer({id:`from-${n.id}`,data:n.data||t.value})),n.lumaBuffers[e]}createSampler(t){return t}needsPOT(){return!1}}var I;!function(t){t[t.POINTS=0]="POINTS",t[t.LINES=1]="LINES",t[t.LINE_LOOP=2]="LINE_LOOP",t[t.LINE_STRIP=3]="LINE_STRIP",t[t.TRIANGLES=4]="TRIANGLES",t[t.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",t[t.TRIANGLE_FAN=6]="TRIANGLE_FAN"}(I||(I={}));var B=n(93594),R=n(91431);async function L(t){const e=[];return t.scenes.forEach((t=>{t.traverse((t=>{Object.values(t.model.uniforms).forEach((t=>{!1===t.loaded&&e.push(t)}))}))})),await async function(t){for(;t();)await new Promise((t=>requestAnimationFrame(t)))}((()=>e.some((t=>!t.loaded))))}var O=n(35533
vendor: 6,736 bytes, line 2
2);const D=[255,255,255,255],k={scenegraph:{type:"object",value:null,async:!0},getScene:t=>t&&t.scenes?"object"===typeof t.scene?t.scene:t.scenes[t.scene||0]:t,getAnimator:t=>t&&t.animator,_animations:null,sizeScale:{type:"number",value:1,min:0},sizeMinPixels:{type:"number",min:0,value:0},sizeMaxPixels:{type:"number",min:0,value:Number.MAX_SAFE_INTEGER},getPosition:{type:"accessor",value:t=>t.position},getColor:{type:"accessor",value:D},_lighting:"flat",_imageBasedLightingEnvironment:void 0,getOrientation:{type:"accessor",value:[0,0,0]},getScale:{type:"accessor",value:[1,1,1]},getTranslation:{type:"accessor",value:[0,0,0]},getTransformMatrix:{type:"accessor",value:[]},loaders:[B.B]};class F extends i.A{getShaders(){const t=[r.A,o.A];return"pbr"===this.props._lighting&&t.push(a.R),super.getShaders({vs:"#version 300 es\n#define SHADER_NAME scenegraph-layer-vertex-shader\nin vec3 instancePositions;\nin vec3 instancePositions64Low;\nin vec4 instanceColors;\nin vec3 instancePickingColors;\nin vec3 instanceModelMatrixCol0;\nin vec3 instanceModelMatrixCol1;\nin vec3 instanceModelMatrixCol2;\nin vec3 instanceTranslation;\nuniform float sizeScale;\nuniform float sizeMinPixels;\nuniform float sizeMaxPixels;\nuniform mat4 sceneModelMatrix;\nuniform bool composeModelMatrix;\nin vec3 positions;\n#ifdef HAS_UV\nin vec2 texCoords;\n#endif\n#ifdef MODULE_PBR\n#ifdef HAS_NORMALS\nin vec3 normals;\n#endif\n#endif\nout vec4 vColor;\n#ifndef MODULE_PBR\n#ifdef HAS_UV\nout vec2 vTEXCOORD_0;\n#endif\n#endif\nvoid main(void) {\n#if defined(HAS_UV) && !defined(MODULE_PBR)\nvTEXCOORD_0 = texCoords;\ngeometry.uv = texCoords;\n#endif\ngeometry.worldPosition = instancePositions;\ngeometry.pickingColor = instancePickingColors;\nmat3 instanceModelMatrix = mat3(instanceModelMatrixCol0, instanceModelMatrixCol1, instanceModelMatrixCol2);\nvec3 normal = vec3(0.0, 0.0, 1.0);\n#ifdef MODULE_PBR\n#ifdef HAS_NORMALS\nnormal = instanceModelMatrix * (sceneModelMatrix * vec4(normals, 0.0)).xyz;\n#endif\n#endif\nfloat originalSize = project_size_to_pixel(sizeScale);\nfloat clampedSize = clamp(originalSize, sizeMinPixels, sizeMaxPixels);\nvec3 pos = (instanceModelMatrix * (sceneModelMatrix * vec4(positions, 1.0)).xyz) * sizeScale * (clampedSize / originalSize) + instanceTranslation;\nif(composeModelMatrix) {\nDECKGL_FILTER_SIZE(pos, geometry);\ngeometry.normal = project_normal(normal);\ngeometry.worldPosition += pos;\ngl_Position = project_position_to_clipspace(pos + instancePositions, instancePositions64Low, vec3(0.0), geometry.position);\n}\nelse {\npos = project_size(pos);\nDECKGL_FILTER_SIZE(pos, geometry);\ngl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, pos, geometry.position);\ngeometry.normal = project_normal(normal);\n}\nDECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n#ifdef MODULE_PBR\npbr_vPosition = geometry.position.xyz;\n#ifdef HAS_NORMALS\npbr_vNormal = geometry.normal;\n#endif\n#ifdef HAS_UV\npbr_vUV = texCoords;\n#else\npbr_vUV = vec2(0., 0.);\n#endif\ngeometry.uv = pbr_vUV;\n#endif\nvColor = instanceColors;\nDECKGL_FILTER_COLOR(vColor, geometry);\n}\n",fs:"#version 300 es\n#define SHADER_NAME scenegraph-layer-fragment-shader\nuniform float opacity;\nin vec4 vColor;\nout vec4 fragColor;\n#ifndef MODULE_PBR\n#if defined(HAS_UV) && defined(HAS_BASECOLORMAP)\nin vec2 vTEXCOORD_0;\nuniform sampler2D u_BaseColorSampler;\n#endif\n#endif\nvoid main(void) {\n#ifdef MODULE_PBR\nfragColor = vColor * pbr_filterColor(vec4(0));\ngeometry.uv = pbr_vUV;\n#else\n#if defined(HAS_UV) && defined(HAS_BASECOLORMAP)\nfragColor = vColor * texture(u_BaseColorSampler, vTEXCOORD_0);\ngeometry.uv = vTEXCOORD_0;\n#else\nfragColor = vColor;\n#endif\n#endif\nfragColor.a *= opacity;\nDECKGL_FILTER_COLOR(fragColor, geometry);\n}\n",modules:t})}initializeState(){this.getAttributeManager().addInstanced({instancePositions:{size:3,type:"float64",fp64:this.use64bitPositions(),accessor:"getPosition",transition:!0},instanceColors:{type:"unorm8",size:this.props.colorFormat.length,accessor:"getColor",defaultValue:D,transition:!0},instanceModelMatrix:O.U})}updateState(t){super.updateState(t);const{props:e,oldProps:n}=t;e.scenegraph!==n.scenegraph?this._updateScenegraph():e._animations!==n._animations&&this._applyAnimationsProp(this.state.animator,e._animations)}finalizeState(t){super.finalizeState(t),this.state.scenegraph?.destroy()}get isLoaded(){return Boolean(this.state?.scenegraph&&super.isLoaded)}_updateScenegraph(){const t=this.props,{device:e}=this.context;let n=null;if(t.scenegraph instanceof d)n={scenes:[t.scenegraph]};else if(t.scenegraph&&"object"===typeof t.scenegraph){const i=t.scenegraph,r=i.json?(0,R.R)(i):i,o=function(t,e,n){const i=new M(t,n);return{scenes:i.instantiate(e),animator:i.createAnimator()}}(e,r,this._getModelOptions());n={gltf:r,...o},L(o).then((()=>{this.setNeedsRedraw()})).catch((t=>{this.raiseError(t,"loading glTF")}))}const i={layer:this,device:this.context.device},r=t.getScene(n,i),o=t.getAnimator(n,i);if(r instanceof f){this.state.scenegraph?.destroy(),this._applyAnimationsProp(o,t._animations);const e=[];r.traverse((t=>{t instanceof A&&e.push(t.model)})),this.setState({scenegraph:r,animator:o,models:e}),this.getAttributeManager().invalidateAll()}else null!==r&&s.A.warn("invalid scenegraph:",r)()}_applyAnimationsProp(t,e){if(!t||!e)return;const n=t.getAnimations();Object.keys(e).sort().forEach((t=>{const i=e[t];if("*"===t)n.forEach((t=>{Object.assign(t,i)}));else if(Number.isFinite(Number(t))){const e=Number(t);e>=0&&e<n.length?Object.assign(n[e],i):s.A.warn(`animation ${t} not found`)()}else{const e=n.find((e=>{let{name:n}=e;return n===t}));e?Object.assign(e,i):s.A.warn(`animation ${t} not found`)()}}))}_getModelOptions(){const{_imageBasedLightingEnvironment:t}=this.props;let e;return t&&(e="function"===typeof t?t({gl:this.context.gl,layer:this}):t),{imageBasedLightingEnvironment:e,modelOptions:{id:this.props.id,isInstanced:!0,bufferLayout:this.getAttributeManager().getBufferLayouts(),...this.getShaders()},useTangents:!1}}draw(t){let{context:e}=t;if(!this.state.scenegraph)return;this.props._animations&&this.state.animator&&(this.state.animator.animate(e.timeline.getTime()),this.setNeedsRedraw());const{viewport:n,renderPass:i}=this.context,{sizeScale:r,sizeMinPixels:o,sizeMaxPixels:s,opacity:a,coordinateSystem:l}=this.props,c=this.getNumInstances();this.state.scenegraph.traverse(((t,e)=>{let{worldMatrix:u}=e;if(t instanceof A){const{model:e}=t;e.setInstanceCount(c),e.setUniforms({sizeScale:r,opacity:a,sizeMinPixels:o,sizeMaxPixels:s,composeModelMatrix:(0,O.w)(n,l),sceneModelMatrix:u,u_Camera:e.uniforms.project_uCameraPosition}),e.draw(i)}}))}}F.defaultProps=k,F.layerName="ScenegraphLayer";const N=F},4
vendor: 23,615 bytes, line 2
27605:(t,e,n)=>{"use strict";n.d(e,{A:()=>m});var i=n(45957),r=n(14939),o=n(57941),s=n(63351),a=n(22108),l=n(44980),c=n(83647),u=n(30141),h=n(35533);var d=n(78981);function p(t){const e=t.positions||t.POSITION;i.A.assert(e,'no "postions" or "POSITION" attribute in mesh');const n=e.value.length/e.size;let r=t.COLOR_0||t.colors;r||(r={size:3,value:new Float32Array(3*n).fill(1)});let o=t.NORMAL||t.normals;o||(o={size:3,value:new Float32Array(3*n).fill(0)});let s=t.TEXCOORD_0||t.texCoords;return s||(s={size:2,value:new Float32Array(2*n).fill(0)}),{positions:e,colors:r,normals:o,texCoords:s}}function f(t){return t instanceof c.V?(t.attributes=p(t.attributes),t):t.attributes?new c.V({...t,topology:"triangle-list",attributes:p(t.attributes)}):new c.V({topology:"triangle-list",attributes:p(t)})}const A={mesh:{type:"object",value:null,async:!0},texture:{type:"image",value:null,async:!0},sizeScale:{type:"number",value:1,min:0},_instanced:!0,wireframe:!1,material:!0,getPosition:{type:"accessor",value:t=>t.position},getColor:{type:"accessor",value:[0,0,0,255]},getOrientation:{type:"accessor",value:[0,0,0]},getScale:{type:"accessor",value:[1,1,1]},getTranslation:{type:"accessor",value:[0,0,0]},getTransformMatrix:{type:"accessor",value:[]},textureParameters:{type:"object",ignore:!0,value:null}};class g extends r.A{getShaders(){return super.getShaders({vs:"#version 300 es\n#define SHADER_NAME simple-mesh-layer-vs\nuniform float sizeScale;\nuniform bool composeModelMatrix;\nin vec3 positions;\nin vec3 normals;\nin vec3 colors;\nin vec2 texCoords;\nin vec3 instancePositions;\nin vec3 instancePositions64Low;\nin vec4 instanceColors;\nin vec3 instancePickingColors;\nin vec3 instanceModelMatrixCol0;\nin vec3 instanceModelMatrixCol1;\nin vec3 instanceModelMatrixCol2;\nin vec3 instanceTranslation;\nout vec2 vTexCoord;\nout vec3 cameraPosition;\nout vec3 normals_commonspace;\nout vec4 position_commonspace;\nout vec4 vColor;\nvoid main(void) {\ngeometry.worldPosition = instancePositions;\ngeometry.uv = texCoords;\ngeometry.pickingColor = instancePickingColors;\nvTexCoord = texCoords;\ncameraPosition = project_uCameraPosition;\nvColor = vec4(colors * instanceColors.rgb, instanceColors.a);\nmat3 instanceModelMatrix = mat3(instanceModelMatrixCol0, instanceModelMatrixCol1, instanceModelMatrixCol2);\nvec3 pos = (instanceModelMatrix * positions) * sizeScale + instanceTranslation;\nif (composeModelMatrix) {\nDECKGL_FILTER_SIZE(pos, geometry);\nnormals_commonspace = project_normal(instanceModelMatrix * normals);\ngeometry.worldPosition += pos;\ngl_Position = project_position_to_clipspace(pos + instancePositions, instancePositions64Low, vec3(0.0), position_commonspace);\ngeometry.position = position_commonspace;\n}\nelse {\npos = project_size(pos);\nDECKGL_FILTER_SIZE(pos, geometry);\ngl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, pos, position_commonspace);\ngeometry.position = position_commonspace;\nnormals_commonspace = project_normal(instanceModelMatrix * normals);\n}\ngeometry.normal = normals_commonspace;\nDECKGL_FILTER_GL_POSITION(gl_Position, geometry);\nDECKGL_FILTER_COLOR(vColor, geometry);\n}\n",fs:"#version 300 es\n#define SHADER_NAME simple-mesh-layer-fs\nprecision highp float;\nuniform bool hasTexture;\nuniform sampler2D sampler;\nuniform bool flatShading;\nuniform float opacity;\nin vec2 vTexCoord;\nin vec3 cameraPosition;\nin vec3 normals_commonspace;\nin vec4 position_commonspace;\nin vec4 vColor;\nout vec4 fragColor;\nvoid main(void) {\ngeometry.uv = vTexCoord;\nvec3 normal;\nif (flatShading) {\nnormal = normalize(cross(dFdx(position_commonspace.xyz), dFdy(position_commonspace.xyz)));\n} else {\nnormal = normals_commonspace;\n}\nvec4 color = hasTexture ? texture(sampler, vTexCoord) : vColor;\nDECKGL_FILTER_COLOR(color, geometry);\nvec3 lightColor = lighting_getLightColor(color.rgb, cameraPosition, position_commonspace.xyz, normal);\nfragColor = vec4(lightColor, color.a * opacity);\n}\n",modules:[o.A,s.p,a.A]})}getBounds(){if(this.props._instanced)return super.getBounds();let t=this.state.positionBounds;if(t)return t;const{mesh:e}=this.props;if(!e)return null;if(t=e.header?.boundingBox,!t){const{attributes:n}=f(e);n.POSITION=n.POSITION||n.positions,t=(0,d.l)(n)}return this.state.positionBounds=t,t}initializeState(){this.getAttributeManager().addInstanced({instancePositions:{transition:!0,type:"float64",fp64:this.use64bitPositions(),size:3,accessor:"getPosition"},instanceColors:{type:"unorm8",transition:!0,size:this.props.colorFormat.length,accessor:"getColor",defaultValue:[0,0,0,255]},instanceModelMatrix:h.U}),this.setState({emptyTexture:this.context.device.createTexture({data:new Uint8Array(4),width:1,height:1})})}updateState(t){super.updateState(t);const{props:e,oldProps:n,changeFlags:i}=t;if(e.mesh!==n.mesh||i.extensionsChanged){if(this.state.positionBounds=null,this.state.model?.destroy(),e.mesh){this.state.model=this.getModel(e.mesh);const t=e.mesh.attributes||e.mesh;this.setState({hasNormals:Boolean(t.NORMAL||t.normals)})}this.getAttributeManager().invalidateAll()}e.texture!==n.texture&&e.texture instanceof l.g&&this.setTexture(e.texture),this.state.model&&this.state.model.setTopology(this.props.wireframe?"line-strip":"triangle-list")}finalizeState(t){super.finalizeState(t),this.state.emptyTexture.delete()}draw(t){let{uniforms:e}=t;const{model:n}=this.state;if(!n)return;const{viewport:i,renderPass:r}=this.context,{sizeScale:o,coordinateSystem:s,_instanced:a}=this.props;n.setUniforms(e),n.setUniforms({sizeScale:o,composeModelMatrix:!a||(0,h.w)(i,s),flatShading:!this.state.hasNormals}),n.draw(r)}get isLoaded(){return Boolean(this.state?.model&&super.isLoaded)}getModel(t){const e=new u.K(this.context.device,{...this.getShaders(),id:this.props.id,bufferLayout:this.getAttributeManager().getBufferLayouts(),geometry:f(t),isInstanced:!0}),{texture:n}=this.props,{emptyTexture:i}=this.state;return e.setBindings({sampler:n||i}),e.setUniforms({hasTexture:Boolean(n)}),e}setTexture(t){const{emptyTexture:e,model:n}=this.state;n&&(n.setBindings({sampler:t||e}),n.setUniforms({hasTexture:Boolean(t)}))}}g.defaultProps=A,g.layerName="SimpleMeshLayer";const m=g},35533:(t,e,n)=>{"use strict";n.d(e,{U:()=>u,w:()=>h});var i=n(61281),r=n(4896);const o=Math.PI/180,s=new Float32Array(16),a=new Float32Array(12);function l(t,e,n){const i=e[0]*o,r=e[1]*o,s=e[2]*o,a=Math.sin(s),l=Math.sin(i),c=Math.sin(r),u=Math.cos(s),h=Math.cos(i),d=Math.cos(r),p=n[0],f=n[1],A=n[2];t[0]=p*d*h,t[1]=p*c*h,t[2]=p*-l,t[3]=f*(-c*u+d*l*a),t[4]=f*(d*u+c*l*a),t[5]=f*h*a,t[6]=A*(c*a+d*l*u),t[7]=A*(-d*a+c*l*u),t[8]=A*h*u}function c(t){return t[0]=t[0],t[1]=t[1],t[2]=t[2],t[3]=t[4],t[4]=t[5],t[5]=t[6],t[6]=t[8],t[7]=t[9],t[8]=t[10],t[9]=t[12],t[10]=t[13],t[11]=t[14],t.subarray(0,12)}const u={size:12,accessor:["getOrientation","getScale","getTranslation","getTransformMatrix"],shaderAttributes:{instanceModelMatrixCol0:{size:3,elementOffset:0},instanceModelMatrixCol1:{size:3,elementOffset:3},instanceModelMatrixCol2:{size:3,elementOffset:6},instanceTranslation:{size:3,elementOffset:9}},update(t,e){let{startRow:n,endRow:r}=e;const{data:o,getOrientation:u,getScale:h,getTranslation:d,getTransformMatrix:p}=this.props,f=Array.isArray(p),A=f&&16===p.length,g=Array.isArray(h),m=Array.isArray(u),y=Array.isArray(d),_=A||!f&&Boolean(p(o[0]));t.constant=_?A:m&&g&&y;const v=t.value;if(t.constant){let e;if(_)s.set(p),e=c(s);else{e=a;l(e,u,h),e.set(d,9)}t.value=new Float32Array(e)}else{let e=n*t.size;const{iterable:f,objectInfo:b}=(0,i.X)(o,n,r);for(const t of f){let n;if(b.index++,_)s.set(A?p:p(t,b)),n=c(s);else{n=a;l(n,m?u:u(t,b),g?h:h(t,b)),n.set(y?d:d(t,b),9)}v[e++]=n[0],v[e++]=n[1],v[e++]=n[2],v[e++]=n[3],v[e++]=n[4],v[e++]=n[5],v[e++]=n[6],v[e++]=n[7],v[e++]=n[8],v[e++]=n[9],v[e++]=n[10],v[e++]=n[11]}}}};function h(t,e){return e===r.rf.CARTESIAN||e===r.rf.METER_OFFSETS||e===r.rf.DEFAULT&&!t.isGeospatial}},86411:(t,e,n)=>{"use strict";n.d(e,{A:()=>vr});var i=n(58878);let r=1,o=1;class s{time=0;channels=new Map;animations=new Map;playing=!1;lastEngineTime=-1;constructor(){}addChannel(t){const{delay:e=0,duration:n=Number.POSITIVE_INFINITY,rate:i=1,repeat:o=1}=t,s=r++,a={time:0,delay:e,duration:n,rate:i,repeat:o};return this._setChannelTime(a,this.time),this.channels.set(s,a),s}removeChannel(t){this.channels.delete(t);for(const[e,n]of this.animations)n.channel===t&&this.detachAnimation(e)}isFinished(t){const e=this.channels.get(t);return void 0!==e&&this.time>=e.delay+e.duration*e.repeat}getTime(t){if(void 0===t)return this.time;const e=this.channels.get(t);return void 0===e?-1:e.time}setTime(t){this.time=Math.max(0,t);const e=this.channels.values();for(const i of e)this._setChannelTime(i,this.time);const n=this.animations.values();for(const i of n){const{animation:t,channel:e}=i;t.setTime(this.getTime(e))}}play(){this.playing=!0}pause(){this.playing=!1,this.lastEngineTime=-1}reset(){this.setTime(0)}attachAnimation(t,e){const n=o++;return this.animations.set(n,{animation:t,channel:e}),t.setTime(this.getTime(e)),n}detachAnimation(t){this.animations.delete(t)}update(t){this.playing&&(-1===this.lastEngineTime&&(this.lastEngineTime=t),this.setTime(this.time+(t-this.lastEngineTime)),this.lastEngineTime=t)}_setChannelTime(t,e){const n=e-t.delay;n>=t.duration*t.repeat?t.time=t.duration*t.rate:(t.time=Math.max(0,n)%t.duration,t.time*=t.rate)}}var a=n(56830),l=n(11275),c=n(45957),u=n(81997),h=n(8729),d=n(1021),p=n(70889);class f{constructor(t,e,n){this._loadCount=0,this._subscribers=new Set,this.id=t,this.context=n,this.setData(e)}subscribe(t){this._subscribers.add(t)}unsubscribe(t){this._subscribers.delete(t)}inUse(){return this._subscribers.size>0}delete(){}getData(){return this.isLoaded?this._error?Promise.reject(this._error):this._content:this._loader.then((()=>this.getData()))}setData(t,e){if(t===this._data&&!e)return;this._data=t;const n=++this._loadCount;let i=t;"string"===typeof t&&(i=(0,p.H)(t)),i instanceof Promise?(this.isLoaded=!1,this._loader=i.then((t=>{this._loadCount===n&&(this.isLoaded=!0,this._error=void 0,this._content=t)})).catch((t=>{this._loadCount===n&&(this.isLoaded=!0,this._error=t||!0)}))):(this.isLoaded=!0,this._error=void 0,this._content=t);for(const r of this._subscribers)r.onChange(this.getData())}}class A{constructor(t){this.protocol=t.protocol||"resource://",this._context={device:t.device,gl:t.device?.gl,resourceManager:this},this._resources={},this._consumers={},this._pruneRequest=null}contains(t){return!!t.startsWith(this.protocol)||t in this._resources}add(t){let{resourceId:e,data:n,forceUpdate:i=!1,persistent:r=!0}=t,o=this._resources[e];o?o.setData(n,i):(o=new f(e,n,this._context),this._resources[e]=o),o.persistent=r}remove(t){const e=this._resources[t];e&&(e.delete(),delete this._resources[t])}unsubscribe(t){let{consumerId:e}=t;const n=this._consumers[e];if(n){for(const t in n){const e=n[t],i=this._resources[e.resourceId];i&&i.unsubscribe(e)}delete this._consumers[e],this.prune()}}subscribe(t){let{resourceId:e,onChange:n,consumerId:i,requestId:r="default"}=t;const{_resources:o,protocol:s}=this;e.startsWith(s)&&(e=e.replace(s,""),o[e]||this.add({resourceId:e,data:null,persistent:!1}));const a=o[e];if(this._track(i,r,a,n),a)return a.getData()}prune(){this._pruneRequest||(this._pruneRequest=setTimeout((()=>this._prune()),0))}finalize(){for(const t in this._resources)this._resources[t].delete()}_track(t,e,n,i){const r=this._consumers,o=r[t]=r[t]||{};let s=o[e];const a=s&&s.resourceId&&this._resources[s.resourceId];a&&(a.unsubscribe(s),this.prune()),n&&(s?(s.onChange=i,s.resourceId=n.id):s={onChange:i,resourceId:n.id},o[e]=s,n.subscribe(s))}_prune(){this._pruneRequest=null;for(const t of Object.keys(this._resources)){const e=this._resources[t];e.persistent||e.inUse()||(e.delete(),delete this._resources[t])}}}var g=n(5279);class m{constructor(t,e){this._lastRenderedLayers=[],this._needsRedraw=!1,this._needsUpdate=!1,this._nextLayers=null,this._debug=!1,this._defaultShaderModulesChanged=!1,this.activateViewport=t=>{(0,u.A)("layerManager.activateViewport",this,t),t&&(this.context.viewport=t)};const{deck:n,stats:i,viewport:r,timeline:o}=e||{};this.layers=[],this.resourceManager=new A({device:t,protocol:"deck://"}),this.context={mousePosition:null,userData:{},layerManager:this,device:t,gl:t?.gl,deck:n,shaderAssembler:(0,a.cN)(),defaultShaderModules:[],renderPass:void 0,stats:i||new d.A({id:"deck.gl"}),viewport:r||new g.A({id:"DEFAULT-INITIAL-VIEWPORT"}),timeline:o||new s,resourceManager:this.resourceManager,onError:void 0},Object.seal(this)}finalize(){this.resourceManager.finalize();for(const t of this.layers)this._finalizeLayer(t)}needsRedraw(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1},e=this._needsRedraw;t.clearRedrawFlags&&(this._needsRedraw=!1);for(const n of this.layers){const i=n.getNeedsRedraw(t);e=e||i}return e}needsUpdate(){return this._nextLayers&&this._nextLayers!==this._lastRenderedLayers?"layers changed":this._defaultShaderModulesChanged?"shader modules changed":this._needsUpdate}setNeedsRedraw(t){this._needsRedraw=this._needsRedraw||t}setNeedsUpdate(t){this._needsUpdate=this._needsUpdate||t}getLayers(){let{layerIds:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t?this.layers.filter((e=>t.find((t=>0===e.id.indexOf(t))))):this.layers}setProps(t){"debug"in t&&(this._debug=t.debug),"userData"in t&&(this.context.userData=t.userData),"layers"in t&&(this._nextLayers=t.layers),"onError"in t&&(this.context.onError=t.onError)}setLayers(t,e){(0,u.A)("layerManager.setLayers",this,e,t),this._lastRenderedLayers=t;const n=(0,h.B)(t,Boolean);for(const i of n)i.context=this.context;this._updateLayers(this.layers,n)}updateLayers(){const t=this.needsUpdate();t&&(this.setNeedsRedraw(`updating layers: ${t}`),this.setLayers(this._nextLayers||this._lastRenderedLayers,t)),this._nextLayers=null}addDefaultShaderModule(t){const{defaultShaderModules:e}=this.context;e.find((e=>e.name===t.name))||(e.push(t),this._defaultShaderModulesChanged=!0)}removeDefaultShaderModule(t){const{defaultShaderModules:e}=this.context,n=e.findIndex((e=>e.name===t.name));n>=0&&(e.splice(n,1),this._defaultShaderModulesChanged=!0)}_handleError(t,e,n){n.raiseError(e,`${t} of ${n}`)}_updateLayers(t,e){const n={};for(const o of t)n[o.id]?c.A.warn(`Multiple old layers with same id ${o.id}`)():n[o.id]=o;if(this._defaultShaderModulesChanged){for(const e of t)e.setNeedsUpdate(),e.setChangeFlags({extensionsChanged:!0});this._defaultShaderModulesChanged=!1}const i=[];this._updateSublayersRecursively(e,n,i),this._finalizeOldLayers(n);let r=!1;for(const o of i)if(o.hasUniformTransition()){r=`Uniform transition in ${o}`;break}this._needsUpdate=r,this.layers=i}_updateSublayersRecursively(t,e,n){for(const r of t){r.context=this.context;const t=e[r.id];null===t&&c.A.warn(`Multiple new layers with same id ${r.id}`)(),e[r.id]=null;let o=null;try{this._debug&&t!==r&&r.validateProps(),t?(this._transferLayerState(t,r),this._updateLayer(r)):this._initializeLayer(r),n.push(r),o=r.isComposite?r.getSubLayers():null}catch(i){this._handleError("matching",i,r)}o&&this._updateSublayersRecursively(o,e,n)}}_finalizeOldLayers(t){for(const e in t){const n=t[e];n&&this._finalizeLayer(n)}}_initializeLayer(t){try{t._initialize(),t.lifecycle=l.VD.INITIALIZED}catch(e){this._handleError("initialization",e,t)}}_transferLayerState(t,e){e._transferState(t),e.lifecycle=l.VD.MATCHED,e!==t&&(t.lifecycle=l.VD.AWAITING_GC)}_updateLayer(t){try{t._update()}catch(e){this._handleError("update",e,t)}}_finalizeLayer(t){this._needsRedraw=this._needsRedraw||`finalized ${t}`,t.lifecycle=l.VD.AWAITING_FINALIZATION;try{t._finalize(),t.lifecycle=l.VD.FINALIZED}catch(e){this._handleError("finalization",e,t)}}}var y=n(67440);class _{constructor(t){this.views=[],this.width=100,this.height=100,this.viewState={},this.controllers={},this.timeline=t.timeline,this._viewports=[],this._viewportMap={},this._isUpdating=!1,this._needsRedraw="First render",this._needsUpdate="Initialize",this._eventManager=t.eventManager,this._eventCallbacks={onViewStateChange:t.onViewStateChange,onInteractionStateChange:t.onInteractionStateChange},Object.seal(this),this.setProps(t)}finalize(){for(const t in this.controllers){const e=this.controllers[t];e&&e.finalize()}this.controllers={}}needsRedraw(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1};const e=this._needsRedraw;return t.clearRedrawFlags&&(this._needsRedraw=!1),e}setNeedsUpdate(t){this._needsUpdate=this._needsUpdate||t,this._needsRedraw=this._needsRedraw||t}updateViewStates(){for(const t in this.controllers){const e=this.controllers[t];e&&e.updateTransition()}}getViewports(t){return t?this._viewports.filter((e=>e.containsPixel(t))):this._viewports}getViews(){const t={};return this.views.forEach((e=>{t[e.id]=e})),t}getView(t){return this.views.find((e=>e.id===t))}getViewState(t){const e="string"===typeof t?this.getView(t):t,n=e&&this.viewState[e.getViewStateId()]||this.viewState;return e?e.filterViewState(n):n}getViewport(t){return this._viewportMap[t]}unproject(t,e){const n=this.getViewports(),i={x:t[0],y:t[1]};for(let r=n.length-1;r>=0;--r){const o=n[r];if(o.containsPixel(i)){const n=t.slice();return n[0]-=o.x,n[1]-=o.y,o.unproject(n,e)}}return null}setProps(t){t.views&&this._setViews(t.views),t.viewState&&this._setViewState(t.viewState),("width"in t||"height"in t)&&this._setSize(t.width,t.height),this._isUpdating||this._update()}_update(){this._isUpdating=!0,this._needsUpdate&&(this._needsUpdate=!1,this._rebuildViewports()),this._needsUpdate&&(this._needsUpdate=!1,this._rebuildViewports()),this._isUpdating=!1}_setSize(t,e){t===this.width&&e===this.height||(this.width=t,this.height=e,this.setNeedsUpdate("Size changed"))}_setViews(t){t=(0,h.B)(t,Boolean);this._diffViews(t,this.views)&&this.setNeedsUpdate("views changed"),this.views=t}_setViewState(t){if(t){!(0,y.b)(t,this.viewState,3)&&this.setNeedsUpdate("viewState changed"),this.viewState=t}else c.A.warn("missing `viewState` or `initialViewState`")()}_createController(t,e){return new(0,e.type)({timeline:this.timeline,eventManager:this._eventManager,onViewStateChange:this._eventCallbacks.onViewStateChange,onStateChange:this._eventCallbacks.onInteractionStateChange,makeViewport:e=>this.getView(t.id)?.makeViewport({viewState:e,width:this.width,height:this.height})})}_updateController(t,e,n,i){const r=t.controller;if(r&&n){const o={...e,...r,id:t.id,x:n.x,y:n.y,width:n.width,height:n.height};return i&&i.constructor===r.type||(i=this._createController(t,o)),i&&i.setProps(o),i}return null}_rebuildViewports(){const{views:t}=this,e=this.controllers;this._viewports=[],this.controllers={};let n=!1;for(let i=t.length;i--;){const r=t[i],o=this.getViewState(r),s=r.makeViewport({viewState:o,width:this.width,height:this.height});let a=e[r.id];const l=Boolean(r.controller);l&&!a&&(n=!0),!n&&l||!a||(a.finalize(),a=null),this.controllers[r.id]=this._updateController(r,o,s,a),s&&this._viewports.unshift(s)}for(const i in e){const t=e[i];t&&!this.controllers[i]&&t.finalize()}this._buildViewportMap()}_buildViewportMap(){this._viewportMap={},this._viewports.forEach((t=>{t.id&&(this._viewportMap[t.id]=this._viewportMap[t.id]||t)}))}_diffViews(t,e){return t.length!==e.length||t.some(((n,i)=>!t[i].equals(e[i])))}}const v=/([0-9]+\.?[0-9]*)(%|px)/;function b(t){switch(typeof t){case"number":return{position:t,relative:!1};case"string":const e=v.exec(t);if(e&&e.length>=3){const t="%"===e[2],n=parseFloat(e[1]);return{position:t?n/100:n,relative:t}}default:throw new Error(`Could not parse position string ${t}`)}}function x(t,e){return t.relative?Math.round(t.position*e):t.position}class w{constructor(t){const{id:e,x:n=0,y:i=0,width:r="100%",height:o="100%",padding:s=null}=t;this.id=e||this.constructor.displayName||"view",this.props={...t,id:this.id},this._x=b(n),this._y=b(i),this._width=b(r),this._height=b(o),this._padding=s&&{left:b(s.left||0),right:b(s.right||0),top:b(s.top||0),bottom:b(s.bottom||0)},this.equals=this.equals.bind(this),Object.seal(this)}equals(t){return this===t||this.ViewportType===t.ViewportType&&(0,y.b)(this.props,t.props,2)}makeViewport(t){let{width:e,height:n,viewState:i}=t;i=this.filterViewState(i);const r=this.getDimensions({width:e,height:n});return r.height&&r.width?new this.ViewportType({...i,...this.props,...r}):null}getViewStateId(){const{viewState:t}=this.props;return"string"===typeof t?t:t?.id||this.id}filterViewState(t){if(this.props.viewState&&"object"===typeof this.props.viewState){if(!this.props.viewState.id)return this.props.viewState;const e={...t};for(const t in this.props.viewState)"id"!==t&&(e[t]=this.props.viewState[t]);return e}return t}getDimensions(t){let{width:e,height:n}=t;const i={x:x(this._x,e),y:x(this._y,n),width:x(this._width,e),height:x(this._height,n)};return this._padding&&(i.padding={left:x(this._padding.left,e),top:x(this._padding.top,n),right:x(this._padding.right,e),bottom:x(this._padding.bottom,n)}),i}get controller(){const t=this.props.controller;return t?!0===t?{type:this.ControllerType}:"function"===typeof t?{type:t}:{type:this.ControllerType,...t}:null}}var E=n(2816),C=n(25195),T=n(48163);const S=()=>{},P=2,M=3,I=t=>t,B=1;class R{constructor(t){this._onTransitionUpdate=t=>{const{time:e,settings:{interpolator:n,startProps:i,endProps:r,duration:o,easing:s}}=t,a=s(e/o),l=n.interpolateProps(i,r,a);this.propsInTransition=this.getControllerState({...this.props,...l}).getViewportProps(),this.onViewStateChange({viewState:this.propsInTransition,oldViewState:this.props})},this.getControllerState=t.getControllerState,this.propsInTransition=null,this.transition=new T.A(t.timeline),this.onViewStateChange=t.onViewStateChange||S,this.onStateChange=t.onStateChange||S}finalize(){this.transition.cancel()}getViewportInTransition(){return this.propsInTransition}processViewStateChange(t){let e=!1;const n=this.props;if(this.props=t,!n||this._shouldIgnoreViewportChange(n,t))return!1;if(this._isTransitionEnabled(t)){let i=n;if(this.transition.inProgress){const{interruption:t,endProps:e}=this.transition.settings;i={...n,...t===P?e:this.propsInTransition||n}}this._triggerTransition(i,t),e=!0}else this.transition.cancel();return e}updateTransition(){this.transition.update()}_isTransitionEnabled(t){const{transitionDuration:e,transitionInterpolator:n}=t;return(e>0||"auto"===e)&&Boolean(n)}_isUpdateDueToCurrentTransition(t){return!(!this.transition.inProgress||!this.propsInTransition)&&this.transition.settings.interpolator.arePropsEqual(t,this.propsInTransition)}_shouldIgnoreViewportChange(t,e){if(this.transition.inProgress){return this.transition.settings.interruption===M||this._isUpdateDueToCurrentTransition(e)}return!this._isTransitionEnabled(e)||e.transitionInterpolator.arePropsEqual(t,e)}_triggerTransition(t,e){const n=this.getControllerState(t),i=this.getControllerState(e).shortestPathFrom(n),r=e.transitionInterpolator,o=r.getDuration?r.getDuration(t,e):e.transitionDuration;if(0===o)return;const s=r.initializeProps(t,i);this.propsInTransition={};const a={duration:o,easing:e.transitionEasing||I,interpolator:r,interruption:e.transitionInterruption||B,startProps:s.start,endProps:s.end,onStart:e.onTransitionStart,onUpdate:this._onTransitionUpdate,onInterrupt:this._onTransitionEnd(e.onTransitionInterrupt),onEnd:this._onTransitionEnd(e.onTransitionEnd)};this.transition.start(a),this.onStateChange({inTransition:!0}),this.updateTransition()}_onTransitionEnd(t){return e=>{this.propsInTransition=null,this.onStateChange({inTransition:!1,isZooming:!1,isPanning:!1,isRotating:!1}),t?.(e)}}}var L=n(57813
vendor: 11,819 bytes, line 2
2);class O{constructor(t){const{compare:e,extract:n,required:i}=t;this._propsToCompare=e,this._propsToExtract=n||e,this._requiredProps=i}arePropsEqual(t,e){for(const n of this._propsToCompare)if(!(n in t)||!(n in e)||!(0,C.aI)(t[n],e[n]))return!1;return!0}initializeProps(t,e){const n={},i={};for(const r of this._propsToExtract)(r in t||r in e)&&(n[r]=t[r],i[r]=e[r]);return this._checkRequiredProps(n),this._checkRequiredProps(i),{start:n,end:i}}getDuration(t,e){return e.transitionDuration}_checkRequiredProps(t){this._requiredProps&&this._requiredProps.forEach((e=>{const n=t[e];(0,L.A)(Number.isFinite(n)||Array.isArray(n),`${e} is required for transition`)}))}}const D=["longitude","latitude","zoom","bearing","pitch"],k=["longitude","latitude","zoom"];class F extends O{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const e=Array.isArray(t)?t:t.transitionProps,n=Array.isArray(t)?{}:t;n.transitionProps=Array.isArray(e)?{compare:e,required:e}:e||{compare:D,required:k},super(n.transitionProps),this.opts=n}initializeProps(t,e){const n=super.initializeProps(t,e),{makeViewport:i,around:r}=this.opts;if(i&&r){const o=i(t),s=i(e),a=o.unproject(r);n.start.around=r,Object.assign(n.end,{around:s.project(a),aroundPosition:a,width:e.width,height:e.height})}return n}interpolateProps(t,e,n){const i={};for(const r of this._propsToExtract)i[r]=(0,C.Cc)(t[r]||0,e[r]||0,n);if(e.aroundPosition&&this.opts.makeViewport){const r=this.opts.makeViewport({...e,...i});Object.assign(i,r.panByPosition(e.aroundPosition,(0,C.Cc)(t.around,e.around,n)))}return i}}const N={transitionDuration:0},z=t=>1-(1-t)*(1-t),U=["wheel"],G=["panstart","panmove","panend"],V=["pinchstart","pinchmove","pinchend"],j=["tripanstart","tripanmove","tripanend"],H=["doubletap"],W=["keydown"],q={};class Z{constructor(t){this.state={},this._events={},this._interactionState={isDragging:!1},this._customEvents=[],this._eventStartBlocked=null,this._panMove=!1,this.invertPan=!1,this.dragMode="rotate",this.inertia=0,this.scrollZoom=!0,this.dragPan=!0,this.dragRotate=!0,this.doubleClickZoom=!0,this.touchZoom=!0,this.touchRotate=!1,this.keyboard=!0,this.transitionManager=new R({...t,getControllerState:t=>new this.ControllerState(t),onViewStateChange:this._onTransition.bind(this),onStateChange:this._setInteractionState.bind(this)}),this.handleEvent=this.handleEvent.bind(this),this.eventManager=t.eventManager,this.onViewStateChange=t.onViewStateChange||(()=>{}),this.onStateChange=t.onStateChange||(()=>{}),this.makeViewport=t.makeViewport}set events(t){this.toggleEvents(this._customEvents,!1),this.toggleEvents(t,!0),this._customEvents=t,this.props&&this.setProps(this.props)}finalize(){for(const t in this._events)this._events[t]&&this.eventManager?.off(t,this.handleEvent);this.transitionManager.finalize()}handleEvent(t){this._controllerState=void 0;const e=this._eventStartBlocked;switch(t.type){case"panstart":return!e&&this._onPanStart(t);case"panmove":return this._onPan(t);case"panend":return this._onPanEnd(t);case"pinchstart":return!e&&this._onPinchStart(t);case"pinchmove":return this._onPinch(t);case"pinchend":return this._onPinchEnd(t);case"tripanstart":return!e&&this._onTriplePanStart(t);case"tripanmove":return this._onTriplePan(t);case"tripanend":return this._onTriplePanEnd(t);case"doubletap":return this._onDoubleTap(t);case"wheel":return this._onWheel(t);case"keydown":return this._onKeyDown(t);default:return!1}}get controllerState(){return this._controllerState=this._controllerState||new this.ControllerState({makeViewport:this.makeViewport,...this.props,...this.state}),this._controllerState}getCenter(t){const{x:e,y:n}=this.props,{offsetCenter:i}=t;return[i.x-e,i.y-n]}isPointInBounds(t,e){const{width:n,height:i}=this.props;if(e&&e.handled)return!1;const r=t[0]>=0&&t[0]<=n&&t[1]>=0&&t[1]<=i;return r&&e&&e.stopPropagation(),r}isFunctionKeyPressed(t){const{srcEvent:e}=t;return Boolean(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}isDragging(){return this._interactionState.isDragging||!1}blockEvents(t){const e=setTimeout((()=>{this._eventStartBlocked===e&&(this._eventStartBlocked=null)}),t);this._eventStartBlocked=e}setProps(t){t.dragMode&&(this.dragMode=t.dragMode),this.props=t,"transitionInterpolator"in t||(t.transitionInterpolator=this._getTransitionProps().transitionInterpolator),this.transitionManager.processViewStateChange(t);const{inertia:e}=t;this.inertia=Number.isFinite(e)?e:!0===e?300:0;const{scrollZoom:n=!0,dragPan:i=!0,dragRotate:r=!0,doubleClickZoom:o=!0,touchZoom:s=!0,touchRotate:a=!1,keyboard:l=!0}=t,c=Boolean(this.onViewStateChange);this.toggleEvents(U,c&&n),this.toggleEvents(G,c),this.toggleEvents(V,c&&(s||a)),this.toggleEvents(j,c&&a),this.toggleEvents(H,c&&o),this.toggleEvents(W,c&&l),this.scrollZoom=n,this.dragPan=i,this.dragRotate=r,this.doubleClickZoom=o,this.touchZoom=s,this.touchRotate=a,this.keyboard=l}updateTransition(){this.transitionManager.updateTransition()}toggleEvents(t,e){this.eventManager&&t.forEach((t=>{this._events[t]!==e&&(this._events[t]=e,e?this.eventManager.on(t,this.handleEvent):this.eventManager.off(t,this.handleEvent))}))}updateViewport(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i={...t.getViewportProps(),...e},r=this.controllerState!==t;if(this.state=t.getState(),this._setInteractionState(n),r){const t=this.controllerState&&this.controllerState.getViewportProps();this.onViewStateChange&&this.onViewStateChange({viewState:i,interactionState:this._interactionState,oldViewState:t,viewId:this.props.id})}}_onTransition(t){this.onViewStateChange({...t,interactionState:this._interactionState,viewId:this.props.id})}_setInteractionState(t){Object.assign(this._interactionState,t),this.onStateChange(this._interactionState)}_onPanStart(t){const e=this.getCenter(t);if(!this.isPointInBounds(e,t))return!1;let n=this.isFunctionKeyPressed(t)||t.rightButton||!1;(this.invertPan||"pan"===this.dragMode)&&(n=!n);const i=this.controllerState[n?"panStart":"rotateStart"]({pos:e});return this._panMove=n,this.updateViewport(i,N,{isDragging:!0}),!0}_onPan(t){return!!this.isDragging()&&(this._panMove?this._onPanMove(t):this._onPanRotate(t))}_onPanEnd(t){return!!this.isDragging()&&(this._panMove?this._onPanMoveEnd(t):this._onPanRotateEnd(t))}_onPanMove(t){if(!this.dragPan)return!1;const e=this.getCenter(t),n=this.controllerState.pan({pos:e});return this.updateViewport(n,N,{isDragging:!0,isPanning:!0}),!0}_onPanMoveEnd(t){const{inertia:e}=this;if(this.dragPan&&e&&t.velocity){const n=this.getCenter(t),i=[n[0]+t.velocityX*e/2,n[1]+t.velocityY*e/2],r=this.controllerState.pan({pos:i}).panEnd();this.updateViewport(r,{...this._getTransitionProps(),transitionDuration:e,transitionEasing:z},{isDragging:!1,isPanning:!0})}else{const t=this.controllerState.panEnd();this.updateViewport(t,null,{isDragging:!1,isPanning:!1})}return!0}_onPanRotate(t){if(!this.dragRotate)return!1;const e=this.getCenter(t),n=this.controllerState.rotate({pos:e});return this.updateViewport(n,N,{isDragging:!0,isRotating:!0}),!0}_onPanRotateEnd(t){const{inertia:e}=this;if(this.dragRotate&&e&&t.velocity){const n=this.getCenter(t),i=[n[0]+t.velocityX*e/2,n[1]+t.velocityY*e/2],r=this.controllerState.rotate({pos:i}).rotateEnd();this.updateViewport(r,{...this._getTransitionProps(),transitionDuration:e,transitionEasing:z},{isDragging:!1,isRotating:!0})}else{const t=this.controllerState.rotateEnd();this.updateViewport(t,null,{isDragging:!1,isRotating:!1})}return!0}_onWheel(t){if(!this.scrollZoom)return!1;const e=this.getCenter(t);if(!this.isPointInBounds(e,t))return!1;t.srcEvent.preventDefault();const{speed:n=.01,smooth:i=!1}=!0===this.scrollZoom?{}:this.scrollZoom,{delta:r}=t;let o=2/(1+Math.exp(-Math.abs(r*n)));r<0&&0!==o&&(o=1/o);const s=this.controllerState.zoom({pos:e,scale:o});return this.updateViewport(s,{...this._getTransitionProps({around:e}),transitionDuration:i?250:1},{isZooming:!0,isPanning:!0}),!0}_onTriplePanStart(t){const e=this.getCenter(t);if(!this.isPointInBounds(e,t))return!1;const n=this.controllerState.rotateStart({pos:e});return this.updateViewport(n,N,{isDragging:!0}),!0}_onTriplePan(t){if(!this.touchRotate)return!1;if(!this.isDragging())return!1;const e=this.getCenter(t);e[0]-=t.deltaX;const n=this.controllerState.rotate({pos:e});return this.updateViewport(n,N,{isDragging:!0,isRotating:!0}),!0}_onTriplePanEnd(t){if(!this.isDragging())return!1;const{inertia:e}=this;if(this.touchRotate&&e&&t.velocityY){const n=this.getCenter(t),i=[n[0],n[1]+=t.velocityY*e/2],r=this.controllerState.rotate({pos:i});this.updateViewport(r,{...this._getTransitionProps(),transitionDuration:e,transitionEasing:z},{isDragging:!1,isRotating:!0}),this.blockEvents(e)}else{const t=this.controllerState.rotateEnd();this.updateViewport(t,null,{isDragging:!1,isRotating:!1})}return!0}_onPinchStart(t){const e=this.getCenter(t);if(!this.isPointInBounds(e,t))return!1;const n=this.controllerState.zoomStart({pos:e}).rotateStart({pos:e});return q._startPinchRotation=t.rotation,q._lastPinchEvent=t,this.updateViewport(n,N,{isDragging:!0}),!0}_onPinch(t){if(!this.touchZoom&&!this.touchRotate)return!1;if(!this.isDragging())return!1;let e=this.controllerState;if(this.touchZoom){const{scale:n}=t,i=this.getCenter(t);e=e.zoom({pos:i,scale:n})}if(this.touchRotate){const{rotation:n}=t;e=e.rotate({deltaAngleX:q._startPinchRotation-n})}return this.updateViewport(e,N,{isDragging:!0,isPanning:this.touchZoom,isZooming:this.touchZoom,isRotating:this.touchRotate}),q._lastPinchEvent=t,!0}_onPinchEnd(t){if(!this.isDragging())return!1;const{inertia:e}=this,{_lastPinchEvent:n}=q;if(this.touchZoom&&e&&n&&t.scale!==n.scale){const i=this.getCenter(t);let r=this.controllerState.rotateEnd();const o=Math.log2(t.scale),s=(o-Math.log2(n.scale))/(t.deltaTime-n.deltaTime),a=Math.pow(2,o+s*e/2);r=r.zoom({pos:i,scale:a}).zoomEnd(),this.updateViewport(r,{...this._getTransitionProps({around:i}),transitionDuration:e,transitionEasing:z},{isDragging:!1,isPanning:this.touchZoom,isZooming:this.touchZoom,isRotating:!1}),this.blockEvents(e)}else{const t=this.controllerState.zoomEnd().rotateEnd();this.updateViewport(t,null,{isDragging:!1,isPanning:!1,isZooming:!1,isRotating:!1})}return q._startPinchRotation=null,q._lastPinchEvent=null,!0}_onDoubleTap(t){if(!this.doubleClickZoom)return!1;const e=this.getCenter(t);if(!this.isPointInBounds(e,t))return!1;const n=this.isFunctionKeyPressed(t),i=this.controllerState.zoom({pos:e,scale:n?.5:2});return this.updateViewport(i,this._getTransitionProps({around:e}),{isZooming:!0,isPanning:!0}),this.blockEvents(100),!0}_onKeyDown(t){if(!this.keyboard)return!1;const e=this.isFunctionKeyPressed(t),{zoomSpeed:n,moveSpeed:i,rotateSpeedX:r,rotateSpeedY:o}=!0===this.keyboard?{}:this.keyboard,{controllerState:s}=this;let a;const l={};switch(t.srcEvent.code){case"Minus":a=e?s.zoomOut(n).zoomOut(n):s.zoomOut(n),l.isZooming=!0;break;case"Equal":a=e?s.zoomIn(n).zoomIn(n):s.zoomIn(n),l.isZooming=!0;break;case"ArrowLeft":e?(a=s.rotateLeft(r),l.isRotating=!0):(a=s.moveLeft(i),l.isPanning=!0);break;case"ArrowRight":e?(a=s.rotateRight(r),l.isRotating=!0):(a=s.moveRight(i),l.isPanning=!0);break;case"ArrowUp":e?(a=s.rotateUp(o),l.isRotating=!0):(a=s.moveUp(i),l.isPanning=!0);break;case"ArrowDown":e?(a=s.rotateDown(o),l.isRotating=!0):(a=s.moveDown(i),l.isPanning=!0);break;default:return!1}return this.updateViewport(a,this._getTransitionProps(),l),!0}_getTransitionProps(t){const{transition:e}=this;return e&&e.transitionInterpolator?t?{...e,transitionInterpolator:new F({...t,...e.transitionInterpolator.opts,makeViewport:this.controllerState.makeViewport})}:e:N}}class X{constructor(t,e){this._viewportProps=this.applyConstraints(t),this._state=e}getViewportProps(){return this._viewportProps}getState(){return this._state}}var K=n(
vendor: 11,020 bytes, line 2
268945);class Q extends X{constructor(t){const{width:e,height:n,latitude:i,longitude:r,zoom:o,bearing:s=0,pitch:a=0,altitude:l=1.5,position:c=[0,0,0],maxZoom:u=20,minZoom:h=0,maxPitch:d=60,minPitch:p=0,startPanLngLat:f,startZoomLngLat:A,startRotatePos:g,startBearing:m,startPitch:y,startZoom:_,normalize:v=!0}=t;(0,L.A)(Number.isFinite(r)),(0,L.A)(Number.isFinite(i)),(0,L.A)(Number.isFinite(o)),super({width:e,height:n,latitude:i,longitude:r,zoom:o,bearing:s,pitch:a,altitude:l,maxZoom:u,minZoom:h,maxPitch:d,minPitch:p,normalize:v,position:c},{startPanLngLat:f,startZoomLngLat:A,startRotatePos:g,startBearing:m,startPitch:y,startZoom:_}),this.makeViewport=t.makeViewport}panStart(t){let{pos:e}=t;return this._getUpdatedState({startPanLngLat:this._unproject(e)})}pan(t){let{pos:e,startPos:n}=t;const i=this.getState().startPanLngLat||this._unproject(n);if(!i)return this;const r=this.makeViewport(this.getViewportProps()).panByPosition(i,e);return this._getUpdatedState(r)}panEnd(){return this._getUpdatedState({startPanLngLat:null})}rotateStart(t){let{pos:e}=t;return this._getUpdatedState({startRotatePos:e,startBearing:this.getViewportProps().bearing,startPitch:this.getViewportProps().pitch})}rotate(t){let{pos:e,deltaAngleX:n=0,deltaAngleY:i=0}=t;const{startRotatePos:r,startBearing:o,startPitch:s}=this.getState();if(!r||void 0===o||void 0===s)return this;let a;return a=e?this._getNewRotation(e,r,s,o):{bearing:o+n,pitch:s+i},this._getUpdatedState(a)}rotateEnd(){return this._getUpdatedState({startBearing:null,startPitch:null})}zoomStart(t){let{pos:e}=t;return this._getUpdatedState({startZoomLngLat:this._unproject(e),startZoom:this.getViewportProps().zoom})}zoom(t){let{pos:e,startPos:n,scale:i}=t,{startZoom:r,startZoomLngLat:o}=this.getState();if(o||(r=this.getViewportProps().zoom,o=this._unproject(n)||this._unproject(e)),!o)return this;const{maxZoom:s,minZoom:a}=this.getViewportProps();let l=r+Math.log2(i);l=(0,C.qE)(l,a,s);const c=this.makeViewport({...this.getViewportProps(),zoom:l});return this._getUpdatedState({zoom:l,...c.panByPosition(o,e)})}zoomEnd(){return this._getUpdatedState({startZoomLngLat:null,startZoom:null})}zoomIn(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:2;return this._zoomFromCenter(t)}zoomOut(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:2;return this._zoomFromCenter(1/t)}moveLeft(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:100;return this._panFromCenter([t,0])}moveRight(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:100;return this._panFromCenter([-t,0])}moveUp(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:100;return this._panFromCenter([0,t])}moveDown(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:100;return this._panFromCenter([0,-t])}rotateLeft(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:15;return this._getUpdatedState({bearing:this.getViewportProps().bearing-t})}rotateRight(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:15;return this._getUpdatedState({bearing:this.getViewportProps().bearing+t})}rotateUp(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;return this._getUpdatedState({pitch:this.getViewportProps().pitch+t})}rotateDown(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;return this._getUpdatedState({pitch:this.getViewportProps().pitch-t})}shortestPathFrom(t){const e=t.getViewportProps(),n={...this.getViewportProps()},{bearing:i,longitude:r}=n;return Math.abs(i-e.bearing)>180&&(n.bearing=i<0?i+360:i-360),Math.abs(r-e.longitude)>180&&(n.longitude=r<0?r+360:r-360),n}applyConstraints(t){const{maxZoom:e,minZoom:n,zoom:i}=t;t.zoom=(0,C.qE)(i,n,e);const{maxPitch:r,minPitch:o,pitch:s}=t;t.pitch=(0,C.qE)(s,o,r);const{normalize:a=!0}=t;return a&&Object.assign(t,(0,K.CK)(t)),t}_zoomFromCenter(t){const{width:e,height:n}=this.getViewportProps();return this.zoom({pos:[e/2,n/2],scale:t})}_panFromCenter(t){const{width:e,height:n}=this.getViewportProps();return this.pan({startPos:[e/2,n/2],pos:[e/2+t[0],n/2+t[1]]})}_getUpdatedState(t){return new this.constructor({makeViewport:this.makeViewport,...this.getViewportProps(),...this.getState(),...t})}_unproject(t){const e=this.makeViewport(this.getViewportProps());return t&&e.unproject(t)}_getNewRotation(t,e,n,i){const r=t[0]-e[0],o=t[1]-e[1],s=t[1],a=e[1],{width:l,height:c}=this.getViewportProps(),u=r/l;let h=0;o>0?Math.abs(c-a)>5&&(h=o/(a-c)*1.2):o<0&&a>5&&(h=1-s/a),h=(0,C.qE)(h,-1,1);const{minPitch:d,maxPitch:p}=this.getViewportProps();let f=n;return h>0?f=n+h*(p-n):h<0&&(f=n-h*(d-n)),{pitch:f,bearing:i+180*u}}}class J extends Z{constructor(){super(...arguments),this.ControllerState=Q,this.transition={transitionDuration:300,transitionInterpolator:new F({transitionProps:{compare:["longitude","latitude","zoom","bearing","pitch","position"],required:["longitude","latitude","zoom"]}})},this.dragMode="pan"}setProps(t){t.position=t.position||[0,0,0];const e=this.props;super.setProps(t);(!e||e.height!==t.height)&&this.updateViewport(new this.ControllerState({makeViewport:this.makeViewport,...t,...this.state}))}}class Y extends w{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{})}get ViewportType(){return E.A}get ControllerType(){return J}}Y.displayName="MapView";const $=Y,tt=[255,255,255],et=1;let nt=0;class it{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.type="ambient";const{color:e=tt}=t,{intensity:n=et}=t;this.id=t.id||"ambient-"+nt++,this.color=e,this.intensity=n}}var rt=n(15183);const ot=[255,255,255],st=1,at=[0,0,-1];let lt=0;class ct{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.type="directional";const{color:e=ot}=t,{intensity:n=st}=t,{direction:i=at}=t,{_shadow:r=!1}=t;this.id=t.id||"directional-"+lt++,this.color=e,this.intensity=n,this.type="directional",this.direction=new rt.P(i).normalize().toArray(),this.shadow=r}getProjectedLight(t){return this}}var ut=n(33128),ht=n(78550);class dt extends ht.A{constructor(){super(...arguments),this._lastRenderIndex=-1}render(t){const[e,n]=this.device.canvasContext.getDrawingBufferSize(),i=t.clearCanvas??!0,r=t.clearColor??(!!i&&[0,0,0,0]),o=!!i&&1,s=!!i&&0,a=t.colorMask??15,l={viewport:[0,0,e,n]};t.colorMask&&(l.colorMask=a),t.scissorRect&&(l.scissorRect=t.scissorRect);const c=this.device.beginRenderPass({framebuffer:t.target,parameters:l,clearColor:r,clearDepth:o,clearStencil:s});try{return this._drawLayers(c,t)}finally{c.end()}}_drawLayers(t,e){const{target:n,moduleParameters:i,viewports:r,views:o,onViewportActive:s,clearStack:a=!0}=e;e.pass=e.pass||"unknown",a&&(this._lastRenderIndex=-1);const l=[];for(const c of r){const r=o&&o[c.id];s?.(c);const a=this._getDrawLayerParams(c,e),u=c.subViewports||[c];for(const o of u){const s=this._drawLayersInViewport(t,{target:n,moduleParameters:i,viewport:o,view:r,pass:e.pass,layers:e.layers},a);l.push(s)}}return l}_getDrawLayerParams(t,e){let{layers:n,pass:i,isPicking:r=!1,layerFilter:o,cullRect:s,effects:a,moduleParameters:l}=e,c=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const u=[],h=pt(this._lastRenderIndex+1),d={layer:n[0],viewport:t,isPicking:r,renderPass:i,cullRect:s},p={};for(let f=0;f<n.length;f++){const e=n[f],r=this._shouldDrawLayer(e,d,o,p),s={shouldDrawLayer:r};r&&!c&&(s.layerRenderIndex=h(e,r),s.moduleParameters=this._getModuleParameters(e,a,i,l),s.layerParameters={...e.context.deck?.props.parameters,...this.getLayerParameters(e,f,t)}),u[f]=s}return u}_drawLayersInViewport(t,e,n){let{layers:i,moduleParameters:r,pass:o,target:s,viewport:a,view:l}=e;const c=function(t,e){let{moduleParameters:n,target:i,viewport:r}=e;const o=n&&n.devicePixelRatio||t.canvasContext.cssToDeviceRatio(),[,s]=t.canvasContext.getDrawingBufferSize(),a=i?i.height:s,l=r;return[l.x*o,a-(l.y+l.height)*o,l.width*o,l.height*o]}(this.device,{moduleParameters:r,target:s,viewport:a});if(l&&l.props.clear){const t=!0===l.props.clear?{color:!0,depth:!0}:l.props.clear;this.device.withParametersWebGL({scissorTest:!0,scissor:c},(()=>this.device.clearWebGL(t)))}const u={totalCount:i.length,visibleCount:0,compositeCount:0,pickableCount:0};t.setParameters({viewport:c});for(let d=0;d<i.length;d++){const e=i[d],{shouldDrawLayer:r,layerRenderIndex:s,moduleParameters:l,layerParameters:c}=n[d];if(r&&e.props.pickable&&u.pickableCount++,e.isComposite)u.compositeCount++;else if(r){u.visibleCount++,this._lastRenderIndex=Math.max(this._lastRenderIndex,s),l.viewport=a,e.context.renderPass=t;try{e._drawLayer({renderPass:t,moduleParameters:l,uniforms:{layerIndex:s},parameters:c})}catch(h){e.raiseError(h,`drawing ${e} to ${o}`)}}}return u}shouldDrawLayer(t){return!0}getModuleParameters(t,e){return null}getLayerParameters(t,e,n){return t.props.parameters}_shouldDrawLayer(t,e,n,i){if(!(t.props.visible&&this.shouldDrawLayer(t)))return!1;e.layer=t;let r=t.parent;for(;r;){if(!r.props.visible||!r.filterSubLayer(e))return!1;e.layer=r,r=r.parent}if(n){const t=e.layer.id;if(t in i||(i[t]=n(e)),!i[t])return!1}return t.activateViewport(e.viewport),!0}_getModuleParameters(t,e,n,i){const r=this.device.canvasContext.cssToDeviceRatio(),o=Object.assign(Object.create(t.internalState?.propsInTransition||t.props),{autoWrapLongitude:t.wrapLongitude,viewport:t.context.viewport,mousePosition:t.context.mousePosition,picking:{isActive:0},devicePixelRatio:r});if(e)for(const s of e)Object.assign(o,s.getModuleParameters?.(t));return Object.assign(o,this.getModuleParameters(t,e),i)}}function pt(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n={},i=(r,o)=>{const s=r.props._offset,a=r.id,l=r.parent&&r.parent.id;let c;if(l&&!(l in e)&&i(r.parent,!1),l in n){const t=n[l]=n[l]||pt(e[l],e);c=t(r,o),n[a]=t}else Number.isFinite(s)?(c=s+(e[l]||0),n[a]=null):c=t;return o&&c>=t&&(t=c+1),e[a]=c,c};return i}class ft extends dt{constructor(t,e){super(t,e),this.shadowMap=t.createTexture({width:1,height:1,sampler:{minFilter:"linear",magFilter:"linear",addressModeU:"clamp-to-edge",addressModeV:"clamp-to-edge"}}),this.depthBuffer=t.createTexture({format:"depth16unorm",width:1,height:1,mipmaps:!1,dataFormat:6402,type:5125}),this.fbo=t.createFramebuffer({id:"shadowmap",width:1,height:1,colorAttachments:[this.shadowMap],depthStencilAttachment:this.depthBuffer})}render(t){const e=this.fbo,n=this.device.canvasContext.cssToDeviceRatio(),i=t.viewports[0],r=i.width*n,o=i.height*n;r===e.width&&o===e.height||e.resize({width:r,height:o}),super.render({...t,clearColor:[1,1,1,1],target:e,pass:"shadow"})}getLayerParameters(t,e,n){return{...t.props.parameters,blend:!1,depthRange:[0,1],depthTest:!0}}shouldDrawLayer(t){return!1!==t.props.shadowEnabled}getModuleParameters(){return{drawToShadowMap:!0}}delete(){this.fbo&&(this.fbo.destroy(),this.fbo=null),this.shadowMap&&(this.shadowMap.destroy(),this.shadowMap=null),this.depthBuffer&&(this.depthBuffer.destroy(),this.depthBuffer=null)}}var At=n(4896),gt=n(95835),mt=n(7201
vendor: 24,020 bytes, line 2
21);const yt=(0,mt.A)((function(t){let{viewport:e,center:n}=t;return new ut.k(e.viewProjectionMatrix).invert().transform(n)})),_t=(0,mt.A)((function(t){let{viewport:e,shadowMatrices:n}=t;const i=[],r=e.pixelUnprojectionMatrix,o=e.isGeospatial?void 0:1,s=[[0,0,o],[e.width,0,o],[0,e.height,o],[e.width,e.height,o],[0,0,-1],[e.width,0,-1],[0,e.height,-1],[e.width,e.height,-1]].map((t=>function(t,e){const[n,i,r]=t,o=(0,K.xJ)([n,i,r],e);if(Number.isFinite(r))return o;return[o[0],o[1],0]}(t,r)));for(const a of n){const t=a.clone().translate(new rt.P(e.center).negate()),n=s.map((e=>t.transform(e))),r=(new ut.k).ortho({left:Math.min(...n.map((t=>t[0]))),right:Math.max(...n.map((t=>t[0]))),bottom:Math.min(...n.map((t=>t[1]))),top:Math.max(...n.map((t=>t[1]))),near:Math.min(...n.map((t=>-t[2]))),far:Math.max(...n.map((t=>-t[2])))});i.push(r.multiplyRight(a))}return i})),vt=[0,0,0,1],bt=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0];const xt={name:"shadow",dependencies:[gt.A],vs:"\nconst int max_lights = 2;\nuniform mat4 shadow_uViewProjectionMatrices[max_lights];\nuniform vec4 shadow_uProjectCenters[max_lights];\nuniform bool shadow_uDrawShadowMap;\nuniform bool shadow_uUseShadowMap;\nuniform int shadow_uLightId;\nuniform float shadow_uLightCount;\n\nout vec3 shadow_vPosition[max_lights];\n\nvec4 shadow_setVertexPosition(vec4 position_commonspace) {\n if (shadow_uDrawShadowMap) {\n return project_common_position_to_clipspace(position_commonspace, shadow_uViewProjectionMatrices[shadow_uLightId], shadow_uProjectCenters[shadow_uLightId]);\n }\n if (shadow_uUseShadowMap) {\n for (int i = 0; i < max_lights; i++) {\n if(i < int(shadow_uLightCount)) {\n vec4 shadowMap_position = project_common_position_to_clipspace(position_commonspace, shadow_uViewProjectionMatrices[i], shadow_uProjectCenters[i]);\n shadow_vPosition[i] = (shadowMap_position.xyz / shadowMap_position.w + 1.0) / 2.0;\n }\n }\n }\n return gl_Position;\n}\n",fs:"\nconst int max_lights = 2;\nuniform bool shadow_uDrawShadowMap;\nuniform bool shadow_uUseShadowMap;\nuniform sampler2D shadow_uShadowMap0;\nuniform sampler2D shadow_uShadowMap1;\nuniform vec4 shadow_uColor;\nuniform float shadow_uLightCount;\n\nin vec3 shadow_vPosition[max_lights];\n\nconst vec4 bitPackShift = vec4(1.0, 255.0, 65025.0, 16581375.0);\nconst vec4 bitUnpackShift = 1.0 / bitPackShift;\nconst vec4 bitMask = vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 0.0);\n\nfloat shadow_getShadowWeight(vec3 position, sampler2D shadowMap) {\n vec4 rgbaDepth = texture(shadowMap, position.xy);\n\n float z = dot(rgbaDepth, bitUnpackShift);\n return smoothstep(0.001, 0.01, position.z - z);\n}\n\nvec4 shadow_filterShadowColor(vec4 color) {\n if (shadow_uDrawShadowMap) {\n vec4 rgbaDepth = fract(gl_FragCoord.z * bitPackShift);\n rgbaDepth -= rgbaDepth.gbaa * bitMask;\n return rgbaDepth;\n }\n if (shadow_uUseShadowMap) {\n float shadowAlpha = 0.0;\n shadowAlpha += shadow_getShadowWeight(shadow_vPosition[0], shadow_uShadowMap0);\n if(shadow_uLightCount > 1.0) {\n shadowAlpha += shadow_getShadowWeight(shadow_vPosition[1], shadow_uShadowMap1);\n }\n shadowAlpha *= shadow_uColor.a / shadow_uLightCount;\n float blendedAlpha = shadowAlpha + color.a * (1.0 - shadowAlpha);\n\n return vec4(\n mix(color.rgb, shadow_uColor.rgb, shadowAlpha / blendedAlpha),\n blendedAlpha\n );\n }\n return color;\n}\n",inject:{"vs:DECKGL_FILTER_GL_POSITION":"\n position = shadow_setVertexPosition(geometry.position);\n ","fs:DECKGL_FILTER_COLOR":"\n color = shadow_filterShadowColor(color);\n "},getUniforms:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"viewport"in t&&(t.drawToShadowMap||t.shadowMaps&&t.shadowMaps.length>0)?function(t,e){const{shadowEnabled:n=!0}=t;if(!n||!t.shadowMatrices||!t.shadowMatrices.length)return{shadow_uDrawShadowMap:!1,shadow_uUseShadowMap:!1,shadow_uShadowMap0:t.dummyShadowMap,shadow_uShadowMap1:t.dummyShadowMap};const i={shadow_uDrawShadowMap:Boolean(t.drawToShadowMap),shadow_uUseShadowMap:!!t.shadowMaps&&t.shadowMaps.length>0,shadow_uColor:t.shadowColor||vt,shadow_uLightId:t.shadowLightId||0,shadow_uLightCount:t.shadowMatrices.length},r=yt({viewport:t.viewport,center:e.project_uCenter}),o=[],s=_t({shadowMatrices:t.shadowMatrices,viewport:t.viewport}).slice();for(let a=0;a<t.shadowMatrices.length;a++){const n=s[a],i=n.clone().translate(new rt.P(t.viewport.center).negate());e.project_uCoordinateSystem===At.rf.LNGLAT&&e.project_uProjectionMode===At.Kx.WEB_MERCATOR?(s[a]=i,o[a]=r):(s[a]=n.clone().multiplyRight(bt),o[a]=i.transform(r))}for(let a=0;a<s.length;a++)i[`shadow_uViewProjectionMatrices[${a}]`]=s[a],i[`shadow_uProjectCenters[${a}]`]=o[a];for(let a=0;a<2;a++)i[`shadow_uShadowMap${a}`]=t.shadowMaps&&t.shadowMaps[a]||t.dummyShadowMap;return i}(t,e):{}}},wt={color:[255,255,255],intensity:1},Et=[{color:[255,255,255],intensity:1,direction:[-1,3,-1]},{color:[255,255,255],intensity:.9,direction:[1,-8,-2.5]}],Ct=[0,0,0,200/255];class Tt{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.id="lighting-effect",this.shadowColor=Ct,this.shadow=!1,this.ambientLight=null,this.directionalLights=[],this.pointLights=[],this.shadowPasses=[],this.shadowMaps=[],this.dummyShadowMap=null,this.setProps(t)}setup(t){this.context=t;const{device:e,deck:n}=t;this.shadow&&!this.dummyShadowMap&&(this._createShadowPasses(e),n._addDefaultShaderModule(xt),this.dummyShadowMap=e.createTexture({width:1,height:1}))}setProps(t){this.ambientLight=null,this.directionalLights=[],this.pointLights=[];for(const e in t){const n=t[e];switch(n.type){case"ambient":this.ambientLight=n;break;case"directional":this.directionalLights.push(n);break;case"point":this.pointLights.push(n)}}this._applyDefaultLights(),this.shadow=this.directionalLights.some((t=>t.shadow)),this.context&&this.setup(this.context),this.props=t}preRender(t){let{layers:e,layerFilter:n,viewports:i,onViewportActive:r,views:o}=t;if(this.shadow){this.shadowMatrices=this._calculateMatrices();for(let t=0;t<this.shadowPasses.length;t++){this.shadowPasses[t].render({layers:e,layerFilter:n,viewports:i,onViewportActive:r,views:o,moduleParameters:{shadowLightId:t,dummyShadowMap:this.dummyShadowMap,shadowMatrices:this.shadowMatrices}})}}}getModuleParameters(t){const e=this.shadow?{shadowMaps:this.shadowMaps,dummyShadowMap:this.dummyShadowMap,shadowColor:this.shadowColor,shadowMatrices:this.shadowMatrices}:{};return e.lightSources={ambientLight:this.ambientLight,directionalLights:this.directionalLights.map((e=>e.getProjectedLight({layer:t}))),pointLights:this.pointLights.map((e=>e.getProjectedLight({layer:t})))},e}cleanup(t){for(const e of this.shadowPasses)e.delete();this.shadowPasses.length=0,this.shadowMaps.length=0,this.dummyShadowMap&&(this.dummyShadowMap.destroy(),this.dummyShadowMap=null,t.deck._removeDefaultShaderModule(xt))}_calculateMatrices(){const t=[];for(const e of this.directionalLights){const n=(new ut.k).lookAt({eye:new rt.P(e.direction).negate()});t.push(n)}return t}_createShadowPasses(t){for(let e=0;e<this.directionalLights.length;e++){const n=new ft(t);this.shadowPasses[e]=n,this.shadowMaps[e]=n.shadowMap}}_applyDefaultLights(){const{ambientLight:t,pointLights:e,directionalLights:n}=this;t||0!==e.length||0!==n.length||(this.ambientLight=new it(wt),this.directionalLights.push(new ct(Et[0]),new ct(Et[1])))}}const St=new Tt;class Pt{constructor(t){this._resolvedEffects=[],this._defaultEffects=[],this.effects=[],this._context=t,this._needsRedraw="Initial render",this._setEffects([])}addDefaultEffect(t){const e=this._defaultEffects;if(!e.find((e=>e.id===t.id))){const n=e.findIndex((e=>{return n=t,(e.order??1/0)-(n.order??1/0)>0;var n}));n<0?e.push(t):e.splice(n,0,t),t.setup(this._context),this._setEffects(this.effects)}}setProps(t){"effects"in t&&((0,y.b)(t.effects,this.effects,1)||this._setEffects(t.effects))}needsRedraw(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1};const e=this._needsRedraw;return t.clearRedrawFlags&&(this._needsRedraw=!1),e}getEffects(){return this._resolvedEffects}_setEffects(t){const e={};for(const i of this.effects)e[i.id]=i;const n=[];for(const i of t){const t=e[i.id];let r=i;t&&t!==i?t.setProps?(t.setProps(i.props),r=t):t.cleanup(this._context):t||i.setup(this._context),n.push(r),delete e[i.id]}for(const i in e)e[i].cleanup(this._context);this.effects=n,this._resolvedEffects=n.concat(this._defaultEffects),t.some((t=>t instanceof Tt))||this._resolvedEffects.push(St),this._needsRedraw="effects changed"}finalize(){for(const t of this._resolvedEffects)t.cleanup(this._context);this.effects.length=0,this._resolvedEffects.length=0,this._defaultEffects.length=0}}class Mt extends dt{shouldDrawLayer(t){const{operation:e}=t.props;return e.includes("draw")||e.includes("terrain")}}const It={blendColorOperation:"add",blendColorSrcFactor:"one",blendColorDstFactor:"zero",blendAlphaOperation:"add",blendAlphaSrcFactor:"constant-alpha",blendAlphaDstFactor:"zero"};class Bt extends dt{constructor(){super(...arguments),this._colorEncoderState=null}render(t){return"pickingFBO"in t?this._drawPickingBuffer(t):super.render(t)}_drawPickingBuffer(t){let{layers:e,layerFilter:n,views:i,viewports:r,onViewportActive:o,pickingFBO:s,deviceRect:{x:a,y:l,width:c,height:u},cullRect:h,effects:d,pass:p="picking",pickZ:f,moduleParameters:A}=t;this.pickZ=f;const g=this._resetColorEncoder(f),m=[a,l,c,u],y=super.render({target:s,layers:e,layerFilter:n,views:i,viewports:r,onViewportActive:o,cullRect:h,effects:d?.filter((t=>t.useInPicking)),pass:p,isPicking:!0,moduleParameters:A,clearColor:[0,0,0,0],colorMask:15,scissorRect:m});this._colorEncoderState=null;return{decodePickingColor:g&&Rt.bind(null,g),stats:y}}shouldDrawLayer(t){const{pickable:e,operation:n}=t.props;return e&&n.includes("draw")||n.includes("terrain")||n.includes("mask")}getModuleParameters(){return{picking:{isActive:1,isAttribute:this.pickZ},lightSources:{}}}getLayerParameters(t,e,n){const i={depthMask:!0,depthTest:!0,depthRange:[0,1],...t.props.parameters},{pickable:r,operation:o}=t.props;return!this._colorEncoderState||o.includes("terrain")?i.blend=!1:r&&o.includes("draw")&&(Object.assign(i,It),i.blend=!0,i.blendColor=function(t,e,n){const{byLayer:i,byAlpha:r}=t;let o,s=i.get(e);s?(s.viewports.push(n),o=s.a):(o=i.size+1,o<=255?(s={a:o,layer:e,viewports:[n]},i.set(e,s),r[o]=s):(c.A.warn("Too many pickable layers, only picking the first 255")(),o=0));return[0,0,0,o/255]}(this._colorEncoderState,t,n)),i}_resetColorEncoder(t){return this._colorEncoderState=t?null:{byLayer:new Map,byAlpha:[]},this._colorEncoderState}}function Rt(t,e){const n=t.byAlpha[e[3]];return n&&{pickedLayer:n.layer,pickedViewports:n.viewports,pickedObjectIndex:n.layer.decodePickingColor(e)}}class Lt{constructor(t){this.device=t,this.layerFilter=null,this.drawPickingColors=!1,this.drawLayersPass=new Mt(t),this.pickLayersPass=new Bt(t),this.renderCount=0,this._needsRedraw="Initial render",this.renderBuffers=[],this.lastPostProcessEffect=null}setProps(t){this.layerFilter!==t.layerFilter&&(this.layerFilter=t.layerFilter,this._needsRedraw="layerFilter changed"),this.drawPickingColors!==t.drawPickingColors&&(this.drawPickingColors=t.drawPickingColors,this._needsRedraw="drawPickingColors changed")}renderLayers(t){if(!t.viewports.length)return;const e=this.drawPickingColors?this.pickLayersPass:this.drawLayersPass,n={layerFilter:this.layerFilter,isPicking:this.drawPickingColors,...t};n.effects&&this._preRender(n.effects,n);const i=this.lastPostProcessEffect?this.renderBuffers[0]:n.target;this.lastPostProcessEffect&&(n.clearColor=[0,0,0,0],n.clearCanvas=!0);const r=e.render({...n,target:i});n.effects&&this._postRender(n.effects,n),this.renderCount++,(0,u.A)("deckRenderer.renderLayers",this,r,t)}needsRedraw(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1};const e=this._needsRedraw;return t.clearRedrawFlags&&(this._needsRedraw=!1),e}finalize(){const{renderBuffers:t}=this;for(const e of t)e.delete();t.length=0}_preRender(t,e){this.lastPostProcessEffect=null,e.preRenderStats=e.preRenderStats||{};for(const n of t)e.preRenderStats[n.id]=n.preRender(e),n.postRender&&(this.lastPostProcessEffect=n.id);this.lastPostProcessEffect&&this._resizeRenderBuffers()}_resizeRenderBuffers(){const{renderBuffers:t}=this,e=this.device.canvasContext.getDrawingBufferSize();0===t.length&&[0,1].map((e=>{const n=this.device.createTexture({sampler:{minFilter:"linear",magFilter:"linear"}});t.push(this.device.createFramebuffer({id:`deck-renderbuffer-${e}`,colorAttachments:[n]}))}));for(const n of t)n.resize(e)}_postRender(t,e){const{renderBuffers:n}=this,i={...e,inputBuffer:n[0],swapBuffer:n[1]};for(const r of t)if(r.postRender){i.target=r.id===this.lastPostProcessEffect?e.target:void 0;const t=r.postRender(i);i.inputBuffer=t,i.swapBuffer=t===n[0]?n[1]:n[0]}}}const Ot={pickedColor:null,pickedObjectIndex:-1};function Dt(t){let{pickedColors:e,decodePickingColor:n,deviceX:i,deviceY:r,deviceRadius:o,deviceRect:s}=t;const{x:a,y:l,width:u,height:h}=s;let d=o*o,p=-1,f=0;for(let c=0;c<h;c++){const t=c+l-r,n=t*t;if(n>d)f+=4*u;else for(let r=0;r<u;r++){if(e[f+3]-1>=0){const t=r+a-i,e=t*t+n;e<=d&&(d=e,p=f)}f+=4}}if(p>=0){const t=e.slice(p,p+4),i=n(t);if(i){const e=Math.floor(p/4/u),n=p/4-e*u;return{...i,pickedColor:t,pickedX:a+n,pickedY:l+e}}c.A.error("Picked non-existent layer. Is picking buffer corrupt?")()}return Ot}function kt(t){let e,{pickInfo:n,viewports:i,pixelRatio:r,x:o,y:s,z:a}=t,l=i[0];if(i.length>1&&(l=function(t,e){for(let n=t.length-1;n>=0;n--){const i=t[n];if(i.containsPixel(e))return i}return t[0]}(n?.pickedViewports||i,{x:o,y:s})),l){const t=[o-l.x,s-l.y];void 0!==a&&(t[2]=a),e=l.unproject(t)}return{color:null,layer:null,viewport:l,index:-1,picked:!1,x:o,y:s,pixel:[o,s],coordinate:e,devicePixel:n&&"pickedX"in n?[n.pickedX,n.pickedY]:void 0,pixelRatio:r}}function Ft(t){const{pickInfo:e,lastPickedInfo:n,mode:i,layers:r}=t,{pickedColor:o,pickedLayer:s,pickedObjectIndex:a}=e,l=s?[s]:[];if("hover"===i){const t=n.index,e=n.layerId,i=s?s.props.id:null;if(i!==e||a!==t){if(i!==e){const t=r.find((t=>t.props.id===e));t&&l.unshift(t)}n.layerId=i,n.index=a,n.info=null}}const c=kt(t),u=new Map;return u.set(null,c),l.forEach((t=>{let e={...c};t===s&&(e.color=o,e.index=a,e.picked=!0),e=Nt({layer:t,info:e,mode:i});const r=e.layer;t===s&&"hover"===i&&(n.info=e),u.set(r.id,e),"hover"===i&&r.updateAutoHighlight(e)})),u}function Nt(t){let{layer:e,info:n,mode:i}=t;for(;e&&n;){const t=n.layer||null;n.sourceLayer=t,n.layer=e,n=e.getPickingInfo({info:n,mode:i,sourceLayer:t}),e=e.parent}return n}class zt{constructor(t){this._pickable=!0,this.device=t,this.pickLayersPass=new Bt(t),this.lastPickedInfo={index:-1,layerId:null,info:null}}setProps(t){"layerFilter"in t&&(this.layerFilter=t.layerFilter),"_pickable"in t&&(this._pickable=t._pickable)}finalize(){this.pickingFBO&&this.pickingFBO.destroy(),this.depthFBO&&this.depthFBO.destroy()}pickObject(t){return this._pickClosestObject(t)}pickObjects(t){return this._pickVisibleObjects(t)}getLastPickedObject(t){let{x:e,y:n,layers:i,viewports:r}=t,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.lastPickedInfo.info;const s=o&&o.layer&&o.layer.id,a=o&&o.viewport&&o.viewport.id,l=s?i.find((t=>t.id===s)):null,c=a&&r.find((t=>t.id===a))||r[0],u=c&&c.unproject([e-c.x,n-c.y]),h={x:e,y:n,viewport:c,coordinate:u,layer:l};return{...o,...h}}_resizeBuffer(){if(!this.pickingFBO&&(this.pickingFBO=this.device.createFramebuffer({colorAttachments:["rgba8unorm"],depthStencilAttachment:"depth16unorm"}),this.device.isTextureFormatRenderable("rgba32float"))){const t=this.device.createFramebuffer({colorAttachments:["rgba32float"],depthStencilAttachment:"depth16unorm"});this.depthFBO=t}const{canvas:t}=this.device.getCanvasContext();this.pickingFBO?.resize({width:t.width,height:t.height}),this.depthFBO?.resize({width:t.width,height:t.height})}_getPickable(t){if(!1===this._pickable)return null;const e=t.filter((t=>this.pickLayersPass.shouldDrawLayer(t)&&!t.isComposite));return e.length?e:null}_pickClosestObject(t){let{layers:e,views:n,viewports:i,x:r,y:o,radius:s=0,depth:a=1,mode:l="query",unproject3D:c,onViewportActive:u,effects:h}=t;const d=this.device.canvasContext.cssToDeviceRatio(),p=this._getPickable(e);if(!p||0===i.length)return{result:[],emptyInfo:kt({viewports:i,x:r,y:o,pixelRatio:d})};this._resizeBuffer();const f=this.device.canvasContext.cssToDevicePixels([r,o],!0),A=[f.x+Math.floor(f.width/2),f.y+Math.floor(f.height/2)],g=Math.round(s*d),{width:m,height:y}=this.pickingFBO,_=this._getPickingRect({deviceX:A[0],deviceY:A[1],deviceRadius:g,deviceWidth:m,deviceHeight:y}),v={x:r-s,y:o-s,width:2*s+1,height:2*s+1};let b;const x=[],w=new Set;for(let E=0;E<a;E++){let t,e;if(_){t=Dt({...this._drawAndSample({layers:p,views:n,viewports:i,onViewportActive:u,deviceRect:_,cullRect:v,effects:h,pass:`picking:${l}`}),deviceX:A[0],deviceY:A[1],deviceRadius:g,deviceRect:_})}else t={pickedColor:null,pickedObjectIndex:-1};if(t.pickedLayer&&c&&this.depthFBO){const{pickedColors:r}=this._drawAndSample({layers:[t.pickedLayer],views:n,viewports:i,onViewportActive:u,deviceRect:{x:t.pickedX,y:t.pickedY,width:1,height:1},cullRect:v,effects:h,pass:`picking:${l}:z`},!0);r[3]&&(e=r[0])}t.pickedLayer&&E+1<a&&(w.add(t.pickedLayer),t.pickedLayer.disablePickingIndex(t.pickedObjectIndex)),b=Ft({pickInfo:t,lastPickedInfo:this.lastPickedInfo,mode:l,layers:p,viewports:i,x:r,y:o,z:e,pixelRatio:d});for(const n of b.values())n.layer&&x.push(n);if(!t.pickedColor)break}for(const E of w)E.restorePickingColors();return{result:x,emptyInfo:b.get(null)}}_pickVisibleObjects(t){let{layers:e,views:n,viewports:i,x:r,y:o,width:s=1,height:a=1,mode:l="query",maxObjects:u=null,onViewportActive:h,effects:d}=t;const p=this._getPickable(e);if(!p||0===i.length)return[];this._resizeBuffer();const f=this.device.canvasContext.cssToDeviceRatio(),A=this.device.canvasContext.cssToDevicePixels([r,o],!0),g=A.x,m=A.y+A.height,y=this.device.canvasContext.cssToDevicePixels([r+s,o+a],!0),_=y.x+y.width,v=y.y,b={x:g,y:v,width:_-g,height:m-v},x=function(t){let{pickedColors:e,decodePickingColor:n}=t;const i=new Map;if(e)for(let r=0;r<e.length;r+=4)if(e[r+3]-1>=0){const t=e.slice(r,r+4),o=t.join(",");if(!i.has(o)){const e=n(t);e?i.set(o,{...e,color:t}):c.A.error("Picked non-existent layer. Is picking buffer corrupt?")()}}return Array.from(i.values())}(this._drawAndSample({layers:p,views:n,viewports:i,onViewportActive:h,deviceRect:b,cullRect:{x:r,y:o,width:s,height:a},effects:d,pass:`picking:${l}`})),w=new Map,E=[],C=Number.isFinite(u);for(let c=0;c<x.length&&!(C&&E.length>=u);c++){const t=x[c];let e={color:t.pickedColor,layer:null,index:t.pickedObjectIndex,picked:!0,x:r,y:o,pixelRatio:f};e=Nt({layer:t.pickedLayer,info:e,mode:l});const n=e.layer.id;w.has(n)||w.set(n,new Set);const i=w.get(n),s=e.object??e.index;i.has(s)||(i.add(s),E.push(e))}return E}_drawAndSample(t){let{layers:e,views:n,viewports:i,onViewportActive:r,deviceRect:o,cullRect:s,effects:a,pass:l}=t,c=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const u=c?this.depthFBO:this.pickingFBO,h={layers:e,layerFilter:this.layerFilter,views:n,viewports:i,onViewportActive:r,pickingFBO:u,deviceRect:o,cullRect:s,effects:a,pass:l,pickZ:c,preRenderStats:{}};for(const y of a)y.useInPicking&&(h.preRenderStats[y.id]=y.preRender(h));const{decodePickingColor:d}=this.pickLayersPass.render(h),{x:p,y:f,width:A,height:g}=o,m=new(c?Float32Array:Uint8Array)(A*g*4);return this.device.readPixelsToArrayWebGL(u,{sourceX:p,sourceY:f,sourceWidth:A,sourceHeight:g,target:m}),{pickedColors:m,decodePickingColor:d}}_getPickingRect(t){let{deviceX:e,deviceY:n,deviceRadius:i,deviceWidth:r,deviceHeight:o}=t;const s=Math.max(0,e-i),a=Math.max(0,n-i),l=Math.min(r,e+i+1)-s,c=Math.min(o,n+i+1)-a;return l<=0||c<=0?null:{x:s,y:a,width:l,height:c}}}const Ut={"top-left":{top:0,left:0},"top-right":{top:0,right:0},"bottom-left":{bottom:0,left:0},"bottom-right":{bottom:0,right:0},fill:{top:0,left:0,bottom:0,right:0}},Gt="top-left",Vt="__root";class jt{constructor(t){let{deck:e,parentElement:n}=t;this.defaultWidgets=[],this.widgets=[],this.resolvedWidgets=[],this.containers={},this.lastViewports={},this.deck=e,this.parentElement=n}getWidgets(){return this.resolvedWidgets}setProps(t){t.widgets&&!(0,y.b)(t.widgets,this.widgets,1)&&this._setWidgets(t.widgets)}finalize(){for(const t of this.getWidgets())this._remove(t);this.defaultWidgets.length=0,this.resolvedWidgets.length=0;for(const t in this.containers)this.containers[t].remove()}addDefault(t){this.defaultWidgets.find((e=>e.id===t.id))||(this._add(t),this.defaultWidgets.push(t),this._setWidgets(this.widgets))}_setWidgets(t){const e={};for(const n of this.resolvedWidgets)e[n.id]=n;this.resolvedWidgets.length=0;for(const n of this.defaultWidgets)e[n.id]=null,this.resolvedWidgets.push(n);for(let n of t){const t=e[n.id];t?t.viewId!==n.viewId||t.placement!==n.placement?(this._remove(t),this._add(n)):n!==t&&(t.setProps(n.props),n=t):this._add(n),e[n.id]=null,this.resolvedWidgets.push(n)}for(const n in e){const t=e[n];t&&this._remove(t)}this.widgets=t}_add(t){const{viewId:e=null,placement:n=Gt}=t,i=t.onAdd({deck:this.deck,viewId:e});i&&this._getContainer(e,n).append(i),t._element=i}_remove(t){t.onRemove(),t._element&&t._element.remove(),t._element=void 0}_getContainer(t,e){const n=t||Vt;let i=this.containers[n];i||(i=document.createElement("div"),i.style.pointerEvents="none",i.style.position="absolute",i.style.overflow="hidden",this.parentElement?.append(i),this.containers[n]=i);let r=i.querySelector(`.${e}`);return r||(r=document.createElement("div"),r.className=e,r.style.position="absolute",r.style.zIndex="2",Object.assign(r.style,Ut[e]),i.append(r)),r}_updateContainers(){const t=this.deck.width,e=this.deck.height;for(const n in this.containers){const i=this.lastViewports[n]||null,r=n===Vt||i,o=this.containers[n];r?(o.style.display="block",o.style.left=`${i?i.x:0}px`,o.style.top=`${i?i.y:0}px`,o.style.width=`${i?i.width:t}px`,o.style.height=`${i?i.height:e}px`):o.style.display="none"}}onRedraw(t){let{viewports:e,layers:n}=t;const i=e.reduce(((t,e)=>(t[e.id]=e,t)),{}),{lastViewports:r}=this;for(const o of this.getWidgets()){const{viewId:t}=o;if(t){const e=i[t];e&&(o.onViewportChange&&!e.equals(r[t])&&o.onViewportChange(e),o.onRedraw?.({viewports:[e],layers:n}))}else{if(o.onViewportChange)for(const t of e)t.equals(r[t.id])||o.onViewportChange(t);o.onRedraw?.({viewports:e,layers:n})}}this.lastViewports=i,this._updateContainers()}onHover(t,e){for(const n of this.getWidgets()){const{viewId:i}=n;i&&i!==t.viewport?.id||n.onHover?.(t,e)}}onEvent(t,e){const n=At.qY[e.type];if(n)for(const i of this.getWidgets()){const{viewId:r}=i;r&&r!==t.viewport?.id||i[n.handler]?.(t,e)}}}const Ht={zIndex:"1",position:"absolute",pointerEvents:"none",color:"#a0a7b4",backgroundColor:"#29323c",padding:"10px",top:"0",left:"0",display:"none"};class Wt{constructor(){this.id="default-tooltip",this.placement="fill",this.props={},this.isVisible=!1}onAdd(t){let{deck:e}=t;const n=document.createElement("div");return n.className="deck-tooltip",Object.assign(n.style,Ht),this.deck=e,this.element=n,n}onRemove(){this.deck=void 0,this.element=void 0}setProps(){}onViewportChange(t){this.isVisible&&t.id===this.lastViewport?.id&&t!==this.lastViewport&&this.setTooltip(null)}onHover(t){const{deck:e}=this,n=e&&e.props.getTooltip;if(!n)return;const i=n(t);this.lastViewport=t.viewport,this.setTooltip(i,t.x,t.y)}setTooltip(t,e,n){const i=this.element;if(i){if("string"===typeof t)i.innerText=t;else{if(!t)return this.isVisible=!1,void(i.style.display="none");t.text&&(i.innerText=t.text),t.html&&(i.innerHTML=t.html),t.className&&(i.className=t.className)}this.isVisible=!0,i.style.display="block",i.style.transform=`translate(${e}px, ${n}px)`,t&&"object"===typeof t&&"style"in t&&Object.assign(i.style,t.style)}}}var qt=n(1
vendor: 3,874 bytes, line 2
25753),Zt=n(44432),Xt=n(68595),Kt=n(44261);const Qt=new class{stats=new Map;getStats(t){return this.get(t)}get(t){return this.stats.has(t)||this.stats.set(t,new d.A({id:t})),this.stats.get(t)}};const Jt=function(){const t="9.0.27";if(globalThis.luma&&globalThis.luma.VERSION!==t)throw new Error(`luma.gl - multiple VERSIONs detected: ${globalThis.luma.VERSION} vs ${t}`);return globalThis.luma||((0,Xt.B)()&&Kt.R.log(1,`${t} - set luma.log.level=1 (or higher) to trace rendering`)(),globalThis.luma=globalThis.luma||{VERSION:t,version:t,log:Kt.R,stats:Qt}),t}();var Yt=n(99294),$t=n(86561),te=n(84980);const ee=["bc1","bc2","bc3","bc4","bc5","bc6","bc7","etc1","etc2","eac","atc","astc","pvrtc"],ne=/^(rg?b?a?)([0-9]*)([a-z]*)(-srgb)?(-webgl|-unsized)?$/;function ie(t){const e=ne.exec(t);if(e){const[,t,n,i,r,o]=e;if(t){const e=`${i}${n}`,s=(0,te.l)(e);return{format:t,components:t.length,srgb:"-srgb"===r,unsized:"-unsized"===o,webgl:"-webgl"===o,...s}}}return function(t){const e=re[t];if(!e)throw new Error(`Unknown format ${t}`);return{format:e.format||"",components:e.components||e.format?.length||1,byteLength:e.bpp||1,srgb:!1,unsized:!1}}(t)}const re={"rgba4unorm-webgl":{format:"rgba",bpp:2},"rgb565unorm-webgl":{format:"rgb",bpp:2},"rgb5a1unorm-webgl":{format:"rgba",bbp:2},rgb9e5ufloat:{format:"rgb",bbp:4},rg11b10ufloat:{format:"rgb",bbp:4},rgb10a2unorm:{format:"rgba",bbp:4},"rgb10a2uint-webgl":{format:"rgba",bbp:4},stencil8:{components:1,bpp:1,a:"stencil"},depth16unorm:{components:1,bpp:2,a:"depth"},depth24plus:{components:1,bpp:3,a:"depth"},depth32float:{components:1,bpp:4,a:"depth"},"depth24plus-stencil8":{components:2,bpp:4,a:"depth-stencil"},"depth24unorm-stencil8":{components:2,bpp:4,a:"depth-stencil"},"depth32float-stencil8":{components:2,bpp:4,a:"depth-stencil"}};class oe{}class se{features;disabledFeatures;constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1?arguments[1]:void 0;this.features=new Set(t),this.disabledFeatures=e||{}}*[Symbol.iterator](){yield*this.features}has(t){return!this.disabledFeatures[t]&&this.features.has(t)}}class ae{static defaultProps={id:null,canvas:null,container:null,manageState:!0,width:800,height:600,requestMaxLimits:!0,debug:Boolean(Kt.R.get("debug")),spector:Boolean(Kt.R.get("spector")||Kt.R.get("spectorjs")),break:[],initalizeFeatures:!0,disabledFeatures:{"compilation-status-async-webgl":!0},gl:null,onError:t=>Kt.R.error(t.message)};get[Symbol.toStringTag](){return"Device"}static VERSION=Jt;constructor(t){this.props={...ae.defaultProps,...t},this.id=this.props.id||(0,Yt.L)(this[Symbol.toStringTag].toLowerCase())}id;props;userData={};statsManager=Qt;_lumaData={};isTextureFormatCompressed(t){return e=t,ee.some((t=>e.startsWith(t)));var e}loseDevice(){return!1}getCanvasContext(){if(!this.canvasContext)throw new Error("Device has no CanvasContext");return this.canvasContext}createTexture(t){return(t instanceof Promise||"string"===typeof t)&&(t={data:t}),this._createTexture(t)}createCommandEncoder(){throw new Error("not implemented")}readPixelsToArrayWebGL(t,e){throw new Error("not implemented")}readPixelsToBufferWebGL(t,e){throw new Error("not implemented")}setParametersWebGL(t){throw new Error("not implemented")}getParametersWebGL(t){throw new Error("not implemented")}withParametersWebGL(t,e){throw new Error("not implemented")}clearWebGL(t){throw new Error("not implemented")}resetWebGL(){throw new Error("not implemented")}timestamp=0;incrementTimestamp(){return this.timestamp++}onError(t){this.props.onError(t)}_getBufferProps(t){(t instanceof ArrayBuffer||ArrayBuffer.isView(t))&&(t={data:t});const e={...t};return(t.usage||0)&$t.h.INDEX&&!t.indexType&&(t.data instanceof Uint32Array?e.indexType="uint32":t.data instanceof Uint16Array?e.indexType="uint16":Kt.R.warn("indices buffer content must be of integer type")()),e}}var le=n(25077
vendor: 14,557 bytes, line 2
2);const ce=new Map;class ue{static defaultProps={...ae.defaultProps,type:"best-available",devices:void 0};static stats=Qt;static log=Kt.R;static registerDevices(t){for(const e of t)(0,le.v)(e.type&&e.isSupported&&e.create),ce.set(e.type,e)}static getAvailableDevices(){return Array.from(ce).map((t=>t.type))}static getSupportedDevices(){return Array.from(ce).filter((t=>t.isSupported())).map((t=>t.type))}static setDefaultDeviceProps(t){Object.assign(ae.defaultProps,t)}static async attachDevice(t){const e=he(t.devices)||ce;if(t.handle instanceof WebGL2RenderingContext){const n=e.get("webgl");if(n)return await n.attach(t.handle)}if(null===t.handle){const t=e.get("unknown");if(t)return await t.attach(null)}throw new Error("Failed to attach device. Ensure `@luma.gl/webgl` and/or `@luma.gl/webgpu` modules are imported.")}static async createDevice(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t={...ue.defaultProps,...t},t.gl&&(t.type="webgl");const e=he(t.devices)||ce;let n,i;switch(t.type){case"webgpu":if(n=e.get("webgpu"),n)return await n.create(t);break;case"webgl":if(i=e.get("webgl"),i)return await i.create(t);break;case"unknown":const r=e.get("unknown");if(r)return await r.create(t);break;case"best-available":if(n=e.get("webgpu"),n?.isSupported?.())return await n.create(t);if(i=e.get("webgl"),i?.isSupported?.())return await i.create(t)}throw new Error("No matching device found. Ensure `@luma.gl/webgl` and/or `@luma.gl/webgpu` modules are imported.")}static enforceWebGL2(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const e=HTMLCanvasElement.prototype;if(!t&&e.originalGetContext)return e.getContext=e.originalGetContext,void(e.originalGetContext=void 0);e.originalGetContext=e.getContext,e.getContext=function(t,e){return"webgl"===t||"experimental-webgl"===t?this.originalGetContext("webgl2",e):this.originalGetContext(t,e)}}}function he(t){if(!t||0===t?.length)return null;const e=new Map;for(const n of t)e.set(n.type,n);return e}const de=(0,Xt.B)()&&"undefined"!==typeof document,pe=()=>de&&"complete"===document.readyState,fe={canvas:null,width:800,height:600,useDevicePixels:!0,autoResize:!0,container:null,visible:!0,colorSpace:"srgb",alphaMode:"opaque"};class Ae{id;props;canvas;htmlCanvas;offscreenCanvas;type;width=1;height=1;resizeObserver;_canvasSizeInfo={clientWidth:0,clientHeight:0,devicePixelRatio:1};static get isPageLoaded(){return pe()}static pageLoaded=function(){if(pe()||"undefined"===typeof window)return Promise.resolve();return new Promise((t=>{window.addEventListener("load",(()=>t()))}))}();constructor(t){if(this.props={...fe,...t},t=this.props,!(0,Xt.B)())return this.id="node-canvas-context",this.type="node",this.width=this.props.width,this.height=this.props.height,void(this.canvas=null);if(t.canvas)"string"===typeof t.canvas?this.canvas=function(t){const e=document.getElementById(t);if(!e&&!pe())throw new Error(`Accessing '${t}' before page was loaded`);if(!(e instanceof HTMLCanvasElement))throw new Error("Object is not a canvas element");return e}(t.canvas):this.canvas=t.canvas;else{const e=function(t){const{width:e,height:n}=t,i=document.createElement("canvas");return i.id="lumagl-auto-created-canvas",i.width=e||1,i.height=n||1,i.style.width=Number.isFinite(e)?`${e}px`:"100%",i.style.height=Number.isFinite(n)?`${n}px`:"100%",i}(t),n=function(t){if("string"===typeof t){const e=document.getElementById(t);if(!e&&!pe())throw new Error(`Accessing '${t}' before page was loaded`);if(!e)throw new Error(`${t} is not an HTML element`);return e}if(t)return t;return document.body}(t?.container||null);n.insertBefore(e,n.firstChild),this.canvas=e,t?.visible||(this.canvas.style.visibility="hidden")}this.canvas instanceof HTMLCanvasElement?(this.id=this.canvas.id,this.type="html-canvas",this.htmlCanvas=this.canvas):(this.id="offscreen-canvas",this.type="offscreen-canvas",this.offscreenCanvas=this.canvas),this.canvas instanceof HTMLCanvasElement&&t.autoResize&&(this.resizeObserver=new ResizeObserver((t=>{for(const e of t)e.target===this.canvas&&this.update()})),this.resizeObserver.observe(this.canvas))}getDevicePixelRatio(t){if("undefined"!==typeof OffscreenCanvas&&this.canvas instanceof OffscreenCanvas)return 1;if(!(t=void 0===t?this.props.useDevicePixels:t)||t<=0)return 1;if(!0===t){return"undefined"!==typeof window&&window.devicePixelRatio||1}return t}getPixelSize(){switch(this.type){case"node":return[this.width,this.height];case"offscreen-canvas":return[this.canvas.width,this.canvas.height];case"html-canvas":const t=this.getDevicePixelRatio(),e=this.canvas;return e.parentElement?[e.clientWidth*t,e.clientHeight*t]:[this.canvas.width,this.canvas.height];default:throw new Error(this.type)}}getAspect(){const[t,e]=this.getPixelSize();return t/e}cssToDeviceRatio(){try{const[t]=this.getDrawingBufferSize(),{clientWidth:e}=this._canvasSizeInfo;return e?t/e:1}catch{return 1}}cssToDevicePixels(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const n=this.cssToDeviceRatio(),[i,r]=this.getDrawingBufferSize();return function(t,e,n,i,r){const o=t,s=ge(o[0],e,n);let a=me(o[1],e,i,r),l=ge(o[0]+1,e,n);const c=l===n-1?l:l-1;let u;l=me(o[1]+1,e,i,r),r?(l=0===l?l:l+1,u=a,a=l):u=l===i-1?l:l-1;return{x:s,y:a,width:Math.max(c-s+1,1),height:Math.max(u-a+1,1)}}(t,n,i,r,e)}setDevicePixelRatio(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.htmlCanvas)return;let n="width"in e?e.width:this.htmlCanvas.clientWidth,i="height"in e?e.height:this.htmlCanvas.clientHeight;n&&i||(Kt.R.log(1,"Canvas clientWidth/clientHeight is 0")(),t=1,n=this.htmlCanvas.width||1,i=this.htmlCanvas.height||1);const r=this._canvasSizeInfo;if(r.clientWidth!==n||r.clientHeight!==i||r.devicePixelRatio!==t){let e=t;const r=Math.floor(n*e),o=Math.floor(i*e);this.htmlCanvas.width=r,this.htmlCanvas.height=o;const[s,a]=this.getDrawingBufferSize();s===r&&a===o||(e=Math.min(s/n,a/i),this.htmlCanvas.width=Math.floor(n*e),this.htmlCanvas.height=Math.floor(i*e),Kt.R.warn("Device pixel ratio clamped")()),this._canvasSizeInfo.clientWidth=n,this._canvasSizeInfo.clientHeight=i,this._canvasSizeInfo.devicePixelRatio=t}}getDrawingBufferSize(){const t=this.device.gl;if(!t)throw new Error("canvas size");return[t.drawingBufferWidth,t.drawingBufferHeight]}_setAutoCreatedCanvasId(t){"lumagl-auto-created-canvas"===this.htmlCanvas?.id&&(this.htmlCanvas.id=t)}}function ge(t,e,n){return Math.min(Math.round(t*e),n-1)}function me(t,e,n,i){return i?Math.max(0,n-1-Math.round(t*e)):Math.min(Math.round(t*e),n-1)}const ye={3042:!1,32773:new Float32Array([0,0,0,0]),32777:32774,34877:32774,32969:1,32968:0,32971:1,32970:0,3106:new Float32Array([0,0,0,0]),3107:[!0,!0,!0,!0],2884:!1,2885:1029,2929:!1,2931:1,2932:513,2928:new Float32Array([0,1]),2930:!0,3024:!0,35725:null,36006:null,36007:null,34229:null,34964:null,2886:2305,33170:4352,2849:1,32823:!1,32824:0,10752:0,32926:!1,32928:!1,32938:1,32939:!1,3089:!1,3088:new Int32Array([0,0,1024,1024]),2960:!1,2961:0,2968:4294967295,36005:4294967295,2962:519,2967:0,2963:4294967295,34816:519,36003:0,36004:4294967295,2964:7680,2965:7680,2966:7680,34817:7680,34818:7680,34819:7680,2978:[0,0,1024,1024],36389:null,36662:null,36663:null,35053:null,35055:null,35723:4352,36010:null,35977:!1,3333:4,3317:4,37440:!1,37441:!1,37443:37444,3330:0,3332:0,3331:0,3314:0,32878:0,3316:0,3315:0,32877:0},_e=(t,e,n)=>e?t.enable(n):t.disable(n),ve=(t,e,n)=>t.hint(n,e),be=(t,e,n)=>t.pixelStorei(n,e),xe=(t,e,n)=>{const i=36006===n?36009:36008;return t.bindFramebuffer(i,e)},we=(t,e,n)=>{const i={34964:34962,36662:36662,36663:36663,35053:35051,35055:35052}[n];t.bindBuffer(i,e)};function Ee(t){return Array.isArray(t)||ArrayBuffer.isView(t)&&!(t instanceof DataView)}const Ce={3042:_e,32773:(t,e)=>t.blendColor(...e),32777:"blendEquation",34877:"blendEquation",32969:"blendFunc",32968:"blendFunc",32971:"blendFunc",32970:"blendFunc",3106:(t,e)=>t.clearColor(...e),3107:(t,e)=>t.colorMask(...e),2884:_e,2885:(t,e)=>t.cullFace(e),2929:_e,2931:(t,e)=>t.clearDepth(e),2932:(t,e)=>t.depthFunc(e),2928:(t,e)=>t.depthRange(...e),2930:(t,e)=>t.depthMask(e),3024:_e,35723:ve,35725:(t,e)=>t.useProgram(e),36007:(t,e)=>t.bindRenderbuffer(36161,e),36389:(t,e)=>t.bindTransformFeedback?.(36386,e),34229:(t,e)=>t.bindVertexArray(e),36006:xe,36010:xe,34964:we,36662:we,36663:we,35053:we,35055:we,2886:(t,e)=>t.frontFace(e),33170:ve,2849:(t,e)=>t.lineWidth(e),32823:_e,32824:"polygonOffset",10752:"polygonOffset",35977:_e,32926:_e,32928:_e,32938:"sampleCoverage",32939:"sampleCoverage",3089:_e,3088:(t,e)=>t.scissor(...e),2960:_e,2961:(t,e)=>t.clearStencil(e),2968:(t,e)=>t.stencilMaskSeparate(1028,e),36005:(t,e)=>t.stencilMaskSeparate(1029,e),2962:"stencilFuncFront",2967:"stencilFuncFront",2963:"stencilFuncFront",34816:"stencilFuncBack",36003:"stencilFuncBack",36004:"stencilFuncBack",2964:"stencilOpFront",2965:"stencilOpFront",2966:"stencilOpFront",34817:"stencilOpBack",34818:"stencilOpBack",34819:"stencilOpBack",2978:(t,e)=>t.viewport(...e),34383:_e,10754:_e,12288:_e,12289:_e,12290:_e,12291:_e,12292:_e,12293:_e,12294:_e,12295:_e,3333:be,3317:be,37440:be,37441:be,37443:be,3330:be,3332:be,3331:be,3314:be,32878:be,3316:be,3315:be,32877:be,framebuffer:(t,e)=>{const n=e&&"handle"in e?e.handle:e;return t.bindFramebuffer(36160,n)},blend:(t,e)=>e?t.enable(3042):t.disable(3042),blendColor:(t,e)=>t.blendColor(...e),blendEquation:(t,e)=>{const n="number"===typeof e?[e,e]:e;t.blendEquationSeparate(...n)},blendFunc:(t,e)=>{const n=2===e?.length?[...e,...e]:e;t.blendFuncSeparate(...n)},clearColor:(t,e)=>t.clearColor(...e),clearDepth:(t,e)=>t.clearDepth(e),clearStencil:(t,e)=>t.clearStencil(e),colorMask:(t,e)=>t.colorMask(...e),cull:(t,e)=>e?t.enable(2884):t.disable(2884),cullFace:(t,e)=>t.cullFace(e),depthTest:(t,e)=>e?t.enable(2929):t.disable(2929),depthFunc:(t,e)=>t.depthFunc(e),depthMask:(t,e)=>t.depthMask(e),depthRange:(t,e)=>t.depthRange(...e),dither:(t,e)=>e?t.enable(3024):t.disable(3024),derivativeHint:(t,e)=>{t.hint(35723,e)},frontFace:(t,e)=>t.frontFace(e),mipmapHint:(t,e)=>t.hint(33170,e),lineWidth:(t,e)=>t.lineWidth(e),polygonOffsetFill:(t,e)=>e?t.enable(32823):t.disable(32823),polygonOffset:(t,e)=>t.polygonOffset(...e),sampleCoverage:(t,e)=>t.sampleCoverage(...e),scissorTest:(t,e)=>e?t.enable(3089):t.disable(3089),scissor:(t,e)=>t.scissor(...e),stencilTest:(t,e)=>e?t.enable(2960):t.disable(2960),stencilMask:(t,e)=>{e=Ee(e)?e:[e,e];const[n,i]=e;t.stencilMaskSeparate(1028,n),t.stencilMaskSeparate(1029,i)},stencilFunc:(t,e)=>{e=Ee(e)&&3===e.length?[...e,...e]:e;const[n,i,r,o,s,a]=e;t.stencilFuncSeparate(1028,n,i,r),t.stencilFuncSeparate(1029,o,s,a)},stencilOp:(t,e)=>{e=Ee(e)&&3===e.length?[...e,...e]:e;const[n,i,r,o,s,a]=e;t.stencilOpSeparate(1028,n,i,r),t.stencilOpSeparate(1029,o,s,a)},viewport:(t,e)=>t.viewport(...e)};function Te(t,e,n){return void 0!==e[t]?e[t]:n[t]}const Se={blendEquation:(t,e,n)=>t.blendEquationSeparate(Te(32777,e,n),Te(34877,e,n)),blendFunc:(t,e,n)=>t.blendFuncSeparate(Te(32969,e,n),Te(32968,e,n),Te(32971,e,n),Te(32970,e,n)),polygonOffset:(t,e,n)=>t.polygonOffset(Te(32824,e,n),Te(10752,e,n)),sampleCoverage:(t,e,n)=>t.sampleCoverage(Te(32938,e,n),Te(32939,e,n)),stencilFuncFront:(t,e,n)=>t.stencilFuncSeparate(1028,Te(2962,e,n),Te(2967,e,n),Te(2963,e,n)),stencilFuncBack:(t,e,n)=>t.stencilFuncSeparate(1029,Te(34816,e,n),Te(36003,e,n),Te(36004,e,n)),stencilOpFront:(t,e,n)=>t.stencilOpSeparate(1028,Te(2964,e,n),Te(2965,e,n),Te(2966,e,n)),stencilOpBack:(t,e,n)=>t.stencilOpSeparate(1029,Te(34817,e,n),Te(34818,e,n),Te(34819,e,n))},Pe={enable:(t,e)=>t({[e]:!0}),disable:(t,e)=>t({[e]:!1}),pixelStorei:(t,e,n)=>t({[e]:n}),hint:(t,e,n)=>t({[e]:n}),useProgram:(t,e)=>t({35725:e}),bindRenderbuffer:(t,e,n)=>t({36007:n}),bindTransformFeedback:(t,e,n)=>t({36389:n}),bindVertexArray:(t,e)=>t({34229:e}),bindFramebuffer:(t,e,n)=>{switch(e){case 36160:return t({36006:n,36010:n});case 36009:return t({36006:n});case 36008:return t({36010:n});default:return null}},bindBuffer:(t,e,n)=>{const i={34962:[34964],36662:[36662],36663:[36663],35051:[35053],35052:[35055]}[e];return i?t({[i]:n}):{valueChanged:!0}},blendColor:(t,e,n,i,r)=>t({32773:new Float32Array([e,n,i,r])}),blendEquation:(t,e)=>t({32777:e,34877:e}),blendEquationSeparate:(t,e,n)=>t({32777:e,34877:n}),blendFunc:(t,e,n)=>t({32969:e,32968:n,32971:e,32970:n}),blendFuncSeparate:(t,e,n,i,r)=>t({32969:e,32968:n,32971:i,32970:r}),clearColor:(t,e,n,i,r)=>t({3106:new Float32Array([e,n,i,r])}),clearDepth:(t,e)=>t({2931:e}),clearStencil:(t,e)=>t({2961:e}),colorMask:(t,e,n,i,r)=>t({3107:[e,n,i,r]}),cullFace:(t,e)=>t({2885:e}),depthFunc:(t,e)=>t({2932:e}),depthRange:(t,e,n)=>t({2928:new Float32Array([e,n])}),depthMask:(t,e)=>t({2930:e}),frontFace:(t,e)=>t({2886:e}),lineWidth:(t,e)=>t({2849:e}),polygonOffset:(t,e,n)=>t({32824:e,10752:n}),sampleCoverage:(t,e,n)=>t({32938:e,32939:n}),scissor:(t,e,n,i,r)=>t({3088:new Int32Array([e,n,i,r])}),stencilMask:(t,e)=>t({2968:e,36005:e}),stencilMaskSeparate:(t,e,n)=>t({[1028===e?2968:36005]:n}),stencilFunc:(t,e,n,i)=>t({2962:e,2967:n,2963:i,34816:e,36003:n,36004:i}),stencilFuncSeparate:(t,e,n,i,r)=>t({[1028===e?2962:34816]:n,[1028===e?2967:36003]:i,[1028===e?2963:36004]:r}),stencilOp:(t,e,n,i)=>t({2964:e,2965:n,2966:i,34817:e,34818:n,34819:i}),stencilOpSeparate:(t,e,n,i,r)=>t({[1028===e?2964:34817]:n,[1028===e?2965:34818]:i,[1028===e?2966:34819]:r}),viewport:(t,e,n,i,r)=>t({2978:[e,n,i,r]})},Me=(t,e)=>t.isEnabled(e),Ie={3042:Me,2884:Me,2929:Me,3024:Me,32823:Me,32926:Me,32928:Me,3089:Me,2960:Me,35977:Me},Be=new Set([34016,36388,36387,35983,35368,34965,35739,35738,3074,34853,34854,34855,34856,34857,34858,34859,34860,34861,34862,34863,34864,34865,34866,34867,34868,35097,32873,35869,32874,34068]);function Re(t,e){if(function(t){for(const e in t)return!1;return!0}(e))return;const n={};for(const r in e){const i=Number(r),o=Ce[r];o&&("string"===typeof o?n[o]=!0:o(t,e[r],i))}const i=t.state&&t.state.cache;if(i)for(const r in n){(0,Se[r])(t,e,i)}}function Le(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ye;if("number"===typeof e){const n=e,i=Ie[n];return i?i(t,n):t.getParameter(n)}const n=Array.isArray(e)?e:Object.keys(e),i={};for(const r of n){const e=Ie[r];i[r]=e?e(t,Number(r)):t.getParameter(Number(r))}return i}function Oe(t,e){if(t===e)return!0;const n=Array.isArray(t)||ArrayBuffer.isView(t),i=Array.isArray(e)||ArrayBuffer.isView(e);if(n&&i&&t.length===e.length){for(let n=0;n<t.length;++n)if(t[n]!==e[n])return!1;return!0}return!1}class De{gl;program=null;stateStack=[];enable=!0;cache;log;constructor(t){let{copyState:e=!1,log:n=(
2)=>{}
vendor: 13,871 bytes, line 2
2}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.gl=t,this.cache=e?Le(t):Object.assign({},ye),this.log=n,this._updateCache=this._updateCache.bind(this),Object.seal(this)}push(){this.stateStack.push({})}pop(){(0,le.v)(this.stateStack.length>0);const t=this.stateStack[this.stateStack.length-1];Re(this.gl,t),this.stateStack.pop()}_updateCache(t){let e,n=!1;const i=this.stateStack.length>0?this.stateStack[this.stateStack.length-1]:null;for(const r in t){(0,le.v)(void 0!==r);const o=t[r],s=this.cache[r];Oe(o,s)||(n=!0,e=s,i&&!(r in i)&&(i[r]=s),this.cache[r]=o)}return{valueChanged:n,oldValue:e}}}function ke(t){return t.state}function Fe(t,e){const{enable:n=!0,copyState:i}=e;if((0,le.v)(void 0!==i),!t.state){t.state=new De(t,{copyState:i}),function(t){const e=t.useProgram.bind(t);t.useProgram=function(n){const i=ke(t);i.program!==n&&(e(n),i.program=n)}}(t);for(const e in Pe){Ge(t,e,Pe[e])}Ue(t,"getParameter"),Ue(t,"isEnabled")}return ke(t).enable=n,t}function Ne(t){let e=ke(t);e||(Fe(t,{copyState:!1}),e=ke(t)),e.push()}function ze(t){const e=ke(t);(0,le.v)(e),e.pop()}function Ue(t,e){const n=t[e].bind(t);t[e]=function(e){if(void 0===e||Be.has(e))return n(e);const i=ke(t);return e in i.cache||(i.cache[e]=n(e)),i.enable?i.cache[e]:n(e)},Object.defineProperty(t[e],"name",{value:`${e}-from-cache`,configurable:!1})}function Ge(t,e,n){if(!t[e])return;const i=t[e].bind(t);t[e]=function(){const e=ke(t);for(var r=arguments.length,o=new Array(r),s=0;s<r;s++)o[s]=arguments[s];const{valueChanged:a,oldValue:l}=n(e._updateCache,...o);return a&&i(...o),l},Object.defineProperty(t[e],"name",{value:`${e}-to-cache`,configurable:!1})}const Ve={powerPreference:"high-performance",onContextLost:()=>console.error("WebGL context lost"),onContextRestored:()=>console.info("WebGL context restored")};function je(t,e,n){return void 0===n[e]&&(n[e]=t.getExtension(e)||null),n[e]}function He(t,e){const n=t.getParameter(7936),i=t.getParameter(7937);je(t,"WEBGL_debug_renderer_info",e);const r=e.WEBGL_debug_renderer_info,o=t.getParameter(r?r.UNMASKED_VENDOR_WEBGL:7936)||n,s=t.getParameter(r?r.UNMASKED_RENDERER_WEBGL:7937)||i,a=t.getParameter(7938),l=We(o,s),c=function(t,e){if(/Metal/i.exec(t)||/Metal/i.exec(e))return"metal";if(/ANGLE/i.exec(t)||/ANGLE/i.exec(e))return"opengl";return"unknown"}(o,s),u=function(t,e){if(/SwiftShader/i.exec(t)||/SwiftShader/i.exec(e))return"cpu";switch(We(t,e)){case"intel":return"integrated";case"software":return"cpu";case"unknown":return"unknown";default:return"discrete"}}(o,s);return{type:"webgl",gpu:l,gpuType:u,gpuBackend:c,vendor:o,renderer:s,version:a,shadingLanguage:"glsl",shadingLanguageVersion:300}}function We(t,e){return/NVIDIA/i.exec(t)||/NVIDIA/i.exec(e)?"nvidia":/INTEL/i.exec(t)||/INTEL/i.exec(e)?"intel":/Apple/i.exec(t)||/Apple/i.exec(e)?"apple":/AMD/i.exec(t)||/AMD/i.exec(e)||/ATI/i.exec(t)||/ATI/i.exec(e)?"amd":/SwiftShader/i.exec(t)||/SwiftShader/i.exec(e)?"software":"unknown"}function qe(t){switch(t){case"uint8":case"unorm8":return 5121;case"sint8":case"snorm8":return 5120;case"uint16":case"unorm16":return 5123;case"sint16":case"snorm16":return 5122;case"uint32":return 5125;case"sint32":return 5124;case"float16":return 5131;case"float32":return 5126}throw new Error(String(t))}const Ze="texture-compression-bc",Xe="texture-compression-astc",Ke="texture-compression-etc2",Qe="texture-compression-pvrtc-webgl",Je="texture-compression-atc-webgl",Ye="float32-renderable-webgl",$e="float16-renderable-webgl",tn="snorm8-renderable-webgl",en="norm16-renderable-webgl",nn="snorm16-renderable-webgl",rn="float32-filterable",on="float16-filterable-webgl",sn="WEBGL_compressed_texture_s3tc",an="WEBGL_compressed_texture_s3tc_srgb",ln="EXT_texture_compression_rgtc",cn="EXT_texture_compression_bptc",un="EXT_texture_norm16",hn="EXT_render_snorm",dn={"float32-renderable-webgl":["EXT_color_buffer_float"],"float16-renderable-webgl":["EXT_color_buffer_half_float"],"rgb9e5ufloat_renderable-webgl":["WEBGL_render_shared_exponent"],"snorm8-renderable-webgl":[hn],"norm16-renderable-webgl":[un],"snorm16-renderable-webgl":[un,hn],"float32-filterable":["OES_texture_float_linear"],"float16-filterable-webgl":["OES_texture_half_float_linear"],"texture-filterable-anisotropic-webgl":["EXT_texture_filter_anisotropic"],"texture-blend-float-webgl":["EXT_float_blend"],"texture-compression-bc":[sn,an,ln,cn],"texture-compression-bc5-webgl":[ln],"texture-compression-bc7-webgl":[cn],"texture-compression-etc2":["WEBGL_compressed_texture_etc"],"texture-compression-astc":["WEBGL_compressed_texture_astc"],"texture-compression-etc1-webgl":["WEBGL_compressed_texture_etc1"],"texture-compression-pvrtc-webgl":["WEBGL_compressed_texture_pvrtc"],"texture-compression-atc-webgl":["WEBGL_compressed_texture_atc"]};function pn(t,e,n){return(dn[e]||[]).every((e=>je(t,e,n)))}const fn={"rgb8unorm-unsized":{gl:6407,b:4,c:2,bpp:4,dataFormat:6407,types:[5121,33635]},"rgba8unorm-unsized":{gl:6408,b:4,c:2,bpp:4,dataFormat:6408,types:[5121,32819,32820]},r8unorm:{gl:33321,b:1,c:1,rb:!0},r8snorm:{gl:36756,b:1,c:1,render:tn},r8uint:{gl:33330,b:1,c:1,rb:!0},r8sint:{gl:33329,b:1,c:1,rb:!0},rg8unorm:{gl:33323,b:2,c:2,rb:!0},rg8snorm:{gl:36757,b:2,c:2,render:tn},rg8uint:{gl:33336,b:2,c:2,rb:!0},rg8sint:{gl:33335,b:2,c:2,rb:!0},r16uint:{gl:33332,b:2,c:1,rb:!0},r16sint:{gl:33331,b:2,c:1,rb:!0},r16float:{gl:33325,b:2,c:1,render:$e,filter:"float16-filterable-webgl",rb:!0},"r16unorm-webgl":{gl:33322,b:2,c:1,f:en,rb:!0},"r16snorm-webgl":{gl:36760,b:2,c:1,f:nn},"rgba4unorm-webgl":{gl:32854,b:2,c:4,wgpu:!1,rb:!0},"rgb565unorm-webgl":{gl:36194,b:2,c:4,wgpu:!1,rb:!0},"rgb5a1unorm-webgl":{gl:32855,b:2,c:4,wgpu:!1,rb:!0},"rgb8unorm-webgl":{gl:32849,b:3,c:3,wgpu:!1},"rgb8snorm-webgl":{gl:36758,b:3,c:3,wgpu:!1},rgba8unorm:{gl:32856,b:4,c:2,bpp:4},"rgba8unorm-srgb":{gl:35907,b:4,c:4,bpp:4},rgba8snorm:{gl:36759,b:4,c:4,render:tn},rgba8uint:{gl:36220,b:4,c:4,bpp:4},rgba8sint:{gl:36238,b:4,c:4,bpp:4},bgra8unorm:{b:4,c:4},"bgra8unorm-srgb":{b:4,c:4},rg16uint:{gl:33338,b:4,c:1,bpp:4},rg16sint:{gl:33337,b:4,c:2,bpp:4},rg16float:{gl:33327,bpp:4,b:4,c:2,render:$e,filter:on,rb:!0},"rg16unorm-webgl":{gl:33324,b:2,c:2,render:en},"rg16snorm-webgl":{gl:36761,b:2,c:2,render:nn},r32uint:{gl:33334,b:4,c:1,bpp:4,rb:!0},r32sint:{gl:33333,b:4,c:1,bpp:4,rb:!0},r32float:{gl:33326,bpp:4,b:4,c:1,render:Ye,filter:rn},rgb9e5ufloat:{gl:35901,b:4,c:3,p:1,render:"rgb9e5ufloat_renderable-webgl"},rg11b10ufloat:{gl:35898,b:4,c:3,p:1,render:Ye,rb:!0},rgb10a2unorm:{gl:32857,b:4,c:4,p:1,rb:!0},"rgb10a2uint-webgl":{b:4,c:4,gl:36975,p:1,wgpu:!1,bpp:4,rb:!0},"rgb16unorm-webgl":{gl:32852,b:2,c:3,f:en},"rgb16snorm-webgl":{gl:36762,b:2,c:3,f:en},rg32uint:{gl:33340,b:8,c:2,rb:!0},rg32sint:{gl:33339,b:8,c:2,rb:!0},rg32float:{gl:33328,b:8,c:2,render:Ye,filter:rn,rb:!0},rgba16uint:{gl:36214,b:8,c:4,rb:!0},rgba16sint:{gl:36232,b:8,c:4,rb:!0},rgba16float:{gl:34842,b:8,c:4,render:$e,filter:on},"rgba16unorm-webgl":{gl:32859,b:2,c:4,render:en,rb:!0},"rgba16snorm-webgl":{gl:36763,b:2,c:4,render:nn},"rgb32float-webgl":{gl:34837,render:Ye,filter:rn,gl2ext:"EXT_color_buffer_float",dataFormat:6407,types:[5126]},rgba32uint:{gl:36208,b:16,c:4,rb:!0},rgba32sint:{gl:36226,b:16,c:4,rb:!0},rgba32float:{gl:34836,b:16,c:4,render:Ye,filter:rn,rb:!0},stencil8:{gl:36168,b:1,c:1,attachment:36128,rb:!0},depth16unorm:{gl:33189,b:2,c:1,attachment:36096,dataFormat:6402,types:[5123],rb:!0},depth24plus:{gl:33190,b:3,c:1,attachment:36096,dataFormat:6402,types:[5125]},depth32float:{gl:36012,b:4,c:1,attachment:36096,dataFormat:6402,types:[5126],rb:!0},"depth24plus-stencil8":{gl:35056,b:4,c:2,p:1,attachment:33306,rb:!0,depthTexture:!0,dataFormat:34041,types:[34042]},"depth24unorm-stencil8":{gl:35056,b:4,c:2,p:1,attachment:33306,dataFormat:34041,types:[34042],rb:!0},"depth32float-stencil8":{gl:36013,b:5,c:2,p:1,attachment:33306,dataFormat:34041,types:[36269],rb:!0},"bc1-rgb-unorm-webgl":{gl:33776,x:sn,f:Ze},"bc1-rgb-unorm-srgb-webgl":{gl:35916,x:an,f:Ze},"bc1-rgba-unorm":{gl:33777,x:sn,f:Ze},"bc1-rgba-unorm-srgb":{gl:35916,x:an,f:Ze},"bc2-rgba-unorm":{gl:33778,x:sn,f:Ze},"bc2-rgba-unorm-srgb":{gl:35918,x:an,f:Ze},"bc3-rgba-unorm":{gl:33779,x:sn,f:Ze},"bc3-rgba-unorm-srgb":{gl:35919,x:an,f:Ze},"bc4-r-unorm":{gl:36283,x:ln,f:Ze},"bc4-r-snorm":{gl:36284,x:ln,f:Ze},"bc5-rg-unorm":{gl:36285,x:ln,f:Ze},"bc5-rg-snorm":{gl:36286,x:ln,f:Ze},"bc6h-rgb-ufloat":{gl:36495,x:cn,f:Ze},"bc6h-rgb-float":{gl:36494,x:cn,f:Ze},"bc7-rgba-unorm":{gl:36492,x:cn,f:Ze},"bc7-rgba-unorm-srgb":{gl:36493,x:cn,f:Ze},"etc2-rgb8unorm":{gl:37492,f:Ke},"etc2-rgb8unorm-srgb":{gl:37494,f:Ke},"etc2-rgb8a1unorm":{gl:37496,f:Ke},"etc2-rgb8a1unorm-srgb":{gl:37497,f:Ke},"etc2-rgba8unorm":{gl:37493,f:Ke},"etc2-rgba8unorm-srgb":{gl:37495,f:Ke},"eac-r11unorm":{gl:37488,f:Ke},"eac-r11snorm":{gl:37489,f:Ke},"eac-rg11unorm":{gl:37490,f:Ke},"eac-rg11snorm":{gl:37491,f:Ke},"astc-4x4-unorm":{gl:37808,f:Xe},"astc-4x4-unorm-srgb":{gl:37840,f:Xe},"astc-5x4-unorm":{gl:37809,f:Xe},"astc-5x4-unorm-srgb":{gl:37841,f:Xe},"astc-5x5-unorm":{gl:37810,f:Xe},"astc-5x5-unorm-srgb":{gl:37842,f:Xe},"astc-6x5-unorm":{gl:37811,f:Xe},"astc-6x5-unorm-srgb":{gl:37843,f:Xe},"astc-6x6-unorm":{gl:37812,f:Xe},"astc-6x6-unorm-srgb":{gl:37844,f:Xe},"astc-8x5-unorm":{gl:37813,f:Xe},"astc-8x5-unorm-srgb":{gl:37845,f:Xe},"astc-8x6-unorm":{gl:37814,f:Xe},"astc-8x6-unorm-srgb":{gl:37846,f:Xe},"astc-8x8-unorm":{gl:37815,f:Xe},"astc-8x8-unorm-srgb":{gl:37847,f:Xe},"astc-10x5-unorm":{gl:37819,f:Xe},"astc-10x5-unorm-srgb":{gl:37851,f:Xe},"astc-10x6-unorm":{gl:37817,f:Xe},"astc-10x6-unorm-srgb":{gl:37849,f:Xe},"astc-10x8-unorm":{gl:37818,f:Xe},"astc-10x8-unorm-srgb":{gl:37850,f:Xe},"astc-10x10-unorm":{gl:37819,f:Xe},"astc-10x10-unorm-srgb":{gl:37851,f:Xe},"astc-12x10-unorm":{gl:37820,f:Xe},"astc-12x10-unorm-srgb":{gl:37852,f:Xe},"astc-12x12-unorm":{gl:37821,f:Xe},"astc-12x12-unorm-srgb":{gl:37853,f:Xe},"pvrtc-rgb4unorm-webgl":{gl:35840,f:Qe},"pvrtc-rgba4unorm-webgl":{gl:35842,f:Qe},"pvrtc-rbg2unorm-webgl":{gl:35841,f:Qe},"pvrtc-rgba2unorm-webgl":{gl:35843,f:Qe},"etc1-rbg-unorm-webgl":{gl:36196,f:"texture-compression-etc1-webgl"},"atc-rgb-unorm-webgl":{gl:35986,f:Je},"atc-rgba-unorm-webgl":{gl:35986,f:Je},"atc-rgbai-unorm-webgl":{gl:34798,f:Je}},An={6403:1,36244:1,33319:2,33320:2,6407:3,36248:3,6408:4,36249:4,6402:1,34041:1,6406:1,6409:1,6410:2},gn={5126:4,5125:4,5124:4,5123:2,5122:2,5131:2,5120:1,5121:1};function mn(t,e,n){const i=fn[e];if(!i)return!1;if(void 0===i.gl)return!1;const r=i.x||i.gl2ext;return!r||Boolean(je(t,r,n))}function yn(t){const e=fn[t],n=e?.gl;if(void 0===n)throw new Error(`Unsupported texture format ${t}`);return n}function _n(t){const e=fn[t],n=yn(t),i=ie(t);return{format:n,dataFormat:e?.dataFormat||bn(i.format,i.integer,i.normalized,n),type:i.dataType?qe(i.dataType):e?.types?.[0]||5121,compressed:i.compressed}}function vn(t){const e=_n(t);return(An[e.dataFormat]||4)*(gn[e.type]||1)}function bn(t,e,n,i){if(6408===i||6407===i)return i;switch(t){case"r":return e&&!n?36244:6403;case"rg":return e&&!n?33320:33319;case"rgb":return e&&!n?36248:6407;case"rgba":return e&&!n?36249:6408;default:return 6408}}const xn={"depth-clip-control":"EXT_depth_clamp","timer-query-webgl":"EXT_disjoint_timer_query_webgl2","compilation-status-async-webgl":"KHR_parallel_shader_compile","polygon-mode-webgl":"WEBGL_polygon_mode","provoking-vertex-webgl":"WEBGL_provoking_vertex","shader-clip-cull-distance-webgl":"WEBGL_clip_cull_distance","shader-noperspective-interpolation-webgl":"NV_shader_noperspective_interpolation","shader-conservative-depth-webgl":"EXT_conservative_depth"};class wn extends se{gl;extensions;testedFeatures=new Set;constructor(t,e,n){super([],n),this.gl=t,this.extensions=e,je(t,"EXT_color_buffer_float",e)}*[Symbol.iterator](){const t=this.getFeatures();for(const e of t)this.has(e)&&(yield e);return[]}has(t){return!this.disabledFeatures[t]&&(this.testedFeatures.has(t)||(this.testedFeatures.add(t),function(t){return t in dn}(t)&&pn(this.gl,t,this.extensions)&&this.features.add(t),this.getWebGLFeature(t)&&this.features.add(t)),this.features.has(t))}initializeFeatures(){const t=this.getFeatures().filter((t=>"polygon-mode-webgl"!==t));for(const e of t)this.has(e)}getFeatures(){return[...Object.keys(xn),...Object.keys(dn)]}getWebGLFeature(t){const e=xn[t];return"string"===typeof e?Boolean(je(this.gl,e,this.extensions)):Boolean(e)}}class En extends oe{get maxTextureDimension1D(){return 0}get maxTextureDimension2D(){return this.getParameter(3379)}get maxTextureDimension3D(){return this.getParameter(32883)}get maxTextureArrayLayers(){return this.getParameter(35071)}get maxBindGroups(){return 0}get maxDynamicUniformBuffersPerPipelineLayout(){return 0}get maxDynamicStorageBuffersPerPipelineLayout(){return 0}get maxSampledTexturesPerShaderStage(){return this.getParameter(35660)}get maxSamplersPerShaderStage(){return this.getParameter(35661)}get maxStorageBuffersPerShaderStage(){return 0}get maxStorageTexturesPerShaderStage(){return 0}get maxUniformBuffersPerShaderStage(){return this.getParameter(35375)}get maxUniformBufferBindingSize(){return this.getParameter(35376)}get maxStorageBufferBindingSize(){return 0}get minUniformBufferOffsetAlignment(){return this.getParameter(35380)}get minStorageBufferOffsetAlignment(){return 0}get maxVertexBuffers(){return 16}get maxVertexAttributes(){return this.getParameter(34921)}get maxVertexBufferArrayStride(){return 2048}get maxInterStageShaderComponents(){return this.getParameter(35659)}get maxComputeWorkgroupStorageSize(){return 0}get maxComputeInvocationsPerWorkgroup(){return 0}get maxComputeWorkgroupSizeX(){return 0}get maxComputeWorkgroupSizeY(){return 0}get maxComputeWorkgroupSizeZ(){return 0}get maxComputeWorkgroupsPerDimension(){return 0}gl;limits={};constructor(t){super(),this.gl=t}getParameter(t){return void 0===this.limits[t]&&(this.limits[t]=this.gl.getParameter(t)),this.limits[t]}}var Cn=n(
298383),Tn=n(44980
vendor: 9,734 bytes, line 2
2);class Sn extends Cn.F{static defaultProps={...Cn.F.defaultProps,width:1,height:1,colorAttachments:[],depthStencilAttachment:null};get[Symbol.toStringTag](){return"Framebuffer"}width;height;colorAttachments=[];depthStencilAttachment=null;constructor(t){super(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},Sn.defaultProps),this.width=this.props.width,this.height=this.props.height}resize(t){let e=!t;if(t){const[n,i]=Array.isArray(t)?t:[t.width,t.height];e=e||i!==this.height||n!==this.width,this.width=n,this.height=i}e&&(Kt.R.log(2,`Resizing framebuffer ${this.id} to ${this.width}x${this.height}`)(),this.resizeAttachments(this.width,this.height))}autoCreateAttachmentTextures(){if(0===this.props.colorAttachments.length&&!this.props.depthStencilAttachment)throw new Error("Framebuffer has noattachments");this.colorAttachments=this.props.colorAttachments.map((t=>{if("string"===typeof t){const e=this.createColorTexture(t);return this.attachResource(e),e.view}return t instanceof Tn.g?t.view:t}));const t=this.props.depthStencilAttachment;if(t)if("string"===typeof t){const e=this.createDepthStencilTexture(t);this.attachResource(e),this.depthStencilAttachment=e.view}else t instanceof Tn.g?this.depthStencilAttachment=t.view:this.depthStencilAttachment=t}createColorTexture(t){return this.device.createTexture({id:"color-attachment",usage:Tn.g.RENDER_ATTACHMENT,format:t,width:this.width,height:this.height})}createDepthStencilTexture(t){return this.device.createTexture({id:"depth-stencil-attachment",usage:Tn.g.RENDER_ATTACHMENT,format:t,width:this.width,height:this.height})}resizeAttachments(t,e){for(let n=0;n<this.colorAttachments.length;++n)if(this.colorAttachments[n]){const i=this.device._createTexture({...this.colorAttachments[n].props,width:t,height:e});this.destroyAttachedResource(this.colorAttachments[n]),this.colorAttachments[n]=i.view,this.attachResource(i.view)}if(this.depthStencilAttachment){const n=this.device._createTexture({...this.depthStencilAttachment.props,width:t,height:e});this.destroyAttachedResource(this.depthStencilAttachment),this.depthStencilAttachment=n.view,this.attachResource(n)}}}let Pn="";async function Mn(t,e){return await new Promise(((n,i)=>{try{const r=new Image;r.onload=()=>n(r),r.onerror=()=>i(new Error(`Could not load image ${t}.`)),r.crossOrigin=e?.crossOrigin||"anonymous",r.src=t.startsWith("http")?t:Pn+t}catch(r){i(r)}}))}async function In(t,e){const n=document.getElementsByTagName("head")[0];if(!n)throw new Error("loadScript");const i=document.createElement("script");return i.setAttribute("type","text/javascript"),i.setAttribute("src",t),e&&(i.id=e),new Promise(((e,r)=>{i.onload=e,i.onerror=e=>r(new Error(`Unable to load script '${t}': ${e}`)),n.appendChild(i)}))}function Bn(t,e,n){if(function(t){for(const e in t)return!1;return!0}(e))return n(t);const{nocatch:i=!0}=e;let r;if(Ne(t),Re(t,e),i)r=n(t),ze(t);else try{r=n(t)}finally{ze(t)}return r}function Rn(t,e){const n=t,{gl:i}=n;if(e.cullMode)switch(e.cullMode){case"none":i.disable(2884);break;case"front":i.enable(2884),i.cullFace(1028);break;case"back":i.enable(2884),i.cullFace(1029)}if(e.frontFace&&i.frontFace(Fn("frontFace",e.frontFace,{ccw:2305,cw:2304})),e.unclippedDepth&&t.features.has("depth-clip-control")&&i.enable(34383),void 0!==e.depthBias&&(i.enable(32823),i.polygonOffset(e.depthBias,e.depthBiasSlopeScale||0)),e.provokingVertex&&t.features.has("provoking-vertex-webgl")){const t=n.getExtension("WEBGL_provoking_vertex").WEBGL_provoking_vertex,i=Fn("provokingVertex",e.provokingVertex,{first:36429,last:36430});t?.provokingVertexWEBGL(i)}if((e.polygonMode||e.polygonOffsetLine)&&t.features.has("polygon-mode-webgl")){if(e.polygonMode){const t=n.getExtension("WEBGL_polygon_mode").WEBGL_polygon_mode,i=Fn("polygonMode",e.polygonMode,{fill:6914,line:6913});t?.polygonModeWEBGL(1028,i),t?.polygonModeWEBGL(1029,i)}e.polygonOffsetLine&&i.enable(10754)}if(t.features.has("shader-clip-cull-distance-webgl")&&(e.clipDistance0&&i.enable(12288),e.clipDistance1&&i.enable(12289),e.clipDistance2&&i.enable(12290),e.clipDistance3&&i.enable(12291),e.clipDistance4&&i.enable(12292),e.clipDistance5&&i.enable(12293),e.clipDistance6&&i.enable(12294),e.clipDistance7&&i.enable(12295)),void 0!==e.depthWriteEnabled&&i.depthMask(e.depthWriteEnabled),e.depthCompare&&("always"!==e.depthCompare?i.enable(2929):i.disable(2929),i.depthFunc(Ln("depthCompare",e.depthCompare))),e.stencilWriteMask){const t=e.stencilWriteMask;i.stencilMaskSeparate(1028,t),i.stencilMaskSeparate(1029,t)}if(e.stencilReadMask&&Kt.R.warn("stencilReadMask not supported under WebGL"),e.stencilCompare){const t=e.stencilReadMask||4294967295,n=Ln("depthCompare",e.stencilCompare);"always"!==e.stencilCompare?i.enable(2960):i.disable(2960),i.stencilFuncSeparate(1028,n,0,t),i.stencilFuncSeparate(1029,n,0,t)}if(e.stencilPassOperation&&e.stencilFailOperation&&e.stencilDepthFailOperation){const t=On("stencilPassOperation",e.stencilPassOperation),n=On("stencilFailOperation",e.stencilFailOperation),r=On("stencilDepthFailOperation",e.stencilDepthFailOperation);i.stencilOpSeparate(1028,n,r,t),i.stencilOpSeparate(1029,n,r,t)}if(e.blendColorOperation||e.blendAlphaOperation){i.enable(3042);const t=Dn("blendColorOperation",e.blendColorOperation||"add"),n=Dn("blendAlphaOperation",e.blendAlphaOperation||"add");i.blendEquationSeparate(t,n);const r=kn("blendColorSrcFactor",e.blendColorSrcFactor||"one"),o=kn("blendColorDstFactor",e.blendColorDstFactor||"zero"),s=kn("blendAlphaSrcFactor",e.blendAlphaSrcFactor||"one"),a=kn("blendAlphaDstFactor",e.blendAlphaDstFactor||"zero");i.blendFuncSeparate(r,o,s,a)}}function Ln(t,e){return Fn(t,e,{never:512,less:513,equal:514,"less-equal":515,greater:516,"not-equal":517,"greater-equal":518,always:519})}function On(t,e){return Fn(t,e,{keep:7680,zero:0,replace:7681,invert:5386,"increment-clamp":7682,"decrement-clamp":7683,"increment-wrap":34055,"decrement-wrap":34056})}function Dn(t,e){return Fn(t,e,{add:32774,subtract:32778,"reverse-subtract":32779,min:32775,max:32776})}function kn(t,e){return Fn(t,e,{one:1,zero:0,"src-color":768,"one-minus-src-color":769,"dst-color":774,"one-minus-dst-color":775,"src-alpha":770,"one-minus-src-alpha":771,"dst-alpha":772,"one-minus-dst-alpha":773,"src-alpha-saturated":776,"constant-color":32769,"one-minus-constant-color":32770,"constant-alpha":32771,"one-minus-constant-alpha":32772})}function Fn(t,e,n){if(!(e in n))throw new Error(function(t,e){return`Illegal parameter ${e} for ${t}`}(t,e));return n[e]}function Nn(t){const e={};return t.addressModeU&&(e[10242]=zn(t.addressModeU)),t.addressModeV&&(e[10243]=zn(t.addressModeV)),t.addressModeW&&(e[32882]=zn(t.addressModeW)),t.magFilter&&(e[10240]=Un(t.magFilter)),(t.minFilter||t.mipmapFilter)&&(e[10241]=function(t,e){if(!e)return Un(t);switch(t){case"nearest":return"nearest"===e?9984:9986;case"linear":return"nearest"===e?9985:9987}}(t.minFilter||"linear",t.mipmapFilter)),void 0!==t.lodMinClamp&&(e[33082]=t.lodMinClamp),void 0!==t.lodMaxClamp&&(e[33083]=t.lodMaxClamp),"comparison-sampler"===t.type&&(e[34892]=34894),t.compare&&(e[34893]=Ln("compare",t.compare)),t.maxAnisotropy&&(e[34046]=t.maxAnisotropy),e}function zn(t){switch(t){case"clamp-to-edge":return 33071;case"repeat":return 10497;case"mirror-repeat":return 33648}}function Un(t){switch(t){case"nearest":return 9728;case"linear":return 9729}}class Gn extends $t.h{device;gl;handle;glTarget;glUsage;glIndexType=5123;byteLength;bytesUsed;constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(t,e),this.device=t,this.gl=this.device.gl;const n="object"===typeof e?e.handle:void 0;this.handle=n||this.gl.createBuffer(),t.setSpectorMetadata(this.handle,{...this.props,data:typeof this.props.data}),this.glTarget=function(t){if(t&$t.h.INDEX)return 34963;if(t&$t.h.VERTEX)return 34962;if(t&$t.h.UNIFORM)return 35345;return 34962}(this.props.usage),this.glUsage=function(t){if(t&$t.h.INDEX)return 35044;if(t&$t.h.VERTEX)return 35044;if(t&$t.h.UNIFORM)return 35048;return 35044}(this.props.usage),this.glIndexType="uint32"===this.props.indexType?5125:5123,e.data?this._initWithData(e.data,e.byteOffset,e.byteLength):this._initWithByteLength(e.byteLength||0)}_initWithData(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.byteLength+e;const i=this.glTarget;this.gl.bindBuffer(i,this.handle),this.gl.bufferData(i,n,this.glUsage),this.gl.bufferSubData(i,e,t),this.gl.bindBuffer(i,null),this.bytesUsed=n,this.byteLength=n,this._setDebugData(t,e,n),this.trackAllocatedMemory(n)}_initWithByteLength(t){(0,le.v)(t>=0);let e=t;0===t&&(e=new Float32Array(0));const n=this.glTarget;return this.gl.bindBuffer(n,this.handle),this.gl.bufferData(n,e,this.glUsage),this.gl.bindBuffer(n,null),this.bytesUsed=t,this.byteLength=t,this._setDebugData(null,0,t),this.trackAllocatedMemory(t),this}destroy(){!this.destroyed&&this.handle&&(this.removeStats(),this.trackDeallocatedMemory(),this.gl.deleteBuffer(this.handle),this.destroyed=!0,this.handle=null)}write(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const n=36663;this.gl.bindBuffer(n,this.handle),this.gl.bufferSubData(n,e,t),this.gl.bindBuffer(n,null),this._setDebugData(t,e,t.byteLength)}async readAsync(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1?arguments[1]:void 0;return this.readSyncWebGL(t,e)}readSyncWebGL(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1?arguments[1]:void 0;e=e??this.byteLength-t;const n=new Uint8Array(e);return this.gl.bindBuffer(36662,this.handle),this.gl.getBufferSubData(36662,t,n,0,e),this.gl.bindBuffer(36662,null),this._setDebugData(n,t,e),n}}var Vn=n(72
251);class jn extends Vn.L{device;handle;parameters;constructor(t,e){super(t,e),this.device=t,this.parameters=Nn(e),this.handle=this.handle||this.device.gl.createSampler(),this._setSamplerParameters(this.parameters)}destroy(){this.handle&&(this.device.gl.deleteSampler(this.handle),this.handle=void 0)}toString(){return`Sampler(${this.id},${JSON.stringify(this.props)})`}_setSamplerParameters(t){for(const[e,n]of Object.entries(t)){const t=Number(e);switch(t){case 33082:case 33083:this.device.gl.samplerParameterf(this.handle,t,n);break;default:this.device.gl.samplerParameteri(this.handle,t,n)}}}}var Hn=n(90516
vendor: 47,775 bytes, line 2
2);class Wn extends Hn.X{device;gl;handle;texture;constructor(t,e){super(t,{...Tn.g.defaultProps,...e}),this.device=t,this.gl=this.device.gl,this.handle=null,this.texture=e.texture}}const qn={parameters:{},pixelStore:{},pixels:null,border:0,dataFormat:void 0,textureUnit:void 0,target:void 0};class Zn extends Tn.g{static FACES=[34069,34070,34071,34072,34073,34074];MAX_ATTRIBUTES;device;gl;handle;sampler=void 0;view=void 0;glFormat=void 0;type=void 0;dataFormat=void 0;mipmaps=void 0;target;textureUnit=void 0;loaded=!1;_video;constructor(t,e){super(t,{...qn,format:"rgba8unorm",...e}),this.device=t,this.gl=this.device.gl,this.handle=this.props.handle||this.gl.createTexture(),this.device.setSpectorMetadata(this.handle,{...this.props,data:typeof this.props.data}),this.glFormat=6408,this.target=function(t){switch(t.dimension){case"2d":return 3553;case"cube":return 34067;case"2d-array":return 35866;case"3d":return 32879;default:throw new Error(t.dimension)}}(this.props),this.loaded=!1,"string"===typeof this.props?.data&&Object.assign(this.props,{data:Mn(this.props.data)}),this.initialize(this.props),Object.seal(this)}destroy(){this.handle&&(this.gl.deleteTexture(this.handle),this.removeStats(),this.trackDeallocatedMemory("Texture"),this.destroyed=!0)}toString(){return`Texture(${this.id},${this.width}x${this.height})`}createView(t){return new Wn(this.device,{...t,texture:this})}initialize(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("cube"===this.props.dimension)return this.initializeCube(t);let e=t.data;if(e instanceof Promise)return e.then((e=>this.initialize(Object.assign({},t,{pixels:e,data:e})))),this;const n="undefined"!==typeof HTMLVideoElement&&e instanceof HTMLVideoElement;if(n&&e.readyState<HTMLVideoElement.HAVE_METADATA)return this._video=null,e.addEventListener("loadeddata",(()=>this.initialize(t))),this;const{parameters:i={}}=t,{pixels:r=null,pixelStore:o={},textureUnit:s,mipmaps:a=!0}=t;e||(e=r);let{width:l,height:c,dataFormat:u,type:h,compressed:d=!1}=t;const{depth:p=0}=t,f=yn(t.format);return({width:l,height:c,compressed:d,dataFormat:u,type:h}=this._deduceParameters({format:t.format,type:h,dataFormat:u,compressed:d,data:e,width:l,height:c})),this.width=l,this.height=c,this.glFormat=f,this.type=h,this.dataFormat=u,this.textureUnit=s,Number.isFinite(this.textureUnit)&&(this.gl.activeTexture(33984+this.textureUnit),this.gl.bindTexture(this.target,this.handle)),this.mipmaps=a,this.setImageData({data:e,width:l,height:c,depth:p,format:t.format,type:h,dataFormat:u,parameters:o,compressed:d}),this.setSampler(t.sampler),this._setSamplerParameters(i),this.view=this.createView({...this.props,mipLevelCount:1,arrayLayerCount:1}),a&&this.device.isTextureFormatFilterable(t.format)&&this.generateMipmap(),n&&(this._video={video:e,parameters:i,lastTime:e.readyState>=HTMLVideoElement.HAVE_CURRENT_DATA?e.currentTime:-1}),this}initializeCube(t){const{mipmaps:e=!0,parameters:n={}}=t;return this.setCubeMapImageData(t).then((()=>{this.loaded=!0,e&&this.generateMipmap(t),this.setSampler(t.sampler),this._setSamplerParameters(n)})),this}setSampler(){let t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e instanceof jn?(this.sampler=e,t=e.props):(this.sampler=new jn(this.device,e),t=e);const n=Nn(t);return this._setSamplerParameters(n),this}resize(t){const{height:e,width:n,mipmaps:i=!1}=t;return n!==this.width||e!==this.height?this.initialize({width:n,height:e,format:this.format,type:this.type,dataFormat:this.dataFormat,mipmaps:i}):this}update(){if(this._video){const{video:t,parameters:e,lastTime:n}=this._video;if(n===t.currentTime||t.readyState<HTMLVideoElement.HAVE_CURRENT_DATA)return;this.setSubImageData({data:t,parameters:e}),this.mipmaps&&this.generateMipmap(),this._video.lastTime=t.currentTime}}generateMipmap(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.mipmaps=!0,this.gl.bindTexture(this.target,this.handle),Bn(this.gl,t,(()=>{this.gl.generateMipmap(this.target)})),this.gl.bindTexture(this.target,null),this}setImageData(t){if("3d"===this.props.dimension||"2d-array"===this.props.dimension)return this.setImageData3D(t);this.trackDeallocatedMemory("Texture");const{target:e=this.target,pixels:n=null,level:i=0,glFormat:r=this.glFormat,offset:o=0,parameters:s={}}=t;let{data:a=null,type:l=this.type,width:c=this.width,height:u=this.height,dataFormat:h=this.dataFormat,compressed:d=!1}=t;a||(a=n),({type:l,dataFormat:h,compressed:d,width:c,height:u}=this._deduceParameters({format:this.props.format,type:l,dataFormat:h,compressed:d,data:a,width:c,height:u}));const{gl:p}=this;p.bindTexture(this.target,this.handle);let f=null;if(({data:a,dataType:f}=this._getDataType({data:a,compressed:d})),Bn(this.gl,s,(()=>{switch(f){case"null":case"browser-object":p.texImage2D(e,i,r,c,u,0,h,l,a);break;case"typed-array":p.texImage2D(e,i,r,c,u,0,h,l,a,o);break;case"buffer":this.device.gl.bindBuffer(35052,a.handle||a),this.device.gl.texImage2D(e,i,r,c,u,0,h,l,o),this.device.gl.bindBuffer(35052,null);break;case"compressed":for(const[t,n]of a.entries())p.compressedTexImage2D(e,t,n.format,n.width,n.height,0,n.data);break;default:(0,le.v)(!1,"Unknown image data type")}})),a&&a.byteLength)this.trackAllocatedMemory(a.byteLength,"Texture");else{const t=vn(this.props.format);this.trackAllocatedMemory(this.width*this.height*t,"Texture")}return this.loaded=!0,this}setSubImageData(t){let{target:e=this.target,pixels:n=null,data:i=null,x:r=0,y:o=0,width:s=this.width,height:a=this.height,level:l=0,glFormat:c=this.glFormat,type:u=this.type,dataFormat:h=this.dataFormat,compressed:d=!1,offset:p=0,parameters:f={}}=t;if(({type:u,dataFormat:h,compressed:d,width:s,height:a}=this._deduceParameters({format:this.props.format,type:u,dataFormat:h,compressed:d,data:i,width:s,height:a})),(0,le.v)(1===this.depth,"texSubImage not supported for 3D textures"),i||(i=n),i&&i.data){const t=i;i=t.data,s=t.shape[0],a=t.shape[1]}i instanceof Gn&&(i=i.handle),this.gl.bindTexture(this.target,this.handle),Bn(this.gl,f,(()=>{d?this.gl.compressedTexSubImage2D(e,l,r,o,s,a,c,i):null===i?this.gl.texSubImage2D(e,l,r,o,s,a,h,u,null):ArrayBuffer.isView(i)?this.gl.texSubImage2D(e,l,r,o,s,a,h,u,i,p):"undefined"!==typeof WebGLBuffer&&i instanceof WebGLBuffer?(this.device.gl.bindBuffer(35052,i),this.device.gl.texSubImage2D(e,l,r,o,s,a,h,u,p),this.device.gl.bindBuffer(35052,null)):this.device.gl.texSubImage2D(e,l,r,o,s,a,h,u,i)})),this.gl.bindTexture(this.target,null)}copyFramebuffer(){return Kt.R.error("Texture.copyFramebuffer({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null}getActiveUnit(){return this.gl.getParameter(34016)-33984}bind(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.textureUnit;const{gl:e}=this;return void 0!==t&&(this.textureUnit=t,e.activeTexture(33984+t)),e.bindTexture(this.target,this.handle),t}unbind(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.textureUnit;const{gl:e}=this;return void 0!==t&&(this.textureUnit=t,e.activeTexture(33984+t)),e.bindTexture(this.target,null),t}_getDataType(t){let{data:e,compressed:n=!1}=t;return n?{data:e,dataType:"compressed"}:null===e?{data:e,dataType:"null"}:ArrayBuffer.isView(e)?{data:e,dataType:"typed-array"}:e instanceof Gn?{data:e.handle,dataType:"buffer"}:"undefined"!==typeof WebGLBuffer&&e instanceof WebGLBuffer?{data:e,dataType:"buffer"}:{data:e,dataType:"browser-object"}}_deduceParameters(t){const{format:e,data:n}=t;let{width:i,height:r,dataFormat:o,type:s,compressed:a}=t;const l=_n(e);return o=o||l.dataFormat,s=s||l.type,a=a||l.compressed,({width:i,height:r}=this._deduceImageSize(n,i,r)),{dataFormat:o,type:s,compressed:a,width:i,height:r,format:e,data:n}}_deduceImageSize(t,e,n){let i;return i="undefined"!==typeof ImageData&&t instanceof ImageData?{width:t.width,height:t.height}:"undefined"!==typeof HTMLImageElement&&t instanceof HTMLImageElement?{width:t.naturalWidth,height:t.naturalHeight}:"undefined"!==typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!==typeof ImageBitmap&&t instanceof ImageBitmap?{width:t.width,height:t.height}:"undefined"!==typeof HTMLVideoElement&&t instanceof HTMLVideoElement?{width:t.videoWidth,height:t.videoHeight}:t?{width:e,height:n}:{width:e>=0?e:1,height:n>=0?n:1},(0,le.v)(i,"Could not deduced texture size"),(0,le.v)(void 0===e||i.width===e,"Deduced texture width does not match supplied width"),(0,le.v)(void 0===n||i.height===n,"Deduced texture height does not match supplied height"),i}async setCubeMapImageData(t){const{gl:e}=this,{width:n,height:i,pixels:r,data:o,format:s=6408,type:a=5121}=t,l=r||o,c=await Promise.all(Zn.FACES.map((t=>{const e=l[t];return Promise.all(Array.isArray(e)?e:[e])})));this.bind(),Zn.FACES.forEach(((t,r)=>{c[r].length>1&&!1!==this.props.mipmaps&&Kt.R.warn(`${this.id} has mipmap and multiple LODs.`)(),c[r].forEach(((r,o)=>{n&&i?e.texImage2D(t,o,s,n,i,0,s,a,r):e.texImage2D(t,o,s,s,a,r)}))})),this.unbind()}setImageDataForFace(t){const{face:e,width:n,height:i,pixels:r,data:o,format:s=6408,type:a=5121}=t,{gl:l}=this,c=r||o;return this.bind(),c instanceof Promise?c.then((n=>this.setImageDataForFace(Object.assign({},t,{face:e,data:n,pixels:n})))):this.width||this.height?l.texImage2D(e,0,s,n,i,0,s,a,c):l.texImage2D(e,0,s,s,a,c),this}setImageData3D(t){const{level:e=0,dataFormat:n,format:i,type:r,width:o,height:s,depth:a=1,offset:l=0,data:c,parameters:u={}}=t;this.trackDeallocatedMemory("Texture"),this.gl.bindTexture(this.target,this.handle);const h=_n(i);if(Bn(this.gl,u,(()=>{ArrayBuffer.isView(c)&&this.gl.texImage3D(this.target,e,h.format,o,s,a,0,h.dataFormat,h.type,c),c instanceof Gn&&(this.gl.bindBuffer(35052,c.handle),this.gl.texImage3D(this.target,e,n,o,s,a,0,i,r,l))})),c&&c.byteLength)this.trackAllocatedMemory(c.byteLength,"Texture");else{const t=vn(this.props.format);this.trackAllocatedMemory(this.width*this.height*this.depth*t,"Texture")}return this.loaded=!0,this}_setSamplerParameters(t){if(!(0,Yt.Z)(t)){!function(t){Kt.R.log(1,"texture sampler parameters",t)()}(t),this.gl.bindTexture(this.target,this.handle);for(const[e,n]of Object.entries(t)){const t=Number(e),i=n;switch(t){case 33082:case 33083:this.gl.texParameterf(this.target,t,i);break;default:this.gl.texParameteri(this.target,t,i)}}this.gl.bindTexture(this.target,null)}}}class Xn extends Sn{device;gl;handle;get texture(){return this.colorAttachments[0]}constructor(t,e){super(t,e);const n=null===e.handle;if(this.device=t,this.gl=t.gl,this.handle=this.props.handle||n?this.props.handle:this.gl.createFramebuffer(),!n){t.setSpectorMetadata(this.handle,{id:this.props.id,props:this.props}),this.autoCreateAttachmentTextures();const n=this.gl.bindFramebuffer(36160,this.handle);for(let t=0;t<this.colorAttachments.length;++t){const e=this.colorAttachments[t],n=36064+t;e&&this._attachOne(n,e)}if(this.depthStencilAttachment&&this._attachOne(function(t){const e=fn[t];if(!e?.attachment)throw new Error(`${t} is not a depth stencil format`);return e.attachment}(this.depthStencilAttachment.props.format),this.depthStencilAttachment),!1!==e.check){const t=this.gl.checkFramebufferStatus(36160);if(36053!==t)throw new Error(`Framebuffer ${function(t){switch(t){case 36053:return"success";case 36054:return"Mismatched attachments";case 36055:return"No attachments";case 36057:return"Height/width mismatch";case 36061:return"Unsupported or split attachments";case 36182:return"Samples mismatch";default:return`${t}`}}(t)}`)}this.gl.bindFramebuffer(36160,n)}}destroy(){super.destroy(),this.destroyed||null===this.handle||this.gl.deleteFramebuffer(this.handle)}createDepthStencilTexture(t){return new Zn(this.device,{id:`${this.id}-depth-stencil`,format:t,width:this.width,height:this.height,mipmaps:!1})}resizeAttachments(t,e){if(null===this.handle)return this.width=this.gl.drawingBufferWidth,this.height=this.gl.drawingBufferHeight,this;void 0===t&&(t=this.gl.drawingBufferWidth),void 0===e&&(e=this.gl.drawingBufferHeight);for(const n of this.colorAttachments)n.texture.resize({width:t,height:e});return this.depthStencilAttachment&&this.depthStencilAttachment.texture.resize({width:t,height:e}),this}_attachOne(t,e){if(Array.isArray(e)){const[n,i=0,r=0]=e;return this._attachTexture(t,n,i,r),n}if(e instanceof Zn)return this._attachTexture(t,e,0,0),e;if(e instanceof Wn){const n=e;return this._attachTexture(t,n.texture,n.props.baseMipLevel,n.props.baseArrayLayer),e.texture}throw new Error("attach")}_attachTexture(t,e,n,i){const{gl:r}=this.device;switch(r.bindTexture(e.target,e.handle),e.target){case 35866:case 32879:r.framebufferTextureLayer(36160,t,e.target,i,n);break;case 34067:const o=function(t){return t<34069?t+34069:t}(n);r.framebufferTexture2D(36160,t,o,e.handle,i);break;case 3553:r.framebufferTexture2D(36160,t,3553,e.handle,i);break;default:(0,le.v)(!1,"Illegal texture type")}r.bindTexture(e.target,null)}}class Kn extends Ae{device;presentationSize;_framebuffer=null;constructor(t,e){super(e),this.device=t,this.presentationSize=[-1,-1],this._setAutoCreatedCanvasId(`${this.device.id}-canvas`),this.update()}getCurrentFramebuffer(){return this.update(),this._framebuffer=this._framebuffer||new Xn(this.device,{handle:null}),this._framebuffer}update(){const t=this.getPixelSize();(t[0]!==this.presentationSize[0]||t[1]!==this.presentationSize[1])&&(this.presentationSize=t,this.resize())}resize(t){if(this.device.gl)if(this.canvas){const e=this.getDevicePixelRatio(t?.useDevicePixels);this.setDevicePixelRatio(e,t)}else;}commit(){}}const Qn={spector:Kt.R.get("spector")||Kt.R.get("spectorjs")};let Jn=null,Yn=!1;var $n;!function(t){t[t.DEPTH_BUFFER_BIT=256]="DEPTH_BUFFER_BIT",t[t.STENCIL_BUFFER_BIT=1024]="STENCIL_BUFFER_BIT",t[t.COLOR_BUFFER_BIT=16384]="COLOR_BUFFER_BIT",t[t.POINTS=0]="POINTS",t[t.LINES=1]="LINES",t[t.LINE_LOOP=2]="LINE_LOOP",t[t.LINE_STRIP=3]="LINE_STRIP",t[t.TRIANGLES=4]="TRIANGLES",t[t.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",t[t.TRIANGLE_FAN=6]="TRIANGLE_FAN",t[t.ZERO=0]="ZERO",t[t.ONE=1]="ONE",t[t.SRC_COLOR=768]="SRC_COLOR",t[t.ONE_MINUS_SRC_COLOR=769]="ONE_MINUS_SRC_COLOR",t[t.SRC_ALPHA=770]="SRC_ALPHA",t[t.ONE_MINUS_SRC_ALPHA=771]="ONE_MINUS_SRC_ALPHA",t[t.DST_ALPHA=772]="DST_ALPHA",t[t.ONE_MINUS_DST_ALPHA=773]="ONE_MINUS_DST_ALPHA",t[t.DST_COLOR=774]="DST_COLOR",t[t.ONE_MINUS_DST_COLOR=775]="ONE_MINUS_DST_COLOR",t[t.SRC_ALPHA_SATURATE=776]="SRC_ALPHA_SATURATE",t[t.CONSTANT_COLOR=32769]="CONSTANT_COLOR",t[t.ONE_MINUS_CONSTANT_COLOR=32770]="ONE_MINUS_CONSTANT_COLOR",t[t.CONSTANT_ALPHA=32771]="CONSTANT_ALPHA",t[t.ONE_MINUS_CONSTANT_ALPHA=32772]="ONE_MINUS_CONSTANT_ALPHA",t[t.FUNC_ADD=32774]="FUNC_ADD",t[t.FUNC_SUBTRACT=32778]="FUNC_SUBTRACT",t[t.FUNC_REVERSE_SUBTRACT=32779]="FUNC_REVERSE_SUBTRACT",t[t.BLEND_EQUATION=32777]="BLEND_EQUATION",t[t.BLEND_EQUATION_RGB=32777]="BLEND_EQUATION_RGB",t[t.BLEND_EQUATION_ALPHA=34877]="BLEND_EQUATION_ALPHA",t[t.BLEND_DST_RGB=32968]="BLEND_DST_RGB",t[t.BLEND_SRC_RGB=32969]="BLEND_SRC_RGB",t[t.BLEND_DST_ALPHA=32970]="BLEND_DST_ALPHA",t[t.BLEND_SRC_ALPHA=32971]="BLEND_SRC_ALPHA",t[t.BLEND_COLOR=32773]="BLEND_COLOR",t[t.ARRAY_BUFFER_BINDING=34964]="ARRAY_BUFFER_BINDING",t[t.ELEMENT_ARRAY_BUFFER_BINDING=34965]="ELEMENT_ARRAY_BUFFER_BINDING",t[t.LINE_WIDTH=2849]="LINE_WIDTH",t[t.ALIASED_POINT_SIZE_RANGE=33901]="ALIASED_POINT_SIZE_RANGE",t[t.ALIASED_LINE_WIDTH_RANGE=33902]="ALIASED_LINE_WIDTH_RANGE",t[t.CULL_FACE_MODE=2885]="CULL_FACE_MODE",t[t.FRONT_FACE=2886]="FRONT_FACE",t[t.DEPTH_RANGE=2928]="DEPTH_RANGE",t[t.DEPTH_WRITEMASK=2930]="DEPTH_WRITEMASK",t[t.DEPTH_CLEAR_VALUE=2931]="DEPTH_CLEAR_VALUE",t[t.DEPTH_FUNC=2932]="DEPTH_FUNC",t[t.STENCIL_CLEAR_VALUE=2961]="STENCIL_CLEAR_VALUE",t[t.STENCIL_FUNC=2962]="STENCIL_FUNC",t[t.STENCIL_FAIL=2964]="STENCIL_FAIL",t[t.STENCIL_PASS_DEPTH_FAIL=2965]="STENCIL_PASS_DEPTH_FAIL",t[t.STENCIL_PASS_DEPTH_PASS=2966]="STENCIL_PASS_DEPTH_PASS",t[t.STENCIL_REF=2967]="STENCIL_REF",t[t.STENCIL_VALUE_MASK=2963]="STENCIL_VALUE_MASK",t[t.STENCIL_WRITEMASK=2968]="STENCIL_WRITEMASK",t[t.STENCIL_BACK_FUNC=34816]="STENCIL_BACK_FUNC",t[t.STENCIL_BACK_FAIL=34817]="STENCIL_BACK_FAIL",t[t.STENCIL_BACK_PASS_DEPTH_FAIL=34818]="STENCIL_BACK_PASS_DEPTH_FAIL",t[t.STENCIL_BACK_PASS_DEPTH_PASS=34819]="STENCIL_BACK_PASS_DEPTH_PASS",t[t.STENCIL_BACK_REF=36003]="STENCIL_BACK_REF",t[t.STENCIL_BACK_VALUE_MASK=36004]="STENCIL_BACK_VALUE_MASK",t[t.STENCIL_BACK_WRITEMASK=36005]="STENCIL_BACK_WRITEMASK",t[t.VIEWPORT=2978]="VIEWPORT",t[t.SCISSOR_BOX=3088]="SCISSOR_BOX",t[t.COLOR_CLEAR_VALUE=3106]="COLOR_CLEAR_VALUE",t[t.COLOR_WRITEMASK=3107]="COLOR_WRITEMASK",t[t.UNPACK_ALIGNMENT=3317]="UNPACK_ALIGNMENT",t[t.PACK_ALIGNMENT=3333]="PACK_ALIGNMENT",t[t.MAX_TEXTURE_SIZE=3379]="MAX_TEXTURE_SIZE",t[t.MAX_VIEWPORT_DIMS=3386]="MAX_VIEWPORT_DIMS",t[t.SUBPIXEL_BITS=3408]="SUBPIXEL_BITS",t[t.RED_BITS=3410]="RED_BITS",t[t.GREEN_BITS=3411]="GREEN_BITS",t[t.BLUE_BITS=3412]="BLUE_BITS",t[t.ALPHA_BITS=3413]="ALPHA_BITS",t[t.DEPTH_BITS=3414]="DEPTH_BITS",t[t.STENCIL_BITS=3415]="STENCIL_BITS",t[t.POLYGON_OFFSET_UNITS=10752]="POLYGON_OFFSET_UNITS",t[t.POLYGON_OFFSET_FACTOR=32824]="POLYGON_OFFSET_FACTOR",t[t.TEXTURE_BINDING_2D=32873]="TEXTURE_BINDING_2D",t[t.SAMPLE_BUFFERS=32936]="SAMPLE_BUFFERS",t[t.SAMPLES=32937]="SAMPLES",t[t.SAMPLE_COVERAGE_VALUE=32938]="SAMPLE_COVERAGE_VALUE",t[t.SAMPLE_COVERAGE_INVERT=32939]="SAMPLE_COVERAGE_INVERT",t[t.COMPRESSED_TEXTURE_FORMATS=34467]="COMPRESSED_TEXTURE_FORMATS",t[t.VENDOR=7936]="VENDOR",t[t.RENDERER=7937]="RENDERER",t[t.VERSION=7938]="VERSION",t[t.IMPLEMENTATION_COLOR_READ_TYPE=35738]="IMPLEMENTATION_COLOR_READ_TYPE",t[t.IMPLEMENTATION_COLOR_READ_FORMAT=35739]="IMPLEMENTATION_COLOR_READ_FORMAT",t[t.BROWSER_DEFAULT_WEBGL=37444]="BROWSER_DEFAULT_WEBGL",t[t.STATIC_DRAW=35044]="STATIC_DRAW",t[t.STREAM_DRAW=35040]="STREAM_DRAW",t[t.DYNAMIC_DRAW=35048]="DYNAMIC_DRAW",t[t.ARRAY_BUFFER=34962]="ARRAY_BUFFER",t[t.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",t[t.BUFFER_SIZE=34660]="BUFFER_SIZE",t[t.BUFFER_USAGE=34661]="BUFFER_USAGE",t[t.CURRENT_VERTEX_ATTRIB=34342]="CURRENT_VERTEX_ATTRIB",t[t.VERTEX_ATTRIB_ARRAY_ENABLED=34338]="VERTEX_ATTRIB_ARRAY_ENABLED",t[t.VERTEX_ATTRIB_ARRAY_SIZE=34339]="VERTEX_ATTRIB_ARRAY_SIZE",t[t.VERTEX_ATTRIB_ARRAY_STRIDE=34340]="VERTEX_ATTRIB_ARRAY_STRIDE",t[t.VERTEX_ATTRIB_ARRAY_TYPE=34341]="VERTEX_ATTRIB_ARRAY_TYPE",t[t.VERTEX_ATTRIB_ARRAY_NORMALIZED=34922]="VERTEX_ATTRIB_ARRAY_NORMALIZED",t[t.VERTEX_ATTRIB_ARRAY_POINTER=34373]="VERTEX_ATTRIB_ARRAY_POINTER",t[t.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING=34975]="VERTEX_ATTRIB_ARRAY_BUFFER_BINDING",t[t.CULL_FACE=2884]="CULL_FACE",t[t.FRONT=1028]="FRONT",t[t.BACK=1029]="BACK",t[t.FRONT_AND_BACK=1032]="FRONT_AND_BACK",t[t.BLEND=3042]="BLEND",t[t.DEPTH_TEST=2929]="DEPTH_TEST",t[t.DITHER=3024]="DITHER",t[t.POLYGON_OFFSET_FILL=32823]="POLYGON_OFFSET_FILL",t[t.SAMPLE_ALPHA_TO_COVERAGE=32926]="SAMPLE_ALPHA_TO_COVERAGE",t[t.SAMPLE_COVERAGE=32928]="SAMPLE_COVERAGE",t[t.SCISSOR_TEST=3089]="SCISSOR_TEST",t[t.STENCIL_TEST=2960]="STENCIL_TEST",t[t.NO_ERROR=0]="NO_ERROR",t[t.INVALID_ENUM=1280]="INVALID_ENUM",t[t.INVALID_VALUE=1281]="INVALID_VALUE",t[t.INVALID_OPERATION=1282]="INVALID_OPERATION",t[t.OUT_OF_MEMORY=1285]="OUT_OF_MEMORY",t[t.CONTEXT_LOST_WEBGL=37442]="CONTEXT_LOST_WEBGL",t[t.CW=2304]="CW",t[t.CCW=2305]="CCW",t[t.DONT_CARE=4352]="DONT_CARE",t[t.FASTEST=4353]="FASTEST",t[t.NICEST=4354]="NICEST",t[t.GENERATE_MIPMAP_HINT=33170]="GENERATE_MIPMAP_HINT",t[t.BYTE=5120]="BYTE",t[t.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",t[t.SHORT=5122]="SHORT",t[t.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",t[t.INT=5124]="INT",t[t.UNSIGNED_INT=5125]="UNSIGNED_INT",t[t.FLOAT=5126]="FLOAT",t[t.DOUBLE=5130]="DOUBLE",t[t.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",t[t.ALPHA=6406]="ALPHA",t[t.RGB=6407]="RGB",t[t.RGBA=6408]="RGBA",t[t.LUMINANCE=6409]="LUMINANCE",t[t.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",t[t.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",t[t.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",t[t.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",t[t.FRAGMENT_SHADER=35632]="FRAGMENT_SHADER",t[t.VERTEX_SHADER=35633]="VERTEX_SHADER",t[t.COMPILE_STATUS=35713]="COMPILE_STATUS",t[t.DELETE_STATUS=35712]="DELETE_STATUS",t[t.LINK_STATUS=35714]="LINK_STATUS",t[t.VALIDATE_STATUS=35715]="VALIDATE_STATUS",t[t.ATTACHED_SHADERS=35717]="ATTACHED_SHADERS",t[t.ACTIVE_ATTRIBUTES=35721]="ACTIVE_ATTRIBUTES",t[t.ACTIVE_UNIFORMS=35718]="ACTIVE_UNIFORMS",t[t.MAX_VERTEX_ATTRIBS=34921]="MAX_VERTEX_ATTRIBS",t[t.MAX_VERTEX_UNIFORM_VECTORS=36347]="MAX_VERTEX_UNIFORM_VECTORS",t[t.MAX_VARYING_VECTORS=36348]="MAX_VARYING_VECTORS",t[t.MAX_COMBINED_TEXTURE_IMAGE_UNITS=35661]="MAX_COMBINED_TEXTURE_IMAGE_UNITS",t[t.MAX_VERTEX_TEXTURE_IMAGE_UNITS=35660]="MAX_VERTEX_TEXTURE_IMAGE_UNITS",t[t.MAX_TEXTURE_IMAGE_UNITS=34930]="MAX_TEXTURE_IMAGE_UNITS",t[t.MAX_FRAGMENT_UNIFORM_VECTORS=36349]="MAX_FRAGMENT_UNIFORM_VECTORS",t[t.SHADER_TYPE=35663]="SHADER_TYPE",t[t.SHADING_LANGUAGE_VERSION=35724]="SHADING_LANGUAGE_VERSION",t[t.CURRENT_PROGRAM=35725]="CURRENT_PROGRAM",t[t.NEVER=512]="NEVER",t[t.LESS=513]="LESS",t[t.EQUAL=514]="EQUAL",t[t.LEQUAL=515]="LEQUAL",t[t.GREATER=516]="GREATER",t[t.NOTEQUAL=517]="NOTEQUAL",t[t.GEQUAL=518]="GEQUAL",t[t.ALWAYS=519]="ALWAYS",t[t.KEEP=7680]="KEEP",t[t.REPLACE=7681]="REPLACE",t[t.INCR=7682]="INCR",t[t.DECR=7683]="DECR",t[t.INVERT=5386]="INVERT",t[t.INCR_WRAP=34055]="INCR_WRAP",t[t.DECR_WRAP=34056]="DECR_WRAP",t[t.NEAREST=9728]="NEAREST",t[t.LINEAR=9729]="LINEAR",t[t.NEAREST_MIPMAP_NEAREST=9984]="NEAREST_MIPMAP_NEAREST",t[t.LINEAR_MIPMAP_NEAREST=9985]="LINEAR_MIPMAP_NEAREST",t[t.NEAREST_MIPMAP_LINEAR=9986]="NEAREST_MIPMAP_LINEAR",t[t.LINEAR_MIPMAP_LINEAR=9987]="LINEAR_MIPMAP_LINEAR",t[t.TEXTURE_MAG_FILTER=10240]="TEXTURE_MAG_FILTER",t[t.TEXTURE_MIN_FILTER=10241]="TEXTURE_MIN_FILTER",t[t.TEXTURE_WRAP_S=10242]="TEXTURE_WRAP_S",t[t.TEXTURE_WRAP_T=10243]="TEXTURE_WRAP_T",t[t.TEXTURE_2D=3553]="TEXTURE_2D",t[t.TEXTURE=5890]="TEXTURE",t[t.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",t[t.TEXTURE_BINDING_CUBE_MAP=34068]="TEXTURE_BINDING_CUBE_MAP",t[t.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",t[t.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",t[t.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",t[t.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",t[t.MAX_CUBE_MAP_TEXTURE_SIZE=34076]="MAX_CUBE_MAP_TEXTURE_SIZE",t[t.TEXTURE0=33984]="TEXTURE0",t[t.ACTIVE_TEXTURE=34016]="ACTIVE_TEXTURE",t[t.REPEAT=10497]="REPEAT",t[t.CLAMP_TO_EDGE=33071]="CLAMP_TO_EDGE",t[t.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT",t[t.TEXTURE_WIDTH=4096]="TEXTURE_WIDTH",t[t.TEXTURE_HEIGHT=4097]="TEXTURE_HEIGHT",t[t.FLOAT_VEC2=35664]="FLOAT_VEC2",t[t.FLOAT_VEC3=35665]="FLOAT_VEC3",t[t.FLOAT_VEC4=35666]="FLOAT_VEC4",t[t.INT_VEC2=35667]="INT_VEC2",t[t.INT_VEC3=35668]="INT_VEC3",t[t.INT_VEC4=35669]="INT_VEC4",t[t.BOOL=35670]="BOOL",t[t.BOOL_VEC2=35671]="BOOL_VEC2",t[t.BOOL_VEC3=35672]="BOOL_VEC3",t[t.BOOL_VEC4=35673]="BOOL_VEC4",t[t.FLOAT_MAT2=35674]="FLOAT_MAT2",t[t.FLOAT_MAT3=35675]="FLOAT_MAT3",t[t.FLOAT_MAT4=35676]="FLOAT_MAT4",t[t.SAMPLER_2D=35678]="SAMPLER_2D",t[t.SAMPLER_CUBE=35680]="SAMPLER_CUBE",t[t.LOW_FLOAT=36336]="LOW_FLOAT",t[t.MEDIUM_FLOAT=36337]="MEDIUM_FLOAT",t[t.HIGH_FLOAT=36338]="HIGH_FLOAT",t[t.LOW_INT=36339]="LOW_INT",t[t.MEDIUM_INT=36340]="MEDIUM_INT",t[t.HIGH_INT=36341]="HIGH_INT",t[t.FRAMEBUFFER=36160]="FRAMEBUFFER",t[t.RENDERBUFFER=36161]="RENDERBUFFER",t[t.RGBA4=32854]="RGBA4",t[t.RGB5_A1=32855]="RGB5_A1",t[t.RGB565=36194]="RGB565",t[t.DEPTH_COMPONENT16=33189]="DEPTH_COMPONENT16",t[t.STENCIL_INDEX=6401]="STENCIL_INDEX",t[t.STENCIL_INDEX8=36168]="STENCIL_INDEX8",t[t.DEPTH_STENCIL=34041]="DEPTH_STENCIL",t[t.RENDERBUFFER_WIDTH=36162]="RENDERBUFFER_WIDTH",t[t.RENDERBUFFER_HEIGHT=36163]="RENDERBUFFER_HEIGHT",t[t.RENDERBUFFER_INTERNAL_FORMAT=36164]="RENDERBUFFER_INTERNAL_FORMAT",t[t.RENDERBUFFER_RED_SIZE=36176]="RENDERBUFFER_RED_SIZE",t[t.RENDERBUFFER_GREEN_SIZE=36177]="RENDERBUFFER_GREEN_SIZE",t[t.RENDERBUFFER_BLUE_SIZE=36178]="RENDERBUFFER_BLUE_SIZE",t[t.RENDERBUFFER_ALPHA_SIZE=36179]="RENDERBUFFER_ALPHA_SIZE",t[t.RENDERBUFFER_DEPTH_SIZE=36180]="RENDERBUFFER_DEPTH_SIZE",t[t.RENDERBUFFER_STENCIL_SIZE=36181]="RENDERBUFFER_STENCIL_SIZE",t[t.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE=36048]="FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE",t[t.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME=36049]="FRAMEBUFFER_ATTACHMENT_OBJECT_NAME",t[t.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL=36050]="FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL",t[t.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE=36051]="FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE",t[t.COLOR_ATTACHMENT0=36064]="COLOR_ATTACHMENT0",t[t.DEPTH_ATTACHMENT=36096]="DEPTH_ATTACHMENT",t[t.STENCIL_ATTACHMENT=36128]="STENCIL_ATTACHMENT",t[t.DEPTH_STENCIL_ATTACHMENT=33306]="DEPTH_STENCIL_ATTACHMENT",t[t.NONE=0]="NONE",t[t.FRAMEBUFFER_COMPLETE=36053]="FRAMEBUFFER_COMPLETE",t[t.FRAMEBUFFER_INCOMPLETE_ATTACHMENT=36054]="FRAMEBUFFER_INCOMPLETE_ATTACHMENT",t[t.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT=36055]="FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT",t[t.FRAMEBUFFER_INCOMPLETE_DIMENSIONS=36057]="FRAMEBUFFER_INCOMPLETE_DIMENSIONS",t[t.FRAMEBUFFER_UNSUPPORTED=36061]="FRAMEBUFFER_UNSUPPORTED",t[t.FRAMEBUFFER_BINDING=36006]="FRAMEBUFFER_BINDING",t[t.RENDERBUFFER_BINDING=36007]="RENDERBUFFER_BINDING",t[t.READ_FRAMEBUFFER=36008]="READ_FRAMEBUFFER",t[t.DRAW_FRAMEBUFFER=36009]="DRAW_FRAMEBUFFER",t[t.MAX_RENDERBUFFER_SIZE=34024]="MAX_RENDERBUFFER_SIZE",t[t.INVALID_FRAMEBUFFER_OPERATION=1286]="INVALID_FRAMEBUFFER_OPERATION",t[t.UNPACK_FLIP_Y_WEBGL=37440]="UNPACK_FLIP_Y_WEBGL",t[t.UNPACK_PREMULTIPLY_ALPHA_WEBGL=37441]="UNPACK_PREMULTIPLY_ALPHA_WEBGL",t[t.UNPACK_COLORSPACE_CONVERSION_WEBGL=37443]="UNPACK_COLORSPACE_CONVERSION_WEBGL",t[t.READ_BUFFER=3074]="READ_BUFFER",t[t.UNPACK_ROW_LENGTH=3314]="UNPACK_ROW_LENGTH",t[t.UNPACK_SKIP_ROWS=3315]="UNPACK_SKIP_ROWS",t[t.UNPACK_SKIP_PIXELS=3316]="UNPACK_SKIP_PIXELS",t[t.PACK_ROW_LENGTH=3330]="PACK_ROW_LENGTH",t[t.PACK_SKIP_ROWS=3331]="PACK_SKIP_ROWS",t[t.PACK_SKIP_PIXELS=3332]="PACK_SKIP_PIXELS",t[t.TEXTURE_BINDING_3D=32874]="TEXTURE_BINDING_3D",t[t.UNPACK_SKIP_IMAGES=32877]="UNPACK_SKIP_IMAGES",t[t.UNPACK_IMAGE_HEIGHT=32878]="UNPACK_IMAGE_HEIGHT",t[t.MAX_3D_TEXTURE_SIZE=32883]="MAX_3D_TEXTURE_SIZE",t[t.MAX_ELEMENTS_VERTICES=33e3]="MAX_ELEMENTS_VERTICES",t[t.MAX_ELEMENTS_INDICES=33001]="MAX_ELEMENTS_INDICES",t[t.MAX_TEXTURE_LOD_BIAS=34045]="MAX_TEXTURE_LOD_BIAS",t[t.MAX_FRAGMENT_UNIFORM_COMPONENTS=35657]="MAX_FRAGMENT_UNIFORM_COMPONENTS",t[t.MAX_VERTEX_UNIFORM_COMPONENTS=35658]="MAX_VERTEX_UNIFORM_COMPONENTS",t[t.MAX_ARRAY_TEXTURE_LAYERS=35071]="MAX_ARRAY_TEXTURE_LAYERS",t[t.MIN_PROGRAM_TEXEL_OFFSET=35076]="MIN_PROGRAM_TEXEL_OFFSET",t[t.MAX_PROGRAM_TEXEL_OFFSET=35077]="MAX_PROGRAM_TEXEL_OFFSET",t[t.MAX_VARYING_COMPONENTS=35659]="MAX_VARYING_COMPONENTS",t[t.FRAGMENT_SHADER_DERIVATIVE_HINT=35723]="FRAGMENT_SHADER_DERIVATIVE_HINT",t[t.RASTERIZER_DISCARD=35977]="RASTERIZER_DISCARD",t[t.VERTEX_ARRAY_BINDING=34229]="VERTEX_ARRAY_BINDING",t[t.MAX_VERTEX_OUTPUT_COMPONENTS=37154]="MAX_VERTEX_OUTPUT_COMPONENTS",t[t.MAX_FRAGMENT_INPUT_COMPONENTS=37157]="MAX_FRAGMENT_INPUT_COMPONENTS",t[t.MAX_SERVER_WAIT_TIMEOUT=37137]="MAX_SERVER_WAIT_TIMEOUT",t[t.MAX_ELEMENT_INDEX=36203]="MAX_ELEMENT_INDEX",t[t.RED=6403]="RED",t[t.RGB8=32849]="RGB8",t[t.RGBA8=32856]="RGBA8",t[t.RGB10_A2=32857]="RGB10_A2",t[t.TEXTURE_3D=32879]="TEXTURE_3D",t[t.TEXTURE_WRAP_R=32882]="TEXTURE_WRAP_R",t[t.TEXTURE_MIN_LOD=33082]="TEXTURE_MIN_LOD",t[t.TEXTURE_MAX_LOD=33083]="TEXTURE_MAX_LOD",t[t.TEXTURE_BASE_LEVEL=33084]="TEXTURE_BASE_LEVEL",t[t.TEXTURE_MAX_LEVEL=33085]="TEXTURE_MAX_LEVEL",t[t.TEXTURE_COMPARE_MODE=34892]="TEXTURE_COMPARE_MODE",t[t.TEXTURE_COMPARE_FUNC=34893]="TEXTURE_COMPARE_FUNC",t[t.SRGB=35904]="SRGB",t[t.SRGB8=35905]="SRGB8",t[t.SRGB8_ALPHA8=35907]="SRGB8_ALPHA8",t[t.COMPARE_REF_TO_TEXTURE=34894]="COMPARE_REF_TO_TEXTURE",t[t.RGBA32F=34836]="RGBA32F",t[t.RGB32F=34837]="RGB32F",t[t.RGBA16F=34842]="RGBA16F",t[t.RGB16F=34843]="RGB16F",t[t.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",t[t.TEXTURE_BINDING_2D_ARRAY=35869]="TEXTURE_BINDING_2D_ARRAY",t[t.R11F_G11F_B10F=35898]="R11F_G11F_B10F",t[t.RGB9_E5=35901]="RGB9_E5",t[t.RGBA32UI=36208]="RGBA32UI",t[t.RGB32UI=36209]="RGB32UI",t[t.RGBA16UI=36214]="RGBA16UI",t[t.RGB16UI=36215]="RGB16UI",t[t.RGBA8UI=36220]="RGBA8UI",t[t.RGB8UI=36221]="RGB8UI",t[t.RGBA32I=36226]="RGBA32I",t[t.RGB32I=36227]="RGB32I",t[t.RGBA16I=36232]="RGBA16I",t[t.RGB16I=36233]="RGB16I",t[t.RGBA8I=36238]="RGBA8I",t[t.RGB8I=36239]="RGB8I",t[t.RED_INTEGER=36244]="RED_INTEGER",t[t.RGB_INTEGER=36248]="RGB_INTEGER",t[t.RGBA_INTEGER=36249]="RGBA_INTEGER",t[t.R8=33321]="R8",t[t.RG8=33323]="RG8",t[t.R16F=33325]="R16F",t[t.R32F=33326]="R32F",t[t.RG16F=33327]="RG16F",t[t.RG32F=33328]="RG32F",t[t.R8I=33329]="R8I",t[t.R8UI=33330]="R8UI",t[t.R16I=33331]="R16I",t[t.R16UI=33332]="R16UI",t[t.R32I=33333]="R32I",t[t.R32UI=33334]="R32UI",t[t.RG8I=33335]="RG8I",t[t.RG8UI=33336]="RG8UI",t[t.RG16I=33337]="RG16I",t[t.RG16UI=33338]="RG16UI",t[t.RG32I=33339]="RG32I",t[t.RG32UI=33340]="RG32UI",t[t.R8_SNORM=36756]="R8_SNORM",t[t.RG8_SNORM=36757]="RG8_SNORM",t[t.RGB8_SNORM=36758]="RGB8_SNORM",t[t.RGBA8_SNORM=36759]="RGBA8_SNORM",t[t.RGB10_A2UI=36975]="RGB10_A2UI",t[t.TEXTURE_IMMUTABLE_FORMAT=37167]="TEXTURE_IMMUTABLE_FORMAT",t[t.TEXTURE_IMMUTABLE_LEVELS=33503]="TEXTURE_IMMUTABLE_LEVELS",t[t.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",t[t.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",t[t.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",t[t.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",t[t.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",t[t.HALF_FLOAT=5131]="HALF_FLOAT",t[t.RG=33319]="RG",t[t.RG_INTEGER=33320]="RG_INTEGER",t[t.INT_2_10_10_10_REV=36255]="INT_2_10_10_10_REV",t[t.CURRENT_QUERY=34917]="CURRENT_QUERY",t[t.QUERY_RESULT=34918]="QUERY_RESULT",t[t.QUERY_RESULT_AVAILABLE=34919]="QUERY_RESULT_AVAILABLE",t[t.ANY_SAMPLES_PASSED=35887]="ANY_SAMPLES_PASSED",t[t.ANY_SAMPLES_PASSED_CONSERVATIVE=36202]="ANY_SAMPLES_PASSED_CONSERVATIVE",t[t.MAX_DRAW_BUFFERS=34852]="MAX_DRAW_BUFFERS",t[t.DRAW_BUFFER0=34853]="DRAW_BUFFER0",t[t.DRAW_BUFFER1=34854]="DRAW_BUFFER1",t[t.DRAW_BUFFER2=34855]="DRAW_BUFFER2",t[t.DRAW_BUFFER3=34856]="DRAW_BUFFER3",t[t.DRAW_BUFFER4=34857]="DRAW_BUFFER4",t[t.DRAW_BUFFER5=34858]="DRAW_BUFFER5",t[t.DRAW_BUFFER6=34859]="DRAW_BUFFER6",t[t.DRAW_BUFFER7=34860]="DRAW_BUFFER7",t[t.DRAW_BUFFER8=34861]="DRAW_BUFFER8",t[t.DRAW_BUFFER9=34862]="DRAW_BUFFER9",t[t.DRAW_BUFFER10=34863]="DRAW_BUFFER10",t[t.DRAW_BUFFER11=34864]="DRAW_BUFFER11",t[t.DRAW_BUFFER12=34865]="DRAW_BUFFER12",t[t.DRAW_BUFFER13=34866]="DRAW_BUFFER13",t[t.DRAW_BUFFER14=34867]="DRAW_BUFFER14",t[t.DRAW_BUFFER15=34868]="DRAW_BUFFER15",t[t.MAX_COLOR_ATTACHMENTS=36063]="MAX_COLOR_ATTACHMENTS",t[t.COLOR_ATTACHMENT1=36065]="COLOR_ATTACHMENT1",t[t.COLOR_ATTACHMENT2=36066]="COLOR_ATTACHMENT2",t[t.COLOR_ATTACHMENT3=36067]="COLOR_ATTACHMENT3",t[t.COLOR_ATTACHMENT4=36068]="COLOR_ATTACHMENT4",t[t.COLOR_ATTACHMENT5=36069]="COLOR_ATTACHMENT5",t[t.COLOR_ATTACHMENT6=36070]="COLOR_ATTACHMENT6",t[t.COLOR_ATTACHMENT7=36071]="COLOR_ATTACHMENT7",t[t.COLOR_ATTACHMENT8=36072]="COLOR_ATTACHMENT8",t[t.COLOR_ATTACHMENT9=36073]="COLOR_ATTACHMENT9",t[t.COLOR_ATTACHMENT10=36074]="COLOR_ATTACHMENT10",t[t.COLOR_ATTACHMENT11=36075]="COLOR_ATTACHMENT11",t[t.COLOR_ATTACHMENT12=36076]="COLOR_ATTACHMENT12",t[t.COLOR_ATTACHMENT13=36077]="COLOR_ATTACHMENT13",t[t.COLOR_ATTACHMENT14=36078]="COLOR_ATTACHMENT14",t[t.COLOR_ATTACHMENT15=36079]="COLOR_ATTACHMENT15",t[t.SAMPLER_3D=35679]="SAMPLER_3D",t[t.SAMPLER_2D_SHADOW=35682]="SAMPLER_2D_SHADOW",t[t.SAMPLER_2D_ARRAY=36289]="SAMPLER_2D_ARRAY",t[t.SAMPLER_2D_ARRAY_SHADOW=36292]="SAMPLER_2D_ARRAY_SHADOW",t[t.SAMPLER_CUBE_SHADOW=36293]="SAMPLER_CUBE_SHADOW",t[t.INT_SAMPLER_2D=36298]="INT_SAMPLER_2D",t[t.INT_SAMPLER_3D=36299]="INT_SAMPLER_3D",t[t.INT_SAMPLER_CUBE=36300]="INT_SAMPLER_CUBE",t[t.INT_SAMPLER_2D_ARRAY=36303]="INT_SAMPLER_2D_ARRAY",t[t.UNSIGNED_INT_SAMPLER_2D=36306]="UNSIGNED_INT_SAMPLER_2D",t[t.UNSIGNED_INT_SAMPLER_3D=36307]="UNSIGNED_INT_SAMPLER_3D",t[t.UNSIGNED_INT_SAMPLER_CUBE=36308]="UNSIGNED_INT_SAMPLER_CUBE",t[t.UNSIGNED_INT_SAMPLER_2D_ARRAY=36311]="UNSIGNED_INT_SAMPLER_2D_ARRAY",t[t.MAX_SAMPLES=36183]="MAX_SAMPLES",t[t.SAMPLER_BINDING=35097]="SAMPLER_BINDING",t[t.PIXEL_PACK_BUFFER=35051]="PIXEL_PACK_BUFFER",t[t.PIXEL_UNPACK_BUFFER=35052]="PIXEL_UNPACK_BUFFER",t[t.PIXEL_PACK_BUFFER_BINDING=35053]="PIXEL_PACK_BUFFER_BINDING",t[t.PIXEL_UNPACK_BUFFER_BINDING=35055]="PIXEL_UNPACK_BUFFER_BINDING",t[t.COPY_READ_BUFFER=36662]="COPY_READ_BUFFER",t[t.COPY_WRITE_BUFFER=36663]="COPY_WRITE_BUFFER",t[t.COPY_READ_BUFFER_BINDING=36662]="COPY_READ_BUFFER_BINDING",t[t.COPY_WRITE_BUFFER_BINDING=36663]="COPY_WRITE_BUFFER_BINDING",t[t.FLOAT_MAT2x3=35685]="FLOAT_MAT2x3",t[t.FLOAT_MAT2x4=35686]="FLOAT_MAT2x4",t[t.FLOAT_MAT3x2=35687]="FLOAT_MAT3x2",t[t.FLOAT_MAT3x4=35688]="FLOAT_MAT3x4",t[t.FLOAT_MAT4x2=35689]="FLOAT_MAT4x2",t[t.FLOAT_MAT4x3=35690]="FLOAT_MAT4x3",t[t.UNSIGNED_INT_VEC2=36294]="UNSIGNED_INT_VEC2",t[t.UNSIGNED_INT_VEC3=36295]="UNSIGNED_INT_VEC3",t[t.UNSIGNED_INT_VEC4=36296]="UNSIGNED_INT_VEC4",t[t.UNSIGNED_NORMALIZED=35863]="UNSIGNED_NORMALIZED",t[t.SIGNED_NORMALIZED=36764]="SIGNED_NORMALIZED",t[t.VERTEX_ATTRIB_ARRAY_INTEGER=35069]="VERTEX_ATTRIB_ARRAY_INTEGER",t[t.VERTEX_ATTRIB_ARRAY_DIVISOR=35070]="VERTEX_ATTRIB_ARRAY_DIVISOR",t[t.TRANSFORM_FEEDBACK_BUFFER_MODE=35967]="TRANSFORM_FEEDBACK_BUFFER_MODE",t[t.MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS=35968]="MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS",t[t.TRANSFORM_FEEDBACK_VARYINGS=35971]="TRANSFORM_FEEDBACK_VARYINGS",t[t.TRANSFORM_FEEDBACK_BUFFER_START=35972]="TRANSFORM_FEEDBACK_BUFFER_START",t[t.TRANSFORM_FEEDBACK_BUFFER_SIZE=35973]="TRANSFORM_FEEDBACK_BUFFER_SIZE",t[t.TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN=35976]="TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN",t[t.MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS=35978]="MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS",t[t.MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS=35979]="MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS",t[t.INTERLEAVED_ATTRIBS=35980]="INTERLEAVED_ATTRIBS",t[t.SEPARATE_ATTRIBS=35981]="SEPARATE_ATTRIBS",t[t.TRANSFORM_FEEDBACK_BUFFER=35982]="TRANSFORM_FEEDBACK_BUFFER",t[t.TRANSFORM_FEEDBACK_BUFFER_BINDING=35983]="TRANSFORM_FEEDBACK_BUFFER_BINDING",t[t.TRANSFORM_FEEDBACK=36386]="TRANSFORM_FEEDBACK",t[t.TRANSFORM_FEEDBACK_PAUSED=36387]="TRANSFORM_FEEDBACK_PAUSED",t[t.TRANSFORM_FEEDBACK_ACTIVE=36388]="TRANSFORM_FEEDBACK_ACTIVE",t[t.TRANSFORM_FEEDBACK_BINDING=36389]="TRANSFORM_FEEDBACK_BINDING",t[t.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING=33296]="FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING",t[t.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE=33297]="FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE",t[t.FRAMEBUFFER_ATTACHMENT_RED_SIZE=33298]="FRAMEBUFFER_ATTACHMENT_RED_SIZE",t[t.FRAMEBUFFER_ATTACHMENT_GREEN_SIZE=33299]="FRAMEBUFFER_ATTACHMENT_GREEN_SIZE",t[t.FRAMEBUFFER_ATTACHMENT_BLUE_SIZE=33300]="FRAMEBUFFER_ATTACHMENT_BLUE_SIZE",t[t.FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE=33301]="FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE",t[t.FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE=33302]="FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE",t[t.FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE=33303]="FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE",t[t.FRAMEBUFFER_DEFAULT=33304]="FRAMEBUFFER_DEFAULT",t[t.DEPTH24_STENCIL8=35056]="DEPTH24_STENCIL8",t[t.DRAW_FRAMEBUFFER_BINDING=36006]="DRAW_FRAMEBUFFER_BINDING",t[t.READ_FRAMEBUFFER_BINDING=36010]="READ_FRAMEBUFFER_BINDING",t[t.RENDERBUFFER_SAMPLES=36011]="RENDERBUFFER_SAMPLES",t[t.FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER=36052]="FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER",t[t.FRAMEBUFFER_INCOMPLETE_MULTISAMPLE=36182]="FRAMEBUFFER_INCOMPLETE_MULTISAMPLE",t[t.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER",t[t.UNIFORM_BUFFER_BINDING=35368]="UNIFORM_BUFFER_BINDING",t[t.UNIFORM_BUFFER_START=35369]="UNIFORM_BUFFER_START",t[t.UNIFORM_BUFFER_SIZE=35370]="UNIFORM_BUFFER_SIZE",t[t.MAX_VERTEX_UNIFORM_BLOCKS=35371]="MAX_VERTEX_UNIFORM_BLOCKS",t[t.MAX_FRAGMENT_UNIFORM_BLOCKS=35373]="MAX_FRAGMENT_UNIFORM_BLOCKS",t[t.MAX_COMBINED_UNIFORM_BLOCKS=35374]="MAX_COMBINED_UNIFORM_BLOCKS",t[t.MAX_UNIFORM_BUFFER_BINDINGS=35375]="MAX_UNIFORM_BUFFER_BINDINGS",t[t.MAX_UNIFORM_BLOCK_SIZE=35376]="MAX_UNIFORM_BLOCK_SIZE",t[t.MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS=35377]="MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS",t[t.MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS=35379]="MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS",t[t.UNIFORM_BUFFER_OFFSET_ALIGNMENT=35380]="UNIFORM_BUFFER_OFFSET_ALIGNMENT",t[t.ACTIVE_UNIFORM_BLOCKS=35382]="ACTIVE_UNIFORM_BLOCKS",t[t.UNIFORM_TYPE=35383]="UNIFORM_TYPE",t[t.UNIFORM_SIZE=35384]="UNIFORM_SIZE",t[t.UNIFORM_BLOCK_INDEX=35386]="UNIFORM_BLOCK_INDEX",t[t.UNIFORM_OFFSET=35387]="UNIFORM_OFFSET",t[t.UNIFORM_ARRAY_STRIDE=35388]="UNIFORM_ARRAY_STRIDE",t[t.UNIFORM_MATRIX_STRIDE=35389]="UNIFORM_MATRIX_STRIDE",t[t.UNIFORM_IS_ROW_MAJOR=35390]="UNIFORM_IS_ROW_MAJOR",t[t.UNIFORM_BLOCK_BINDING=35391]="UNIFORM_BLOCK_BINDING",t[t.UNIFORM_BLOCK_DATA_SIZE=35392]="UNIFORM_BLOCK_DATA_SIZE",t[t.UNIFORM_BLOCK_ACTIVE_UNIFORMS=35394]="UNIFORM_BLOCK_ACTIVE_UNIFORMS",t[t.UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES=35395]="UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES",t[t.UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER=35396]="UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER",t[t.UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER=35398]="UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER",t[t.OBJECT_TYPE=37138]="OBJECT_TYPE",t[t.SYNC_CONDITION=37139]="SYNC_CONDITION",t[t.SYNC_STATUS=37140]="SYNC_STATUS",t[t.SYNC_FLAGS=37141]="SYNC_FLAGS",t[t.SYNC_FENCE=37142]="SYNC_FENCE",t[t.SYNC_GPU_COMMANDS_COMPLETE=37143]="SYNC_GPU_COMMANDS_COMPLETE",t[t.UNSIGNALED=37144]="UNSIGNALED",t[t.SIGNALED=37145]="SIGNALED",t[t.ALREADY_SIGNALED=37146]="ALREADY_SIGNALED",t[t.TIMEOUT_EXPIRED=37147]="TIMEOUT_EXPIRED",t[t.CONDITION_SATISFIED=37148]="CONDITION_SATISFIED",t[t.WAIT_FAILED=37149]="WAIT_FAILED",t[t.SYNC_FLUSH_COMMANDS_BIT=1]="SYNC_FLUSH_COMMANDS_BIT",t[t.COLOR=6144]="COLOR",t[t.DEPTH=6145]="DEPTH",t[t.STENCIL=6146]="STENCIL",t[t.MIN=32775]="MIN",t[t.MAX=32776]="MAX",t[t.DEPTH_COMPONENT24=33190]="DEPTH_COMPONENT24",t[t.STREAM_READ=35041]="STREAM_READ",t[t.STREAM_COPY=35042]="STREAM_COPY",t[t.STATIC_READ=35045]="STATIC_READ",t[t.STATIC_COPY=35046]="STATIC_COPY",t[t.DYNAMIC_READ=35049]="DYNAMIC_READ",t[t.DYNAMIC_COPY=35050]="DYNAMIC_COPY",t[t.DEPTH_COMPONENT32F=36012]="DEPTH_COMPONENT32F",t[t.DEPTH32F_STENCIL8=36013]="DEPTH32F_STENCIL8",t[t.INVALID_INDEX=4294967295]="INVALID_INDEX",t[t.TIMEOUT_IGNORED=-1]="TIMEOUT_IGNORED",t[t.MAX_CLIENT_WAIT_TIMEOUT_WEBGL=37447]="MAX_CLIENT_WAIT_TIMEOUT_WEBGL",t[t.UNMASKED_VENDOR_WEBGL=37445]="UNMASKED_VENDOR_WEBGL",t[t.UNMASKED_RENDERER_WEBGL=37446]="UNMASKED_RENDERER_WEBGL",t[t.MAX_TEXTURE_MAX_ANISOTROPY_EXT=34047]="MAX_TEXTURE_MAX_ANISOTROPY_EXT",t[t.TEXTURE_MAX_ANISOTROPY_EXT=34046]="TEXTURE_MAX_ANISOTROPY_EXT",t[t.R16_EXT=33322]="R16_EXT",t[t.RG16_EXT=33324]="RG16_EXT",t[t.RGB16_EXT=32852]="RGB16_EXT",t[t.RGBA16_EXT=32859]="RGBA16_EXT",t[t.R16_SNORM_EXT=36760]="R16_SNORM_EXT",t[t.RG16_SNORM_EXT=36761]="RG16_SNORM_EXT",t[t.RGB16_SNORM_EXT=36762]="RGB16_SNORM_EXT",t[t.RGBA16_SNORM_EXT=36763]="RGBA16_SNORM_EXT",t[t.COMPRESSED_RGB_S3TC_DXT1_EXT=33776]="COMPRESSED_RGB_S3TC_DXT1_EXT",t[t.COMPRESSED_RGBA_S3TC_DXT1_EXT=33777]="COMPRESSED_RGBA_S3TC_DXT1_EXT",t[t.COMPRESSED_RGBA_S3TC_DXT3_EXT=33778]="COMPRESSED_RGBA_S3TC_DXT3_EXT",t[t.COMPRESSED_RGBA_S3TC_DXT5_EXT=33779]="COMPRESSED_RGBA_S3TC_DXT5_EXT",t[t.COMPRESSED_SRGB_S3TC_DXT1_EXT=35916]="COMPRESSED_SRGB_S3TC_DXT1_EXT",t[t.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT=35917]="COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT",t[t.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT=35918]="COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT",t[t.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT=35919]="COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT",t[t.COMPRESSED_RED_RGTC1_EXT=36283]="COMPRESSED_RED_RGTC1_EXT",t[t.COMPRESSED_SIGNED_RED_RGTC1_EXT=36284]="COMPRESSED_SIGNED_RED_RGTC1_EXT",t[t.COMPRESSED_RED_GREEN_RGTC2_EXT=36285]="COMPRESSED_RED_GREEN_RGTC2_EXT",t[t.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT=36286]="COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT",t[t.COMPRESSED_RGBA_BPTC_UNORM_EXT=36492]="COMPRESSED_RGBA_BPTC_UNORM_EXT",t[t.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT=36493]="COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT",t[t.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT=36494]="COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT",t[t.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT=36495]="COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT",t[t.COMPRESSED_R11_EAC=37488]="COMPRESSED_R11_EAC",t[t.COMPRESSED_SIGNED_R11_EAC=37489]="COMPRESSED_SIGNED_R11_EAC",t[t.COMPRESSED_RG11_EAC=37490]="COMPRESSED_RG11_EAC",t[t.COMPRESSED_SIGNED_RG11_EAC=37491]="COMPRESSED_SIGNED_RG11_EAC",t[t.COMPRESSED_RGB8_ETC2=37492]="COMPRESSED_RGB8_ETC2",t[t.COMPRESSED_RGBA8_ETC2_EAC=37493]="COMPRESSED_RGBA8_ETC2_EAC",t[t.COMPRESSED_SRGB8_ETC2=37494]="COMPRESSED_SRGB8_ETC2",t[t.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC=37495]="COMPRESSED_SRGB8_ALPHA8_ETC2_EAC",t[t.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2=37496]="COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2",t[t.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2=37497]="COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2",t[t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG=35840]="COMPRESSED_RGB_PVRTC_4BPPV1_IMG",t[t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG=35842]="COMPRESSED_RGBA_PVRTC_4BPPV1_IMG",t[t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG=35841]="COMPRESSED_RGB_PVRTC_2BPPV1_IMG",t[t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG=35843]="COMPRESSED_RGBA_PVRTC_2BPPV1_IMG",t[t.COMPRESSED_RGB_ETC1_WEBGL=36196]="COMPRESSED_RGB_ETC1_WEBGL",t[t.COMPRESSED_RGB_ATC_WEBGL=35986]="COMPRESSED_RGB_ATC_WEBGL",t[t.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL=35986]="COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL",t[t.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL=34798]="COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL",t[t.COMPRESSED_RGBA_ASTC_4x4_KHR=37808]="COMPRESSED_RGBA_ASTC_4x4_KHR",t[t.COMPRESSED_RGBA_ASTC_5x4_KHR=37809]="COMPRESSED_RGBA_ASTC_5x4_KHR",t[t.COMPRESSED_RGBA_ASTC_5x5_KHR=37810]="COMPRESSED_RGBA_ASTC_5x5_KHR",t[t.COMPRESSED_RGBA_ASTC_6x5_KHR=37811]="COMPRESSED_RGBA_ASTC_6x5_KHR",t[t.COMPRESSED_RGBA_ASTC_6x6_KHR=37812]="COMPRESSED_RGBA_ASTC_6x6_KHR",t[t.COMPRESSED_RGBA_ASTC_8x5_KHR=37813]="COMPRESSED_RGBA_ASTC_8x5_KHR",t[t.COMPRESSED_RGBA_ASTC_8x6_KHR=37814]="COMPRESSED_RGBA_ASTC_8x6_KHR",t[t.COMPRESSED_RGBA_ASTC_8x8_KHR=37815]="COMPRESSED_RGBA_ASTC_8x8_KHR",t[t.COMPRESSED_RGBA_ASTC_10x5_KHR=37816]="COMPRESSED_RGBA_ASTC_10x5_KHR",t[t.COMPRESSED_RGBA_ASTC_10x6_KHR=37817]="COMPRESSED_RGBA_ASTC_10x6_KHR",t[t.COMPRESSED_RGBA_ASTC_10x8_KHR=37818]="COMPRESSED_RGBA_ASTC_10x8_KHR",t[t.COMPRESSED_RGBA_ASTC_10x10_KHR=37819]="COMPRESSED_RGBA_ASTC_10x10_KHR",t[t.COMPRESSED_RGBA_ASTC_12x10_KHR=37820]="COMPRESSED_RGBA_ASTC_12x10_KHR",t[t.COMPRESSED_RGBA_ASTC_12x12_KHR=37821]="COMPRESSED_RGBA_ASTC_12x12_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR=37840]="COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR=37841]="COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR=37842]="COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR=37843]="COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR=37844]="COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR=37845]="COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR=37846]="COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR=37847]="COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR=37848]="COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR=37849]="COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR=37850]="COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR=37851]="COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR=37852]="COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR=37853]="COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR",t[t.QUERY_COUNTER_BITS_EXT=34916]="QUERY_COUNTER_BITS_EXT",t[t.CURRENT_QUERY_EXT=34917]="CURRENT_QUERY_EXT",t[t.QUERY_RESULT_EXT=34918]="QUERY_RESULT_EXT",t[t.QUERY_RESULT_AVAILABLE_EXT=34919]="QUERY_RESULT_AVAILABLE_EXT",t[t.TIME_ELAPSED_EXT=35007]="TIME_ELAPSED_EXT",t[t.TIMESTAMP_EXT=36392]="TIMESTAMP_EXT",t[t.GPU_DISJOINT_EXT=36795]="GPU_DISJOINT_EXT",t[t.COMPLETION_STATUS_KHR=37297]="COMPLETION_STATUS_KHR",t[t.DEPTH_CLAMP_EXT=34383]="DEPTH_CLAMP_EXT",t[t.FIRST_VERTEX_CONVENTION_WEBGL=36429]="FIRST_VERTEX_CONVENTION_WEBGL",t[t.LAST_VERTEX_CONVENTION_WEBGL=36430]="LAST_VERTEX_CONVENTION_WEBGL",t[t.PROVOKING_VERTEX_WEBL=36431]="PROVOKING_VERTEX_WEBL",t[t.POLYGON_MODE_WEBGL=2880]="POLYGON_MODE_WEBGL",t[t.POLYGON_OFFSET_LINE_WEBGL=10754]="POLYGON_OFFSET_LINE_WEBGL",t[t.LINE_WEBGL=6913]="LINE_WEBGL",t[t.FILL_WEBGL=6914]="FILL_WEBGL",t[t.MAX_CLIP_DISTANCES_WEBGL=3378]="MAX_CLIP_DISTANCES_WEBGL",t[t.MAX_CULL_DISTANCES_WEBGL=33529]="MAX_CULL_DISTANCES_WEBGL",t[t.MAX_COMBINED_CLIP_AND_CULL_DISTANCES_WEBGL=33530]="MAX_COMBINED_CLIP_AND_CULL_DISTANCES_WEBGL",t[t.CLIP_DISTANCE0_WEBGL=12288]="CLIP_DISTANCE0_WEBGL",t[t.CLIP_DISTANCE1_WEBGL=12289]="CLIP_DISTANCE1_WEBGL",t[t.CLIP_DISTANCE2_WEBGL=12290]="CLIP_DISTANCE2_WEBGL",t[t.CLIP_DISTANCE3_WEBGL=12291]="CLIP_DISTANCE3_WEBGL",t[t.CLIP_DISTANCE4_WEBGL=12292]="CLIP_DISTANCE4_WEBGL",t[t.CLIP_DISTANCE5_WEBGL=12293]="CLIP_DISTANCE5_WEBGL",t[t.CLIP_DISTANCE6_WEBGL=12294]="CLIP_DISTANCE6_WEBGL",t[t.CLIP_DISTANCE7_WEBGL=12295]="CLIP_DISTANCE7_WEBGL",t[t.POLYGON_OFFSET_CLAMP_EXT=36379]="POLYGON_OFFSET_CLAMP_EXT",t[t.LOWER_LEFT_EXT=36001]="LOWER_LEFT_EXT",t[t.UPPER_LEFT_EXT=36002]="UPPER_LEFT_EXT",t[t.NEGATIVE_ONE_TO_ONE_EXT=37726]="NEGATIVE_ONE_TO_ONE_EXT",t[t.ZERO_TO_ONE_EXT=37727]="ZERO_TO_ONE_EXT",t[t.CLIP_ORIGIN_EXT=37724]="CLIP_ORIGIN_EXT",t[t.CLIP_DEPTH_MODE_EXT=37725]="CLIP_DEPTH_MODE_EXT",t[t.SRC1_COLOR_WEBGL=35065]="SRC1_COLOR_WEBGL",t[t.SRC1_ALPHA_WEBGL=34185]="SRC1_ALPHA_WEBGL",t[t.ONE_MINUS_SRC1_COLOR_WEBGL=35066]="ONE_MINUS_SRC1_COLOR_WEBGL",t[t.ONE_MINUS_SRC1_ALPHA_WEBGL=35067]="ONE_MINUS_SRC1_ALPHA_WEBGL",t[t.MAX_DUAL_SOURCE_DRAW_BUFFERS_WEBGL=35068]="MAX_DUAL_SOURCE_DRAW_BUFFERS_WEBGL",t[t.MIRROR_CLAMP_TO_EDGE_EXT=34627]="MIRROR_CLAMP_TO_EDGE_EXT"}($n||($n={}));function ti(t){return t.luma=t.luma||{},t.luma}function ei(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t?e.debug?function(t,e){if(!globalThis.WebGLDebugUtils)return Kt.R.warn("webgl-debug not loaded")(),t;const n=ti(t);if(n.debugContext)return n.debugContext;globalThis.WebGLDebugUtils.init({...$n,...t});const i=globalThis.WebGLDebugUtils.makeDebugContext(t,ii.bind(null,e),ri.bind(null,e));for(const s in $n)s in i||"number"!==typeof $n[s]||(i[s]=$n[s]);class r{}Object.setPrototypeOf(i,Object.getPrototypeOf(t)),Object.setPrototypeOf(r,i);const o=Object.create(r);return n.realContext=t,n.debugContext=o,o.debug=!0,o}(t,e):function(t){const e=ti(t);return e.realContext?e.realContext:t}(t):null}function ni(t,e){e=Array.from(e).map((t=>void 0===t?"undefined":t));let n=globalThis.WebGLDebugUtils.glFunctionArgsToString(t,e);return n=`${n.slice(0,100)}${n.length>100?"...":""}`,`gl.${t}(${n})`}function ii(t,e,n,i){i=Array.from(i).map((t=>void 0===t?"undefined":t));const r=`${globalThis.WebGLDebugUtils.glEnumToString(e)} in gl.${n}(${globalThis.WebGLDebugUtils.glFunctionArgsToString(n,i)})`;if(Kt.R.error(r)(),t.throwOnError)throw new Error(r)}function ri(t,e,n){let i="";if(Kt.R.level>=1&&(i=ni(e,n),Kt.R.log(1,i)()),t.break&&t.break.length>0){i=i||ni(e,n);t.break.every((t=>-1!==i.indexOf(t)))}for(const r of n)if(void 0===r){if(i=i||ni(e,n),t.throwOnError)throw new Error(`Undefined argument: ${i}`);Kt.R.error(`Undefined argument: ${i}`)()}}var oi=n(
vendor: 4,738 bytes, line 2
239936);function si(t){const e=t.toLowerCase();return["warning","error","info"].includes(e)?e:"info"}class ai extends oi.M{device;handle;constructor(t,e){switch(super(t,e),this.device=t,this.props.stage){case"vertex":this.handle=this.props.handle||this.device.gl.createShader(35633);break;case"fragment":this.handle=this.props.handle||this.device.gl.createShader(35632);break;default:throw new Error(this.props.stage)}this._compile(this.source)}destroy(){this.handle&&(this.removeStats(),this.device.gl.deleteShader(this.handle),this.destroyed=!0)}async getCompilationInfo(){return await this._waitForCompilationComplete(),this.getCompilationInfoSync()}getCompilationInfoSync(){return function(t){const e=t.split(/\r?\n/),n=[];for(const i of e){if(i.length<=1)continue;const t=i.split(":");if(2===t.length){const[e,i]=t;n.push({message:i.trim(),type:si(e),lineNum:0,linePos:0});continue}const[e,r,o,...s]=t;let a=parseInt(o,10);isNaN(a)&&(a=0);let l=parseInt(r,10);isNaN(l)&&(l=0),n.push({message:s.join(":").trim(),type:si(e),lineNum:a,linePos:l})}return n}(this.device.gl.getShaderInfoLog(this.handle))}getTranslatedSource(){const t=this.device.getExtension("WEBGL_debug_shaders").WEBGL_debug_shaders;return t?.getTranslatedShaderSource(this.handle)}async _compile(t){t=(t=>t.startsWith("#version ")?t:`#version 100\n${t}`)(t);const{gl:e}=this.device;if(e.shaderSource(this.handle,t),e.compileShader(this.handle),0!==Kt.R.level){if(this.device.features.has("compilation-status-async-webgl"))Kt.R.once(1,"Shader compilation is asynchronous")(),await this._waitForCompilationComplete(),Kt.R.info(2,`Shader ${this.id} - async compilation complete: ${this.compilationStatus}`)(),this._getCompilationStatus(),this.debugShader();else if(this._getCompilationStatus(),this.debugShader(),"error"===this.compilationStatus)throw new Error(`GLSL compilation errors in ${this.props.stage} shader ${this.props.id}`)}else this.compilationStatus="pending"}async _waitForCompilationComplete(){const t=async t=>await new Promise((e=>setTimeout(e,t)));if(!this.device.features.has("compilation-status-async-webgl"))return void await t(10);const{gl:e}=this.device;for(;;){if(e.getShaderParameter(this.handle,37297))return;await t(10)}}_getCompilationStatus(){this.compilationStatus=this.device.gl.getShaderParameter(this.handle,35713)?"success":"error"}}class li extends Cn.F{static defaultProps={...Cn.F.defaultProps,framebuffer:null,parameters:void 0,clearColor:[0,0,0,0],clearDepth:1,clearStencil:0,depthReadOnly:!1,stencilReadOnly:!1,discard:!1,occlusionQuerySet:void 0,timestampQuerySet:void 0,beginTimestampIndex:void 0,endTimestampIndex:void 0};get[Symbol.toStringTag](){return"RenderPass"}constructor(t,e){super(t,e,li.defaultProps)}}const ci=6144,ui=[1,2,4,8];class hi extends li{device;glParameters;constructor(t,e){super(t,e),this.device=t,Ne(this.device.gl),this.setParameters(this.props.parameters),this.clear()}end(){ze(this.device.gl)}pushDebugGroup(t){}popDebugGroup(){}insertDebugMarker(t){}setParameters(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const e={...this.glParameters};this.props.framebuffer&&(e.framebuffer=this.props.framebuffer),this.props.depthReadOnly&&(e.depthMask=!this.props.depthReadOnly),e.stencilMask=this.props.stencilReadOnly?0:1,e[35977]=this.props.discard,t.viewport&&(t.viewport.length>=6?(e.viewport=t.viewport.slice(0,4),e.depthRange=[t.viewport[4],t.viewport[5]]):e.viewport=t.viewport),t.scissorRect&&(e.scissorTest=!0,e.scissor=t.scissorRect),t.blendConstant&&(e.blendColor=t.blendConstant),t.stencilReference&&(console.warn("RenderPassParameters.stencilReference not yet implemented in WebGL"),t[2967]=t.stencilReference),t.colorMask&&(e.colorMask=ui.map((e=>Boolean(e&t.colorMask)))),this.glParameters=e,Re(this.device.gl,e)}beginOcclusionQuery(t){const e=this.props.occlusionQuerySet;e?.beginOcclusionQuery()}endOcclusionQuery(){const t=this.props.occlusionQuerySet;t?.endOcclusionQuery()}clear(){const t={...this.glParameters};let e=0;!1!==this.props.clearColor&&(e|=16384,t.clearColor=this.props.clearColor),!1!==this.props.clearDepth&&(e|=256,t.clearDepth=this.props.clearDepth),!1!==this.props.clearStencil&&(e|=1024,t.clearStencil=this.props.clearStencil),0!==e&&Bn(this.device.gl,t,(()=>{this.device.gl.clear(e)}))}clearColorBuffer(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0,0];Bn(this.device.gl,{framebuffer:this.props.framebuffer},(()=>{switch(e.constructor){case Int32Array:this.device.gl.clearBufferiv(ci,t,e);break;case Uint32Array:this.device.gl.clearBufferuiv(ci,t,e);break;case Float32Array:default:this.device.gl.clearBufferfv(ci,t,e)}}))}}var di=n(74446);var pi=n(19519),fi=n(99861
vendor: 19,125 bytes, line 2
2);const Ai="Failed to deduce GL constant from typed array";function gi(t,e){const{clamped:n=!0}=e||{};switch(t){case 5126:return Float32Array;case 5123:case 33635:case 32819:case 32820:return Uint16Array;case 5125:return Uint32Array;case 5121:return n?Uint8ClampedArray:Uint8Array;case 5120:return Int8Array;case 5122:return Int16Array;case 5124:return Int32Array;default:throw new Error("Failed to deduce typed array type from GL constant")}}const mi={offset:0,stride:0,type:5126,size:1,divisor:0,normalized:!1,integer:!1},yi={deprecatedProps:{instanced:"divisor",isInstanced:"divisor"}};class _i{offset;stride;type;size;divisor;normalized;integer;buffer;index;static getBytesPerElement(t){return gi(t.type||5126).BYTES_PER_ELEMENT}static getBytesPerVertex(t){(0,le.v)(t.size);return gi(t.type||5126).BYTES_PER_ELEMENT*t.size}static resolve(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return new _i(...[mi,...e])}constructor(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];e.forEach((t=>this._assign(t))),Object.freeze(this)}toString(){return JSON.stringify(this)}get BYTES_PER_ELEMENT(){return _i.getBytesPerElement(this)}get BYTES_PER_VERTEX(){return _i.getBytesPerVertex(this)}_assign(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t=function(t,e,n){const{removedProps:i={},deprecatedProps:r={},replacedProps:o={}}=n;for(const a in i)if(a in e){const e=i[a]?`${t}.${i[a]}`:"N/A";Kt.R.removed(`${t}.${a}`,e)()}for(const a in r)if(a in e){const e=r[a];Kt.R.deprecated(`${t}.${a}`,`${t}.${e}`)()}let s=null;for(const[a,l]of Object.entries(o))a in e&&(Kt.R.deprecated(`${t}.${a}`,`${t}.${l}`)(),s=s||Object.assign({},e),s[l]=e[a],delete s[a]);return s||e}("Accessor",t,yi),void 0!==t.type&&(this.type=t.type,5124!==t.type&&5125!==t.type||(this.integer=!0)),void 0!==t.size&&(this.size=t.size),void 0!==t.offset&&(this.offset=t.offset),void 0!==t.stride&&(this.stride=t.stride),void 0!==t.normalize&&(this.normalized=t.normalize),void 0!==t.normalized&&(this.normalized=t.normalized),void 0!==t.integer&&(this.integer=t.integer),void 0!==t.divisor&&(this.divisor=t.divisor),void 0!==t.buffer&&(this.buffer=t.buffer),void 0!==t.index&&("boolean"===typeof t.index?this.index=t.index?1:0:this.index=t.index),void 0!==t.instanced&&(this.divisor=t.instanced?1:0),void 0!==t.isInstanced&&(this.divisor=t.isInstanced?1:0),void 0===this.offset&&delete this.offset,void 0===this.stride&&delete this.stride,void 0===this.type&&delete this.type,void 0===this.size&&delete this.size,void 0===this.divisor&&delete this.divisor,void 0===this.normalized&&delete this.normalized,void 0===this.integer&&delete this.integer,void 0===this.buffer&&delete this.buffer,void 0===this.index&&delete this.index,this}}const vi=[35678,35680,35679,35682,36289,36292,36293,36298,36299,36300,36303,36306,36307,36308,36311],bi={5126:[5126,1,"float","f32","float32"],35664:[5126,2,"vec2","vec2<f32>","float32x2"],35665:[5126,3,"vec3","vec3<f32>","float32x3"],35666:[5126,4,"vec4","vec4<f32>","float32x4"],5124:[5124,1,"int","i32","sint32"],35667:[5124,2,"ivec2","vec2<i32>","sint32x2"],35668:[5124,3,"ivec3","vec3<i32>","sint32x3"],35669:[5124,4,"ivec4","vec4<i32>","sint32x4"],5125:[5125,1,"uint","u32","uint32"],36294:[5125,2,"uvec2","vec2<u32>","uint32x2"],36295:[5125,3,"uvec3","vec3<u32>","uint32x3"],36296:[5125,4,"uvec4","vec4<u32>","uint32x4"],35670:[5126,1,"bool","f32","float32"],35671:[5126,2,"bvec2","vec2<f32>","float32x2"],35672:[5126,3,"bvec3","vec3<f32>","float32x3"],35673:[5126,4,"bvec4","vec4<f32>","float32x4"],35674:[5126,8,"mat2","mat2x2<f32>"],35685:[5126,8,"mat2x3","mat2x3<f32>"],35686:[5126,8,"mat2x4","mat2x4<f32>"],35687:[5126,12,"mat3x2","mat3x2<f32>"],35675:[5126,12,"mat3","mat3x3<f32>"],35688:[5126,12,"mat3x4","mat3x4<f32>"],35689:[5126,16,"mat4x2","mat4x2<f32>"],35690:[5126,16,"mat4x3","mat4x3<f32>"],35676:[5126,16,"mat4","mat4x4<f32>"]};function xi(t){const e=bi[t];if(!e)throw new Error("uniform");const[n,i,,r]=e;return{format:r,components:i,glType:n}}function wi(t){const e=bi[t];if(!e)throw new Error("attribute");const[,n,,i,r]=e;return{attributeType:i,vertexFormat:r,components:n}}function Ei(t,e){const n={attributes:[],bindings:[]};n.attributes=function(t,e){const n=[],i=t.getProgramParameter(e,35721);for(let r=0;r<i;r++){const i=t.getActiveAttrib(e,r);if(!i)throw new Error("activeInfo");const{name:o,type:s}=i,a=t.getAttribLocation(e,o);if(a>=0){const{attributeType:t}=wi(s),e=/instance/i.test(o)?"instance":"vertex";n.push({name:o,location:a,stepMode:e,type:t})}}return n.sort(((t,e)=>t.location-e.location)),n}(t,e);const i=function(t,e){const n=(n,i)=>t.getActiveUniformBlockParameter(e,n,i),i=[],r=t.getProgramParameter(e,35382);for(let o=0;o<r;o++){const r={name:t.getActiveUniformBlockName(e,o)||"",location:n(o,35391),byteLength:n(o,35392),vertex:n(o,35396),fragment:n(o,35398),uniformCount:n(o,35394),uniforms:[]},s=n(o,35395)||[],a=t.getActiveUniforms(e,s,35383),l=t.getActiveUniforms(e,s,35384),c=t.getActiveUniforms(e,s,35387),u=t.getActiveUniforms(e,s,35388);for(let n=0;n<r.uniformCount;++n){const i=t.getActiveUniform(e,s[n]);if(!i)throw new Error("activeInfo");r.uniforms.push({name:i.name,format:xi(a[n]).format,type:a[n],arrayLength:l[n],byteOffset:c[n],byteStride:u[n]})}i.push(r)}return i.sort(((t,e)=>t.location-e.location)),i}(t,e);for(const l of i){const t=l.uniforms.map((t=>({name:t.name,format:t.format,byteOffset:t.byteOffset,byteStride:t.byteStride,arrayLength:t.arrayLength})));n.bindings.push({type:"uniform",name:l.name,location:l.location,visibility:(l.vertex?1:0)&(l.fragment?2:0),minBindingSize:l.byteLength,uniforms:t})}const r=function(t,e){const n=[],i=t.getProgramParameter(e,35718);for(let r=0;r<i;r++){const i=t.getActiveUniform(e,r);if(!i)throw new Error("activeInfo");const{name:o,size:s,type:a}=i,{name:l,isArray:c}=Si(o);let u=t.getUniformLocation(e,l);const h={location:u,name:l,size:s,type:a,isArray:c};if(n.push(h),h.size>1)for(let r=0;r<h.size;r++){const i=`${l}[${r}]`;u=t.getUniformLocation(e,i);const o={...h,name:i,location:u};n.push(o)}}return n}(t,e);let o=0;for(const l of r)if(s=l.type,vi.includes(s)){const{viewDimension:t,sampleType:e}=Ti(l.type);n.bindings.push({type:"texture",name:l.name,location:o,viewDimension:t,sampleType:e}),l.textureUnit=o,o+=1}var s;r.length&&(n.uniforms=r);const a=function(t,e){const n=[],i=t.getProgramParameter(e,35971);for(let r=0;r<i;r++){const i=t.getTransformFeedbackVarying(e,r);if(!i)throw new Error("activeInfo");const{name:o,type:s,size:a}=i,{glType:l,components:c}=xi(s),u={location:r,name:o,accessor:new _i({type:l,size:a*c})};n.push(u)}return n.sort(((t,e)=>t.location-e.location)),n}(t,e);return a?.length&&(n.varyings=a),n}const Ci={35678:["2d","float"],35680:["cube","float"],35679:["3d","float"],35682:["3d","depth"],36289:["2d-array","float"],36292:["2d-array","depth"],36293:["cube","float"],36298:["2d","sint"],36299:["3d","sint"],36300:["cube","sint"],36303:["2d-array","uint"],36306:["2d","uint"],36307:["3d","uint"],36308:["cube","uint"],36311:["2d-array","uint"]};function Ti(t){const e=Ci[t];if(!e)throw new Error("sampler");const[n,i]=e;return{viewDimension:n,sampleType:i}}function Si(t){if("]"!==t[t.length-1])return{name:t,length:1,isArray:!1};const e=/([^[]*)(\[[0-9]+\])?/.exec(t);if(!e||e.length<2)throw new Error(`Failed to parse GLSL uniform name ${t}`);return{name:e[1],length:e[2]?1:0,isArray:Boolean(e[2])}}function Pi(t,e,n,i){const r=t;let o=i;!0===o&&(o=1),!1===o&&(o=0);const s="number"===typeof o?[o]:o;switch(n){case 35678:case 35680:case 35679:case 35682:case 36289:case 36292:case 36293:case 36298:case 36299:case 36300:case 36303:case 36306:case 36307:case 36308:case 36311:if("number"!==typeof i)throw new Error("samplers must be set to integers");return t.uniform1i(e,i);case 5126:return t.uniform1fv(e,s);case 35664:return t.uniform2fv(e,s);case 35665:return t.uniform3fv(e,s);case 35666:return t.uniform4fv(e,s);case 5124:case 35670:return t.uniform1iv(e,s);case 35667:case 35671:return t.uniform2iv(e,s);case 35668:case 35672:return t.uniform3iv(e,s);case 35669:case 35673:return t.uniform4iv(e,s);case 5125:return r.uniform1uiv(e,s,1);case 36294:return r.uniform2uiv(e,s,2);case 36295:return r.uniform3uiv(e,s,3);case 36296:return r.uniform4uiv(e,s,4);case 35674:return t.uniformMatrix2fv(e,!1,s);case 35675:return t.uniformMatrix3fv(e,!1,s);case 35676:return t.uniformMatrix4fv(e,!1,s);case 35685:return r.uniformMatrix2x3fv(e,!1,s);case 35686:return r.uniformMatrix2x4fv(e,!1,s);case 35687:return r.uniformMatrix3x2fv(e,!1,s);case 35688:return r.uniformMatrix3x4fv(e,!1,s);case 35689:return r.uniformMatrix4x2fv(e,!1,s);case 35690:return r.uniformMatrix4x3fv(e,!1,s)}throw new Error("Illegal uniform")}class Mi extends di.r{device;handle;vs;fs;introspectedLayout;uniforms={};bindings={};varyings=null;_uniformCount=0;_uniformSetters={};constructor(t,e){super(t,e),this.device=t,this.handle=this.props.handle||this.device.gl.createProgram(),this.device.setSpectorMetadata(this.handle,{id:this.props.id}),this.vs=e.vs,this.fs=e.fs;const{varyings:n,bufferMode:i=35981}=e;switch(n&&n.length>0&&(this.varyings=n,this.device.gl.transformFeedbackVaryings(this.handle,n,i)),this._linkShaders(),Kt.R.time(1,`RenderPipeline ${this.id} - shaderLayout introspection`)(),this.introspectedLayout=Ei(this.device.gl,this.handle),Kt.R.timeEnd(1,`RenderPipeline ${this.id} - shaderLayout introspection`)(),this.shaderLayout=(0,fi.GE)(this.introspectedLayout,e.shaderLayout),this.props.topology){case"triangle-fan-webgl":case"line-loop-webgl":Kt.R.warn(`Primitive topology ${this.props.topology} is deprecated and will be removed in v9.1`)}}destroy(){this.handle&&(this.device.gl.deleteProgram(this.handle),this.destroyed=!0)}setBindings(t,e){for(const[n,i]of Object.entries(t)){const t=this.shaderLayout.bindings.find((t=>t.name===n))||this.shaderLayout.bindings.find((t=>t.name===`${n}Uniforms`));if(t){switch(i||Kt.R.warn(`Unsetting binding "${n}" in render pipeline "${this.id}"`)(),t.type){case"uniform":if(!(i instanceof Gn)&&!(i.buffer instanceof Gn))throw new Error("buffer value");break;case"texture":if(!(i instanceof Wn||i instanceof Zn||i instanceof Xn))throw new Error("texture value");break;case"sampler":Kt.R.warn(`Ignoring sampler ${n}`)();break;default:throw new Error(t.type)}this.bindings[n]=i}else{const t=this.shaderLayout.bindings.map((t=>`"${t.name}"`)).join(", ");e?.disableWarnings||Kt.R.warn(`Unknown binding "${n}" in render pipeline "${this.id}", expected one of ${t}`)()}}}draw(t){const{renderPass:e,parameters:n=this.props.parameters,topology:i=this.props.topology,vertexArray:r,vertexCount:o,instanceCount:s,isInstanced:a=!1,firstVertex:l=0,transformFeedback:c}=t,u=function(t){switch(t){case"point-list":return 0;case"line-list":return 1;case"line-strip":return 3;case"line-loop-webgl":return 2;case"triangle-list":return 4;case"triangle-strip":return 5;case"triangle-fan-webgl":return 6;default:throw new Error(t)}}(i),h=Boolean(r.indexBuffer),d=r.indexBuffer?.glIndexType;if("success"!==this.linkStatus)return Kt.R.info(2,`RenderPipeline:${this.id}.draw() aborted - waiting for shader linking`)(),!1;if(!this._areTexturesRenderable()||0===o)return Kt.R.info(2,`RenderPipeline:${this.id}.draw() aborted - textures not yet loaded`)(),!1;if(0===o)return Kt.R.info(2,`RenderPipeline:${this.id}.draw() aborted - no vertices to draw`)(),!0;this.device.gl.useProgram(this.handle),r.bindBeforeRender(e),c&&c.begin(this.props.topology),this._applyBindings(),this._applyUniforms();const p=e;return function(t,e,n,i){if((0,Yt.Z)(e))return i(t);const r=t;Ne(r.gl);try{return Rn(t,e),Re(r.gl,n),i(t)}finally{ze(r.gl)}}(this.device,n,p.glParameters,(()=>{h&&a?this.device.gl.drawElementsInstanced(u,o||0,d,l,s||0):h?this.device.gl.drawElements(u,o||0,d,l):a?this.device.gl.drawArraysInstanced(u,l,o||0,s||0):this.device.gl.drawArrays(u,l,o||0),c&&c.end()})),r.unbindAfterRender(e),!0}setUniformsWebGL(t){const{bindings:e}=(0,pi.l)(t);Object.keys(e).forEach((t=>{Kt.R.warn(`Unsupported value "${JSON.stringify(e[t])}" used in setUniforms() for key ${t}. Use setBindings() instead?`)()})),Object.assign(this.uniforms,t)}async _linkShaders(){const{gl:t}=this.device;if(t.attachShader(this.handle,this.vs.handle),t.attachShader(this.handle,this.fs.handle),Kt.R.time(4,`linkProgram for ${this.id}`)(),t.linkProgram(this.handle),Kt.R.timeEnd(4,`linkProgram for ${this.id}`)(),Kt.R.level,!this.device.features.has("compilation-status-async-webgl")){const t=this._getLinkStatus();return void this._reportLinkStatus(t)}Kt.R.once(1,"RenderPipeline linking is asynchronous")(),await this._waitForLinkComplete(),Kt.R.info(2,`RenderPipeline ${this.id} - async linking complete: ${this.linkStatus}`)();const e=this._getLinkStatus();this._reportLinkStatus(e)}_reportLinkStatus(t){if("success"!==t){if("error"===this.vs.compilationStatus)throw this.vs.debugShader(),new Error(`Error during compilation of shader ${this.vs.id}`);if("error"===this.fs?.compilationStatus)throw this.fs.debugShader(),new Error(`Error during compilation of shader ${this.fs.id}`);throw new Error(`Error during ${t}: ${this.device.gl.getProgramInfoLog(this.handle)}`)}}_getLinkStatus(){const{gl:t}=this.device;if(!t.getProgramParameter(this.handle,35714))return this.linkStatus="error","linking";t.validateProgram(this.handle);return t.getProgramParameter(this.handle,35715)?(this.linkStatus="success","success"):(this.linkStatus="error","validation")}async _waitForLinkComplete(){const t=async t=>await new Promise((e=>setTimeout(e,t)));if(!this.device.features.has("compilation-status-async-webgl"))return void await t(10);const{gl:e}=this.device;for(;;){if(e.getProgramParameter(this.handle,37297))return;await t(10)}}_areTexturesRenderable(){let t=!0;for(const[,e]of Object.entries(this.bindings))e instanceof Zn&&(e.update(),t=t&&e.loaded);return t}_applyBindings(){if("success"!==this.linkStatus)return;const{gl:t}=this.device;t.useProgram(this.handle);let e=0,n=0;for(const i of this.shaderLayout.bindings){const r=this.bindings[i.name]||this.bindings[i.name.replace(/Uniforms$/,"")];if(!r)throw new Error(`No value for binding ${i.name} in ${this.id}`);switch(i.type){case"uniform":const{name:o}=i,s=t.getUniformBlockIndex(this.handle,o);if(4294967295===s)throw new Error(`Invalid uniform block name ${o}`);t.uniformBlockBinding(this.handle,n,s),r instanceof Gn?t.bindBufferBase(35345,n,r.handle):t.bindBufferRange(35345,n,r.buffer.handle,r.offset||0,r.size||r.buffer.byteLength-r.offset),n+=1;break;case"texture":if(!(r instanceof Wn||r instanceof Zn||r instanceof Xn))throw new Error("texture");let a;if(r instanceof Wn)a=r.texture;else if(r instanceof Zn)a=r;else{if(!(r instanceof Xn&&r.colorAttachments[0]instanceof Wn))throw new Error("No texture");Kt.R.warn("Passing framebuffer in texture binding may be deprecated. Use fbo.colorAttachments[0] instead")(),a=r.colorAttachments[0].texture}t.activeTexture(33984+e),t.bindTexture(a.target,a.handle),e+=1;break;case"sampler":break;case"storage":case"read-only-storage":throw new Error(`binding type '${i.type}' not supported in WebGL`)}}}_applyUniforms(){for(const t of this.shaderLayout.uniforms||[]){const{name:e,location:n,type:i,textureUnit:r}=t,o=this.uniforms[e]??r;void 0!==o&&Pi(this.device.gl,n,i,o)}}}class Ii extends Cn.F{static defaultProps={...Cn.F.defaultProps,measureExecutionTime:void 0};get[Symbol.toStringTag](){return"CommandEncoder"}constructor(t,e){super(t,e,Ii.defaultProps)}}class Bi extends Cn.F{static defaultProps={...Cn.F.defaultProps};get[Symbol.toStringTag](){return"CommandBuffer"}constructor(t,e){super(t,e,Bi.defaultProps)}}class Ri extends Bi{device;commands=[];constructor(t){super(t,{}),this.device=t}submitCommands(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.commands;for(const e of t)switch(e.name){case"copy-buffer-to-buffer":Li(this.device,e.options);break;case"copy-buffer-to-texture":Oi(this.device,e.options);break;case"copy-texture-to-buffer":Di(this.device,e.options);break;case"copy-texture-to-texture":ki(this.device,e.options)}}}function Li(t,e){const n=e.source,i=e.destination;t.gl.bindBuffer(36662,n.handle),t.gl.bindBuffer(36663,i.handle),t.gl.copyBufferSubData(36662,36663,e.sourceOffset??0,e.destinationOffset??0,e.size),t.gl.bindBuffer(36662,null),t.gl.bindBuffer(36663,null)}function Oi(t,e){throw new Error("Not implemented")}function Di(t,e){const{source:n,mipLevel:i=0,aspect:r="all",width:o=e.source.width,height:s=e.source.height,depthOrArrayLayers:a=0,origin:l=[0,0],destination:c,byteOffset:u=0,bytesPerRow:h,rowsPerImage:d}=e;if("all"!==r)throw new Error("not supported");if(0!==i||0!==a||h||d)throw new Error("not implemented");const{framebuffer:p,destroyFramebuffer:f}=Fi(n);let A;try{const e=c,n=o||p.width,i=s||p.height,r=_n(p.texture.props.format),a=r.dataFormat,h=r.type;t.gl.bindBuffer(35051,e.handle),A=t.gl.bindFramebuffer(36160,p.handle),t.gl.readPixels(l[0],l[1],n,i,a,h,u)}finally{t.gl.bindBuffer(35051,null),void 0!==A&&t.gl.bindFramebuffer(36160,A),f&&p.destroy()}}function ki(t,e){const{source:n,destinationMipLevel:i=0,origin:r=[0,0],destinationOrigin:o=[0,0],destination:s}=e;let{width:a=e.destination.width,height:l=e.destination.height}=e;const{framebuffer:c,destroyFramebuffer:u}=Fi(n),[h,d]=r,[p,f,A]=o,g=t.gl.bindFramebuffer(36160,c.handle);let m,y=null;if(!(s instanceof Zn))throw new Error("invalid destination");switch(y=s,a=Number.isFinite(a)?a:y.width,l=Number.isFinite(l)?l:y.height,y.bind(0),m=y.target,m){case 3553:case 34067:t.gl.copyTexSubImage2D(m,i,p,f,h,d,a,l);break;case 35866:case 32879:t.gl.copyTexSubImage3D(m,i,p,f,A,h,d,a,l)}y&&y.unbind(),t.gl.bindFramebuffer(36160,g),u&&c.destroy()}function Fi(t){if(t instanceof Tn.g){const{width:e,height:n,id:i}=t;return{framebuffer:t.device.createFramebuffer({id:`framebuffer-for-${i}`,width:e,height:n,colorAttachments:[t]}),destroyFramebuffer:!0}}return{framebuffer:t,destroyFramebuffer:!1}}class Ni extends Ii{device;commandBuffer;constructor(t,e){super(t,e),this.device=t,this.commandBuffer=new Ri(t)}destroy(){}finish(){this.commandBuffer.submitCommands()}copyBufferToBuffer(t){this.commandBuffer.commands.push({name:"copy-buffer-to-buffer",options:t})}copyBufferToTexture(t){this.commandBuffer.commands.push({name:"copy-buffer-to-texture",options:t})}copyTextureToBuffer(t){this.commandBuffer.commands.push({name:"copy-texture-to-buffer",options:t})}copyTextureToTexture(t){this.commandBuffer.commands.push({name:"copy-texture-to-texture",options:t})}pushDebugGroup(t){}popDebugGroup(){}insertDebugMarker(t){}resolveQuerySet(t,e,n){}}class zi extends Cn.F{static defaultProps={...Cn.F.defaultProps,renderPipeline:null};get[Symbol.toStringTag](){return"VertexArray"}maxVertexAttributes;attributeInfos;indexBuffer=null;attributes;constructor(t,e){super(t,e,zi.defaultProps),this.maxVertexAttributes=t.limits.maxVertexAttributes,this.attributes=new Array(this.maxVertexAttributes).fill(null),this.attributeInfos=(0,fi.Mr)(e.renderPipeline.shaderLayout,e.renderPipeline.bufferLayout,this.maxVertexAttributes)}setConstantWebGL(t,e){throw new Error("constant attributes not supported")}}var Ui=n(
vendor: 10,807 bytes, line 2
28988),Gi=n(76325),Vi=n(77192);class ji extends zi{get[Symbol.toStringTag](){return"VertexArray"}device;handle;buffer=null;bufferValue=null;static isConstantAttributeZeroSupported(t){return"Chrome"===(e||(0,Xt.B)()?(0,Gi.b)(e)?"Electron":(e||Vi.gM.userAgent||"").indexOf("Edge")>-1?"Edge":globalThis.chrome?"Chrome":globalThis.safari?"Safari":globalThis.mozInnerScreenX?"Firefox":"Unknown":"Node");var e}constructor(t,e){super(t,e),this.device=t,this.handle=this.device.gl.createVertexArray()}destroy(){super.destroy(),this.buffer&&this.buffer?.destroy(),this.handle&&(this.device.gl.deleteVertexArray(this.handle),this.handle=void 0)}setIndexBuffer(t){const e=t;if(e&&34963!==e.glTarget)throw new Error("Use .setBuffer()");this.device.gl.bindVertexArray(this.handle),this.device.gl.bindBuffer(34963,e?e.handle:null),this.indexBuffer=e,this.device.gl.bindVertexArray(null)}setBuffer(t,e){const n=e;if(34963===n.glTarget)throw new Error("Use .setIndexBuffer()");const{size:i,type:r,stride:o,offset:s,normalized:a,integer:l,divisor:c}=this._getAccessor(t);this.device.gl.bindVertexArray(this.handle),this.device.gl.bindBuffer(34962,n.handle),l?this.device.gl.vertexAttribIPointer(t,i,r,o,s):this.device.gl.vertexAttribPointer(t,i,r,a,o,s),this.device.gl.bindBuffer(34962,null),this.device.gl.enableVertexAttribArray(t),this.device.gl.vertexAttribDivisor(t,c||0),this.attributes[t]=n,this.device.gl.bindVertexArray(null)}setConstantWebGL(t,e){this._enable(t,!1),this.attributes[t]=e}bindBeforeRender(){this.device.gl.bindVertexArray(this.handle),this._applyConstantAttributes()}unbindAfterRender(){this.device.gl.bindVertexArray(null)}_applyConstantAttributes(){for(let t=0;t<this.maxVertexAttributes;++t){const e=this.attributes[t];ArrayBuffer.isView(e)&&this.device.setConstantAttributeWebGL(t,e)}}_getAccessor(t){const e=this.attributeInfos[t];if(!e)throw new Error(`Unknown attribute location ${t}`);const n=qe(e.bufferDataType);return{size:e.bufferComponents,type:n,stride:e.byteStride,offset:e.byteOffset,normalized:e.normalized,integer:e.integer,divisor:"instance"===e.stepMode?1:0}}_enable(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const n=ji.isConstantAttributeZeroSupported(this.device);(e||(n||0!==t))&&(t=Number(t),this.device.gl.bindVertexArray(this.handle),e?this.device.gl.enableVertexAttribArray(t):this.device.gl.disableVertexAttribArray(t),this.device.gl.bindVertexArray(null))}getConstantBuffer(t,e){const n=function(t){if(Array.isArray(t))return new Float32Array(t);return t}(e),i=n.byteLength*t,r=n.length*t;if(this.buffer&&i!==this.buffer.byteLength)throw new Error(`Buffer size is immutable, byte length ${i} !== ${this.buffer.byteLength}.`);let o=!this.buffer;if(this.buffer=this.buffer||this.device.createBuffer({byteLength:i}),o=o||!function(t,e){if(!t||!e||t.length!==e.length||t.constructor!==e.constructor)return!1;for(let n=0;n<t.length;++n)if(t[n]!==e[n])return!1;return!0}(n,this.bufferValue),o){const t=(0,Ui.oF)(e.constructor,r);(0,Ui.R2)({target:t,source:n,start:0,count:r}),this.buffer.write(t),this.bufferValue=e}return this.buffer}}class Hi extends Cn.F{static defaultProps={...Cn.F.defaultProps,layout:void 0,buffers:{}};get[Symbol.toStringTag](){return"TransformFeedback"}constructor(t,e){super(t,e,Hi.defaultProps)}}class Wi extends Hi{device;gl;handle;layout;buffers={};unusedBuffers={};bindOnUse=!0;_bound=!1;constructor(t,e){super(t,e),this.device=t,this.gl=t.gl,this.handle=this.props.handle||this.gl.createTransformFeedback(),this.layout=this.props.layout,e.buffers&&this.setBuffers(e.buffers),Object.seal(this)}destroy(){this.gl.deleteTransformFeedback(this.handle),super.destroy()}begin(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"point-list";this.gl.bindTransformFeedback(36386,this.handle),this.bindOnUse&&this._bindBuffers(),this.gl.beginTransformFeedback(function(t){switch(t){case"point-list":return 0;case"line-list":case"line-strip":case"line-loop-webgl":return 1;case"triangle-list":case"triangle-strip":case"triangle-fan-webgl":return 4;default:throw new Error(t)}}(t))}end(){this.gl.endTransformFeedback(),this.bindOnUse&&this._unbindBuffers(),this.gl.bindTransformFeedback(36386,null)}setBuffers(t){this.buffers={},this.unusedBuffers={},this.bind((()=>{for(const e in t)this.setBuffer(e,t[e])}))}setBuffer(t,e){const n=this._getVaryingIndex(t),{buffer:i,byteLength:r,byteOffset:o}=this._getBufferRange(e);if(n<0)return this.unusedBuffers[t]=i,void Kt.R.warn(`${this.id} unusedBuffers varying buffer ${t}`)();this.buffers[n]={buffer:i,byteLength:r,byteOffset:o},this.bindOnUse||this._bindBuffer(n,i,o,r)}getBuffer(t){if(qi(t))return this.buffers[t]||null;const e=this._getVaryingIndex(t);return e>=0?this.buffers[e]:null}bind(){let t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.handle;return"function"!==typeof e?(this.gl.bindTransformFeedback(36386,e),this):(this._bound?t=e():(this.gl.bindTransformFeedback(36386,this.handle),this._bound=!0,t=e(),this._bound=!1,this.gl.bindTransformFeedback(36386,null)),t)}unbind(){this.bind(null)}_getBufferRange(t){if(t instanceof Gn)return{buffer:t,byteOffset:0,byteLength:t.byteLength};const{buffer:e,byteOffset:n=0,byteLength:i=t.buffer.byteLength}=t;return{buffer:e,byteOffset:n,byteLength:i}}_getVaryingIndex(t){if(qi(t))return Number(t);for(const e of this.layout.varyings)if(t===e.name)return e.location;return-1}_bindBuffers(){for(const t in this.buffers){const{buffer:e,byteLength:n,byteOffset:i}=this._getBufferRange(this.buffers[t]);this._bindBuffer(Number(t),e,i,n)}}_unbindBuffers(){for(const t in this.buffers)this.gl.bindBufferBase(35982,Number(t),null)}_bindBuffer(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3?arguments[3]:void 0;const r=e&&e.handle;r&&void 0!==i?this.gl.bindBufferRange(35982,t,r,n,i):this.gl.bindBufferBase(35982,t,r)}}function qi(t){return"number"===typeof t?Number.isInteger(t):/^\d+$/.test(t)}class Zi extends Cn.F{static defaultProps={...Cn.F.defaultProps,type:void 0,count:void 0};get[Symbol.toStringTag](){return"QuerySet"}constructor(t,e){super(t,e,Zi.defaultProps)}}class Xi extends Zi{device;handle;target=null;_queryPending=!1;_pollingPromise=null;get[Symbol.toStringTag](){return"Query"}constructor(t,e){if(super(t,e),this.device=t,e.count>1)throw new Error("WebGL QuerySet can only have one value");this.handle=this.device.gl.createQuery(),Object.seal(this)}destroy(){this.device.gl.deleteQuery(this.handle)}beginTimestampQuery(){return this._begin(35007)}endTimestampQuery(){this._end()}beginOcclusionQuery(t){return this._begin(t?.conservative?36202:35887)}endOcclusionQuery(){this._end()}beginTransformFeedbackQuery(){return this._begin(35976)}endTransformFeedbackQuery(){this._end()}async resolveQuery(){return[await this.pollQuery()]}_begin(t){this._queryPending||(this.target=t,this.device.gl.beginQuery(this.target,this.handle))}_end(){this._queryPending||this.target&&(this.device.gl.endQuery(this.target),this.target=null,this._queryPending=!0)}isResultAvailable(){if(!this._queryPending)return!1;const t=this.device.gl.getQueryParameter(this.handle,34919);return t&&(this._queryPending=!1),t}isTimerDisjoint(){return this.device.gl.getParameter(36795)}getResult(){return this.device.gl.getQueryParameter(this.handle,34918)}getTimerMilliseconds(){return this.getResult()/1e6}pollQuery(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Number.POSITIVE_INFINITY;if(this._pollingPromise)return this._pollingPromise;let e=0;return this._pollingPromise=new Promise(((n,i)=>{const r=()=>{this.isResultAvailable()?(n(this.getResult()),this._pollingPromise=null):e++>t?(i("Timed out"),this._pollingPromise=null):requestAnimationFrame(r)};requestAnimationFrame(r)})),this._pollingPromise}}function Ki(t){switch(t){case 6406:case 33326:case 6403:return 1;case 33328:case 33319:return 2;case 6407:case 34837:return 3;case 6408:case 34836:return 4;default:return(0,le.v)(!1),0}}function Qi(t,e){const{sourceX:n=0,sourceY:i=0,sourceFormat:r=6408,sourceAttachment:o=36064}=e||{};let{target:s=null,sourceWidth:a,sourceHeight:l,sourceType:c}=e||{};const{framebuffer:u,deleteFramebuffer:h}=Yi(t);(0,le.v)(u);const{gl:d,handle:p}=u;a=a||u.width,l=l||u.height;const f=o-36064;c=c||u.colorAttachments[f]?.texture?.type||5121,s=function(t,e,n,i,r){if(t)return t;const o=gi(e=e||5121,{clamped:!1}),s=Ki(n);return new o(i*r*s)}(s,c,r,a,l),c=c||function(t){switch(ArrayBuffer.isView(t)?t.constructor:t){case Float32Array:return 5126;case Uint16Array:return 5123;case Uint32Array:return 5125;case Uint8Array:case Uint8ClampedArray:return 5121;case Int8Array:return 5120;case Int16Array:return 5122;case Int32Array:return 5124;default:throw new Error(Ai)}}(s);const A=d.bindFramebuffer(36160,p);return d.readPixels(n,i,a,l,r,c,s),d.bindFramebuffer(36160,A||null),h&&u.destroy(),s}function Ji(t,e){const{target:n,sourceX:i=0,sourceY:r=0,sourceFormat:o=6408,targetByteOffset:s=0}=e||{};let{sourceWidth:a,sourceHeight:l,sourceType:c}=e||{};const{framebuffer:u,deleteFramebuffer:h}=Yi(t);(0,le.v)(u),a=a||u.width,l=l||u.height;const d=u;c=c||5121;let p=n;if(!p){const t=s+a*l*Ki(o)*function(t){switch(t){case 5121:return 1;case 33635:case 32819:case 32820:return 2;case 5126:return 4;default:return(0,le.v)(!1),0}}(c);p=d.device.createBuffer({byteLength:t})}const f=t.device.createCommandEncoder();return f.copyTextureToBuffer({source:t,width:a,height:l,origin:[i,r],destination:p,byteOffset:s}),f.destroy(),h&&u.destroy(),p}function Yi(t){return t instanceof Sn?{framebuffer:t,deleteFramebuffer:!1}:{framebuffer:$i(t),deleteFramebuffer:!0}}function $i(t,e){const{device:n,width:i,height:r,id:o}=t;return n.createFramebuffer({...e,id:`framebuffer-for-${o}`,width:i,height:r,colorAttachments:[t]})}const tr="clear: bad arguments";class er extends ae{static type="webgl";type="webgl";handle;features;limits;info;canvasContext;lost;_resolveContextLost;static isSupported(){return"undefined"!==typeof WebGL2RenderingContext}static attach(t){if(t instanceof er)return t;if(t?.device instanceof ae)return t.device;if(!function(t){if("undefined"!==typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext)return!0;return Boolean(t&&Number.isFinite(t._version))}(t))throw new Error("Invalid WebGL2RenderingContext");return new er({gl:t})}static async create(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Kt.R.groupCollapsed(1,"WebGLDevice created")();const e=[];t.debug&&e.push(async function(){(0,Xt.B)()&&!globalThis.WebGLDebugUtils&&(globalThis.global=globalThis.global||globalThis,globalThis.global.module={},await In("https://unpkg.com/[email protected]/index.js"))}()),t.spector&&e.push(async function(){if(!globalThis.SPECTOR)try{await In("https://cdn.jsdelivr.net/npm/[email protected]/dist/spector.bundle.js")}catch(t){Kt.R.warn(String(t
vendor: 13,621 bytes, line 2
2))}}()),"string"===typeof t.canvas&&e.push(Ae.pageLoaded);const n=await Promise.allSettled(e);for(const o of n)"rejected"===o.status&&Kt.R.error(`Failed to initialize debug libraries ${o.reason}`)();if(Kt.R.probe(2,"DOM is loaded")(),t.gl?.device)return Kt.R.warn("reattaching existing device")(),er.attach(t.gl);const i=new er(t),r=`Created ${i.type}${i.debug?" debug":""} context: ${i.info.vendor}, ${i.info.renderer} for canvas: ${i.canvasContext.id}`;return Kt.R.probe(1,r)(),Kt.R.table(1,i.info)(),Kt.R.groupEnd(1)(),i}constructor(t){super({...t,id:t.id||(0,Yt.L)("webgl-device")});const e=t.gl?.device;if(e)throw new Error(`WebGL context already attached to device ${e.id}`);const n=t.gl?.canvas||t.canvas;this.canvasContext=new Kn(this,{...t,canvas:n}),this.lost=new Promise((t=>{this._resolveContextLost=t}));let i=t.gl||null;if(i||=function(t,e){e={...Ve,...e};let n=null;const i=t=>n=t.statusMessage||n;t.addEventListener("webglcontextcreationerror",i,!1);let r=null;if(r||=t.getContext("webgl2",e),t.removeEventListener("webglcontextcreationerror",i,!1),!r)throw new Error(`Failed to create WebGL context: ${n||"Unknown error"}`);if(e.onContextLost){const{onContextLost:n}=e;t.addEventListener("webglcontextlost",(t=>n(t)),!1)}if(e.onContextRestored){const{onContextRestored:n}=e;t.addEventListener("webglcontextrestored",(t=>n(t)),!1)}return r}(this.canvasContext.canvas,{...t,onContextLost:t=>this._resolveContextLost?.({reason:"destroyed",message:"Entered sleep mode, or too many apps or browser tabs are using the GPU."})}),!i)throw new Error("WebGL context creation failed");this.handle=i,this.gl=i,this.gl.device=this,this.gl._version=2,t.spector&&(this.spectorJS=function(t){if(t={...Qn,...t},!t?.spector)return null;if(!Jn&&globalThis.SPECTOR&&(Kt.R.probe(1,"SPECTOR found and initialized")(),Jn=new globalThis.SPECTOR.Spector,globalThis.luma&&(globalThis.luma.spector=Jn)),!Jn)return null;if(Yn||(Yn=!0,Jn.spyCanvases(),Jn?.onCaptureStarted.add((t=>Kt.R.info("Spector capture started:",t)())),Jn?.onCapture.add((t=>{Kt.R.info("Spector capture complete:",t)(),Jn?.getResultUI(),Jn?.resultView.display(),Jn?.resultView.addCapture(t)}))),t?.canvas){if("string"===typeof t.spector&&t.spector!==t.canvas.id)return Jn;Jn?.startCapture(t?.canvas,500),new Promise((t=>setTimeout(t,2e3))).then((t=>{Kt.R.info("Spector capture stopped after 2 seconds")(),Jn?.stopCapture()}))}return Jn}({...this.props,canvas:this.handle.canvas})),this.info=He(this.gl,this._extensions),this.limits=new En(this.gl),this.features=new wn(this.gl,this._extensions,this.props.disabledFeatures),this.props.initalizeFeatures&&this.features.initializeFeatures(),this.canvasContext.resize();const{enable:r=!0,copyState:o=!1}=t;Fe(this.gl,{enable:r,copyState:o,log:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return Kt.R.log(1,...e)()}}),t.debug&&(this.gl=ei(this.gl,{...t,throwOnError:!0}),this.debug=!0,Kt.R.level=Math.max(Kt.R.level,1),Kt.R.warn("WebGL debug mode activated. Performance reduced.")())}destroy(){}get isLost(){return this.gl.isContextLost()}getSize(){return[this.gl.drawingBufferWidth,this.gl.drawingBufferHeight]}isTextureFormatSupported(t){return mn(this.gl,t,this._extensions)}isTextureFormatFilterable(t){return function(t,e,n){if(!mn(t,e,n))return!1;if(e.startsWith("depth")||e.startsWith("stencil"))return!1;try{if(ie(e).signed)return!1}catch{return!1}return e.endsWith("32float")?Boolean(je(t,"OES_texture_float_linear, extensions",n)):!e.endsWith("16float")||Boolean(je(t,"OES_texture_half_float_linear, extensions",n))}(this.gl,t,this._extensions)}isTextureFormatRenderable(t){return function(t,e,n){return!!mn(t,e,n)&&"number"!==typeof e}(this.gl,t,this._extensions)}createCanvasContext(t){throw new Error("WebGL only supports a single canvas")}createBuffer(t){const e=this._getBufferProps(t);return new Gn(this,e)}_createTexture(t){return new Zn(this,t)}createExternalTexture(t){throw new Error("createExternalTexture() not implemented")}createSampler(t){return new jn(this,t)}createShader(t){return new ai(this,t)}createFramebuffer(t){return new Xn(this,t)}createVertexArray(t){return new ji(this,t)}createTransformFeedback(t){return new Wi(this,t)}createQuerySet(t){return new Xi(this,t)}createRenderPipeline(t){return new Mi(this,t)}beginRenderPass(t){return new hi(this,t)}createComputePipeline(t){throw new Error("ComputePipeline not supported in WebGL")}beginComputePass(t){throw new Error("ComputePass not supported in WebGL")}renderPass=null;createCommandEncoder(t){return new Ni(this,t)}submit(){this.renderPass?.end(),this.renderPass=null}readPixelsToArrayWebGL(t,e){return Qi(t,e)}readPixelsToBufferWebGL(t,e){return Ji(t,e)}setParametersWebGL(t){Re(this.gl,t)}getParametersWebGL(t){return Le(this.gl,t)}withParametersWebGL(t,e){return Bn(this.gl,t,e)}clearWebGL(t){!function(t,e){const{framebuffer:n=null,color:i=null,depth:r=null,stencil:o=null}=e||{},s={};n&&(s.framebuffer=n);let a=0;i&&(a|=16384,!0!==i&&(s.clearColor=i)),r&&(a|=256,!0!==r&&(s.clearDepth=r)),o&&(a|=1024,!0!==r&&(s.clearStencil=r)),(0,le.v)(0!==a,tr);const l=t.gl;Bn(l,s,(()=>{l.clear(a)}))}(this,t)}resetWebGL(){Kt.R.warn("WebGLDevice.resetWebGL is deprecated, use only for debugging")(),Re(this.gl,ye)}gl;debug=!1;_canvasSizeInfo={clientWidth:0,clientHeight:0,devicePixelRatio:1};_extensions={};_polyfilled=!1;spectorJS;loseDevice(){let t=!1;const e=this.getExtension("WEBGL_lose_context").WEBGL_lose_context;return e&&(t=!0,e.loseContext()),this._resolveContextLost?.({reason:"destroyed",message:"Application triggered context loss"}),t}pushState(){Ne(this.gl)}popState(){ze(this.gl)}setSpectorMetadata(t,e){t.__SPECTOR_Metadata=e}getGLKey(t,e){e=e||this.gl2||this.gl;const n=Number(t);for(const i in e)if(e[i]===n)return`GL.${i}`;return String(t)}_constants;setConstantAttributeWebGL(t,e){const n=this.limits.maxVertexAttributes;this._constants=this._constants||new Array(n).fill(null);const i=this._constants[t];switch(i&&function(t,e){if(!t||!e||t.length!==e.length||t.constructor!==e.constructor)return!1;for(let n=0;n<t.length;++n)if(t[n]!==e[n])return!1;return!0}(i,e)&&Kt.R.info(1,`setConstantAttributeWebGL(${t}) could have been skipped, value unchanged`)(),this._constants[t]=e,e.constructor){case Float32Array:!function(t,e,n){switch(n.length){case 1:t.gl.vertexAttrib1fv(e,n);break;case 2:t.gl.vertexAttrib2fv(e,n);break;case 3:t.gl.vertexAttrib3fv(e,n);break;case 4:t.gl.vertexAttrib4fv(e,n);break;default:(0,le.v)(!1)}}(this,t,e);break;case Int32Array:!function(t,e,n){t.gl.vertexAttribI4iv(e,n)}(this,t,e);break;case Uint32Array:!function(t,e,n){t.gl.vertexAttribI4uiv(e,n)}(this,t,e);break;default:(0,le.v)(!1)}}getExtension(t){return je(this.gl,t,this._extensions),this._extensions}}let nr=0;const ir={device:null,onAddHTML:()=>"",onInitialize:async()=>null,onRender:()=>{},onFinalize:()=>{},onError:t=>console.error(t),stats:ue.stats.get("animation-loop-"+nr++),useDevicePixels:!0,autoResizeViewport:!1,autoResizeDrawingBuffer:!1};class rr{device=null;canvas=null;props;animationProps=null;timeline=null;stats;cpuTime;gpuTime;frameRate;display;needsRedraw="initialized";_initialized=!1;_running=!1;_animationFrameId=null;_nextFramePromise=null;_resolveNextFrame=null;_cpuStartTime=0;constructor(t){if(this.props={...ir,...t},!(t=this.props).device)throw new Error("No device provided");const{useDevicePixels:e=!0}=this.props;this.stats=t.stats||new d.A({id:"animation-loop-stats"}),this.cpuTime=this.stats.get("CPU Time"),this.gpuTime=this.stats.get("GPU Time"),this.frameRate=this.stats.get("Frame Rate"),this.setProps({autoResizeViewport:t.autoResizeViewport,autoResizeDrawingBuffer:t.autoResizeDrawingBuffer,useDevicePixels:e}),this.start=this.start.bind(this),this.stop=this.stop.bind(this),this._onMousemove=this._onMousemove.bind(this),this._onMouseleave=this._onMouseleave.bind(this)}destroy(){this.stop(),this._setDisplay(null)}delete(){this.destroy()}setNeedsRedraw(t){return this.needsRedraw=this.needsRedraw||t,this}setProps(t){return"autoResizeViewport"in t&&(this.props.autoResizeViewport=t.autoResizeViewport||!1),"autoResizeDrawingBuffer"in t&&(this.props.autoResizeDrawingBuffer=t.autoResizeDrawingBuffer||!1),"useDevicePixels"in t&&(this.props.useDevicePixels=t.useDevicePixels||!1),this}async start(){if(this._running)return this;this._running=!0;try{let t;return this._initialized||(this._initialized=!0,await this._initDevice(),this._initialize(),await this.props.onInitialize(this._getAnimationProps())),this._running?(!1!==t&&(this._cancelAnimationFrame(),this._requestAnimationFrame()),this):null}catch(t){const e=t instanceof Error?t:new Error("Unknown error");throw this.props.onError(e),e}}stop(){return this._running&&(this.animationProps&&this.props.onFinalize(this.animationProps),this._cancelAnimationFrame(),this._nextFramePromise=null,this._resolveNextFrame=null,this._running=!1),this}redraw(){return this.device?.isLost||(this._beginFrameTimers(),this._setupFrame(),this._updateAnimationProps(),this._renderFrame(this._getAnimationProps()),this._clearNeedsRedraw(),this._resolveNextFrame&&(this._resolveNextFrame(this),this._nextFramePromise=null,this._resolveNextFrame=null),this._endFrameTimers()),this}attachTimeline(t){return this.timeline=t,this.timeline}detachTimeline(){this.timeline=null}waitForRender(){return this.setNeedsRedraw("waitForRender"),this._nextFramePromise||(this._nextFramePromise=new Promise((t=>{this._resolveNextFrame=t}))),this._nextFramePromise}async toDataURL(){if(this.setNeedsRedraw("toDataURL"),await this.waitForRender(),this.canvas instanceof HTMLCanvasElement)return this.canvas.toDataURL();throw new Error("OffscreenCanvas")}_initialize(){this._startEventHandling(),this._initializeAnimationProps(),this._updateAnimationProps(),this._resizeCanvasDrawingBuffer(),this._resizeViewport()}_setDisplay(t){this.display&&(this.display.destroy(),this.display.animationLoop=null),t&&(t.animationLoop=this),this.display=t}_requestAnimationFrame(){var t;this._running&&(this._animationFrameId=(t=this._animationFrame.bind(this),"undefined"!==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame(t):setTimeout(t,1e3/60)))}_cancelAnimationFrame(){var t;null!==this._animationFrameId&&(t=this._animationFrameId,"undefined"!==typeof window&&window.cancelAnimationFrame?window.cancelAnimationFrame(t):clearTimeout(t),this._animationFrameId=null)}_animationFrame(){this._running&&(this.redraw(),this._requestAnimationFrame())}_renderFrame(t){this.display?this.display._renderFrame(t):(this.props.onRender(this._getAnimationProps()),this.device.submit())}_clearNeedsRedraw(){this.needsRedraw=!1}_setupFrame(){this._resizeCanvasDrawingBuffer(),this._resizeViewport()}_initializeAnimationProps(){if(!this.device)throw new Error("loop");this.animationProps={animationLoop:this,device:this.device,canvas:this.device?.canvasContext?.canvas,timeline:this.timeline,useDevicePixels:this.props.useDevicePixels,needsRedraw:!1,width:1,height:1,aspect:1,time:0,startTime:Date.now(),engineTime:0,tick:0,tock:0,_mousePosition:null}}_getAnimationProps(){if(!this.animationProps)throw new Error("animationProps");return this.animationProps}_updateAnimationProps(){if(!this.animationProps)return;const{width:t,height:e,aspect:n}=this._getSizeAndAspect();t===this.animationProps.width&&e===this.animationProps.height||this.setNeedsRedraw("drawing buffer resized"),n!==this.animationProps.aspect&&this.setNeedsRedraw("drawing buffer aspect changed"),this.animationProps.width=t,this.animationProps.height=e,this.animationProps.aspect=n,this.animationProps.needsRedraw=this.needsRedraw,this.animationProps.engineTime=Date.now()-this.animationProps.startTime,this.timeline&&this.timeline.update(this.animationProps.engineTime),this.animationProps.tick=Math.floor(this.animationProps.time/1e3*60),this.animationProps.tock++,this.animationProps.time=this.timeline?this.timeline.getTime():this.animationProps.engineTime}async _initDevice(){if(this.device=await this.props.device,!this.device)throw new Error("No device provided");this.canvas=this.device.canvasContext?.canvas||null}_createInfoDiv(){if(this.canvas&&this.props.onAddHTML){const t=document.createElement("div");document.body.appendChild(t),t.style.position="relative";const e=document.createElement("div");e.style.position="absolute",e.style.left="10px",e.style.bottom="10px",e.style.width="300px",e.style.background="white",this.canvas instanceof HTMLCanvasElement&&t.appendChild(this.canvas),t.appendChild(e);const n=this.props.onAddHTML(e);n&&(e.innerHTML=n)}}_getSizeAndAspect(){if(!this.device)return{width:1,height:1,aspect:1};const[t,e]=this.device?.canvasContext?.getPixelSize()||[1,1];let n=1;const i=this.device?.canvasContext?.canvas;return i&&i.clientHeight?n=i.clientWidth/i.clientHeight:t>0&&e>0&&(n=t/e),{width:t,height:e,aspect:n}}_resizeViewport(){this.props.autoResizeViewport&&this.device.gl&&this.device.gl.viewport(0,0,this.device.gl.drawingBufferWidth,this.device.gl.drawingBufferHeight)}_resizeCanvasDrawingBuffer(){this.props.autoResizeDrawingBuffer&&this.device?.canvasContext?.resize({useDevicePixels:this.props.useDevicePixels})}_beginFrameTimers(){this.frameRate.timeEnd(),this.frameRate.timeStart(),this.cpuTime.timeStart()}_endFrameTimers(){this.cpuTime.timeEnd()}_startEventHandling(){this.canvas&&(this.canvas.addEventListener("mousemove",this._onMousemove.bind(this)),this.canvas.addEventListener("mouseleave",this._onMouseleave.bind(this)))}_onMousemove(t){t instanceof MouseEvent&&(this._getAnimationProps()._mousePosition=[t.offsetX,t.offsetY])}_onMouseleave(t){this._getAnimationProps()._mousePosition=null}}var or=n(
267594
vendor: 12,409 bytes, line 2
2);function sr(){}const ar={id:"",width:"100%",height:"100%",style:null,viewState:null,initialViewState:null,pickingRadius:0,layerFilter:null,parameters:{},parent:null,device:null,deviceProps:{type:"webgl"},gl:null,glOptions:{},canvas:null,layers:[],effects:[],views:null,controller:null,useDevicePixels:!0,touchAction:"none",eventRecognizerOptions:{},_framebuffer:null,_animate:!1,_pickable:!0,_typedArrayManagerProps:{},_customRender:null,widgets:[],onDeviceInitialized:sr,onWebGLInitialized:sr,onResize:sr,onViewStateChange:sr,onInteractionStateChange:sr,onBeforeRender:sr,onAfterRender:sr,onLoad:sr,onError:t=>c.A.error(t.message,t.cause)(),onHover:null,onClick:null,onDragStart:null,onDrag:null,onDragEnd:null,_onMetrics:null,getCursor:t=>{let{isDragging:e}=t;return e?"grabbing":"grab"},getTooltip:null,debug:!1,drawPickingColors:!1};class lr{constructor(t){this.width=0,this.height=0,this.userData={},this.device=null,this.canvas=null,this.viewManager=null,this.layerManager=null,this.effectManager=null,this.deckRenderer=null,this.deckPicker=null,this.eventManager=null,this.widgetManager=null,this.tooltip=null,this.animationLoop=null,this.cursorState={isHovering:!1,isDragging:!1},this.stats=new d.A({id:"deck.gl"}),this.metrics={fps:0,setPropsTime:0,updateAttributesTime:0,framesRedrawn:0,pickTime:0,pickCount:0,gpuTime:0,gpuTimePerFrame:0,cpuTime:0,cpuTimePerFrame:0,bufferMemory:0,textureMemory:0,renderbufferMemory:0,gpuMemory:0},this._metricsCounter=0,this._needsRedraw="Initial render",this._pickRequest={mode:"hover",x:-1,y:-1,radius:0,event:null},this._lastPointerDownInfo=null,this._onPointerMove=t=>{const{_pickRequest:e}=this;if("pointerleave"===t.type)e.x=-1,e.y=-1,e.radius=0;else{if(t.leftButton||t.rightButton)return;{const n=t.offsetCenter;if(!n)return;e.x=n.x,e.y=n.y,e.radius=this.props.pickingRadius}}this.layerManager&&(this.layerManager.context.mousePosition={x:e.x,y:e.y}),e.event=t},this._onEvent=t=>{const e=At.qY[t.type],n=t.offsetCenter;if(!e||!n||!this.layerManager)return;const i=this.layerManager.getLayers(),r=this.deckPicker.getLastPickedObject({x:n.x,y:n.y,layers:i,viewports:this.getViewports(n)},this._lastPointerDownInfo),{layer:o}=r,s=o&&(o[e.handler]||o.props[e.handler]),a=this.props[e.handler];let l=!1;s&&(l=s.call(o,r,t)),l||(a?.(r,t),this.widgetManager.onEvent(r,t))},this._onPointerDown=t=>{const e=t.offsetCenter,n=this._pick("pickObject","pickObject Time",{x:e.x,y:e.y,radius:this.props.pickingRadius});this._lastPointerDownInfo=n.result[0]||n.emptyInfo},this.props={...ar,...t},(t=this.props).viewState&&t.initialViewState&&c.A.warn("View state tracking is disabled. Use either `initialViewState` for auto update or `viewState` for manual update.")(),this.viewState=this.props.initialViewState,t.device?this.device=t.device:t.gl&&(t.gl instanceof WebGLRenderingContext&&c.A.error("WebGL1 context not supported.")(),this.device=er.attach(t.gl));let e=this.device;e||(ue.registerDevices([er]),e=ue.createDevice({...t.deviceProps,canvas:this._createCanvas(t)})),this.animationLoop=this._createAnimationLoop(e,t),this.setProps(t),t._typedArrayManagerProps&&qt.A.setOptions(t._typedArrayManagerProps),this.animationLoop.start()}finalize(){this.animationLoop?.stop(),this.animationLoop?.destroy(),this.animationLoop=null,this._lastPointerDownInfo=null,this.layerManager?.finalize(),this.layerManager=null,this.viewManager?.finalize(),this.viewManager=null,this.effectManager?.finalize(),this.effectManager=null,this.deckRenderer?.finalize(),this.deckRenderer=null,this.deckPicker?.finalize(),this.deckPicker=null,this.eventManager?.destroy(),this.eventManager=null,this.widgetManager?.finalize(),this.widgetManager=null,this.props.canvas||this.props.device||this.props.gl||!this.canvas||(this.canvas.parentElement?.removeChild(this.canvas),this.canvas=null)}setProps(t){this.stats.get("setProps Time").timeStart(),"onLayerHover"in t&&c.A.removed("onLayerHover","onHover")(),"onLayerClick"in t&&c.A.removed("onLayerClick","onClick")(),t.initialViewState&&!(0,y.b)(this.props.initialViewState,t.initialViewState,3)&&(this.viewState=t.initialViewState),Object.assign(this.props,t),this._setCanvasSize(this.props);const e=Object.create(this.props);Object.assign(e,{views:this._getViews(),width:this.width,height:this.height,viewState:this._getViewState()}),this.animationLoop?.setProps(e),this.layerManager&&(this.viewManager.setProps(e),this.layerManager.activateViewport(this.getViewports()[0]),this.layerManager.setProps(e),this.effectManager.setProps(e),this.deckRenderer.setProps(e),this.deckPicker.setProps(e),this.widgetManager.setProps(e)),this.stats.get("setProps Time").timeEnd()}needsRedraw(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1};if(!this.layerManager)return!1;if(this.props._animate)return"Deck._animate";let e=this._needsRedraw;t.clearRedrawFlags&&(this._needsRedraw=!1);const n=this.viewManager.needsRedraw(t),i=this.layerManager.needsRedraw(t),r=this.effectManager.needsRedraw(t),o=this.deckRenderer.needsRedraw(t);return e=e||n||i||r||o,e}redraw(t){if(!this.layerManager)return;let e=this.needsRedraw({clearRedrawFlags:!0});e=t||e,e&&(this.stats.get("Redraw Count").incrementCount(),this.props._customRender?this.props._customRender(e):this._drawLayers(e))}get isInitialized(){return null!==this.viewManager}getViews(){return(0,L.A)(this.viewManager),this.viewManager.views}getViewports(t){return(0,L.A)(this.viewManager),this.viewManager.getViewports(t)}getCanvas(){return this.canvas}pickObject(t){const e=this._pick("pickObject","pickObject Time",t).result;return e.length?e[0]:null}pickMultipleObjects(t){return t.depth=t.depth||10,this._pick("pickObject","pickMultipleObjects Time",t).result}pickObjects(t){return this._pick("pickObjects","pickObjects Time",t)}_addResources(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];for(const n in t)this.layerManager.resourceManager.add({resourceId:n,data:t[n],forceUpdate:e})}_removeResources(t){for(const e of t)this.layerManager.resourceManager.remove(e)}_addDefaultEffect(t){this.effectManager.addDefaultEffect(t)}_addDefaultShaderModule(t){this.layerManager.addDefaultShaderModule(t)}_removeDefaultShaderModule(t){this.layerManager?.removeDefaultShaderModule(t)}_pick(t,e,n){(0,L.A)(this.deckPicker);const{stats:i}=this;i.get("Pick Count").incrementCount(),i.get(e).timeStart();const r=this.deckPicker[t]({layers:this.layerManager.getLayers(n),views:this.viewManager.getViews(),viewports:this.getViewports(n),onViewportActive:this.layerManager.activateViewport,effects:this.effectManager.getEffects(),...n});return i.get(e).timeEnd(),r}_createCanvas(t){let e=t.canvas;if("string"===typeof e&&(e=document.getElementById(e),(0,L.A)(e)),!e){e=document.createElement("canvas"),e.id=t.id||"deckgl-overlay";(t.parent||document.body).appendChild(e)}return Object.assign(e.style,t.style),e}_setCanvasSize(t){if(!this.canvas)return;const{width:e,height:n}=t;if(e||0===e){const t=Number.isFinite(e)?`${e}px`:e;this.canvas.style.width=t}if(n||0===n){const e=Number.isFinite(n)?`${n}px`:n;this.canvas.style.position=t.style?.position||"absolute",this.canvas.style.height=e}}_updateCanvasSize(){const{canvas:t}=this;if(!t)return;const e=t.clientWidth??t.width,n=t.clientHeight??t.height;e===this.width&&n===this.height||(this.width=e,this.height=n,this.viewManager?.setProps({width:e,height:n}),this.layerManager?.activateViewport(this.getViewports()[0]),this.props.onResize({width:e,height:n}))}_createAnimationLoop(t,e){const{gl:n,onError:i,useDevicePixels:r}=e;return new rr({device:t,useDevicePixels:r,autoResizeDrawingBuffer:!n,autoResizeViewport:!1,onInitialize:t=>this._setDevice(t.device),onRender:this._onRenderFrame.bind(this),onError:i})}_getViewState(){return this.props.viewState||this.viewState}_getViews(){const{views:t}=this.props,e=Array.isArray(t)?t:t?[t]:[new $({id:"default-view"})];return e.length&&this.props.controller&&(e[0].props.controller=this.props.controller),e}_onContextLost(){const{onError:t}=this.props;this.animationLoop&&t&&t(new Error("WebGL context is lost"))}_pickAndCallback(){const{_pickRequest:t}=this;if(t.event){const{result:e,emptyInfo:n}=this._pick("pickObject","pickObject Time",t);this.cursorState.isHovering=e.length>0;let i=n,r=!1;for(const o of e)i=o,r=o.layer?.onHover(o,t.event)||r;r||(this.props.onHover?.(i,t.event),this.widgetManager.onHover(i,t.event)),t.event=null}}_updateCursor(){const t=this.props.parent||this.canvas;t&&(t.style.cursor=this.props.getCursor(this.cursorState))}_setDevice(t){if(this.device=t,!this.animationLoop)return;this.canvas||(this.canvas=this.device.canvasContext?.canvas),this.device.setParametersWebGL({blend:!0,blendFunc:[770,771,1,771],polygonOffsetFill:!0,depthTest:!0,depthFunc:515}),this.props.onDeviceInitialized(this.device),this.device instanceof er&&this.props.onWebGLInitialized(this.device.gl);const e=new s;e.play(),this.animationLoop.attachTimeline(e),this.eventManager=new or.E(this.props.parent||this.canvas,{touchAction:this.props.touchAction,recognizerOptions:this.props.eventRecognizerOptions,events:{pointerdown:this._onPointerDown,pointermove:this._onPointerMove,pointerleave:this._onPointerMove}});for(const i in At.qY)this.eventManager.on(i,this._onEvent);this.viewManager=new _({timeline:e,eventManager:this.eventManager,onViewStateChange:this._onViewStateChange.bind(this),onInteractionStateChange:this._onInteractionStateChange.bind(this),views:this._getViews(),viewState:this._getViewState(),width:this.width,height:this.height});const n=this.viewManager.getViewports()[0];this.layerManager=new m(this.device,{deck:this,stats:this.stats,viewport:n,timeline:e}),this.effectManager=new Pt({deck:this,device:this.device}),this.deckRenderer=new Lt(this.device),this.deckPicker=new zt(this.device),this.widgetManager=new jt({deck:this,parentElement:this.canvas?.parentElement}),this.widgetManager.addDefault(new Wt),this.setProps(this.props),this._updateCanvasSize(),this.props.onLoad()}_drawLayers(t,e){const{device:n,gl:i}=this.layerManager.context;this.props.onBeforeRender({device:n,gl:i});const r={target:this.props._framebuffer,layers:this.layerManager.getLayers(),viewports:this.viewManager.getViewports(),onViewportActive:this.layerManager.activateViewport,views:this.viewManager.getViews(),pass:"screen",effects:this.effectManager.getEffects(),...e};this.deckRenderer?.renderLayers(r),"screen"===r.pass&&this.widgetManager.onRedraw({viewports:r.viewports,layers:r.layers}),this.props.onAfterRender({device:n,gl:i})}_onRenderFrame(){this._getFrameStats(),this._metricsCounter++%60===0&&(this._getMetrics(),this.stats.reset(),c.A.table(4,this.metrics)(),this.props._onMetrics&&this.props._onMetrics(this.metrics)),this._updateCanvasSize(),this._updateCursor(),this.layerManager.updateLayers(),this._pickAndCallback(),this.redraw(),this.viewManager&&this.viewManager.updateViewStates()}_onViewStateChange(t){const e=this.props.onViewStateChange(t)||t.viewState;this.viewState&&(this.viewState={...this.viewState,[t.viewId]:e},this.props.viewState||this.viewManager&&this.viewManager.setProps({viewState:this.viewState}))}_onInteractionStateChange(t){this.cursorState.isDragging=t.isDragging||!1,this.props.onInteractionStateChange(t)}_getFrameStats(){const{stats:t}=this;t.get("frameRate").timeEnd(),t.get("frameRate").timeStart();const e=this.animationLoop.stats;t.get("GPU Time").addTime(e.get("GPU Time").lastTiming),t.get("CPU Time").addTime(e.get("CPU Time").lastTiming)}_getMetrics(){const{metrics:t,stats:e}=this;t.fps=e.get("frameRate").getHz(),t.setPropsTime=e.get("setProps Time").time,t.updateAttributesTime=e.get("Update Attributes").time,t.framesRedrawn=e.get("Redraw Count").count,t.pickTime=e.get("pickObject Time").time+e.get("pickMultipleObjects Time").time+e.get("pickObjects Time").time,t.pickCount=e.get("Pick Count").count,t.gpuTime=e.get("GPU Time").time,t.cpuTime=e.get("CPU Time").time,t.gpuTimePerFrame=e.get("GPU Time").getAverageTime(),t.cpuTimePerFrame=e.get("CPU Time").getAverageTime();const n=ue.stats.get("Memory Usage");t.bufferMemory=n.get("Buffer Memory").count,t.textureMemory=n.get("Texture Memory").count,t.renderbufferMemory=n.get("Renderbuffer Memory").count,t.gpuMemory=n.get("GPU Memory").count}}lr.defaultProps=ar,lr.VERSION=Zt.x;const cr=lr,ur="undefined"!==typeof window?i.useLayoutEffect:i.useEffect;function hr(t,e){for(;t;){if(t===e)return!0;t=Object.getPrototypeOf(t)}return!1}var dr=n(
vendor: 26,003 bytes, line 2
214939);const pr={position:"absolute",zIndex:-1};function fr(t,e){if("function"===typeof t)return t(e);if(Array.isArray(t))return t.map((t=>fr(t,e)));if(Ar(t)){if(n=t,n.props?.mapStyle)return e.style=pr,(0,i.cloneElement)(t,e);if(function(t){const e=t.type;return e&&e.deckGLViewProps}(t))return(0,i.cloneElement)(t,e)}var n;return t}function Ar(t){return t&&"object"===typeof t&&"type"in t||!1}function gr(t){if("function"===typeof t)return(0,i.createElement)(w,{},t);if(Array.isArray(t))return t.map(gr);if(Ar(t)){if(t.type===i.Fragment)return gr(t.props.children);if(hr(t.type,w))return t}return t}const mr={mixBlendMode:null};function yr(t){t.redrawReason&&(t.deck._drawLayers(t.redrawReason),t.redrawReason=null)}const _r=i.forwardRef((function(t,e){const[n,r]=(0,i.useState)(0),o=(0,i.useRef)({control:null,version:n,forceUpdate:()=>r((t=>t+1))}).current,s=(0,i.useRef)(null),a=(0,i.useRef)(null),l=(0,i.useMemo)((()=>function(t){let{children:e,layers:n=[],views:r=null}=t;const o=[],s=[],a={};return i.Children.forEach(gr(e),(t=>{if(Ar(t)){const e=t.type;if(hr(e,dr.A)){const n=function(t,e){const n={},i=t.defaultProps||{};for(const r in e)i[r]!==e[r]&&(n[r]=e[r]);return new t(n)}(e,t.props);s.push(n)}else o.push(t);if(hr(e,w)&&e!==w&&t.props.id){const n=new e(t.props);a[n.id]=n}}else t&&o.push(t)})),Object.keys(a).length>0&&(Array.isArray(r)?r.forEach((t=>{a[t.id]=t})):r&&(a[r.id]=r),r=Object.values(a)),n=s.length>0?[...s,...n]:n,{layers:n,children:o,views:r}}(t)),[t.layers,t.views,t.children]);let c=!0;const u=e=>c&&t.viewState?(o.viewStateUpdateRequested=e,null):(o.viewStateUpdateRequested=null,t.onViewStateChange?.(e)),h=e=>{c?o.interactionStateUpdateRequested=e:(o.interactionStateUpdateRequested=null,t.onInteractionStateChange?.(e))},d=(0,i.useMemo)((()=>{const e={...t,style:null,width:"100%",height:"100%",parent:s.current,canvas:a.current,layers:l.layers,views:l.views,onViewStateChange:u,onInteractionStateChange:h};return delete e._customRender,o.deck&&o.deck.setProps(e),e}),[t]);(0,i.useEffect)((()=>{const e=t.Deck||cr;return o.deck=function(t,e,n){const i=new e({...n,_customRender:e=>{t.redrawReason=e;const n=i.getViewports();t.lastRenderedViewports!==n?t.forceUpdate():yr(t)}});return i}(o,e,{...d,parent:s.current,canvas:a.current}),()=>o.deck?.finalize()}),[]),ur((()=>{yr(o);const{viewStateUpdateRequested:t,interactionStateUpdateRequested:e}=o;t&&u(t),e&&h(e)})),(0,i.useImperativeHandle)(e,(()=>function(t){return{get deck(){return t.deck},pickObject:e=>t.deck.pickObject(e),pickMultipleObjects:e=>t.deck.pickMultipleObjects(e),pickObjects:e=>t.deck.pickObjects(e)}}(o)),[]);const p=o.deck&&o.deck.isInitialized?o.deck.getViewports():void 0,{ContextProvider:f,width:A="100%",height:g="100%",id:m,style:y}=t,{containerStyle:_,canvasStyle:v}=(0,i.useMemo)((()=>function(t){let{width:e,height:n,style:i}=t;const r={position:"absolute",zIndex:0,left:0,top:0,width:e,height:n},o={left:0,top:0};if(i)for(const s in i)s in mr?o[s]=i[s]:r[s]=i[s];return{containerStyle:r,canvasStyle:o}}({width:A,height:g,style:y})),[A,g,y]);if(!o.viewStateUpdateRequested&&o.lastRenderedViewports===p||o.version!==n){o.lastRenderedViewports=p,o.version=n;const t=function(t){let{children:e,deck:n,ContextProvider:r}=t;const{viewManager:o}=n||{};if(!o||!o.views.length)return[];const s={},a=o.views[0].id;for(const i of e){let t=a,e=i;Ar(i)&&hr(i.type,w)&&(t=i.props.id||a,e=i.props.children);const n=o.getViewport(t),r=o.getViewState(t);if(n){r.padding=n.padding;const{x:i,y:o,width:a,height:l}=n;e=fr(e,{x:i,y:o,width:a,height:l,viewport:n,viewState:r}),s[t]||(s[t]={viewport:n,children:[]}),s[t].children.push(e)}}return Object.keys(s).map((t=>{const{viewport:e,children:o}=s[t],{x:a,y:l,width:c,height:u}=e,h={position:"absolute",left:a,top:l,width:c,height:u},d=`view-${t}`,p=(0,i.createElement)("div",{key:d,id:d,style:h},...o);if(r){const o={viewport:e,container:n.canvas.offsetParent,eventManager:n.eventManager,onViewStateChange:e=>{e.viewId=t,n._onViewStateChange(e)}};return(0,i.createElement)(r,{key:d,value:o},p)}return p}))}({children:l.children,deck:o.deck,ContextProvider:f}),e=(0,i.createElement)("canvas",{key:"canvas",id:m||"deckgl-overlay",ref:a,style:v});o.control=(0,i.createElement)("div",{id:`${m||"deckgl"}-wrapper`,ref:s,style:_},[e,t])}return c=!1,o.control})),vr=_r},85855:(t,e,n)=>{"use strict";n.d(e,{Gv:()=>o,H1:()=>d,Pe:()=>h,Sv:()=>c,Td:()=>l,aC:()=>s,qf:()=>u,xZ:()=>a});const i=t=>"boolean"===typeof t,r=t=>"function"===typeof t,o=t=>null!==t&&"object"===typeof t,s=t=>o(t)&&t.constructor==={}.constructor,a=t=>Boolean(t)&&"function"===typeof t[Symbol.iterator],l=t=>t&&"function"===typeof t[Symbol.asyncIterator],c=t=>"undefined"!==typeof Response&&t instanceof Response||t&&t.arrayBuffer&&t.text&&t.json,u=t=>"undefined"!==typeof Blob&&t instanceof Blob,h=t=>t&&"object"===typeof t&&t.isBuffer,d=t=>(t=>"undefined"!==typeof ReadableStream&&t instanceof ReadableStream||o(t)&&r(t.tee)&&r(t.cancel)&&r(t.getReader))(t)||(t=>o(t)&&r(t.read)&&r(t.pipe)&&i(t.readable))(t)},70889:(t,e,n)=>{"use strict";n.d(e,{H:()=>ct});var i=n(85855),r=n(81183);let o="";const s={};class a extends Error{constructor(t,e){super(t),this.reason=e.reason,this.url=e.url,this.response=e.response}reason;url;response}const l=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,c=/^([-\w.]+\/[-\w.+]+)/;function u(t,e){return t.toLowerCase()===e.toLowerCase()}function h(t){const e=l.exec(t);return e?e[1]:""}const d=/\?.*/;function p(t){return t.replace(d,"")}function f(t){if((0,i.Sv)(t)){return t.url}if((0,i.qf)(t)){return t.name||""}return"string"===typeof t?t:""}function A(t){if((0,i.Sv)(t)){const e=t,n=e.headers.get("content-type")||"",i=p(e.url);return function(t){const e=c.exec(t);return e?e[1]:t}(n)||h(i)}if((0,i.qf)(t)){return t.type||""}return"string"===typeof t?h(t):""}async function g(t){if((0,i.Sv)(t))return t;const e={},n=function(t){if((0,i.Sv)(t))return t.headers["content-length"]||-1;if((0,i.qf)(t))return t.size;return"string"===typeof t?t.length:t instanceof ArrayBuffer||ArrayBuffer.isView(t)?t.byteLength:-1}(t);n>=0&&(e["content-length"]=String(n));const r=f(t),o=A(t);o&&(e["content-type"]=o);const s=await async function(t){const e=5;if("string"===typeof t)return`data:,${t.slice(0,e)}`;if(t instanceof Blob){const e=t.slice(0,5);return await new Promise((t=>{const n=new FileReader;n.onload=e=>t(e?.target?.result),n.readAsDataURL(e)}))}if(t instanceof ArrayBuffer){return`data:base64,${function(t){let e="";const n=new Uint8Array(t);for(let i=0;i<n.byteLength;i++)e+=String.fromCharCode(n[i]);return btoa(e)}(t.slice(0,e))}`}return null}(t);s&&(e["x-first-bytes"]=s),"string"===typeof t&&(t=(new TextEncoder).encode(t));const a=new Response(t,{headers:e});return Object.defineProperty(a,"url",{value:r}),a}async function m(t){if(!t.ok){const e=await async function(t){const n=function(t){if(t.length<50)return t;const e=t.slice(t.length-15);return`${t.substr(0,32)}...${e}`}(t.url);let i=`Failed to fetch resource (${t.status}) ${t.statusText}: ${n}`;i=i.length>100?`${i.slice(0,100)}...`:i;const r={reason:t.statusText,url:t.url,response:t};try{const e=t.headers.get("Content-Type");r.reason=e?.includes("application/json")?await t.json():t.text()}catch(e){}return new a(i,r)}(t);throw e}}async function y(t,e){if("string"===typeof t){const n=function(t){for(const e in s)if(t.startsWith(e)){const n=s[e];t=t.replace(e,n)}return t.startsWith("http://")||t.startsWith("https://")||(t=`${o}${t}`),t}(t);return function(t){return!function(t){return t.startsWith("http:")||t.startsWith("https:")}(t)&&!function(t){return t.startsWith("data:")}(t)}(n)&&globalThis.loaders?.fetchNode?globalThis.loaders?.fetchNode(n,e):await fetch(n,e)}return await g(t)}var _=n(65190);function v(t,e){const n=(0,_.pp)(),r=t||n;return"function"===typeof r.fetch?r.fetch:(0,i.Gv)(r.fetch)?t=>y(t,r.fetch):e?.fetch?e?.fetch:y}var b=n(69213);class x{terminate(){}}var w=n(69727);const E=new Map;function C(t){(0,w.v)(t.source&&!t.url||!t.source&&t.url);let e=E.get(t.source||t.url);return e||(t.url&&(e=function(t){if(!t.startsWith("http"))return t;return T((e=t,`try {\n importScripts('${e}');\n} catch (error) {\n console.error(error);\n throw error;\n}`));var e}(t.url),E.set(t.url,e)),t.source&&(e=T(t.source),E.set(t.source,e))),(0,w.v)(e),e}function T(t){const e=new Blob([t],{type:"application/javascript"});return URL.createObjectURL(e)}function S(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2?arguments[2]:void 0;const i=n||new Set;if(t){if(P(t))i.add(t);else if(P(t.buffer))i.add(t.buffer);else if(ArrayBuffer.isView(t));else if(e&&"object"===typeof t)for(const r in t)S(t[r],e,i)}else;return void 0===n?Array.from(i):[]}function P(t){return!!t&&(t instanceof ArrayBuffer||("undefined"!==typeof MessagePort&&t instanceof MessagePort||("undefined"!==typeof ImageBitmap&&t instanceof ImageBitmap||"undefined"!==typeof OffscreenCanvas&&t instanceof OffscreenCanvas)))}const M=()=>{};class I{name;source;url;terminated=!1;worker;onMessage;onError;_loadableURL="";static isSupported(){return"undefined"!==typeof Worker&&b.Bd||"undefined"!==typeof x&&!b.Bd}constructor(t){const{name:e,source:n,url:i}=t;(0,w.v)(n||i),this.name=e,this.source=n,this.url=i,this.onMessage=M,this.onError=t=>console.log(t),this.worker=b.Bd?this._createBrowserWorker():this._createNodeWorker()}destroy(){this.onMessage=M,this.onError=M,this.worker.terminate(),this.terminated=!0}get isRunning(){return Boolean(this.onMessage)}postMessage(t,e){e=e||S(t),this.worker.postMessage(t,e)}_getErrorFromErrorEvent(t){let e="Failed to load ";return e+=`worker ${this.name} from ${this.url}. `,t.message&&(e+=`${t.message} in `),t.lineno&&(e+=`:${t.lineno}:${t.colno}`),new Error(e)}_createBrowserWorker(){this._loadableURL=C({source:this.source,url:this.url});const t=new Worker(this._loadableURL,{name:this.name});return t.onmessage=t=>{t.data?this.onMessage(t.data):this.onError(new Error("No data received"))},t.onerror=t=>{this.onError(this._getErrorFromErrorEvent(t)),this.terminated=!0},t.onmessageerror=t=>console.error(t),t}_createNodeWorker(){let t;if(this.url){const e=this.url.includes(":/")||this.url.startsWith("/")?this.url:`./${this.url}`;t=new x(e,{eval:!1})}else{if(!this.source)throw new Error("no worker");t=new x(this.source,{eval:!0})}return t.on("message",(t=>{this.onMessage(t)})),t.on("error",(t=>{this.onError(t)})),t.on("exit",(t=>{})),t}}class B{name;workerThread;isRunning=!0;result;_resolve=()=>{};_reject=()=>{};constructor(t,e){this.name=t,this.workerThread=e,this.result=new Promise(((t,e)=>{this._resolve=t,this._reject=e}))}postMessage(t,e){this.workerThread.postMessage({source:"loaders.gl",type:t,payload:e})}done(t){(0,w.v)(this.isRunning),this.isRunning=!1,this._resolve(t)}error(t){(0,w.v)(this.isRunning),this.isRunning=!1,this._reject(t)}}class R{name="unnamed";source;url;maxConcurrency=1;maxMobileConcurrency=1;onDebug=()=>{};reuseWorkers=!0;props={};jobQueue=[];idleQueue=[];count=0;isDestroyed=!1;static isSupported(){return I.isSupported()}constructor(t){this.source=t.source,this.url=t.url,this.setProps(t)}destroy(){this.idleQueue.forEach((t=>t.destroy())),this.isDestroyed=!0}setProps(t){this.props={...this.props,...t},void 0!==t.name&&(this.name=t.name),void 0!==t.maxConcurrency&&(this.maxConcurrency=t.maxConcurrency),void 0!==t.maxMobileConcurrency&&(this.maxMobileConcurrency=t.maxMobileConcurrency),void 0!==t.reuseWorkers&&(this.reuseWorkers=t.reuseWorkers),void 0!==t.onDebug&&(this.onDebug=t.onDebug)}async startJob(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(t,e,n)=>t.done(n),n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:(t,e)=>t.error(e);const i=new Promise((i=>(this.jobQueue.push({name:t,onMessage:e,onError:n,onStart:i}),this)));return this._startQueuedJob(),await i}async _startQueuedJob(){if(!this.jobQueue.length)return;const t=this._getAvailableWorker();if(!t)return;const e=this.jobQueue.shift();if(e){this.onDebug({message:"Starting job",name:e.name,workerThread:t,backlog:this.jobQueue.length});const i=new B(e.name,t);t.onMessage=t=>e.onMessage(i,t.type,t.payload),t.onError=t=>e.onError(i,t),e.onStart(i);try{await i.result}catch(n){console.error(`Worker exception: ${n}`)}finally{this.returnWorkerToQueue(t)}}}returnWorkerToQueue(t){!b.Bd||this.isDestroyed||!this.reuseWorkers||this.count>this._getMaxConcurrency()?(t.destroy(),this.count--):this.idleQueue.push(t),this.isDestroyed||this._startQueuedJob()}_getAvailableWorker(){if(this.idleQueue.length>0)return this.idleQueue.shift()||null;if(this.count<this._getMaxConcurrency()){this.count++;const t=`${this.name.toLowerCase()} (#${this.count} of ${this.maxConcurrency})`;return new I({name:t,source:this.source,url:this.url})}return null}_getMaxConcurrency(){return b.Fr?this.maxMobileConcurrency:this.maxConcurrency}}const L={maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:!0,onDebug:()=>{}};class O{props;workerPools=new Map;static _workerFarm;static isSupported(){return I.isSupported()}static getWorkerFarm(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return O._workerFarm=O._workerFarm||new O({}),O._workerFarm.setProps(t),O._workerFarm}constructor(t){this.props={...L},this.setProps(t),this.workerPools=new Map}destroy(){for(const t of this.workerPools.values())t.destroy();this.workerPools=new Map}setProps(t){this.props={...this.props,...t};for(const e of this.workerPools.values())e.setProps(this._getWorkerPoolProps())}getWorkerPool(t){const{name:e,source:n,url:i}=t;let r=this.workerPools.get(e);return r||(r=new R({name:e,source:n,url:i}),r.setProps(this._getWorkerPoolProps()),this.workerPools.set(e,r)),r}_getWorkerPoolProps(){return{maxConcurrency:this.props.maxConcurrency,maxMobileConcurrency:this.props.maxMobileConcurrency,reuseWorkers:this.props.reuseWorkers,onDebug:this.props.onDebug}}}var D=n(67241);async function k(t,e,n,i,r){const o=t.id,s=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=e[t.id]||{},i=b.Bd?`${t.id}-worker.js`:`${t.id}-worker-node.js`;let r=n.workerUrl;if(r||"compression"!==t.id||(r=e.workerUrl),"test"===e._workerType&&(r=b.Bd?`modules/${t.module}/dist/${i}`:`modules/${t.module}/src/workers/${t.id}-worker-node.ts`),!r){let e=t.version;"latest"===e&&(e=D.x);const n=e?`@${e}`:"";r=`https://unpkg.com/@loaders.gl/${t.module}${n}/dist/${i}`}return(0,w.v)(r),r}(t,n),a=O.getWorkerFarm(n).getWorkerPool({name:o,url:s});n=JSON.parse(JSON.stringify(n)),i=JSON.parse(JSON.stringify(i||{}));const l=await a.startJob("process-on-worker",F.bind(null,r));l.postMessage("process",{input:e,options:n,context:i});const c=await l.result;return await c.result}async function F(t,e,n,i){switch(n){case"done":e.done(i);break;case"error":e.error(new Error(i.error));break;case"process":const{id:o,input:s,options:a}=i;try{const n=await t(s,a);e.postMessage("done",{id:o,result:n})}catch(r){const t=r instanceof Error?r.message:"unknown error";e.postMessage("error",{id:o,error:t})}break;default:console.warn(`parse-with-worker unknown message ${n}`)}}var N=n(59328),z=n(5738);const U=262144;const G=262144;const V=1048576;var j=n(24814);function H(t){if((e=t)&&"object"===typeof e&&e.isBuffer)return t;var e;if(t instanceof ArrayBuffer)return t;if(ArrayBuffer.isView(t))return 0===t.byteOffset&&t.byteLength===t.buffer.byteLength?t.buffer:t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength);if("string"===typeof t){const e=t;return(new TextEncoder).encode(e).buffer}if(t&&"object"===typeof t&&t._toArrayBuffer)return t._toArrayBuffer();throw new Error("toArrayBuffer")}function W(t,e){return j.Bd?async function*(t,e){const n=t.getReader();let i;try{for(;;){const t=i||n.read();e?._streamReadAhead&&(i=n.read());const{done:r,value:o}=await t;if(r)return;yield H(o)}}catch(r){n.releaseLock()}}(t,e):async function*(t){for await(const e of t)yield H(e)}(t)}function q(t,e){if("string"===typeof t)return function*(t,e){const n=e?.chunkSize||U;let i=0;const r=new TextEncoder;for(;i<t.length;){const e=Math.min(t.length-i,n),o=t.slice(i,i+e);i+=e,yield r.encode(o)}}(t,e);if(t instanceof ArrayBuffer)return function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function*(){const{chunkSize:n=G}=e;let i=0;for(;i<t.byteLength;){const e=Math.min(t.byteLength-i,n),r=new ArrayBuffer(e),o=new Uint8Array(t,i,e);new Uint8Array(r).set(o),i+=e,yield r}}()}(t,e);if((0,i.qf)(t))return async function*(t,e){const n=e?.chunkSize||V;let i=0;for(;i<t.size;){const e=i+n,r=await t.slice(i,e).arrayBuffer();i=e,yield r}}(t,e);if((0,i.H1)(t))return W(t,e);if((0,i.Sv)(t)){return W(t.body,e)}throw new Error("makeIterator")}const Z="Cannot convert supplied data type";async function X(t,e,n){const r=t instanceof ArrayBuffer||ArrayBuffer.isView(t);if("string"===typeof t||r)return function(t,e){if(e.text&&"string"===typeof t)return t;if((0,i.Pe)(t)&&(t=t.buffer),t instanceof ArrayBuffer){const n=t;return e.text&&!e.binary?new TextDecoder("utf8").decode(n):n}if(ArrayBuffer.isView(t)){if(e.text&&!e.binary)return new TextDecoder("utf8").decode(t);let n=t.buffer;const i=t.byteLength||t.length;return 0===t.byteOffset&&i===n.byteLength||(n=n.slice(t.byteOffset,t.byteOffset+i)),n}throw new Error(Z)}(t,e);if((0,i.qf)(t)&&(t=await g(t)),(0,i.Sv)(t)){const n=t;return await m(n),e.binary?await n.arrayBuffer():await n.text()}if((0,i.H1)(t)&&(t=q(t,n)),(0,i.xZ)(t)||(0,i.Td)(t))return async function(t){const e=[];for await(const n of t)e.push(n);return(0,z.AQ)(...e)}(t);throw new Error(Z)}var K=n(19804);function Q(t,e,n){if(n)return n;const i={fetch:v(e,t),...t};if(i.url){const t=p(i.url);i.baseUrl=t,i.queryString=function(t){const e=t.match(d);return e&&e[0]}(i.url),i.filename=K.iW(t),i.baseUrl=K.pD(t)}return Array.isArray(i.loaders)||(i.loaders=null),i}const J=new(n(24990).t)({id:"loaders.gl"});var Y=n(78477);const $=/\.([^.]+)$/;function tt(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0;if(!et(t))return null;if(e&&!Array.isArray(e))return(0,r.D)(e);let o=[];e&&(o=o.concat(e)),n?.ignoreRegisteredLoaders||o.push(...(0,Y.Ph)()),function(t){for(const e of t)(0,r.D)(e)}(o);const s=function(t,e,n,i){const r=f(t),o=A(t),s=p(r)||i?.url;let a=null,l="";n?.mimeType&&(a=it(e,n?.mimeType),l=`match forced by supplied MIME type ${n?.mimeType}`);a=a||function(t,e){const n=e&&$.exec(e),i=n&&n[1];return i?function(t,e){e=e.toLowerCase();for(const n of t)for(const t of n.extensions)if(t.toLowerCase()===e)return n;return null}(t,i):null}(e,s),l=l||(a?`matched url ${s}`:""),a=a||it(e,o),l=l||(a?`matched MIME type ${o}`:""),a=a||function(t,e){if(!e)return null;for(const n of t)if("string"===typeof e){if(rt(e,n))return n}else if(ArrayBuffer.isView(e)){if(ot(e.buffer,e.byteOffset,n))return n}else if(e instanceof ArrayBuffer){if(ot(e,0,n))return n}return null}(e,t),l=l||(a?`matched initial data ${st(t)}`:""),n?.fallbackMimeType&&(a=a||it(e,n?.fallbackMimeType),l=l||(a?`matched fallback MIME type ${o}`:""));l&&J.log(1,`selectLoader selected ${a?.name}: ${l}.`);return a}(t,o,n,i);if(!s&&!n?.nothrow)throw new Error(nt(t));return s}function et(t){return!(t instanceof Response&&204===t.status)}function nt(t){const e=f(t),n=A(t);let i="No valid loader found (";i+=e?`${K.iW(e)}, `:"no url provided, ",i+=`MIME type: ${n?`"${n}"`:"not provided"}, `;const r=t?st(t):"";return i+=r?` first bytes: "${r}"`:"first bytes: not available",i+=")",i}function it(t,e){for(const n of t){if(n.mimeTypes?.some((t=>u(e,t))))return n;if(u(e,`application/x.${n.id}`))return n}return null}function rt(t,e){if(e.testText)return e.testText(t);return(Array.isArray(e.tests)?e.tests:[e.tests]).some((e=>t.startsWith(e)))}function ot(t,e,n){return(Array.isArray(n.tests)?n.tests:[n.tests]).some((n=>function(t,e,n,i){if(i instanceof ArrayBuffer)return(0,z.YV)(i,t,i.byteLength);switch(typeof i){case"function":return i(t);case"string":return i===at(t,e,i.length);default:return!1}}(t,e,0,n)))}function st(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5;if("string"===typeof t)return t.slice(0,e);if(ArrayBuffer.isView(t))return at(t.buffer,t.byteOffset,e);if(t instanceof ArrayBuffer){return at(t,0,e)}return""}function at(t,e,n){if(t.byteLength<e+n)return"";const i=new DataView(t);let r="";for(let o=0;o<n;o++)r+=String.fromCharCode(i.getUint8(e+o));return r}async function lt(t,e,n,o){!e||Array.isArray(e)||(0,r.l)(e)||(o=void 0,n=e,e=void 0),n=n||{};const s=f(t=await t),a=function(t,e){if(t&&!Array.isArray(t))return t;let n;if(t&&(n=Array.isArray(t)?t:[t]),e&&e.loaders){const t=Array.isArray(e.loaders)?e.loaders:[e.loaders];n=n?[...n,...t]:t}return n&&n.length?n:void 0}(e,o),l=await async function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;if(!et(t))return null;let o=tt(t,e,{...n,nothrow:!0},r);if(o)return o;if((0,i.qf)(t)&&(o=tt(t=await t.slice(0,10).arrayBuffer(),e,n,r)),!o&&!n?.nothrow)throw new Error(nt(t));return o}(t,a,n);return l?(o=Q({url:s,_parse:lt,loaders:a},n=(0,_.a5)(n,l,a,s),o||null),await async function(t,e,n,r){if(function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:D.Q;(0,w.v)(t,"no worker provided");const n=t.version}(t),n=(0,N.y)(t.options,n),(0,i.Sv)(e)){const t=e,{ok:n,redirected:i,status:o,statusText:s,type:a,url:l}=t,c=Object.fromEntries(t.headers.entries());r.response={headers:c,ok:n,redirected:i,status:o,statusText:s,type:a,url:l}}e=await X(e,t,n);const o=t;if(o.parseTextSync&&"string"===typeof e)return o.parseTextSync(e,n,r);if(function(t,e){return!!O.isSupported()&&!(!b.Bd&&!e?._nodeWorkers)&&t.worker&&e?.worker}(t,n))return await k(t,e,n,r,lt);if(o.parseText&&"string"===typeof e)return await o.parseText(e,n,r);if(o.parse)return await o.parse(e,n,r);throw(0,w.v)(!o.parseSync),new Error(`${t.id} loader - no parser found and worker is disabled`)}(l,t,n,o)):null}async function ct(t,e,n,o){let s,a;Array.isArray(e)||(0,r.l)(e)?(s=e,a=n):(s=[],a=e);const l=v(a);let c=t;return"string"===typeof t&&(c=await l(t)),(0,i.qf)(t)&&(c=await l(t)),Array.isArray(s),await lt(c,s,a)}},78477:(t,e,n)=>{"use strict";n.d(e,{Ph:()=>a,mk:()=>s});var i=n(81183),r=n(65190);const o=()=>{const t=(0,r.K2)();return t.loaderRegistry=t.loaderRegistry||[],t.loaderRegistry};function s(t){const e=o();t=Array.isArray(t)?t:[t];for(const n of t){const t=(0,i.D)(n);e.find((e=>t===e))||e.unshift(t)}}function a(){return o()}},81183:(t,e,n)=>{"use strict";n.d(e,{D:()=>o,l:()=>r});var i=n(21402);function r(t){if(!t)return!1;Array.isArray(t)&&(t=t[0]);return Array.isArray(t?.extensions)}function o(t){let e;return(0,i.v)(t,"null loader"),(0,i.v)(r(t),"invalid loader"),Array.isArray(t)&&(e=t[1],t=t[0],t={...t,options:{...t.options,...e}}),(t?.parseTextSync||t?.parseText)&&(t.text=!0),t.text||(t.binary=!0),t}},65190:(t,e,n)=>{"use strict";n.d(e,{pp:()=>u,K2:()=>c,a5:()=>h});var i=n(85855);const r=new(n(24990).t)({id:"loaders.gl"});class o{log(){return()=>{}}info(){return()=>{}}warn(){return()=>{}}error(){return()=>{}}}var s=n(24814);const a={fetch:null,mimeType:void 0,nothrow:!1,log:new class{console;constructor(){this.console=console}log(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return this.console.log.bind(this.console,...e)}info(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return this.console.info.bind(this.console,...e)}warn(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return this.console.warn.bind(this.console,...e)}error(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return this.console.error.bind(this.console,...e)}},useLocalLibraries:!1,CDN:"https://unpkg.com/@loaders.gl",worker:!0,maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:s.Bd,_nodeWorkers:!1,_workerType:"",limit:0,_limitMB:0,batchSize:"auto",batchDebounceMs:0,metadata:!1,transforms:[]},l={throws:"nothrow",dataType:"(no longer used)",uri:"baseUri",method:"fetch.method",headers:"fetch.headers",body:"fetch.body",mode:"fetch.mode",credentials:"fetch.credentials",cache:"fetch.cache",redirect:"fetch.redirect",referrer:"fetch.referrer",referrerPolicy:"fetch.referrerPolicy",integrity:"fetch.integrity",keepalive:"fetch.keepalive",signal:"fetch.signal"};function c(){globalThis.loaders=globalThis.loaders||{};const{loaders:t}=globalThis;return t._state||(t._state={}),t._state}function u(){const t=c();return t.globalOptions=t.globalOptions||{...a},t.globalOptions}function h(t,e,n,i){return n=n||[],function(t,e){d(t,null,a,l,e);for(const n of e){const i=t&&t[n.id]||{},r=n.options&&n.options[n.id]||{},o=n.deprecatedOptions&&n.deprecatedOptions[n.id]||{};d(i,n.id,r,o,e)}}(t,n=Array.isArray(n)?n:[n]),f(e,t,i)}function d(t,e,n,o,s){const a=e||"Top level",l=e?`${e}.`:"";for(const c in t){const u=!e&&(0,i.Gv)(t[c]);if(!(c in n)&&!("baseUri"===c&&!e)&&!("workerUrl"===c&&e))if(c in o)r.warn(`${a} loader option '${l}${c}' no longer supported, use '${o[c]}'`)();else if(!u){const t=p(c,s);r.warn(`${a} loader option '${l}${c}' not recognized. ${t}`)()}}}function p(t,e){const n=t.toLowerCase();let i="";for(const r of e)for(const e in r.options){if(t===e)return`Did you mean '${r.id}.${e}'?`;const o=e.toLowerCase();(n.startsWith(o)||o.startsWith(n))&&(i=i||`Did you mean '${r.id}.${e}'?`)}return i}function f(t,e,n){const i={...t.options||{}};return function(t,e){e&&!("baseUri"in t)&&(t.baseUri=e)}(i,n),null===i.log&&(i.log=new o),A(i,u()),A(i,e),i}function A(t,e){for(const n in e)if(n in e){const r=e[n];(0,i.aC)(r)&&(0,i.aC)(t[n])?t[n]={...t[n],...e[n]}:t[n]=e[n]}}},34679:(t,e,n)=>{"use strict";function i(t,e){if(!t)throw new Error("null row");const n={};if(e)for(let i=0;i<e.length;i++)n[e[i]]=t[i];else for(let i=0;i<t.length;i++){n[`column-${i}`]=t[i]}return n}function r(t,e){if(!t)throw new Error("null row");if(e){const n=new Array(e.length);for(let i=0;i<e.length;i++)n[i]=t[e[i]];return n}return Object.values(t)}n.d(e,{y:()=>E
vendor: 6,196 bytes, line 2
2});class o extends Array{enqueue(t){return this.push(t)}dequeue(){return this.shift()}}class s{_values;_settlers;_closed;constructor(){this._values=new o,this._settlers=new o,this._closed=!1}close(){for(;this._settlers.length>0;)this._settlers.dequeue().resolve({done:!0});this._closed=!0}[Symbol.asyncIterator](){return this}enqueue(t){if(this._closed)throw new Error("Closed");if(this._settlers.length>0){if(this._values.length>0)throw new Error("Illegal internal state");const e=this._settlers.dequeue();t instanceof Error?e.reject(t):e.resolve({value:t})}else this._values.enqueue(t)}next(){if(this._values.length>0){const t=this._values.dequeue();return t instanceof Error?Promise.reject(t):Promise.resolve({value:t})}if(this._closed){if(this._settlers.length>0)throw new Error("Illegal internal state");return Promise.resolve({done:!0})}return new Promise(((t,e)=>{this._settlers.enqueue({resolve:t,reject:e})}))}}class a{schema;options;shape;length=0;rows=null;cursor=0;_headers=[];constructor(t,e){if(this.options=e,this.schema=t,!Array.isArray(t)){this._headers=[];for(const e in t)this._headers[t[e].index]=t[e].name}}rowCount(){return this.length}addArrayRow(t,e){Number.isFinite(e)&&(this.cursor=e),this.shape="array-row-table",this.rows=this.rows||new Array(100),this.rows[this.length]=t,this.length++}addObjectRow(t,e){Number.isFinite(e)&&(this.cursor=e),this.shape="object-row-table",this.rows=this.rows||new Array(100),this.rows[this.length]=t,this.length++}getBatch(){let t=this.rows;if(!t)return null;t=t.slice(0,this.length),this.rows=null;return{shape:this.shape||"array-row-table",batchType:"data",data:t,length:this.length,schema:this.schema,cursor:this.cursor}}}class l{schema;options;length=0;objectRows=null;arrayRows=null;cursor=0;_headers=null;constructor(t,e){if(this.options=e,this.schema=t,t){this._headers=[];for(const e in t)this._headers[t[e].index]=t[e].name}}rowCount(){return this.length}addArrayRow(t,e){switch(Number.isFinite(e)&&(this.cursor=e),this._headers||=function(t){const e=[];for(let n=0;n<t.length;n++){const t=`column-${n}`;e.push(t)}return e}(t),this.options.shape){case"object-row-table":const n=i(t,this._headers);this.addObjectRow(n,e);break;case"array-row-table":this.arrayRows=this.arrayRows||new Array(100),this.arrayRows[this.length]=t,this.length++}}addObjectRow(t,e){switch(Number.isFinite(e)&&(this.cursor=e),this._headers||=function(t){return Object.keys(t)}(t),this.options.shape){case"array-row-table":const n=r(t,this._headers);this.addArrayRow(n,e);break;case"object-row-table":this.objectRows=this.objectRows||new Array(100),this.objectRows[this.length]=t,this.length++}}getBatch(){let t=this.arrayRows||this.objectRows;return t?(t=t.slice(0,this.length),this.arrayRows=null,this.objectRows=null,{shape:this.options.shape,batchType:"data",data:t,length:this.length,schema:this.schema,cursor:this.cursor}):null}}class c{schema;length=0;allocated=0;columns={};constructor(t,e){this.schema=t,this._reallocateColumns()}rowCount(){return this.length}addArrayRow(t){this._reallocateColumns();let e=0;for(const n in this.columns)this.columns[n][this.length]=t[e++];this.length++}addObjectRow(t){this._reallocateColumns();for(const e in t)this.columns[e][this.length]=t[e];this.length++}getBatch(){this._pruneColumns();const t=Array.isArray(this.schema)?this.columns:{};if(!Array.isArray(this.schema))for(const e in this.schema){const n=this.schema[e];t[n.name]=this.columns[n.index]}this.columns={};return{shape:"columnar-table",batchType:"data",data:t,schema:this.schema,length:this.length}}_reallocateColumns(){if(!(this.length<this.allocated)){this.allocated=this.allocated>0?this.allocated*=2:100,this.columns={};for(const t in this.schema){const e=this.schema[t],n=e.type||Float32Array,i=this.columns[e.index];if(i&&ArrayBuffer.isView(i)){const t=new n(this.allocated);t.set(i),this.columns[e.index]=t}else i?(i.length=this.allocated,this.columns[e.index]=i):this.columns[e.index]=new n(this.allocated)}}}_pruneColumns(){for(const[t,e]of Object.entries(this.columns))this.columns[t]=e.slice(0,this.length)}}const u={shape:void 0,batchSize:"auto",batchDebounceMs:0,limit:0,_limitMB:0};class h{schema;options;aggregator=null;batchCount=0;bytesUsed=0;isChunkComplete=!1;lastBatchEmittedMs=Date.now();totalLength=0;totalBytes=0;rowBytes=0;static ArrowBatch;constructor(t,e){this.schema=t,this.options={...u,...e}}limitReached(){return!!(Boolean(this.options?.limit)&&this.totalLength>=this.options.limit)||!!(Boolean(this.options?._limitMB)&&this.totalBytes/1e6>=this.options._limitMB)}addRow(t){this.limitReached()||(this.totalLength++,this.rowBytes=this.rowBytes||this._estimateRowMB(t),this.totalBytes+=this.rowBytes,Array.isArray(t)?this.addArrayRow(t):this.addObjectRow(t))}addArrayRow(t){if(!this.aggregator){const t=this._getTableBatchType();this.aggregator=new t(this.schema,this.options)}this.aggregator.addArrayRow(t)}addObjectRow(t){if(!this.aggregator){const t=this._getTableBatchType();this.aggregator=new t(this.schema,this.options)}this.aggregator.addObjectRow(t)}chunkComplete(t){t instanceof ArrayBuffer&&(this.bytesUsed+=t.byteLength),"string"===typeof t&&(this.bytesUsed+=t.length),this.isChunkComplete=!0}getFullBatch(t){return this._isFull()?this._getBatch(t):null}getFinalBatch(t){return this._getBatch(t)}_estimateRowMB(t){return Array.isArray(t)?8*t.length:8*Object.keys(t).length}_isFull(){if(!this.aggregator||0===this.aggregator.rowCount())return!1;if("auto"===this.options.batchSize){if(!this.isChunkComplete)return!1}else if(this.options.batchSize>this.aggregator.rowCount())return!1;return!(this.options.batchDebounceMs>Date.now()-this.lastBatchEmittedMs)&&(this.isChunkComplete=!1,this.lastBatchEmittedMs=Date.now(),!0)}_getBatch(t){if(!this.aggregator)return null;t?.bytesUsed&&(this.bytesUsed=t.bytesUsed);const e=this.aggregator.getBatch();return e.count=this.batchCount,e.bytesUsed=this.bytesUsed,Object.assign(e,t),this.batchCount++,this.aggregator=null,e}_getTableBatchType(){switch(this.options.shape){case"array-row-table":case"object-row-table":return l;case"columnar-table":return c;case"arrow-table":if(!h.ArrowBatch)throw new Error("TableBatchBuilder");return h.ArrowBatch;default:return a}}}c
2onst d={parse:function(t,e,n){var i=(e=e||{}).dynamicTyping||!1;v(i)&&(e.dynamicTypingFunction=i,i={});if(e.dynamicTyping=i,e.transform=!!v(e.transform)&&e.transform,e.worker&&d.WORKERS_SUPPORTED){var r=newWorker();return r.userStep=e.step,r.userChunk=e.chunk,r.userComplete=e.complete,r.userError=e.error,e.step=v(e.step),e.chunk=v(e.chunk),e.complete=v(e.complete),e.error=v(e.error),delete e.worker,void r.postMessage({input:t,config:e,workerId:r.id})}var o=null;"string"===typeof t&&(o=new A(e));o||(o=new n(e));return o.stream(t)},unparse:function(t,e){var n=!1,i=!0,r=",",o="\r\n",s='"',a=s+s,l=!1,c=null;!function(){if("object"!==typeof e)return;"string"!==typeof e.delimiter||d.BAD_DELIMITERS.filter((function(t){return-1!==e.delimiter.indexOf(t)})).length||(r=e.delimiter);("boolean"===typeof e.quotes||Array.isArray(e.quotes))&&(n=e.quotes);"boolean"!==typeof e.skipEmptyLines&&"string"!==typeof e.skipEmptyLines||(l=e.skipEmptyLines);"string"===typeof e.newline&&(o=e.newline);"string"===typeof e.quoteChar&&(s=e.quoteChar);"boolean"===typeof e.header&&(i=e.header);if(Array.isArray(e.columns)){if(0===e.columns.length)throw new Error("Option columns is empty");c=e.columns}void 0!==e.escapeChar&&(a=e.escapeChar+s)}();var u=new RegExp(m(s),"g");"string"===typeof t&&(t=JSON.parse(t));if(Array.isArray(t)){if(!t.length||Array.isArray(t[0]))return p(null,t,l);if("object"===typeof t[0])return p(c||h(t[0]),t,l)}else if("object"===typeof t)return"string"===typeof t.data&&(t.data=JSON.parse(t.data)),Array.isArray(t.data)&&(t.fields||(t.fields=t.meta&&t.meta.fields),t.fields||(t.fields=Array.isArray(t.data[0])?t.fields:h(t.data[0])),Array.isArray(t.data[0])||"object"===typeof t.data[0]||(t.data=[t.data])),p(t.fields||[],t.data||[],l);throw new Error("Unable to serialize unrecognized input");function h(t){if("object"!==typeof t)return[];var e=[];for(var n in t)e.push(n);return e}function p(t,e,n){var s="";"string"===typeof t&&(t=JSON.parse(t)),"string"===typeof e&&(e=JSON.parse(e));var a=Array.isArray(t)&&t.length>0,l=!Array.isArray(e[0]);if(a&&i){for(var c=0;c<t.length;c++)c>0&&(s+=r),s+=f(t[c],c);e.length>0&&(s+=o)}for(var u=0;u<e.length;u++){var h=a?t.length:e[u].length,d=!1,p=a?0===Object.keys(e[u]).length:0===e[u].length;if(n&&!a&&(d="greedy"===n?""===e[u].join("").trim():1===e[u].length&&0===e[u][0].length),"greedy"===n&&a){for(var A=[],g=0;g<h;g++){var m=l?t[g]:g;A.push(e[u][m])}d=""===A.join("").trim()}if(!d){for(var y=0;y<h;y++){y>0&&!p&&(s+=r);var _=a&&l?t[y]:y;s+=f(e[u][_],y)}u<e.length-1&&(!n||h>0&&!p)&&(s+=o)}}return s}function f(t,e){if("undefined"===typeof t||null===t)return"";if(t.constructor===Date)return JSON.stringify(t).slice(1,25);t=t.toString().replace(u,a);var i="boolean"===typeof n&&n||Array.isArray(n)&&n[e]||function(t,e){for(var n=0;n<e.length;n++)if(t.indexOf(e[n])>-1)return!0;return!1}(t,d.BAD_DELIMITERS)||t.indexOf(r)>-1||" "===t.charAt(0)||" "===t.charAt(t.length-1);return i?s+t+s:t}},RECORD_SEP:String.fromCharCode(30),UNIT_SEP:String.fromCharCode(31),BYTE_ORDER_MARK:"\ufeff",BAD_DELIMITERS:["\r","\n",'"',"\ufeff"],WORKERS_SUPPORTED:!1,NODE_STREAM_INPUT:1,LocalChunkSize:10485760,RemoteChunkSize:5242880,DefaultDelimiter:",",Parser:y,ParserHandle:g,ChunkStreamer:f,StringStreamer:A},p=d;function f(t){this._handle=null,this._finished=!1,this._completed=!1,this._input=null,this._baseIndex=0,this._partialLine="",this._rowCount=0,this._start=0,this._nextChunk=null,this.isFirstChunk=!0,this._completeResults={data:[],errors:[],meta:{}},function(t){var e=_(t);e.chunkSize=parseInt(e.chunkSize),t.step||t.chunk||(e.chunkSize=null);this._handle=new g(e),this._handle.streamer=this,this._config=e}.call(this,t),this.parseChunk=function(t,e){if(this.isFirstChunk&&v(this._config.beforeFirstChunk)){var n=this._config.beforeFirstChunk(t);void 0!==n&&(t=n)}this.isFirstChunk=!1;var i=this._partialLine+t;this._partialLine="";var r=this._handle.parse(i,this._baseIndex,!this._finished);if(!this._handle.paused()&&!this._handle.aborted()){var o=r.meta.cursor;this._finished||(this._partialLine=i.substring(o-this._baseIndex),this._baseIndex=o),r&&r.data&&(this._rowCount+=r.data.length);var s=this._finished||this._config.preview&&this._rowCount>=this._config.preview;if(v(this._config.chunk)&&!e){if(this._config.chunk(r,this._handle),this._handle.paused()||this._handle.aborted())return;r=void 0,this._completeResults=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(r.data),this._completeResults.errors=this._completeResults.errors.concat(r.errors),this._completeResults.meta=r.meta),this._completed||!s||!v(this._config.complete)||r&&r.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),s||r&&r.meta.paused||this._nextChunk(),r}},this._sendError=function(t){v(this._config.error)&&this._config.error(t)}}function A(t){var e;t=t||{},f.call(this,t),this.stream=function(t){return e=t,this._nextChunk()},this._nextChunk=function(){if(!this._finished){var t=this._config.chunkSize,n=t?e.substr(0,t):e;return e=t?e.substr(t):"",this._finished=!e,this.parseChunk(n)}}}function g(t){var e,n,i,r=/^\s*-?(\d*\.?\d+|\d+\.?\d*)(e[-+]?\d+)?\s*$/i,o=/(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))/,s=this,a=0,l=0,c=!1,u=!1,h=[],p={data:[],errors:[],meta:{}};if(v(t.step)){var f=t.step;t.step=function(e){if(p=e,b())g();else{if(g(),!p.data||0===p.data.length)return;a+=e.data.length,t.preview&&a>t.preview?n.abort():f(p,s)}}}function A(e){return"greedy"===t.skipEmptyLines?""===e.join("").trim():1===e.length&&0===e[0].length}function g(){if(p&&i&&(w("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+d.DefaultDelimiter+"'"),i=!1),t.skipEmptyLines)for(var e=0;e<p.data.length;e++)A(p.data[e])&&p.data.splice(e--,1);return b()&&function(){if(!p)return;function e(e){v(t.transformHeader)&&(e=t.transformHeader(e)),h.push(e)}if(Array.isArray(p.data[0])){for(var n=0;b()&&n<p.data.length;
2n++)p.data[n].forEach(e);p.data.splice(0,1)}else p.data.forEach(e)}(),function(){if(!p||!p.data||!t.header&&!t.dynamicTyping&&!t.transform)return p;function e(e,n){var i,r=t.header?{}:[];for(i=0;i<e.length;i++){var o=i,s=e[i];t.header&&(o=i>=h.length?"__parsed_extra":h[i]),t.transform&&(s=t.transform(s,o)),s=x(o,s),"__parsed_extra"===o?(r[o]=r[o]||[],r[o].push(s)):r[o]=s}return t.header&&(i>h.length?w("FieldMismatch","TooManyFields","Too many fields: expected "+h.length+" fields but parsed "+i,l+n):i<h.length&&w("FieldMismatch","TooFewFields","Too few fields: expected "+h.length+" fields but parsed "+i,l+n)),r}var n=1;!p.data[0]||Array.isArray(p.data[0])?(p.data=p.data.map(e),n=p.data.length):p.data=e(p.data,0);t.header&&p.meta&&(p.meta.fields=h);return l+=n,p}()}function b(){return t.header&&0===h.length}function x(e,n){return function(e){return t.dynamicTypingFunction&&void 0===t.dynamicTyping[e]&&(t.dynamicTyping[e]=t.dynamicTypingFunction(e)),!0===(t.dynamicTyping[e]||t.dynamicTyping)}(e)?"true"===n||"TRUE"===n||"false"!==n&&"FALSE"!==n&&(r.test(n)?parseFloat(n):o.test(n)?new Date(n):""===n?null:n):n}function w(t,e,n,i){p.errors.push({type:t,code:e,message:n,row:i})}this.parse=function(r,o,s){var a=t.quoteChar||'"';if(t.newline||(t.newline=function(t,e){t=t.substr(0,1048576);var n=new RegExp(m(e)+"([^]*?)"+m(e),"gm");t=t.replace(n,"");var i=t.split("\r"),r=t.split("\n"),o=r.length>1&&r[0].length<i[0].length;if(1===i.length||o)return"\n";for(var s=0,a=0;a<i.length;a++)"\n"===i[a][0]&&s++;return s>=i.length/2?"\r\n":"\r"}(r,a)),i=!1,t.delimiter)v(t.delimiter)&&(t.delimiter=t.delimiter(r),p.meta.delimiter=t.delimiter);else{var l=function(e,n,i,r,o){var s,a,l;o=o||[",","\t","|",";",d.RECORD_SEP,d.UNIT_SEP];for(var c=0;c<o.length;c++){var u=o[c],h=0,p=0,f=0;l=void 0;for(var g=new y({comments:r,delimiter:u,newline:n,preview:10}).parse(e),m=0;m<g.data.length;m++)if(i&&A(g.data[m]))f++;else{var _=g.data[m].length;p+=_,"undefined"!==typeof l?_>1&&(h+=Math.abs(_-l),l=_):l=0}g.data.length>0&&(p/=g.data.length-f),("undefined"===typeof a||h>a)&&p>1.99&&(a=h,s=u)}return t.delimiter=s,{successful:!!s,bestDelimiter:s}}(r,t.newline,t.skipEmptyLines,t.comments,t.delimitersToGuess);l.successful?t.delimiter=l.bestDelimiter:(i=!0,t.delimiter=d.DefaultDelimiter),p.meta.delimiter=t.delimiter}var u=_(t);return t.preview&&t.header&&u.preview++,e=r,n=new y(u),p=n.parse(e,o,s),g(),c?{meta:{paused:!0}}:p||{meta:{paused:!1}}},this.paused=function(){return c},this.pause=function(){c=!0,n.abort(),e=e.substr(n.getCharIndex())},this.resume=function(){c=!1,s.streamer.parseChunk(e,!0)},this.aborted=function(){return u},this.abort=function(){u=!0,n.abort(),p.meta.aborted=!0,v(t.complete)&&t.complete(p),e=""}}function m(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function y(t){var e,n=(t=t||{}).delimiter,i=t.newline,r=t.comments,o=t.step,s=t.preview,a=t.fastMode,l=e=void 0===t.quoteChar?'"':t.quoteChar;if(void 0!==t.escapeChar&&(l=t.escapeChar),("string"!==typeof n||d.BAD_DELIMITERS.indexOf(n)>-1)&&(n=","),r===n)throw new Error("Comment character same as delimiter");!0===r?r="#":("string"!==typeof r||d.BAD_DELIMITERS.indexOf(r)>-1)&&(r=!1),"\n"!==i&&"\r"!==i&&"\r\n"!==i&&(i="\n");var c=0,u=!1;this.parse=function(t,h,d){if("string"!==typeof t)throw new Error("Input must be a string");var p=t.length,f=n.length,A=i.length,g=r.length,y=v(o);c=0;var _=[],b=[],x=[],w=0;if(!t)return k();if(a||!1!==a&&-1===t.indexOf(e)){for(var E=t.split(i),C=0;C<E.length;C++){if(x=E[C],c+=x.length,C!==E.length-1)c+=i.length;else if(d)return k();if(!r||x.substr(0,g)!==r){if(y){if(_=[],R(x.split(n)),F(),u)return k()}else R(x.split(n));if(s&&C>=s)return _=_.slice(0,s),k(!0)}}return k()}for(var T,S=t.indexOf(n,c),P=t.indexOf(i,c),M=new RegExp(m(l)+m(e),"g");;)if(t[c]!==e)if(r&&0===x.length&&t.substr(c,g)===r){if(-1===P)return k();c=P+A,P=t.indexOf(i,c),S=t.indexOf(n,c)}else if(-1!==S&&(S<P||-1===P))x.push(t.substring(c,S)),c=S+f,S=t.indexOf(n,c);else{if(-1===P)break;if(x.push(t.substring(c,P)),D(P+A),y&&(F(),u))return k();if(s&&_.length>=s)return k(!0)}else{for(T=c,c++;;){if(-1===(T=t.indexOf(e,T+1)))return d||b.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:_.length,index:c}),O();if(T===p-1)return O(t.substring(c,T).replace(M,e));if(e!==l||t[T+1]!==l){if(e===l||0===T||t[T-1]!==l){var I=L(-1===P?S:Math.min(S,P));if(t[T+1+I]===n){if(x.push(t.substring(c,T).replace(M,e)),c=T+1+I+f,S=t.indexOf(n,c),P=t.indexOf(i,c),y&&(F(),u))return k();if(s&&_.length>=s)return k(!0);break}var B=L(P);
vendor: 37,889 bytes, line 2
2if(t.substr(T+1+B,A)===i){if(x.push(t.substring(c,T).replace(M,e)),D(T+1+B+A),S=t.indexOf(n,c),y&&(F(),u))return k();if(s&&_.length>=s)return k(!0);break}b.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:_.length,index:c}),T++}}else T++}if(y&&(F(),u))return k();if(s&&_.length>=s)return k(!0)}return O();function R(t){_.push(t),w=c}function L(e){var n=0;if(-1!==e){var i=t.substring(T+1,e);i&&""===i.trim()&&(n=i.length)}return n}function O(e){return d||("undefined"===typeof e&&(e=t.substr(c)),x.push(e),c=p,R(x),y&&F()),k()}function D(e){c=e,R(x),x=[],P=t.indexOf(i,c)}function k(t,e){return{data:e||!1?_[0]:_,errors:b,meta:{delimiter:n,linebreak:i,aborted:u,truncated:!!t,cursor:w+(h||0)}}}function F(){o(k(void 0,!0)),_=[],b=[]}},this.abort=function(){u=!0},this.getCharIndex=function(){return c}}function _(t){if("object"!==typeof t||null===t)return t;var e=Array.isArray(t)?[]:{};for(var n in t)e[n]=_(t[n]);return e}function v(t){return"function"===typeof t}A.prototype=Object.create(A.prototype),A.prototype.constructor=A;const{ChunkStreamer:b}=p;function x(t){t=t||{},b.call(this,t),this.textDecoder=new TextDecoder(this._config.encoding),this.stream=async function(t){this._input=t;try{for await(const e of t)this.parseChunk(this.getStringChunk(e));this._finished=!0,this.parseChunk("")}catch(e){this._sendError(e)}},this._nextChunk=function(){},this.getStringChunk=function(t){return"string"===typeof t?t:this.textDecoder.decode(t,{stream:!0})}}x.prototype=Object.create(b.prototype),x.prototype.constructor=x;const w="object-row-table",E={dataType:null,batchType:null,id:"csv",module:"csv",name:"CSV",version:"4.2.4",extensions:["csv","tsv","dsv"],mimeTypes:["text/csv","text/tab-separated-values","text/dsv"],category:"table",parse:async(t,e)=>C((new TextDecoder).decode(t),e),parseText:(t,e)=>C(t,e),parseInBatches:function(t,e){"auto"===(e={...e}).batchSize&&(e.batchSize=4e3);const n={...E.options.csv,...e?.csv},i=new s;let r=!0,o=null,a=null,l=null;const c={...n,header:!1,download:!1,chunkSize:5242880,skipEmptyLines:!1,step(t){let s=t.data;if(n.skipEmptyLines){if(""===s.flat().join("").trim())return}const c=t.meta.cursor;if(r&&!o){if("auto"===n.header?T(s):Boolean(n.header))return void(o=s.map(S()))}r&&(r=!1,o||(o=P(n.columnPrefix,s.length)),l=function(t,e){const n=e?{}:[];for(let i=0;i<t.length;i++){const r=e&&e[i]||i;switch(typeof t[i]){case"number":case"boolean":n[r]={name:String(r),index:i,type:Float32Array};break;default:n[r]={name:String(r),index:i,type:Array}}}return n}(s,o)),n.optimizeMemoryUsage&&(s=JSON.parse(JSON.stringify(s)));const u=n.shape||w;a=a||new h(l,{shape:u,...e});try{a.addRow(s);const t=a&&a.getFullBatch({bytesUsed:c});t&&i.enqueue(t)}catch(d){i.enqueue(d)}},complete(t){try{const e=t.meta.cursor,n=a&&a.getFinalBatch({bytesUsed:e});n&&i.enqueue(n)}catch(e){i.enqueue(e)}i.close()}};return p.parse(t,c,x),i},options:{csv:{shape:w,optimizeMemoryUsage:!1,header:"auto",columnPrefix:"column",quoteChar:'"',escapeChar:'"',dynamicTyping:!0,comments:!1,skipEmptyLines:!0,delimitersToGuess:[",","\t","|",";"]}}};async function C(t,e){const n={...E.options.csv,...e?.csv},o=function(t){const e=p.parse(t,{download:!1,dynamicTyping:!0,preview:1});return e.data[0]}(t),s="auto"===n.header?T(o):Boolean(n.header),a={...n,header:s,download:!1,transformHeader:s?S():void 0,error:t=>{throw new Error(t)}},l=p.parse(t,a),c=l.data,u=l.meta.fields||P(n.columnPrefix,o.length),h=n.shape||w;switch(h){case"object-row-table":return{shape:"object-row-table",data:c.map((t=>Array.isArray(t)?i(t,u):t))};case"array-row-table":return{shape:"array-row-table",data:c.map((t=>Array.isArray(t)?t:r(t,u)))};default:throw new Error(h)}}function T(t){return t&&t.every((t=>"string"===typeof t))}function S(){const t=new Set;return e=>{let n=e,i=1;for(;t.has(n);)n=`${e}.${i}`,i++;return t.add(n),n}}function P(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const n=[];for(let i=0;i<e;i++)n.push(`${t}${i+1}`);return n}},46315:(t,e,n)=>{"use strict";n.d(e,{Vl:()=>_});const i="4.2.4",r={dataType:null,batchType:null,name:"Draco",id:"draco",module:"draco",version:i,worker:!0,extensions:["drc"],mimeTypes:["application/octet-stream"],binary:!0,tests:["DRACO"],options:{draco:{decoderType:"object"===typeof WebAssembly?"wasm":"js",libraryPath:"libs/",extraAttributes:{},attributeNameEntry:void 0}}};var o=n(78981);function s(t){switch(t.constructor){case Int8Array:return"int8";case Uint8Array:case Uint8ClampedArray:return"uint8";case Int16Array:return"int16";case Uint16Array:return"uint16";case Int32Array:return"int32";case Uint32Array:return"uint32";case Float32Array:return"float32";case Float64Array:return"float64";default:return"null"}}function a(t,e,n){const i=s(e.value),r=n||function(t){const e={};"byteOffset"in t&&(e.byteOffset=t.byteOffset.toString(10));"byteStride"in t&&(e.byteStride=t.byteStride.toString(10));"normalized"in t&&(e.normalized=t.normalized.toString());return e}(e);return{name:t,type:{type:"fixed-size-list",listSize:e.size,children:[{name:"value",type:i}]},nullable:!1,metadata:r}}function l(t,e,n){return a(t,e,n?c(n.metadata):void 0)}function c(t){Object.entries(t);const e={};for(const n in t)e[`${n}.string`]=JSON.stringify(t[n]);return e}const u={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},h={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array};class d{draco;decoder;metadataQuerier;constructor(t){this.draco=t,this.decoder=new this.draco.Decoder,this.metadataQuerier=new this.draco.MetadataQuerier}destroy(){this.draco.destroy(this.decoder),this.draco.destroy(this.metadataQuerier)}parseSync(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=new this.draco.DecoderBuffer;n.Init(new Int8Array(t),t.byteLength),this._disableAttributeTransforms(e);const i=this.decoder.GetEncodedGeometryType(n),r=i===this.draco.TRIANGULAR_MESH?new this.draco.Mesh:new this.draco.PointCloud;try{let t;switch(i){case this.draco.TRIANGULAR_MESH:t=this.decoder.DecodeBufferToMesh(n,r);break;case this.draco.POINT_CLOUD:t=this.decoder.DecodeBufferToPointCloud(n,r);break;default:throw new Error("DRACO: Unknown geometry type.")}if(!t.ok()||!r.ptr){const e=`DRACO decompression failed: ${t.error_msg()}`;throw new Error(e)}const s=this._getDracoLoaderData(r,i,e),a=this._getMeshData(r,s,e),u=(0,o.l)(a.attributes),h=function(t,e,n){const i=c(e.metadata),r=[],o=function(t){const e={};for(const n in t){const i=t[n];e[i.name||"undefined"]=i}return e}(e.attributes);for(const s in t){const e=l(s,t[s],o[s]);r.push(e)}if(n){const t=l("indices",n);r.push(t)}return{fields:r,metadata:i}}(a.attributes,s,a.indices);return{loader:"draco",loaderData:s,header:{vertexCount:r.num_points(),boundingBox:u},...a,schema:h}}finally{this.draco.destroy(n),r&&this.draco.destroy(r)}}_getDracoLoaderData(t,e,n){const i=this._getTopLevelMetadata(t),r=this._getDracoAttributes(t,n);return{geometry_type:e,num_attributes:t.num_attributes(),num_points:t.num_points(),num_faces:t instanceof this.draco.Mesh?t.num_faces():0,metadata:i,attributes:r}}_getDracoAttributes(t,e){const n={};for(let i=0;i<t.num_attributes();i++){const r=this.decoder.GetAttribute(t,i),o=this._getAttributeMetadata(t,i);n[r.unique_id()]={unique_id:r.unique_id(),attribute_type:r.attribute_type(),data_type:r.data_type(),num_components:r.num_components(),byte_offset:r.byte_offset(),byte_stride:r.byte_stride(),normalized:r.normalized(),attribute_index:i,metadata:o};const s=this._getQuantizationTransform(r,e);s&&(n[r.unique_id()].quantization_transform=s);const a=this._getOctahedronTransform(r,e);a&&(n[r.unique_id()].octahedron_transform=a)}return n}_getMeshData(t,e,n){const i=this._getMeshAttributes(e,t,n);if(!i.POSITION)throw new Error("DRACO: No position attribute found.");return t instanceof this.draco.Mesh?"triangle-strip"===n.topology?{topology:"triangle-strip",mode:4,attributes:i,indices:{value:this._getTriangleStripIndices(t),size:1}}:{topology:"triangle-list",mode:5,attributes:i,indices:{value:this._getTriangleListIndices(t),size:1}}:{topology:"point-list",mode:0,attributes:i}}_getMeshAttributes(t,e,n){const i={};for(const r of Object.values(t.attributes)){const t=this._deduceAttributeName(r,n);r.name=t;const o=this._getAttributeValues(e,r);if(o){const{value:e,size:n}=o;i[t]={value:e,size:n,byteOffset:r.byte_offset,byteStride:r.byte_stride,normalized:r.normalized}}}return i}_getTriangleListIndices(t){const e=3*t.num_faces(),n=4*e,i=this.draco._malloc(n);try{return this.decoder.GetTrianglesUInt32Array(t,n,i),new Uint32Array(this.draco.HEAPF32.buffer,i,e).slice()}finally{this.draco._free(i)}}_getTriangleStripIndices(t){const e=new this.draco.DracoInt32Array;try{return this.decoder.GetTriangleStripsFromMesh(t,e),function(t){const e=t.size(),n=new Int32Array(e);for(let i=0;i<e;i++)n[i]=t.GetValue(i);return n}(e)}finally{this.draco.destroy(e)}}_getAttributeValues(t,e){const n=h[e.data_type];if(!n)return console.warn(`DRACO: Unsupported attribute type ${e.data_type}`),null;const i=e.num_components,r=t.num_points()*i,o=r*n.BYTES_PER_ELEMENT,s=function(t,e){switch(e){case Float32Array:return t.DT_FLOAT32;case Int8Array:return t.DT_INT8;case Int16Array:return t.DT_INT16;case Int32Array:return t.DT_INT32;case Uint8Array:return t.DT_UINT8;case Uint16Array:return t.DT_UINT16;case Uint32Array:return t.DT_UINT32;default:return t.DT_INVALID}}(this.draco,n);let a;const l=this.draco._malloc(o);try{const i=this.decoder.GetAttribute(t,e.attribute_index);this.decoder.GetAttributeDataArrayForAllPoints(t,i,s,o,l),a=new n(this.draco.HEAPF32.buffer,l,r).slice()}finally{this.draco._free(l)}return{value:a,size:i}}_deduceAttributeName(t,e){const n=t.unique_id;for(const[o,s]of Object.entries(e.extraAttributes||{}))if(s===n)return o;const i=t.attribute_type;for(const o in u){if(this.draco[o]===i)return u[o]}const r=e.attributeNameEntry||"name";return t.metadata[r]?t.metadata[r].string:`CUSTOM_ATTRIBUTE_${n}`}_getTopLevelMetadata(t){const e=this.decoder.GetMetadata(t);return this._getDracoMetadata(e)}_getAttributeMetadata(t,e){const n=this.decoder.GetAttributeMetadata(t,e);return this._getDracoMetadata(n)}_getDracoMetadata(t){if(!t||!t.ptr)return{};const e={},n=this.metadataQuerier.NumEntries(t);for(let i=0;i<n;i++){const n=this.metadataQuerier.GetEntryName(t,i);e[n]=this._getDracoMetadataField(t,n)}return e}_getDracoMetadataField(t,e){const n=new this.draco.DracoInt32Array;try{this.metadataQuerier.GetIntEntryArray(t,e,n);const i=function(t){const e=t.size(),n=new Int32Array(e);for(let i=0;i<e;i++)n[i]=t.GetValue(i);return n}(n);return{int:this.metadataQuerier.GetIntEntry(t,e),string:this.metadataQuerier.GetStringEntry(t,e),double:this.metadataQuerier.GetDoubleEntry(t,e),intArray:i}}finally{this.draco.destroy(n)}}_disableAttributeTransforms(t){const{quantizedAttributes:e=[],octahedronAttributes:n=[]}=t,i=[...e,...n];for(const r of i)this.decoder.SkipAttributeTransform(this.draco[r])}_getQuantizationTransform(t,e){const{quantizedAttributes:n=[]}=e,i=t.attribute_type();if(n.map((t=>this.decoder[t])).includes(i)){const e=new this.draco.AttributeQuantizationTransform;try{if(e.InitFromAttribute(t))return{quantization_bits:e.quantization_bits(),range:e.range(),min_values:new Float32Array([1,2,3]).map((t=>e.min_value(t)))}}finally{this.draco.destroy(e)}}return null}_getOctahedronTransform(t,e){const{octahedronAttributes:n=[]}=e,i=t.attribute_type();if(n.map((t=>this.decoder[t])).includes(i)){const e=new this.draco.AttributeQuantizationTransform;try{if(e.InitFromAttribute(t))return{quantization_bits:e.quantization_bits()}}finally{this.draco.destroy(e)}}return null}}var p=n(29886);const f="https://www.gstatic.com/draco/versioned/decoders/1.5.6",A={DECODER:"draco_wasm_wrapper.js",DECODER_WASM:"draco_decoder.wasm",FALLBACK_DECODER:"draco_decoder.js",ENCODER:"draco_encoder.js"},g={[A.DECODER]:`${f}/${A.DECODER}`,[A.DECODER_WASM]:`${f}/${A.DECODER_WASM}`,[A.FALLBACK_DECODER]:`${f}/${A.FALLBACK_DECODER}`,[A.ENCODER]:`https://raw.githubusercontent.com/google/draco/1.4.1/javascript/${A.ENCODER}`};let m;async function y(t){const e=t.modules||{};return e.draco3d?m||=e.draco3d.createDecoderModule({}).then((t=>({draco:t}))):m||=async function(t){let e,n;if("js"===(t.draco&&t.draco.decoderType))e=await(0,p._)(g[A.FALLBACK_DECODER],"draco",t,A.FALLBACK_DECODER);else[e,n]=await Promise.all([await(0,p._)(g[A.DECODER],"draco",t,A.DECODER),await(0,p._)(g[A.DECODER_WASM],"draco",t,A.DECODER_WASM)]);return e=e||globalThis.DracoDecoderModule,await function(t,e){const n={};e&&(n.wasmBinary=e);return new Promise((e=>{t({...n,onModuleLoaded:t=>e({draco:t})})}))}(e,n)}(t),await m}const _={...r,parse:async function(t,e){const{draco:n}=await y(e),i=new d(n);try{return i.parseSync(t,e?.draco)}finally{i.destroy()}}}},78547:(t,e,n)=>{"use strict";function i(t,e){const n=e?.globalFeatureId;return void 0!==n?function(t,e){const n=o(t);for(const i of n){let t=0,n=i.featureIds.value[0];for(let r=0;r<i.featureIds.value.length;r++){const o=i.featureIds.value[r];if(o!==n){if(e===i.globalFeatureIds.value[t])return s(i,t,r);t=r,n=o}}if(e===i.globalFeatureIds.value[t])return s(i,t,i.featureIds.value.length)}throw new Error(`featureId:${e} not found`)}(t,n):function(t,e){const n=o(t,e);return function(t){const e=[];for(const n of t){if(0===n.featureIds.value.length)continue;let t=0,i=n.featureIds.value[0];for(let r=0;r<n.featureIds.value.length;r++){const o=n.featureIds.value[r];o!==i&&(e.push(s(n,t,r)),t=r,i=o)}e.push(s(n,t,n.featureIds.value.length))}return e}(n)}(t,e?.type)}function r(t,e,n){switch(t.type){case"Point":return function(t,e,n){const{positions:i}=t,r=l(i,e,n);if(r.length>1)return{type:"MultiPoint",coordinates:r};return{type:"Point",coordinates:r[0]}}(t,e,n);case"LineString":return function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1/0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1/0;const{positions:i}=t,r=t.pathIndices.value.filter((t=>t>=e&&t<=n));if(!(r.length>2)){return{type:"LineString",coordinates:l(i,r[0],r[1])}}const o=[];for(let s=0;s<r.length-1;s++){const t=l(i,r[s],r[s+1]);o.push(t)}return{type:"MultiLineString",coordinates:o}}(t,e,n);case"Polygon":return a(t,e,n);default:const i=t;throw new Error(`Unsupported geometry type: ${i?.type}`)}}function o(t,e){const n=[];return t.points&&(t.points.type="Point",n.push(t.points)),t.lines&&(t.lines.type="LineString",n.push(t.lines)),t.polygons&&(t.polygons.type="Polygon",n.push(t.polygons)),n}function s(t,e,n){const i=r(t,e,n),o=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const n=Object.assign({},t.properties[t.featureIds.value[e]]);for(const i in t.numericProps)n[i]=t.numericProps[i].value[e];return n}(t,e,n),s=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t.fields&&t.fields[t.featureIds.value[e]]}(t,e,n);return{type:"Feature",geometry:i,properties:o,...s}}function a(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1/0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1/0;const{positions:i}=t,r=t.polygonIndices.value.filter((t=>t>=e&&t<=n)),o=t.primitivePolygonIndices.value.filter((t=>t>=e&&t<=n));if(!(r.length>2)){const t=[];for(let e=0;e<o.length-1;e++){const n=l(i,o[e],o[e+1]);t.push(n)}return{type:"Polygon",coordinates:t}}const s=[];for(let l=0;l<r.length-1;l++){const e=a(t,r[l],r[l+1]).coordinates;s.push(e)}return{type:"MultiPolygon",coordinates:s}}function l(t,e,n){e=e||0,n=n||t.value.length/t.size;const i=[];for(let r=e;r<n;r++){const e=Array();for(let n=r*t.size;n<(r+1)*t.size;n++)e.push(Number(t.value[n]));i.push(e)}return i}n.d(e,{K:()=>i})},93594:(t,e,n)=>{"use strict";n.d(e,{B:()=>gn});var i={};n.r(i),n.d(i,{decode:()=>Dt,name:()=>Ot});var r={};n.r(r),n.d(r,{decode:()=>zt,name:()=>Nt});var o={};n.r(o),n.d(o,{decode:()=>re,name:()=>ie});var s={};n.r(s),n.d(s,{name:()=>he,preprocess:()=>de});var a={};n.r(a),n.d(a,{name:()=>fe,preprocess:()=>Ae});var l={};n.r(l),n.d(l,{decode:()=>be,encode:()=>xe,name:()=>_e,preprocess:()=>ve});var c={};n.r(c),n.d(c,{decode:()=>Oe,name:()=>Ie});var u={};n.r(u),n.d(u,{decode:()=>Ue,encode:()=>Ge,name:()=>ze});var h={};n.r(h),n.d(h,{decode:()=>He,encode:()=>We,name:()=>je});var d={};n.r(d),n.d(d,{decode:()=>Xe,encode:()=>Ke,name:()=>Ze});var p={};n.r(p),n.d(p,{decode:()=>$e,name:()=>Ye});function f(t,e,n){if(t.byteLength<=e+n)return"";const i=new DataView(t);let r="";for(let o=0;o<n;o++)r+=String.fromCharCode(i.getUint8(e+o));return r}function A(t){try{return JSON.parse(t)}catch(e){throw new Error(`Failed to parse JSON from data starting with "${function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5;if("string"===typeof t)return t.slice(0,e);if(ArrayBuffer.isView(t))return f(t.buffer,t.byteOffset,e);if(t instanceof ArrayBuffer)return f(t,0,e);return""}(t)}"`)}}var g=n(5738),m=n(62967),y=n(83474);var _=n(29886);const v={TRANSCODER:"basis_transcoder.js",TRANSCODER_WASM:"basis_transcoder.wasm",ENCODER:"basis_encoder.js",ENCODER_WASM:"basis_encoder.wasm"};let b,x;async function w(t){var e;e=t.modules,globalThis.loaders||={},globalThis.loaders.modules||={},Object.assign(globalThis.loaders.modules,e);const n=function(t){const e=globalThis.loaders?.modules?.[t];return e||null}("basis");return n||(b||=async function(t){let e=null,n=null;return[e,n]=await Promise.all([await(0,_._)(v.TRANSCODER,"textures",t),await(0,_._)(v.TRANSCODER_WASM,"textures",t)]),e=e||globalThis.BASIS,await function(t,e){const n={};e&&(n.wasmBinary=e);return new Promise((e=>{t(n).then((t=>{const{BasisFile:n,initializeBasis:i}=t;i(),e({BasisFile:n})}))}))}(e,n)}(t),await b)}async function E(t){const e=t.modules||{};return e.basisEncoder?e.basisEncoder:(x=x||async function(t){let e=null,n=null;return[e,n]=await Promise.all([await(0,_._)(v.ENCODER,"textures",t),await(0,_._)(v.ENCODER_WASM,"textures",t)]),e=e||globalThis.BASIS,await function(t,e){const n={};e&&(n.wasmBinary=e);return new Promise((e=>{t(n).then((t=>{const{BasisFile:n,KTX2File:i,initializeBasis:r,BasisEncoder:o}=t;r(),e({BasisFile:n,KTX2File:i,BasisEncoder:o})}))}))}(e,n)}(t),await x)}const C=33776,T=33779,S=35840,P=35842,M=36196,I=37808,B=["","WEBKIT_","MOZ_"],R={WEBGL_compressed_texture_s3tc:"dxt",WEBGL_compressed_texture_s3tc_srgb:"dxt-srgb",WEBGL_compressed_texture_etc1:"etc1",WEBGL_compressed_texture_etc:"etc2",WEBGL_compressed_texture_pvrtc:"pvrtc",WEBGL_compressed_texture_atc:"atc",WEBGL_compressed_texture_astc:"astc",EXT_texture_compression_rgtc:"rgtc"};let L=null;function O(t){if(!L){t=t||function(){try{return document.createElement("canvas").getContext("webgl")}catch(t){return null}}()||void 0,L=new Set;for(const e of B)for(const n in R)if(t&&t.getExtension(`${e}${n}`)){const t=R[n];L.add(t)}}return L}new Uint8Array([0]);var D,k,F,N,z,U,G,V;!function(t){t[t.NONE=0]="NONE",t[t.BASISLZ=1]="BASISLZ",t[t.ZSTD=2]="ZSTD",t[t.ZLIB=3]="ZLIB"}(D||(D={})),function(t){t[t.BASICFORMAT=0]="BASICFORMAT"}(k||(k={})),function(t){t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.ETC1S=163]="ETC1S",t[t.UASTC=166]="UASTC"}(F||(F={})),function(t){t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.SRGB=1]="SRGB"}(N||(N={})),function(t){t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.LINEAR=1]="LINEAR",t[t.SRGB=2]="SRGB",t[t.ITU=3]="ITU",t[t.NTSC=4]="NTSC",t[t.SLOG=5]="SLOG",t[t.SLOG2=6]="SLOG2"}(z||(z={})),function(t){t[t.ALPHA_STRAIGHT=0]="ALPHA_STRAIGHT",t[t.ALPHA_PREMULTIPLIED=1]="ALPHA_PREMULTIPLIED"}(U||(U={})),function(t){t[t.RGB=0]="RGB",t[t.RRR=3]="RRR",t[t.GGG=4]="GGG",t[t.AAA=15]="AAA"}(G||(G={})),function(t){t[t.RGB=0]="RGB",t[t.RGBA=3]="RGBA",t[t.RRR=4]="RRR",t[t.RRRG=5]="RRRG"}(V||(V={}));const j=[171,75,84,88,32,50,48,187,13,10,26,10];const H={etc1:{basisFormat:0,compressed:!0,format:M},etc2:{basisFormat:1,compressed:!0},bc1:{basisFormat:2,compressed:!0,format:C},bc3:{basisFormat:3,compressed:!0,format:T},bc4:{basisFormat:4,compressed:!0},bc5:{basisFormat:5,compressed:!0},"bc7-m6-opaque-only":{basisFormat:6,compressed:!0},"bc7-m5":{basisFormat:7,compressed:!0},"pvrtc1-4-rgb":{basisFormat:8,compressed:!0,format:S},"pvrtc1-4-rgba":{basisFormat:9,compressed:!0,format:P},"astc-4x4":{basisFormat:10,compressed:!0,format:I},"atc-rgb":{basisFormat:11,compressed:!0},"atc-rgba-interpolated-alpha":{basisFormat:12,compressed:!0},rgba32:{basisFormat:13,compressed:!1},rgb565:{basisFormat:14,compressed:!1},bgr565:{basisFormat:15,compressed:!1},rgba4444:{basisFormat:16,compressed:!1}};function W(t,e,n){const i=new t(new Uint8Array(e));try{if(!i.startTranscoding())throw new Error("Failed to start basis transcoding");const t=i.getNumImages(),e=[];for(let r=0;r<t;r++){const t=i.getNumLevels(r),o=[];for(let e=0;e<t;e++)o.push(q(i,r,e,n));e.push(o)}return e}finally{i.close(),i.delete()}}function q(t,e,n,i){const r=t.getImageWidth(e,n),o=t.getImageHeight(e,n),s=t.getHasAlpha(),{compressed:a,format:l,basisFormat:c}=K(i,s),u=t.getImageTranscodedSizeInBytes(e,n,c),h=new Uint8Array(u);if(!t.transcodeImage(h,e,n,c,0,0))throw new Error("failed to start Basis transcoding");return{width:r,height:o,data:h,compressed:a,format:l,hasAlpha:s}}function Z(t,e,n){const i=new t(new Uint8Array(e));try{if(!i.startTranscoding())throw new Error("failed to start KTX2 transcoding");const t=i.getLevels(),e=[];for(let r=0;r<t;r++){e.push(X(i,r,n));break}return[e]}finally{i.close(),i.delete()}}function X(t,e,n){const{alphaFlag:i,height:r,width:o}=t.getImageLevelInfo(e,0,0),{compressed:s,format:a,basisFormat:l}=K(n,i),c=t.getImageTranscodedSizeInBytes(e,0,0,l),u=new Uint8Array(c);if(!t.transcodeImage(u,e,0,0,l,0,-1,-1))throw new Error("Failed to transcode KTX2 image");return{width:o,height:r,data:u,compressed:s,levelSize:c,hasAlpha:i,format:a}}function K(t,e){let n=t&&t.basis&&t.basis.format;return"auto"===n&&(n=Q()),"object"===typeof n&&(n=e?n.alpha:n.noAlpha),n=n.toLowerCase(),H[n]}function Q(){const t=O();return t.has("astc")?"astc-4x4":t.has("dxt")?{alpha:"bc3",noAlpha:"bc1"}:t.has("pvrtc")?{alpha:"pvrtc1-4-rgba",noAlpha:"pvrtc1-4-rgb"}:t.has("etc1")?"etc1":t.has("etc2")?"etc2":"rgb565"}const J={...{dataType:null,batchType:null,name:"Basis",id:"basis",module:"textures",version:"4.2.4",worker:!0,extensions:["basis","ktx2"],mimeTypes:["application/octet-stream","image/ktx2"],tests:["sB"],binary:!0,options:{basis:{format:"auto",libraryPath:"libs/",containerFormat:"auto",module:"transcoder"}}},parse:async function(t,e){if("auto"===e.basis.containerFormat){if(function(t){const e=new Uint8Array(t);return!(e.byteLength<j.length||e[0]!==j[0]||e[1]!==j[1]||e[2]!==j[2]||e[3]!==j[3]||e[4]!==j[4]||e[5]!==j[5]||e[6]!==j[6]||e[7]!==j[7]||e[8]!==j[8]||e[9]!==j[9]||e[10]!==j[10]||e[11]!==j[11])}(t)){return Z((await E(e)).KTX2File,t,e)}const{BasisFile:n}=await w(e);return W(n,t,e)}if("encoder"===e.basis.module){const n=await E(e);return"ktx2"===e.basis.containerFormat?Z(n.KTX2File,t,e):W(n.BasisFile,t,e)}{const{BasisFile:n}=await w(e);return W(n,t,e)}}};var Y=n(64878),$=n(21402);function tt(t,e){return(0,$.v)(t>=0),(0,$.v)(e>0),t+(e-1)&~(e-1)}function et(t,e,n){let i;if(t instanceof ArrayBuffer)i=new Uint8Array(t);else{const e=t.byteOffset,n=t.byteLength;i=new Uint8Array(t.buffer||t.arrayBuffer,e,n)}return e.set(i,n),n+tt(i.byteLength,4)}const nt=!0,it=1735152710,rt=12,ot=8,st=1313821514,at=5130562,lt=0,ct=0,ut=1;function ht(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const r=new DataView(e),o=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return`${String.fromCharCode(t.getUint8(e+0))}${String.fromCharCode(t.getUint8(e+1))}${String.fromCharCode(t.getUint8(e+2))}${String.fromCharCode(t.getUint8(e+3))}`}(r,n+0),s=r.getUint32(n+4,nt),a=r.getUint32(n+8,nt);switch(Object.assign(t,{header:{byteOffset:n,byteLength:a,hasBinChunk:!1},type:o,version:s,json:{},binChunks:[]}),n+=rt,t.version){case 1:return function(t,e,n){(0,$.v)(t.header.byteLength>rt+ot);const i=e.getUint32(n+0,nt),r=e.getUint32(n+4,nt);return n+=ot,(0,$.v)(r===lt),dt(t,e,n,i),n+=i,n+=pt(t,e,n,t.header.byteLength),n}(t,r,n);case 2:return function(t,e,n,i){return(0,$.v)(t.header.byteLength>rt+ot),function(t,e,n,i){for(;n+8<=t.header.byteLength;){const r=e.getUint32(n+0,nt),o=e.getUint32(n+4,nt);switch(n+=ot,o){case st:dt(t,e,n,r);break;case at:pt(t,e,n,r);break;case ct:i.strict||dt(t,e,n,r);break;case ut:i.strict||pt(t,e,n,r)}n+=tt(r,4)}}(t,e,n,i),n+t.header.byteLength}(t,r,n,i={});default:throw new Error(`Invalid GLB version ${t.version}. Only supports version 1 and 2.`)}}function dt(t,e,n,i){const r=new Uint8Array(e.buffer,n,i),o=new TextDecoder("utf8").decode(r);return t.json=JSON.parse(o),tt(i,4)}function pt(t,e,n,i){return t.header.hasBinChunk=!0,t.binChunks.push({byteOffset:n,byteLength:i,arrayBuffer:e.buffer}),tt(i,4)}function ft(t,e){if(t.startsWith("data:")||t.startsWith("http:")||t.startsWith("https:"))return t;const n=e.baseUri||e.uri;if(!n)throw new Error(`'baseUri' must be provided to resolve relative url ${t}`);return n.substr(0,n.lastIndexOf("/")+1)+t}var At=n(17071);function gt(t,e,n){const i=t.bufferViews[n];(0,Y.v)(i);const r=e[i.buffer];(0,Y.v)(r);const o=(i.byteOffset||0)+r.byteOffset;return new Uint8Array(r.arrayBuffer,o,i.byteLength)}var mt=n(9961);class yt{gltf;sourceBuffers;byteLength;constructor(t){this.gltf={json:t?.json||{asset:{version:"2.0",generator:"loaders.gl"},buffers:[],extensions:{},extensionsRequired:[],extensionsUsed:[]},buffers:t?.buffers||[],images:t?.images||[]},this.sourceBuffers=[],this.byteLength=0,this.gltf.buffers&&this.gltf.buffers[0]&&(this.byteLength=this.gltf.buffers[0].byteLength,this.sourceBuffers=[this.gltf.buffers[0]])}get json(){return this.gltf.json}getApplicationData(t){return this.json[t]}getExtraData(t){return(this.json.extras||{})[t]}hasExtension(t){const e=this.getUsedExtensions().find((e=>e===t)),n=this.getRequiredExtensions().find((e=>e===t));return"string"===typeof e||"string"===typeof n}getExtension(t){const e=this.getUsedExtensions().find((e=>e===t)),n=this.json.extensions||{};return e?n[t]:null}getRequiredExtension(t){return this.getRequiredExtensions().find((e=>e===t))?this.getExtension(t):null}getRequiredExtensions(){return this.json.extensionsRequired||[]}getUsedExtensions(){return this.json.extensionsUsed||[]}getRemovedExtensions(){return this.json.extensionsRemoved||[]}getObjectExtension(t,e){return(t.extensions||{})[e]}getScene(t){return this.getObject("scenes",t)}getNode(t){return this.getObject("nodes",t)}getSkin(t){return this.getObject("skins",t)}getMesh(t){return this.getObject("meshes",t)}getMaterial(t){return this.getObject("materials",t)}getAccessor(t){return this.getObject("accessors",t)}getTexture(t){return this.getObject("textures",t)}getSampler(t){return this.getObject("samplers",t)}getImage(t){return this.getObject("images",t)}getBufferView(t){return this.getObject("bufferViews",t)}getBuffer(t){return this.getObject("buffers",t)}getObject(t,e){if("object"===typeof e)return e;const n=this.json[t]&&this.json[t][e];if(!n)throw new Error(`glTF file error: Could not find ${t}[${e}]`);return n}getTypedArrayForBufferView(t){const e=(t=this.getBufferView(t)).buffer,n=this.gltf.buffers[e];(0,Y.v)(n);const i=(t.byteOffset||0)+n.byteOffset;return new Uint8Array(n.arrayBuffer,i,t.byteLength)}getTypedArrayForAccessor(t){const e=this.getAccessor(t);return function(t,e,n){const i="number"===typeof n?t.accessors?.[n]:n;if(!i)throw new Error(`No gltf accessor ${JSON.stringify(n)}`);const r=t.bufferViews?.[i.bufferView||0];if(!r)throw new Error(`No gltf buffer view for accessor ${r}`);const{arrayBuffer:o,byteOffset:s}=e[r.buffer],a=(s||0)+(i.byteOffset||0)+(r.byteOffset||0),{ArrayType:l,length:c,componentByteSize:u,numberOfComponentsInElement:h}=(0,At.aF)(i,r),d=u*h,p=r.byteStride||d;if("undefined"===typeof r.byteStride||r.byteStride===d)return new l(o,a,c);const f=new l(c);for(let A=0;A<i.count;A++){const t=new l(o,a+A*p,h);f.set(t,A*h)}return f}(this.gltf.json,this.gltf.buffers,e)}getTypedArrayForImageData(t){t=this.getAccessor(t);const e=this.getBufferView(t.bufferView),n=this.getBuffer(e.buffer).data,i=e.byteOffset||0;return new Uint8Array(n,i,e.byteLength)}addApplicationData(t,e){return this.json[t]=e,this}addExtraData(t,e){return this.json.extras=this.json.extras||{},this.json.extras[t]=e,this}addObjectExtension(t,e,n){return t.extensions=t.extensions||{},t.extensions[e]=n,this.registerUsedExtension(e),this}setObjectExtension(t,e,n){(t.extensions||{})[e]=n}removeObjectExtension(t,e){const n=t?.extensions||{};if(n[e]){this.json.extensionsRemoved=this.json.extensionsRemoved||[];const t=this.json.extensionsRemoved;t.includes(e)||t.push(e)}delete n[e]}addExtension(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,Y.v)(e),this.json.extensions=this.json.extensions||{},this.json.extensions[t]=e,this.registerUsedExtension(t),e}addRequiredExtension(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,Y.v)(e),this.addExtension(t,e),this.registerRequiredExtension(t),e}registerUsedExtension(t){this.json.extensionsUsed=this.json.extensionsUsed||[],this.json.extensionsUsed.find((e=>e===t))||this.json.extensionsUsed.push(t)}registerRequiredExtension(t){this.registerUsedExtension(t),this.json.extensionsRequired=this.json.extensionsRequired||[],this.json.extensionsRequired.find((e=>e===t))||this.json.extensionsRequired.push(t)}removeExtension(t){if(this.json.extensions?.[t]){this.json.extensionsRemoved=this.json.extensionsRemoved||[];const e=this.json.extensionsRemoved;e.includes(t)||e.push(t)}this.json.extensions&&delete this.json.extensions[t],this.json.extensionsRequired&&this._removeStringFromArray(this.json.extensionsRequired,t),this.json.extensionsUsed&&this._removeStringFromArray(this.json.extensionsUsed,t)}setDefaultScene(t){this.json.scene=t}addScene(t){const{nodeIndices:e}=t;return this.json.scenes=this.json.scenes||[],this.json.scenes.push({nodes:e}),this.json.scenes.length-1}addNode(t){const{meshIndex:e,matrix:n}=t;this.json.nodes=this.json.nodes||[];const i={mesh:e};return n&&(i.matrix=n),this.json.nodes.push(i),this.json.nodes.length-1}addMesh(t){const{attributes:e,indices:n,material:i,mode:r=4}=t,o={primitives:[{attributes:this._addAttributes(e),mode:r}]};if(n){const t=this._addIndices(n);o.primitives[0].indices=t}return Number.isFinite(i)&&(o.primitives[0].material=i),this.json.meshes=this.json.meshes||[],this.json.meshes.push(o),this.json.meshes.length-1}addPointCloud(t){const e={primitives:[{attributes:this._addAttributes(t),mode:0}]};return this.json.meshes=this.json.meshes||[],this.json.meshes.push(e),this.json.meshes.length-1}addImage(t,e){const n=(0,mt.m)(t),i=e||n?.mimeType,r={bufferView:this.addBufferView(t),mimeType:i};return this.json.images=this.json.images||[],this.json.images.push(r),this.json.images.length-1}addBufferView(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.byteLength;const i=t.byteLength;(0,Y.v)(Number.isFinite(i)),this.sourceBuffers=this.sourceBuffers||[],this.sourceBuffers.push(t);const r={buffer:e,byteOffset:n,byteLength:i};return this.byteLength+=tt(i,4),this.json.bufferViews=this.json.bufferViews||[],this.json.bufferViews.push(r),this.json.bufferViews.length-1}addAccessor(t,e){const n={bufferView:t,type:(0,At.v7)(e.size),componentType:e.componentType,count:e.count,max:e.max,min:e.min};return this.json.accessors=this.json.accessors||[],this.json.accessors.push(n),this.json.accessors.length-1}addBinaryBuffer(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{size:3};const n=this.addBufferView(t);let i={min:e.min,max:e.max};i.min&&i.max||(i=this._getAccessorMinMax(t,e.size));const r={size:e.size,componentType:(0,At.rA)(t),count:Math.round(t.length/e.size),min:i.min,max:i.max};return this.addAccessor(n,Object.assign(r,e))}addTexture(t){const{imageIndex:e}=t,n={source:e};return this.json.textures=this.json.textures||[],this.json.textures.push(n),this.json.textures.length-1}addMaterial(t){return this.json.materials=this.json.materials||[],this.json.materials.push(t),this.json.materials.length-1}createBinaryChunk(){this.gltf.buffers=[];const t=this.byteLength,e=new ArrayBuffer(t),n=new Uint8Array(e);let i=0;for(const r of this.sourceBuffers||[])i=et(r,n,i);this.json?.buffers?.[0]?this.json.buffers[0].byteLength=t:this.json.buffers=[{byteLength:t}],this.gltf.binary=e,this.sourceBuffers=[e]}_removeStringFromArray(t,e){let n=!0;for(;n;){const i=t.indexOf(e);i>-1?t.splice(i,1):n=!1}}_addAttributes(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const e={};for(const n in t){const i=t[n],r=this._getGltfAttributeName(n),o=this.addBinaryBuffer(i.value,i);e[r]=o}return e}_addIndices(t){return this.addBinaryBuffer(t,{size:1})}_getGltfAttributeName(t){switch(t.toLowerCase()){case"position":case"positions":case"vertices":return"POSITION";case"normal":case"normals":return"NORMAL";case"color":case"colors":return"COLOR_0";case"texcoord":case"texcoords":return"TEXCOORD_0";default:return t}}_getAccessorMinMax(t,e){const n={min:null,max:null};if(t.length<e)return n;n.min=[],n.max=[];const i=t.subarray(0,e);for(const r of i)n.min.push(r),n.max.push(r);for(let r=e;r<t.length;r+=e)for(let i=0;i<e;i++)n.min[0+i]=Math.min(n.min[0+i],t[r+i]),n.max[0+i]=Math.max(n.max[0+i],t[r+i]);return n}}var _t=n(32143);function vt(t){return(t%1+1)%1}const bt={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16,BOOLEAN:1,STRING:1,ENUM:1},xt={INT8:Int8Array,UINT8:Uint8Array,INT16:Int16Array,UINT16:Uint16Array,INT32:Int32Array,UINT32:Uint32Array,INT64:BigInt64Array,UINT64:BigUint64Array,FLOAT32:Float32Array,FLOAT64:Float64Array},wt={INT8:1,UINT8:1,INT16:2,UINT16:2,INT32:4,UINT32:4,INT64:8,UINT64:8,FLOAT32:4,FLOAT64:8};function Et(t,e){return wt[e]*bt[t]}function Ct(t,e,n,i){if("UINT8"!==n&&"UINT16"!==n&&"UINT32"!==n&&"UINT64"!==n)return null;const r=Tt(t.getTypedArrayForBufferView(e),"SCALAR",n,i+1);return r instanceof BigInt64Array||r instanceof BigUint64Array?null:r}function Tt(t,e,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;const r=bt[e],o=xt[n],s=wt[n],a=i*r,l=a*s;let c=t.buffer,u=t.byteOffset;if(u%s!==0){c=new Uint8Array(c).slice(u,u+l).buffer,u=0}return new o(c,u,a)}function St(t,e,n){const i=`TEXCOORD_${e.texCoord||0}`,r=n.attributes[i],o=t.getTypedArrayForAccessor(r),s=t.gltf.json,a=e.index,l=s.textures?.[a]?.source;if("undefined"!==typeof l){const n=s.images?.[l]?.mimeType,i=t.gltf.images?.[l];if(i&&"undefined"!==typeof i.width){const t=[];for(let r=0;r<o.length;r+=2){const s=Mt(i,n,o,r,e.channels);t.push(s)}return t}}return[]}function Pt(t,e,n,i,r){if(!n?.length)return;const o=[];for(const u of n){let t=i.findIndex((t=>t===u));-1===t&&(t=i.push(u)-1),o.push(t)}const s=new Uint32Array(o),a=t.gltf.buffers.push({arrayBuffer:s.buffer,byteOffset:s.byteOffset,byteLength:s.byteLength})-1,l=t.addBufferView(s,a,0),c=t.addAccessor(l,{size:1,componentType:(0,At.rA)(s),count:s.length});r.attributes[e]=c}function Mt(t,e,n,i){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[0];const o={r:{offset:0,shift:0},g:{offset:1,shift:8},b:{offset:2,shift:16},a:{offset:3,shift:24}},s=n[i],a=n[i+1];let l=1;!e||-1===e.indexOf("image/jpeg")&&-1===e.indexOf("image/png")||(l=4);const c=function(t,e,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;const r=n.width,o=vt(t)*(r-1),s=Math.round(o),a=n.height,l=vt(e)*(a-1),c=Math.round(l),u=n.components?n.components:i,h=(c*r+s)*u;return h}(s,a,t,l);let u=0;for(const h of r){const e="number"===typeof h?Object.values(o)[h]:o[h],n=c+e.offset,i=(0,_t.M5)(t);if(i.data.length<=n)throw new Error(`${i.data.length} <= ${n}`);u|=i.data[n]<<e.shift}return u}function It(t,e,n,i,r){const o=[];for(let s=0;s<e;s++){const e=n[s],a=n[s+1]-n[s];if(a+e>i)break;const l=e/r,c=a/r;o.push(t.slice(l,l+c))}return o}function Bt(t,e,n){const i=[];for(let r=0;r<e;r++){const e=r*n;i.push(t.slice(e,e+n))}return i}function Rt(t,e,n,i){if(n)throw new Error("Not implemented - arrayOffsets for strings is specified");if(i){const n=[],r=new TextDecoder("utf8");let o=0;for(let s=0;s<t;s++){const t=i[s+1]-i[s];if(t+o<=e.length){const i=e.subarray(o,t+o),s=r.decode(i);n.push(s),o+=t}}return n}return[]}const Lt="EXT_mesh_features",Ot=Lt;async function Dt(t,e){!function(t,e){const n=t.gltf.json;if(!n.meshes)return;for(const i of n.meshes)for(const n of i.primitives)kt(t,n,e)}(new yt(t),e)}function kt(t,e,n){if(!n?.gltf?.loadBuffers)return;const i=e.extensions?.[Lt],r=i?.featureIds;if(r)for(const o of r){let i;if("undefined"!==typeof o.attribute){const n=`_FEATURE_ID_${o.attribute}`,r=e.attributes[n];i=t.getTypedArrayForAccessor(r)}else i="undefined"!==typeof o.texture&&n?.gltf?.loadImages?St(t,o.texture,e):[];o.data=i}}const Ft="EXT_structural_metadata",Nt=Ft;async function zt(t,e){!function(t,e){if(!e.gltf?.loadBuffers)return;const n=t.getExtension(Ft);if(!n)return;e.gltf?.loadImages&&function(t,e){const n=e.propertyTextures,i=t.gltf.json;if(n&&i.meshes)for(const r of i.meshes)for(const i of r.primitives)Gt(t,n,i,e)}(t,n);!function(t,e){const n=e.schema;if(!n)return;const i=n.classes,r=e.propertyTables;if(i&&r)for(const o in i){const e=Ut(r,o);e&&jt(t,n,e)}}(t,n)}(new yt(t),e)}function Ut(t,e){for(const n of t)if(n.class===e)return n;return null}function Gt(t,e,n,i){if(!e)return;const r=n.extensions?.[Ft],o=r?.propertyTextures;if(o)for(const s of o){Vt(t,e[s],n,i)}}function Vt(t,e,n,i){if(!e.properties)return;i.dataAttributeNames||(i.dataAttributeNames=[]);const r=e.class;for(const o in e.properties){const s=`${r}_${o}`,a=e.properties?.[o];if(!a)continue;a.data||(a.data=[]);const l=a.data,c=St(t,a,n);null!==c&&(Pt(t,s,c,l,n),a.data=l,i.dataAttributeNames.push(s))}}function jt(t,e,n){const i=e.classes?.[n.class];if(!i)throw new Error(`Incorrect data in the EXT_structural_metadata extension: no schema class with
2name ${n.class}`);const r=n.count;for(const o in i.properties){const s=i.properties[o],a=n.properties?.[o];if(a){const n=Ht(t,e,s,r,a);a.data=n}}}function Ht(t,e,n,i,r){let o=[];const s=r.values,a=t.getTypedArrayForBufferView(s),l=function(t,e,n,i){if(e.array&&"undefined"===typeof e.count&&"undefined"!==typeof n.arrayOffsets)return Ct(t,n.arrayOffsets,n.arrayOffsetType||"UINT32",i);return null}(t,n,r,i),c=function(t,e,n){if("undefined"!==typeof e.stringOffsets)return Ct(t,e.stringOffsets,e.stringOffsetType||"UINT32",n);return null}(t,r,i);switch(n.type){case"SCALAR":case"VEC2":case"VEC3":case"VEC4":case"MAT2":case"MAT3":case"MAT4":o=function(t,e,n,i){const r=t.array,o=t.count,s=Et(t.type,t.componentType),a=n.byteLength/s;let l;l=t.componentType?Tt(n,t.type,t.componentType,a):n;if(r)return i?It(l,e,i,n.length,s):o?Bt(l,e,o):[];return l}(n,i,a,l);break;case"BOOLEAN":throw new Error(`Not implemented - classProperty.type=${n.type}`);case"STRING":o=Rt(i,a,l,c);break;case"ENUM":o=function(t,e,n,i,r){const o=e.enumType;if(!o)throw new Error("Incorrect data in the EXT_structural_metadata extension: classProperty.enumType is not set for type ENUM");const s=t.enums?.[o];if(!s)throw new Error(`Incorrect data in the EXT_structural_metadata extension: schema.enums does't contain ${o}`);const a=s.valueType||"UINT16",l=Et(e.type,a),c=i.byteLength/l;let u=Tt(i,e.type,a,c);u||(u=i);if(e.array){if(r)return function(t){const{valuesData:e,numberOfElements:n,arrayOffsets:i,valuesDataBytesLength:r,elementSize:o,enumEntry:s}=t,a=[];for(let l=0;l<n;l++){const t=i[l],n=i[l+1]-i[l];if(n+t>r)break;const c=Wt(e,t/o,n/o,s);a.push(c)}return a}({valuesData:u,numberOfElements:n,arrayOffsets:r,valuesDataBytesLength:i.length,elementSize:l,enumEntry:s});const t=e.count;return t?function(t,e,n,i){const r=[];for(let o=0;o<e;o++){const e=Wt(t,n*o,n,i);r.push(e)}return r}(u,n,t,s):[]}return Wt(u,0,n,s)}(e,n,i,a,l);break;default:throw new Error(`Unknown classProperty type ${n.type}`)}return o}function Wt(t,e,n,i){const r=[];for(let o=0;o<n;o++)if(t instanceof BigInt64Array||t instanceof BigUint64Array)r.push("");else{const n=qt(i,t[e+o]);n?r.push(n.name):r.push("")}return r}function qt(t,e){for(const n of t.values)if(n.value===e)return n;return null}const Zt="B9h9z9tFBBBF8fL9gBB9gLaaaaaFa9gEaaaB9gFaFa9gEaaaFaEMcBFFFGGGEIIILF9wFFFLEFBFKNFaFCx/IFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBF8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBGy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBEn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBIi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBKI9z9iqlBOc+x8ycGBM/qQFTa8jUUUUBCU/EBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAGTkUUUBRNCUoBAG9uC/wgBZHKCUGAKCUG9JyRVAECFJRICBRcGXEXAcAF9PQFAVAFAclAcAVJAF9JyRMGXGXAG9FQBAMCbJHKC9wZRSAKCIrCEJCGrRQANCUGJRfCBRbAIRTEXGXAOATlAQ9PQBCBRISEMATAQJRIGXAS9FQBCBRtCBREEXGXAOAIlCi9PQBCBRISLMANCU/CBJAEJRKGXGXGXGXGXATAECKrJ2BBAtCKZrCEZfIBFGEBMAKhB83EBAKCNJhB83EBSEMAKAI2BIAI2BBHmCKrHYAYCE6HYy86BBAKCFJAICIJAYJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCGJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCEJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCIJAYAmJHY2BBAI2BFHmCKrHPAPCE6HPy86BBAKCLJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCKJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCOJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCNJAYAmJHY2BBAI2BGHmCKrHPAPCE6HPy86BBAKCVJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCcJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCMJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCSJAYAmJHm2BBAI2BEHICKrHYAYCE6HYy86BBAKCQJAmAYJHm2BBAICIrCEZHYAYCE6HYy86BBAKCfJAmAYJHm2BBAICGrCEZHYAYCE6HYy86BBAKCbJAmAYJHK2BBAICEZHIAICE6HIy86BBAKAIJRISGMAKAI2BNAI2BBHmCIrHYAYCb6HYy86BBAKCFJAICNJAYJHY2BBAmCbZHmAmCb6Hmy86BBAKCGJAYAmJHm2BBAI2BFHYCIrHPAPCb6HPy86BBAKCEJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCIJAmAYJHm2BBAI2BGHYCIrHPAPCb6HPy86BBAKCLJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCKJAmAYJHm2BBAI2BEHYCIrHPAPCb6HPy86BBAKCOJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCNJAmAYJHm2BBAI2BIHYCIrHPAPCb6HPy86BBAKCVJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCcJAmAYJHm2BBAI2BLHYCIrHPAPCb6HPy86BBAKCMJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCSJAmAYJHm2BBAI2BKHYCIrHPAPCb6HPy86BBAKCQJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCfJAmAYJHm2BBAI2BOHICIrHYAYCb6HYy86BBAKCbJAmAYJHK2BBAICbZHIAICb6HIy86BBAKAIJRISFMAKAI8pBB83BBAKCNJAICNJ8pBB83BBAICTJRIMAtCGJRtAECTJHEAS9JQBMMGXAIQBCBRISEMGXAM9FQBANAbJ2BBRtCBRKAfREEXAEANCU/CBJAKJ2BBHTCFrCBATCFZl9zAtJHt86BBAEAGJREAKCFJHKAM9HQBMMAfCFJRfAIRTAbCFJHbAG9HQBMMABAcAG9sJANCUGJAMAG9sTkUUUBpANANCUGJAMCaJAG9sJAGTkUUUBpMAMCBAIyAcJRcAIQBMC9+RKSFMCBC99AOAIlAGCAAGCA9Ly6yRKMALCU/EBJ8kUUUUBAKM+OmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUFT+JUUUBpALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9
2LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+F6HPJROAYCbZRtGXGXAYCIrHmQBAOCFJRbSFMAORbALAIAmlCbZCGWJ8oGBROMGXGXAtQBAbCFJRVSFMAbRVALAIAYlCbZCGWJ8oGBRbMGXGXAP9FQBAMCFJRYSFMAM1BFHYCgFZRTGXGXAYCa9MQBAMCGJRYSFMAM1BGHYCgBZCOWATCgBZqRTGXAYCa9MQBAMCEJRYSFMAM1BEHYCgBZCfWATqRTGXAYCa9MQBAMCIJRYSFMAM1BIHYCgBZCdWATqRTGXAYCa9MQBAMCLJRYSFMAMCKJRYAM2BLC8cWATqRTMATCFrCBATCFZl9zAQJHQRTMGXGXAmCb6QBAYRPSFMAY1BBHMCgFZROGXGXAMCa9MQBAYCFJRPSFMAY1BFHMCgBZCOWAOCgBZqROGXAMCa9MQBAYCGJRPSFMAY1BGHMCgBZCfWAOqROGXAMCa9MQBAYCEJRPSFMAY1BEHMCgBZCdWAOqROGXAMCa9MQBAYCIJRPSFMAYCLJRPAY2BIC8cWAOqROMAOCFrCBAOCFZl9zAQJHQROMGXGXAtCb6QBAPRMSFMAP1BBHMCgFZRbGXGXAMCa9MQBAPCFJRMSFMAP1BFHMCgBZCOWAbCgBZqRbGXAMCa9MQBAPCGJRMSFMAP1BGHMCgBZCfWAbqRbGXAMCa9MQBAPCEJRMSFMAP1BEHMCgBZCdWAbqRbGXAMCa9MQBAPCIJRMSFMAPCLJRMAP2BIC8cWAbqRbMAbCFrCBAbCFZl9zAQJHQRbMGXGXAGCG9HQBABAT87FBABCIJAb87FBABCGJAO87FBSFMAEATjGBAECNJAbjGBAECIJAOjGBMALCoBJAKCEWJHYAOjGBAYATjGIALAICGWJATjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAICFJHICbZCGWJAOjGBALCoBJAKCGJCbZCEWJHOATjGBAOAbjGIALAIAm9FAmCb6qJHICbZCGWJAbjGBAIAt9FAtCb6qJRIAKCEJRKMANCFJRNABCKJRBAECSJREAKCbZRKAICbZRIAfCEJHfAF9JQBMMCBC99AMAc6yRKMALCoFJ8kUUUUBAKM/tIFGa8jUUUUBCTlRLC9+RKGXAFCLJAI9LQBCaRKAE2BBC/+FZC/QF9HQBALhB83ENAECFJRKAEAIJC98JREGXAF9FQBGXAGCG6QBEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMALCNJAICFZCGWqHGAICGrCBAICFrCFZl9zAG8oGBJHIjGBABAIjGBABCIJRBAFCaJHFQBSGMMEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMABAICGrCBAICFrCFZl9zALCNJAICFZCGWqHI8oGBJHG87FBAIAGjGBABCGJRBAFCaJHFQBMMCBC99AKAE6yRKMAKM+lLKFaF99GaG99FaG99GXGXAGCI9HQBAF9FQFEXGXGX9DBBB8/9DBBB+/ABCGJHG1BB+yAB1BBHE+yHI+L+TABCFJHL1BBHK+yHO+L+THN9DBBBB9gHVyAN9DBB/+hANAN+U9DBBBBANAVyHcAc+MHMAECa3yAI+SHIAI+UAcAMAKCa3yAO+SHcAc+U+S+S+R+VHO+U+SHN+L9DBBB9P9d9FQBAN+oRESFMCUUUU94REMAGAE86BBGXGX9DBBB8/9DBBB+/Ac9DBBBB9gyAcAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMALAG86BBGXGX9DBBB8/9DBBB+/AI9DBBBB9gyAIAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMABAG86BBABCIJRBAFCaJHFQBSGMMAF9FQBEXGXGX9DBBB8/9DBBB+/ABCIJHG8uFB+yAB8uFBHE+yHI+L+TABCGJHL8uFBHK+yHO+L+THN9DBBBB9gHVyAN9DB/+g6ANAN+U9DBBBBANAVyHcAc+MHMAECa3yAI+SHIAI+UAcAMAKCa3yAO+SHcAc+U+S+S+R+VHO+U+SHN+L9DBBB9P9d9FQBAN+oRESFMCUUUU94REMAGAE87FBGXGX9DBBB8/9DBBB+/Ac9DBBBB9gyAcAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMALAG87FBGXGX9DBBB8/9DBBB+/AI9DBBBB9gyAIAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMABAG87FBABCNJRBAFCaJHFQBMMM/SEIEaE99EaF99GXAF9FQBCBREABRIEXGXGX9D/zI818/AICKJ8uFBHLCEq+y+VHKAI8uFB+y+UHO9DB/+g6+U9DBBB8/9DBBB+/AO9DBBBB9gy+SHN+L9DBBB9P9d9FQBAN+oRVSFMCUUUU94RVMAICIJ8uFBRcAICGJ8uFBRMABALCFJCEZAEqCFWJAV87FBGXGXAKAM+y+UHN9DB/+g6+U9DBBB8/9DBBB+/AN9DBBBB9gy+SHS+L9DBBB9P9d9FQBAS+oRMSFMCUUUU94RMMABALCGJCEZAEqCFWJAM87FBGXGXAKAc+y+UHK9DB/+g6+U9DBBB8/9DBBB+/AK9DBBBB9gy+SHS+L9DBBB9P9d9FQBAS+oRcSFMCUUUU94RcMABALCaJCEZAEqCFWJAc87FBGXGX9DBBU8/AOAO+U+TANAN+U+TAKAK+U+THO9DBBBBAO9DBBBB9gy+R9DB/+g6+U9DBBB8/+SHO+L9DBBB9P9d9FQBAO+oRcSFMCUUUU94RcMABALCEZAEqCFWJAc87FBAICNJRIAECIJREAFCaJHFQBMMM9JBGXAGCGrAF9sHF9FQBEXABAB8oGBHGCNWCN91+yAGCi91CnWCUUU/8EJ+++U84GBABCIJRBAFCaJHFQBMMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEM/lFFFaGXGXAFABqCEZ9FQBABRESFMGXGXAGCT9PQBABRESFMABREEXAEAF8oGBjGBAECIJAFCIJ8oGBjGBAECNJAFCNJ8oGBjGBAECSJAFCSJ8oGBjGBAECTJREAFCTJRFAGC9wJHGCb9LQBMMAGCI9JQBEXAEAF8oGBjGBAFCIJRFAECIJREAGC98JHGCE9LQBMMGXAG9FQBEXAEAF2BB86BBAECFJREAFCFJRFAGCaJHGQBMMABMoFFGaGXGXABCEZ9FQBABRESFMAFCgFZC+BwsN9sRIGXGXAGCT9PQBABRESFMABREEXAEAIjGBAECSJAIjGBAECNJAIjGBAECIJAIjGBAECTJREAGC9wJHGCb9LQBMMAGCI9JQBEXAEAIjGBAECIJREAGC98JHGCE9LQBMMGXAG9FQBEXAEAF86BBAECFJREAGCaJHGQBMMABMMMFBCUNMIT9kBB",Xt
vendor: 10,662 bytes, line 2
2="B9h9z9tFBBBF8dL9gBB9gLaaaaaFa9gEaaaB9gGaaB9gFaFaEQSBBFBFFGEGEGIILF9wFFFLEFBFKNFaFCx/aFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBG8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBIy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBKi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBNn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBcI9z9iqlBMc/j9JSIBTEM9+FLa8jUUUUBCTlRBCBRFEXCBRGCBREEXABCNJAGJAECUaAFAGrCFZHIy86BBAEAIJREAGCFJHGCN9HQBMAFCx+YUUBJAE86BBAFCEWCxkUUBJAB8pEN83EBAFCFJHFCUG9HQBMMkRIbaG97FaK978jUUUUBCU/KBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAG/8cBBCUoBAG9uC/wgBZHKCUGAKCUG9JyRNAECFJRKCBRVGXEXAVAF9PQFANAFAVlAVANJAF9JyRcGXGXAG9FQBAcCbJHIC9wZHMCE9sRSAMCFWRQAICIrCEJCGrRfCBRbEXAKRTCBRtGXEXGXAOATlAf9PQBCBRKSLMALCU/CBJAtAM9sJRmATAfJRKCBREGXAMCoB9JQBAOAKlC/gB9JQBCBRIEXAmAIJREGXGXGXGXGXATAICKrJ2BBHYCEZfIBFGEBMAECBDtDMIBSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCIJAnDeBJAeCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCNJAnDeBJAeCx+YUUBJ2BBJRKSFMAEAKDBBBDMIBAKCTJRKMGXGXGXGXGXAYCGrCEZfIBFGEBMAECBDtDMITSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMITAKCIJAnDeBJAeCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMITAKCNJAnDeBJAeCx+YUUBJ2BBJRKSFMAEAKDBBBDMITAKCTJRKMGXGXGXGXGXAYCIrCEZfIBFGEBMAECBDtDMIASEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIAAKCIJAnDeBJAeCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIAAKCNJAnDeBJAeCx+YUUBJ2BBJRKSFMAEAKDBBBDMIAAKCTJRKMGXGXGXGXGXAYCKrfIBFGEBMAECBDtDMI8wSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HYCEWCxkUUBJDBEBAYCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HYCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMI8wAKCIJAnDeBJAYCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HYCEWCxkUUBJDBEBAYCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HYCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMI8wAKCNJAnDeBJAYCx+YUUBJ2BBJRKSFMAEAKDBBBDMI8wAKCTJRKMAICoBJREAICUFJAM9LQFAERIAOAKlC/fB9LQBMMGXAEAM9PQBAECErRIEXGXAOAKlCi9PQBCBRKSOMAmAEJRYGXGXGXGXGXATAECKrJ2BBAICKZrCEZfIBFGEBMAYCBDtDMIBSEMAYAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCIJAnDeBJAeCx+YUUBJ2BBJRKSGMAYAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCNJAnDeBJAeCx+YUUBJ2BBJRKSFMAYAKDBBBDMIBAKCTJRKMAICGJRIAECTJHEAM9JQBMMGXAK9FQBAKRTAtCFJHtCI6QGSFMMCBRKSEMGXAM9FQBALCUGJAbJREALAbJDBGBRnCBRYEXAEALCU/CBJAYJHIDBIBHdCFD9tAdCFDbHPD9OD9hD9RHdAIAMJDBIBHiCFD9tAiAPD9OD9hD9RHiDQBTFtGmEYIPLdKeOnH8ZAIAQJDBIBHpCFD9tApAPD9OD9hD9RHpAIASJDBIBHyCFD9tAyAPD9OD9hD9RHyDQBTFtGmEYIPLdKeOnH8cDQBFTtGEmYILPdKOenHPAPDQBFGEBFGEBFGEBFGEAnD9uHnDyBjGBAEAGJHIAnAPAPDQILKOILKOILKOILKOD9uHnDyBjGBAIAGJHIAnAPAPDQNVcMNVcMNVcMNVcMD9uHnDyBjGBAIAGJHIAnAPAPDQSQfbSQfbSQfbSQfbD9uHnDyBjGBAIAGJHIAnA8ZA8cDQNVi8ZcMpySQ8c8dfb8e8fHPAPDQBFGEBFGEBFGEBFGED9uHnDyBjGBAIAGJHIAnAPAPDQILKOILKOILKOILKOD9uHnDyBjGBAIAGJHIAnAPAPDQNVcMNVcMNVcMNVcMD9uHnDyBjGBAIAGJHIAnAPAPDQSQfbSQfbSQfbSQfbD9uHnDyBjGBAIAGJHIAnAdAiDQNiV8ZcpMyS8cQ8df8eb8fHdApAyDQNiV8ZcpMyS8cQ8df8eb8fHiDQBFTtGEmYILPdKOenHPAPDQBFGEBFGEBFGEBFGED9uHnDyBjGBAIAGJHIAnAPAPDQILKOILKOILKOILKOD9uHnDyBjGBAIAGJHIAnAPAPDQNVcMNVcMNVcMNVcMD9uHnDyBjGBAIAGJHIAnAPAPDQSQfbSQfbSQfbSQfbD9uHnDyBjGBAIAGJHIAnAdAiDQNVi8ZcMpySQ8c8dfb8e8fHPAPDQBFGEBFGEBFGEBFGED9uHnDyBjGBAIAGJHIAnAPAPDQILKOILKOILKOILKOD9uHnDyBjGBAIAGJHIAnAPAPDQNVcMNVcMNVcMNVcMD9uHnDyBjGBAIAGJHIAnAPAPDQSQfbSQfbSQfbSQfbD9uHnDyBjGBAIAGJREAYCTJHYAM9JQBMMAbCIJHbAG9JQBMMABAVAG9sJALCUGJAcAG9s/8cBBALALCUGJAcCaJAG9sJAG/8cBBMAcCBAKyAVJRVAKQBMC9+RKSFMCBC99AOAKlAGCAAGCA9Ly6yRKMALCU/KBJ8kUUUUBAKMNBT+BUUUBM+KmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUF/8MBALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+F6HPJROAYCbZRtGXGXAYCIrHmQBAOCFJRbSFMAORbALAIAmlCbZCGWJ8oGBROMGXGXAtQBAbCFJRVSFMAbRVALAIAYlCbZCGWJ8oGBRbMGXGXAP9FQBAMCFJRYSFMAM1BFHYCgFZRTGXGXAYCa9MQBAMCGJRYSFMAM1BGHYCgBZCOWATCgBZqRTGXAYCa9MQBAMCEJRYSFMAM1BEHYCgBZCfWATqRTGXAYCa9MQBAMCIJRYSFMAM1BIHYCgBZCdWATqRTGXAYCa9MQBAMCLJRYSFMAMCKJRYAM2BLC8cWATqRTMATCFrCBATCFZl9zAQJHQRTMGXGXAmCb6QBAYRPSFMAY1BBHMCgFZROGXGXAMCa9MQBAYCFJRPSFMAY1BFHMCgBZCOWAOCgBZqROGXAMCa9MQBAYCGJRPSFMAY1BGHMCgBZCfWAOqROGXAMCa9MQBAYCEJRPSFMAY1BEHMCgBZCdWAOqROGXAMCa9MQBAYCIJRPSFMAYCLJRPAY2BIC8cWAOqROMAOCFrCBAOCFZl9zAQJHQROMGXGXAtCb6QBAPRMSFMAP1BBHMCgFZRbGXGXAMCa9MQBAPCFJRMSFMAP1BFHMCgBZCOWAbCgBZqRbGXAMCa9MQBAPCGJRMSFMAP1BGHMCgBZCfWAbqRbGXAMCa9MQBAPCEJRMSFMAP1BEHMCgBZCdWAbqRbGXAMCa9MQBAPCIJRMSFMAPCLJRMAP2BIC8cWAbqRbMAbCFrCBAbCFZl9zAQJHQRbMGXGXAGCG9HQBABAT87FBABCIJAb87FBABCGJAO87FBSFMAEATjGBAECNJAbjGBAECIJAOjGBMALCoBJAKCEWJHYAOjGBAYATjGIALAICGWJATjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAICFJHICbZCGWJAOjGBALCoBJAKCGJCbZCEWJHOATjGBAOAbjGIALAIAm9FAmCb6qJHICbZCGWJAbjGBAIAt9FAtCb6qJRIAKCEJRKMANCFJRNABCKJRBAECSJREAKCbZRKAICbZRIAfCEJHfAF9JQBMMCBC99AMAc6yRKMALCoFJ8kUUUUBAKM/tIFGa8jUUUUBCTlRLC9+RKGXAFCLJAI9LQBCaRKAE2BBC/+FZC/QF9HQBALhB83ENAECFJRKAEAIJC98JREGXAF9FQBGXAGCG6QBEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMALCNJAICFZCGWqHGAICGrCBAICFrCFZl9zAG8oGBJHIjGBABAIjGBABCIJRBAFCaJHFQBSGMMEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMABAICGrCBAICFrCFZl9zALCNJAICFZCGWqHI8oGBJHG87FBAIAGjGBABCGJRBAFCaJHFQBMMCBC99AKAE6yRKMAKM/xLGEaK978jUUUUBCAlHE8kUUUUBGXGXAGCI9HQBGXAFC98ZHI9FQBABRGCBRLEXAGAGDBBBHKCiD+rFCiD+sFD/6FHOAKCND+rFCiD+sFD/6FAOD/gFAKCTD+rFCiD+sFD/6FHND/gFD/kFD/lFHVCBDtD+2FHcAOCUUUU94DtHMD9OD9RD/kFHO9DBB/+hDYAOAOD/mFAVAVD/mFANAcANAMD9OD9RD/kFHOAOD/mFD/kFD/kFD/jFD/nFHND/mF9DBBX9LDYHcD/kFCgFDtD9OAKCUUU94DtD9OD9QAOAND/mFAcD/kFCND+rFCU/+EDtD9OD9QAVAND/mFAcD/kFCTD+rFCUU/8ODtD9OD9QDMBBAGCTJRGALCIJHLAI9JQBMMAIAF9PQFAEAFCEZHLCGWHGqCBCTAGl/8MBAEABAICGWJHIAG/8cBBGXAL9FQBAEAEDBIBHKCiD+rFCiD+sFD/6FHOAKCND+rFCiD+sFD/6FAOD/gFAKCTD+rFCiD+sFD/6FHND/gFD/kFD/lFHVCBDtD+2FHcAOCUUUU94DtHMD9OD9RD/kFHO9DBB/+hDYAOAOD/mFAVAVD/mFANAcANAMD9OD9RD/kFHOAOD/mFD/kFD/kFD/jFD/nFHND/mF9DBBX9LDYHcD/kFCgFDtD9OAKCUUU94DtD9OD9QAOAND/mFAcD/kFCND+rFCU/+EDtD9OD9QAVAND/mFAcD/kFCTD+rFCUU/8ODtD9OD9QDMIBMAIAEAG/8cBBSFMABAFC98ZHGT+HUUUBAGAF9PQBAEAFCEZHICEWHLJCBCAALl/8MBAEABAGCEWJHGAL/8cBBAEAIT+HUUUBAGAEAL/8cBBMAECAJ8kUUUUBM+yEGGaO97GXAF9FQBCBRGEXABCTJHEAEDBBBHICBDtHLCUU98D8cFCUU98D8cEHKD9OABDBBBHOAIDQILKOSQfbPden8c8d8e8fCggFDtD9OD/6FAOAIDQBFGENVcMTtmYi8ZpyHICTD+sFD/6FHND/gFAICTD+rFCTD+sFD/6FHVD/gFD/kFD/lFHI9DB/+g6DYAVAIALD+2FHLAVCUUUU94DtHcD9OD9RD/kFHVAVD/mFAIAID/mFANALANAcD9OD9RD/kFHIAID/mFD/kFD/kFD/jFD/nFHND/mF9DBBX9LDYHLD/kFCTD+rFAVAND/mFALD/kFCggEDtD9OD9QHVAIAND/mFALD/kFCaDbCBDnGCBDnECBDnKCBDnOCBDncCBDnMCBDnfCBDnbD9OHIDQNVi8ZcMpySQ8c8dfb8e8fD9QDMBBABAOAKD9OAVAIDQBFTtGEmYILPdKOenD9QDMBBABCAJRBAGCIJHGAF9JQBMMM94FEa8jUUUUBCAlHE8kUUUUBABAFC98ZHIT+JUUUBGXAIAF9PQBAEAFCEZHLCEWHFJCBCAAFl/8MBAEABAICEWJHBAF/8cBBAEALT+JUUUBABAEAF/8cBBMAECAJ8kUUUUBM/hEIGaF97FaL978jUUUUBCTlRGGXAF9FQBCBREEXAGABDBBBHIABCTJHLDBBBHKDQILKOSQfbPden8c8d8e8fHOCTD+sFHNCID+rFDMIBAB9DBBU8/DY9D/zI818/DYANCEDtD9QD/6FD/nFHNAIAKDQBFGENVcMTtmYi8ZpyHICTD+rFCTD+sFD/6FD/mFHKAKD/mFANAICTD+sFD/6FD/mFHVAVD/mFANAOCTD+rFCTD+sFD/6FD/mFHOAOD/mFD/kFD/kFD/lFCBDtD+4FD/jF9DB/+g6DYHND/mF9DBBX9LDYHID/kFCggEDtHcD9OAVAND/mFAID/kFCTD+rFD9QHVAOAND/mFAID/kFCTD+rFAKAND/mFAID/kFAcD9OD9QHNDQBFTtGEmYILPdKOenHID8dBAGDBIBDyB+t+J83EBABCNJAID8dFAGDBIBDyF+t+J83EBALAVANDQNVi8ZcMpySQ8c8dfb8e8fHND8dBAGDBIBDyG+t+J83EBABCiJAND8dFAGDBIBDyE+t+J83EBABCAJRBAECIJHEAF9JQBMMM/3FGEaF978jUUUUBCoBlREGXAGCGrAF9sHIC98ZHL9FQBCBRGABRFEXAFAFDBBBHKCND+rFCND+sFD/6FAKCiD+sFCnD+rFCUUU/8EDtD+uFD/mFDMBBAFCTJRFAGCIJHGAL9JQBMMGXALAI9PQBAEAICEZHGCGWHFqCBCoBAFl/8MBAEABALCGWJHLAF/8cBBGXAG9FQBAEAEDBIBHKCND+rFCND+sFD/6FAKCiD+sFCnD+rFCUUU/8EDtD+uFD/mFDMIBMALAEAF/8cBBMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEMMMFBCUNMIT9tBB",
vendor: 19,633 bytes, line 2
2Kt=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),Qt=new Uint8Array([32,0,65,253,3,1,2,34,4,106,6,5,11,8,7,20,13,33,12,16,128,9,116,64,19,113,127,15,10,21,22,14,255,66,24,54,136,107,18,23,192,26,114,118,132,17,77,101,130,144,27,87,131,44,45,74,156,154,70,167]),Jt={0:"",1:"meshopt_decodeFilterOct",2:"meshopt_decodeFilterQuat",3:"meshopt_decodeFilterExp",NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},Yt={0:"meshopt_decodeVertexBuffer",1:"meshopt_decodeIndexBuffer",2:"meshopt_decodeIndexSequence",ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"};let $t;async function te(){return $t||($t=async function(){let t=Zt;WebAssembly.validate(Kt)&&(t=Xt,console.log("Warning: meshopt_decoder is using experimental SIMD support"));const e=await WebAssembly.instantiate(function(t){const e=new Uint8Array(t.length);for(let i=0;i<t.length;++i){const n=t.charCodeAt(i);e[i]=n>96?n-71:n>64?n-65:n>47?n+4:n>46?63:62}let n=0;for(let i=0;i<t.length;++i)e[n++]=e[i]<60?Qt[e[i]]:64*(e[i]-60)+e[++i];return e.buffer.slice(0,n)}(t),{});return await e.instance.exports.__wasm_call_ctors(),e.instance}()),$t}function ee(t,e,n,i,r,o,s){const a=t.exports.sbrk,l=i+3&-4,c=a(l*r),u=a(o.length),h=new Uint8Array(t.exports.memory.buffer);h.set(o,u);const d=e(c,i,r,u,o.length);if(0===d&&s&&s(c,l,r),n.set(h.subarray(c,c+i*r)),a(c-a(0)),0!==d)throw new Error(`Malformed buffer data: ${d}`)}const ne="EXT_meshopt_compression",ie=ne;async function re(t,e){const n=new yt(t);if(!e?.gltf?.decompressMeshes||!e.gltf?.loadBuffers)return;const i=[];for(const r of t.json.bufferViews||[])i.push(oe(n,r));await Promise.all(i),n.removeExtension(ne)}async function oe(t,e){const n=t.getObjectExtension(e,ne);if(n){const{byteOffset:i=0,byteLength:r=0,byteStride:o,count:s,mode:a,filter:l="NONE",buffer:c}=n,u=t.gltf.buffers[c],h=new Uint8Array(u.arrayBuffer,u.byteOffset+i,r),d=new Uint8Array(t.gltf.buffers[e.buffer].arrayBuffer,e.byteOffset,e.byteLength);await async function(t,e,n,i,r){let o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"NONE";const s=await te();ee(s,s.exports[Yt[r]],t,e,n,i,s.exports[Jt[o||"NONE"]])}(d,s,o,h,a,l),t.removeObjectExtension(e,ne)}}var se=n(24814);const ae={};function le(t){if(void 0===ae[t]){const e=se.Bd?function(t){switch(t){case"image/avif":case"image/webp":return function(t){try{const e=document.createElement("canvas");return 0===e.toDataURL(t).indexOf(`data:${t}`)}catch{return!1}}(t);default:return!0}}(t):ce(t);ae[t]=e}return ae[t]}function ce(t){const e=globalThis.loaders?.imageFormatsNode||["image/png","image/jpeg","image/gif"],n=globalThis.loaders?.parseImageNode;return Boolean(n)&&e.includes(t)}const ue="EXT_texture_webp",he=ue;function de(t,e){const n=new yt(t);if(!le("image/webp")){if(n.getRequiredExtensions().includes(ue))throw new Error(`gltf: Required extension ${ue} not supported by browser`);return}const{json:i}=n;for(const r of i.textures||[]){const t=n.getObjectExtension(r,ue);t&&(r.source=t.source),n.removeObjectExtension(r,ue)}n.removeExtension(ue)}const pe="KHR_texture_basisu",fe=pe;function Ae(t,e){const n=new yt(t),{json:i}=n;for(const r of i.textures||[]){const t=n.getObjectExtension(r,pe);t&&(r.source=t.source,n.removeObjectExtension(r,pe))}n.removeExtension(pe)}var ge=n(46315);function me(t){const{buffer:e,size:n,count:i}=function(t){let e=t,n=1,i=0;t&&t.value&&(e=t.value,n=t.size||1);e&&(ArrayBuffer.isView(e)||(e=function(t,e){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!t)return null;if(Array.isArray(t))return new e(t);if(n&&!(t instanceof e))return new e(t);return t}(e,Float32Array)),i=e.length/n);return{buffer:e,size:n,count:i}}(t);return{value:e,size:n,byteOffset:0,count:i,type:(0,At.v7)(n),componentType:(0,At.rA)(e)}}const ye="KHR_draco_mesh_compression",_e=ye;function ve(t,e,n){const i=new yt(t);for(const r of Ce(i))i.getObjectExtension(r,ye)}async function be(t,e,n){if(!e?.gltf?.decompressMeshes)return;const i=new yt(t),r=[];for(const o of Ce(i))i.getObjectExtension(o,ye)&&r.push(we(i,o,e,n));await Promise.all(r),i.removeExtension(ye)}function xe(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=new yt(t);for(const i of n.json.meshes||[])Ee(i,e),n.addRequiredExtension(ye)}async function we(t,e,n,i){const r=t.getObjectExtension(e,ye);if(!r)return;const o=t.getTypedArrayForBufferView(r.bufferView),s=(0,g._m)(o.buffer,o.byteOffset),a={...n};delete a["3d-tiles"];const l=await(0,m.N9)(s,ge.Vl,a,i),c=function(t){const e={};for(const n in t){const i=t[n];if("indices"!==n){const t=me(i);e[n]=t}}return e}(l.attributes);for(const[u,h]of Object.entries(c))if(u in e.attributes){const n=e.attributes[u],i=t.getAccessor(n);i?.min&&i?.max&&(h.min=i.min,h.max=i.max)}e.attributes=c,l.indices&&(e.indices=me(l.indices)),t.removeObjectExtension(e,ye),function(t){if(!t.attributes&&Object.keys(t.attributes).length>0)throw new Error("glTF: Empty primitive detected: Draco decompression failure?")}(e)}function Ee(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:4,i=arguments.length>3?arguments[3]:void 0,r=arguments.length>4?arguments[4]:void 0;if(!i.DracoWriter)throw new Error("options.gltf.DracoWriter not provided");const o=i.DracoWriter.encodeSync({attributes:t}),s=r?.parseSync?.({attributes:t}),a=i._addFauxAttributes(s.attributes),l=i.addBufferView(o);return{primitives:[{attributes:a,mode:n,extensions:{[ye]:{bufferView:l,attributes:a}}}]}}function*Ce(t){for(const e of t.json.meshes||[])for(const t of e.primitives)yield t}var Te=n(15183),Se=n(63869),Pe=n(13711);const Me="KHR_texture_transform",Ie=Me,Be=new Te.P,Re=new Se.d,Le=new Se.d;async function Oe(t,e){if(!new yt(t).hasExtension(Me)||!e.gltf?.loadBuffers)return;const n=t.json.materials||[];for(let i=0;i<n.length;i++)De(i,t)}function De(t,e){const n=e.json.materials?.[t],i=[n?.pbrMetallicRoughness?.baseColorTexture,n?.emissiveTexture,n?.normalTexture,n?.occlusionTexture,n?.pbrMetallicRoughness?.metallicRoughnessTexture],r=[];for(const o of i)o&&o?.extensions?.[Me]&&ke(e,t,o,r)}function ke(t,e,n,i){const r=function(t,e){const n=t.extensions?.[Me],{texCoord:i=0}=t,{texCoord:r=i}=n,o=-1!==e.findIndex((t=>{let[e,n]=t;return e===i&&n===r}));if(!o){const o=function(t){const{offset:e=[0,0],rotation:n=0,scale:i=[1,1]}=t,r=(new Se.d).set(1,0,0,0,1,0,e[0],e[1],1),o=Re.set(Math.cos(n),Math.sin(n),0,-Math.sin(n),Math.cos(n),0,0,0,1),s=Le.set(i[0],0,0,0,i[1],0,0,0,1);return r.multiplyRight(o).multiplyRight(s)}(n);return i!==r&&(t.texCoord=r),e.push([i,r]),{originalTexCoord:i,texCoord:r,matrix:o}}return null}(n,i);if(!r)return;const o=t.json.meshes||[];for(const s of o)for(const n of s.primitives){const i=n.material;Number.isFinite(i)&&e===i&&Fe(t,n,r)}}function Fe(t,e,n){const{originalTexCoord:i,texCoord:r,matrix:o}=n,s=e.attributes[`TEXCOORD_${i}`];if(Number.isFinite(s)){const n=t.json.accessors?.[s];if(n&&n.bufferView){const s=t.json.bufferViews?.[n.bufferView];if(s){const{arrayBuffer:a,byteOffset:l}=t.buffers[s.buffer],c=(l||0)+(n.byteOffset||0)+(s.byteOffset||0),{ArrayType:u,length:h}=(0,At.aF)(n,s),d=Pe.E9[n.componentType],p=Pe.$j[n.type],f=s.byteStride||d*p,A=new Float32Array(h);for(let t=0;t<n.count;t++){const e=new u(a,c+t*f,2);Be.set(e[0],e[1],1),Be.transformByMatrix3(o),A.set([Be[0],Be[1]],t*p)}i===r?function(t,e,n,i){t.componentType=5126,n.push({arrayBuffer:i.buffer,byteOffset:0,byteLength:i.buffer.byteLength}),e.buffer=n.length-1,e.byteLength=i.buffer.byteLength,e.byteOffset=0,delete e.byteStride}(n,s,t.buffers,A):function(t,e,n,i,r){i.buffers.push({arrayBuffer:r.buffer,byteOffset:0,byteLength:r.buffer.byteLength});const o=i.json.bufferViews;if(!o)return;o.push({buffer:i.buffers.length-1,byteLength:r.buffer.byteLength,byteOffset:0});const s=i.json.accessors;if(!s)return;s.push({bufferView:o?.length-1,byteOffset:0,componentType:5126,count:e.count,type:"VEC2"}),n.attributes[`TEXCOORD_${t}`]=s.length-1}(r,n,e,t,A)}}}}const Ne="KHR_lights_punctual",ze=Ne;async function Ue(t){const e=new yt(t),{json:n}=e,i=e.getExtension(Ne);i&&(e.json.lights=i.lights,e.removeExtension(Ne));for(const r of n.nodes||[]){const t=e.getObjectExtension(r,Ne);t&&(r.light=t.light),e.removeObjectExtension(r,Ne)}}async function Ge(t){const e=new yt(t),{json:n}=e;if(n.lights){const t=e.addExtension(Ne);(0,Y.v)(!t.lights),t.lights=n.lights,delete n.lights}if(e.json.lights){for(const t of e.json.lights){const n=t.node;e.addObjectExtension(n,Ne,t)}delete e.json.lights}}const Ve="KHR_materials_unlit",je=Ve;async function He(t){const e=new yt(t),{json:n}=e;for(const i of n.materials||[]){i.extensions&&i.extensions.KHR_materials_unlit&&(i.unlit=!0),e.removeObjectExtension(i,Ve)}e.removeExtension(Ve)}function We(t){const e=new yt(t),{json:n}=e;if(e.materials)for(const i of n.materials||[])i.unlit&&(delete i.unlit,e.addObjectExtension(i,Ve,{}),e.addExtension(Ve))}const qe="KHR_techniques_webgl",Ze=qe;async function Xe(t){const e=new yt(t),{json:n}=e,i=e.getExtension(qe);if(i){const t=function(t,e){const{programs:n=[],shaders:i=[],techniques:r=[]}=t,o=new TextDecoder;return i.forEach((t=>{if(!Number.isFinite(t.bufferView))throw new Error("KHR_techniques_webgl: no shader code");t.code=o.decode(e.getTypedArrayForBufferView(t.bufferView))})),n.forEach((t=>{t.fragmentShader=i[t.fragmentShader],t.vertexShader=i[t.vertexShader]})),r.forEach((t=>{t.program=n[t.program]})),r}(i,e);for(const i of n.materials||[]){const n=e.getObjectExtension(i,qe);n&&(i.technique=Object.assign({},n,t[n.technique]),i.technique.values=Qe(i.technique,e)),e.removeObjectExtension(i,qe)}e.removeExtension(qe)}}async function Ke(t,e){}function Qe(t,e){const n=Object.assign({},t.values);return Object.keys(t.uniforms||{}).forEach((e=>{t.uniforms[e].value&&!(e in n)&&(n[e]=t.uniforms[e].value)})),Object.keys(n).forEach((t=>{"object"===typeof n[t]&&void 0!==n[t].index&&(n[t].texture=e.getTexture(n[t].index))})),n}const Je="EXT_feature_metadata",Ye=Je;async function $e(t,e){!function(t,e){if(!e.gltf?.loadBuffers)return;const n=t.getExtension(Je);if(!n)return;e.gltf?.loadImages&&function(t,e){const n=e.schema;if(!n)return;const i=n.classes,{featureTextures:r}=e;if(i&&r)for(const o in i){const e=i[o],n=en(r,o);n&&rn(t,n,e)}}(t,n);!function(t,e){const n=e.schema;if(!n)return;const i=n.classes,r=e.featureTables;if(i&&r)for(const o in i){const e=tn(r,o);e&&nn(t,n,e)}}(t,n)}(new yt(t),e)}function tn(t,e){for(const n in t){const i=t[n];if(i.class===e)return i}return null}function en(t,e){for(const n in t){const i=t[n];if(i.class===e)return i}return null}function nn(t,e,n){if(!n.class)return;const i=e.classes?.[n.class];if(!i)throw new Error(`Incorrect data in the EXT_structural_metadata extension: no schema class with name ${n.class}`);const r=n.count;for(const o in i.properties){const s=i.properties[o],a=n.properties?.[o];if(a){const n=on(t,e,s,r,a);a.data=n}}}function rn(t,e,n){const i=e.class;for(const r in n.properties){const n=e?.properties?.[r];if(n){const e=sn(t,n,i);n.data=e}}}function on(t,e,n,i,r){let o=[];const s=r.bufferView,a=t.getTypedArrayForBufferView(s),l=function(t,e,n,i){if("ARRAY"===e.type&&"undefined"===typeof e.componentCount&&"undefined"!==typeof n.arrayOffsetBufferView)return Ct(t,n.arrayOffsetBufferView,n.offsetType||"UINT32",i);return null}(t,n,r,i),c=function(t,e,n,i){if("undefined"!==typeof n.stringOffsetBufferView)return Ct(t,n.stringOffsetBufferView,n.offsetType||"UINT32",i);return null}(t,0,r,i);return"STRING"===n.type||"STRING"===n.componentType?o=Rt(i,a,l,c):function(t){const e=["UINT8","INT16","UINT16","INT32","UINT32","INT64","UINT64","FLOAT32","FLOAT64"];return e.includes(t.type)||"undefined"!==typeof t.componentType&&e.includes(t.componentType)}(n)&&(o=function(t,e,n,i){const r="ARRAY"===t.type,o=t.componentCount,s="SCALAR",a=t.componentType||t.type,l=Et(s,a),c=n.byteLength/l,u=Tt(n,s,a,c);if(r)return i?It(u,e,i,n.length,l):o?Bt(u,e,o):[];return u}(n,i,a,l)),o}function sn(t,e,n){const i=t.gltf.json;if(!i.meshes)return[];const r=[];for(const o of i.meshes)for(const i of o.primitives)an(t,n,e,r,i);return r}function an(t,e,n,i,r){const o=St(t,{channels:n.channels,...n.texture},r);o&&Pt(t,e,o,i,r)}const ln=[r,i,o,s,a,l,u,h,d,c,p];function cn(t,e){const n=e?.gltf?.excludeExtensions||{};return!(t in n&&!n[t])}const un="KHR_binary_glTF";const hn={accessors:"accessor",animations:"animation",buffers:"buffer",bufferViews:"bufferView",images:"image",materials:"material",meshes:"mesh",nodes:"node",samplers:"sampler",scenes:"scene",skins:"skin",textures:"texture"},dn={accessor:"accessors",animations:"animation",buffer:"buffers",bufferView:"bufferViews",image:"images",material:"materials",mesh:"meshes",node:"nodes",sampler:"samplers",scene:"scenes",skin:"skins",texture:"textures"};class pn{idToIndexMap={animations:{},accessors:{},buffers:{},bufferViews:{},images:{},materials:{},meshes:{},nodes:{},samplers:{},scenes:{},skins:{},textures:{}};json;normalize(t,e){this.json=t.json;const n=t.json;switch(n.asset&&n.asset.version){case"2.0":return;case void 0:case"1.0":break;default:return void console.warn(`glTF: Unknown version ${n.asset.version}`)}if(!e.normalize)throw new Error("glTF v1 is not supported.");console.warn("Converting glTF v1 to glTF v2 format. This is experimental and may fail."),this._addAsset(n),this._convertTopLevelObjectsToArrays(n),function(t){const e=new yt(t),{json:n}=e;for(const i of n.images||[]){const t=e.getObjectExtension(i,un);t&&Object.assign(i,t),e.removeObjectExtension(i,un)}n.buffers&&n.buffers[0]&&delete n.buffers[0].uri,e.removeExtension(un)}(t),this._convertObjectIdsToArrayIndices(n),this._updateObjects(n),this._updateMaterial(n)}_addAsset(t){t.asset=t.asset||{},t.asset.version="2.0",t.asset.generator=t.asset.generator||"Normalized to glTF 2.0 by loaders.gl"}_convertTopLevelObjectsToArrays(t){for(const e in hn)this._convertTopLevelObjectToArray(t,e)}_convertTopLevelObjectToArray(t,e){const n=t[e];if(n&&!Array.isArray(n)){t[e]=[];for(const i in n){const r=n[i];r.id=r.id||i;const o=t[e].length;t[e].push(r),this.idToIndexMap[e][i]=o}}}_convertObjectIdsToArrayIndices(t){for(const e in hn)this._convertIdsToIndices(t,e);"scene"in t&&(t.scene=this._convertIdToIndex(t.scene,"scene"));for(const e of t.textures)this._convertTextureIds(e);for(const e of t.meshes)this._convertMeshIds(e);for(const e of t.nodes)this._convertNodeIds(e);for(const e of t.scenes)this._convertSceneIds(e)}_convertTextureIds(t){t.source&&(t.source=this._convertIdToIndex(t.source,"image"))}_convertMeshIds(t){for(const e of t.primitives){const{attributes:t,indices:n,material:i}=e;for(const e in t)t[e]=this._convertIdToIndex(t[e],"accessor");n&&(e.indices=this._convertIdToIndex(n,"accessor")),i&&(e.material=this._convertIdToIndex(i,"material"))}}_convertNodeIds(t){t.children&&(t.children=t.children.map((t=>this._convertIdToIndex(t,"node")))),t.meshes&&(t.meshes=t.meshes.map((t=>this._convertIdToIndex(t,"mesh"))))}_convertSceneIds(t){t.nodes&&(t.nodes=t.nodes.map((t=>this._convertIdToIndex(t,"node"))))}_convertIdsToIndices(t,e){t[e]||(console.warn(`gltf v1: json doesn't contain attribute ${e}`),t[e]=[]);for(const n of t[e])for(const t in n){const e=n[t],i=this._convertIdToIndex(e,t);n[t]=i}}_convertIdToIndex(t,e){const n=dn[e];if(n in this.idToIndexMap){const i=this.idToIndexMap[n][t];if(!Number.isFinite(i))throw new Error(`gltf v1: failed to resolve ${e} with id ${t}`);return i}return t}_updateObjects(t){for(const e of this.json.buffers)delete e.type}_updateMaterial(t){for(const e of t.materials){e.pbrMetallicRoughness={baseColorFactor:[1,1,1,1],metallicFactor:1,roughnessFactor:1};const n=e.values?.tex||e.values?.texture2d_0||e.values?.diffuseTex,i=t.textures.findIndex((t=>t.id===n));-1!==i&&(e.pbrMetallicRoughness.baseColorTexture={index:i})}}}async function fn(t,e){let n=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0;return function(t,e,n,i){i.uri&&(t.baseUri=i.uri);if(e instanceof ArrayBuffer&&!function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i=new DataView(t),{magic:r=it}=n,o=i.getUint32(e,!1);return o===r||o===it}(e,n,i)){e=(new TextDecoder).decode(e)}if("string"===typeof e)t.json=A(e);else if(e instanceof ArrayBuffer){const r={};n=ht(r,e,n,i.glb),(0,Y.v)("glTF"===r.type,`Invalid GLB magic string ${r.type}`),t._glb=r,t.json=r.json}else(0,Y.v)(!1,"GLTF: must be ArrayBuffer or string");const r=t.json.buffers||[];if(t.buffers=new Array(r.length).fill(null),t._glb&&t._glb.header.hasBinChunk){const{binChunks:e}=t._glb;t.buffers[0]={arrayBuffer:e[0].arrayBuffer,byteOffset:e[0].byteOffset,byteLength:e[0].byteLength}}const o=t.json.images||[];t.images=new Array(o.length).fill({})}(t,e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n),function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(new pn).normalize(t,e)}(t,{normalize:n?.gltf?.normalize}),function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;const i=ln.filter((t=>cn(t.name,e)));for(const r of i)r.preprocess?.(t,e,n)}(t,n,i),n?.gltf?.loadBuffers&&t.json.buffers&&await async function(t,e,n){const i=t.json.buffers||[];for(let r=0;r<i.length;++r){const o=i[r];if(o.uri){const{fetch:i}=n;(0,Y.v)(i);const s=ft(o.uri,e),a=await(n?.fetch?.(s)),l=await(a?.arrayBuffer?.());t.buffers[r]={arrayBuffer:l,byteOffset:0,byteLength:l.byteLength},delete o.uri}else null===t.buffers[r]&&(t.buffers[r]={arrayBuffer:new ArrayBuffer(o.byteLength),byteOffset:0,byteLength:o.byteLength})}}(t,n,i),n?.gltf?.loadImages&&await async function(t,e,n){const i=function(t){const e=new Set,n=t.json.textures||[];for(const i of n)void 0!==i.source&&e.add(i.source);return Array.from(e).sort()}(t),r=t.json.images||[],o=[];for(const s of i)o.push(An(t,r[s],s,e,n));return await Promise.all(o)}(t,n,i),await async function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;const i=ln.filter((t=>cn(t.name,e)));for(const r of i)await(r.decode?.(t,e,n))}(t,n,i),t}async function An(t,e,n,i,r){let o;if(e.uri&&!e.hasOwnProperty("bufferView")){const t=ft(e.uri,i),{fetch:n}=r,s=await n(t);o=await s.arrayBuffer(),e.bufferView={data:o}}if(Number.isFinite(e.bufferView)){const n=gt(t.json,t.buffers,e.bufferView);o=(0,g._m)(n.buffer,n.byteOffset,n.byteLength)}(0,Y.v)(o,"glTF image has no data");let s=await(0,m.N9)(o,[y.$,J],{...i,mimeType:e.mimeType,basis:i.basis||{format:Q()}},r);s&&s[0]&&(s={compressed:!0,mipmaps:!1,width:s[0].width,height:s[0].height,data:s[0]}),t.images=t.images||[],t.images[n]=s}const gn={dataType:null,batchType:null,name:"glTF",id:"gltf",module:"gltf",version:"4.2.4",extensions:["gltf","glb"],mimeTypes:["model/gltf+json","model/gltf-binary"],text:!0,binary:!0,tests:["glTF"],parse:async function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;e={...gn.options,...e},e.gltf={...gn.options.gltf,...e.gltf};const{byteOffset:i=0}=e;return await fn({},t,i,e,n)},options:{gltf:{normalize:!0,loadBuffers:!0,loadImages:!0,decompressMeshes:!0},log:console}}},91431:(t,e,n)=>{"use strict";n.d(e,{R:()=>m});var i=n(64878),r=n(17071);const o={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},s={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},a=10240,l=10241,c=10242,u=10243,h=10497,d=9729,p=9986,f={magFilter:a,minFilter:l,wrapS:c,wrapT:u},A={[a]:d,[l]:p,[c]:h,[u]:h};class g
vendor: 5,053 bytes, line 2
2{baseUri="";jsonUnprocessed;json;buffers=[];images=[];postProcess(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{json:n,buffers:r=[],images:o=[]}=t,{baseUri:s=""}=t;return(0,i.v)(n),this.baseUri=s,this.buffers=r,this.images=o,this.jsonUnprocessed=n,this.json=this._resolveTree(t.json,e),this.json}_resolveTree(t){const e={...t};return this.json=e,t.bufferViews&&(e.bufferViews=t.bufferViews.map(((t,e)=>this._resolveBufferView(t,e)))),t.images&&(e.images=t.images.map(((t,e)=>this._resolveImage(t,e)))),t.samplers&&(e.samplers=t.samplers.map(((t,e)=>this._resolveSampler(t,e)))),t.textures&&(e.textures=t.textures.map(((t,e)=>this._resolveTexture(t,e)))),t.accessors&&(e.accessors=t.accessors.map(((t,e)=>this._resolveAccessor(t,e)))),t.materials&&(e.materials=t.materials.map(((t,e)=>this._resolveMaterial(t,e)))),t.meshes&&(e.meshes=t.meshes.map(((t,e)=>this._resolveMesh(t,e)))),t.nodes&&(e.nodes=t.nodes.map(((t,e)=>this._resolveNode(t,e))),e.nodes=e.nodes.map(((t,e)=>this._resolveNodeChildren(t)))),t.skins&&(e.skins=t.skins.map(((t,e)=>this._resolveSkin(t,e)))),t.scenes&&(e.scenes=t.scenes.map(((t,e)=>this._resolveScene(t,e)))),"number"===typeof this.json.scene&&e.scenes&&(e.scene=e.scenes[this.json.scene]),e}getScene(t){return this._get(this.json.scenes,t)}getNode(t){return this._get(this.json.nodes,t)}getSkin(t){return this._get(this.json.skins,t)}getMesh(t){return this._get(this.json.meshes,t)}getMaterial(t){return this._get(this.json.materials,t)}getAccessor(t){return this._get(this.json.accessors,t)}getCamera(t){return this._get(this.json.cameras,t)}getTexture(t){return this._get(this.json.textures,t)}getSampler(t){return this._get(this.json.samplers,t)}getImage(t){return this._get(this.json.images,t)}getBufferView(t){return this._get(this.json.bufferViews,t)}getBuffer(t){return this._get(this.json.buffers,t)}_get(t,e){if("object"===typeof e)return e;const n=t&&t[e];return n||console.warn(`glTF file error: Could not find ${t}[${e}]`),n}_resolveScene(t,e){return{...t,id:t.id||`scene-${e}`,nodes:(t.nodes||[]).map((t=>this.getNode(t)))}}_resolveNode(t,e){const n={...t,id:t?.id||`node-${e}`};return void 0!==t.mesh&&(n.mesh=this.getMesh(t.mesh)),void 0!==t.camera&&(n.camera=this.getCamera(t.camera)),void 0!==t.skin&&(n.skin=this.getSkin(t.skin)),void 0!==t.meshes&&t.meshes.length&&(n.mesh=t.meshes.reduce(((t,e)=>{const n=this.getMesh(e);return t.id=n.id,t.primitives=t.primitives.concat(n.primitives),t}),{primitives:[]})),n}_resolveNodeChildren(t){return t.children&&(t.children=t.children.map((t=>this.getNode(t)))),t}_resolveSkin(t,e){const n="number"===typeof t.inverseBindMatrices?this.getAccessor(t.inverseBindMatrices):void 0;return{...t,id:t.id||`skin-${e}`,inverseBindMatrices:n}}_resolveMesh(t,e){const n={...t,id:t.id||`mesh-${e}`,primitives:[]};return t.primitives&&(n.primitives=t.primitives.map((t=>{const e={...t,attributes:{},indices:void 0,material:void 0},n=t.attributes;for(const i in n)e.attributes[i]=this.getAccessor(n[i]);return void 0!==t.indices&&(e.indices=this.getAccessor(t.indices)),void 0!==t.material&&(e.material=this.getMaterial(t.material)),e}))),n}_resolveMaterial(t,e){const n={...t,id:t.id||`material-${e}`};if(n.normalTexture&&(n.normalTexture={...n.normalTexture},n.normalTexture.texture=this.getTexture(n.normalTexture.index)),n.occlusionTexture&&(n.occlusionTexture={...n.occlusionTexture},n.occlusionTexture.texture=this.getTexture(n.occlusionTexture.index)),n.emissiveTexture&&(n.emissiveTexture={...n.emissiveTexture},n.emissiveTexture.texture=this.getTexture(n.emissiveTexture.index)),n.emissiveFactor||(n.emissiveFactor=n.emissiveTexture?[1,1,1]:[0,0,0]),n.pbrMetallicRoughness){n.pbrMetallicRoughness={...n.pbrMetallicRoughness};const t=n.pbrMetallicRoughness;t.baseColorTexture&&(t.baseColorTexture={...t.baseColorTexture},t.baseColorTexture.texture=this.getTexture(t.baseColorTexture.index)),t.metallicRoughnessTexture&&(t.metallicRoughnessTexture={...t.metallicRoughnessTexture},t.metallicRoughnessTexture.texture=this.getTexture(t.metallicRoughnessTexture.index))}return n}_resolveAccessor(t,e){const n=(i=t.componentType,s[i]);var i;const a=(l=t.type,o[l]);var l;const c=n*a,u={...t,id:t.id||`accessor-${e}`,bytesPerComponent:n,components:a,bytesPerElement:c,value:void 0,bufferView:void 0,sparse:void 0};if(void 0!==t.bufferView&&(u.bufferView=this.getBufferView(t.bufferView)),u.bufferView){const t=u.bufferView.buffer,{ArrayType:e,byteLength:n}=(0,r.aF)(u,u.bufferView),i=(u.bufferView.byteOffset||0)+(u.byteOffset||0)+t.byteOffset;let o=t.arrayBuffer.slice(i,i+n);u.bufferView.byteStride&&(o=this._getValueFromInterleavedBuffer(t,i,u.bufferView.byteStride,u.bytesPerElement,u.count)),u.value=new e(o)}return u}_getValueFromInterleavedBuffer(t,e,n,i,r){const o=new Uint8Array(r*i);for(let s=0;s<r;s++){const r=e+s*n;o.set(new Uint8Array(t.arrayBuffer.slice(r,r+i)),s*i)}return o.buffer}_resolveTexture(t,e){return{...t,id:t.id||`texture-${e}`,sampler:"number"===typeof t.sampler?this.getSampler(t.sampler):{id:"default-sampler",parameters:
vendor: 55,780 bytes, line 2
2A},source:"number"===typeof t.source?this.getImage(t.source):void 0}}_resolveSampler(t,e){const n={id:t.id||`sampler-${e}`,...t,parameters:{}};for(const i in n){const t=this._enumSamplerParameter(i);void 0!==t&&(n.parameters[t]=n[i])}return n}_enumSamplerParameter(t){return f[t]}_resolveImage(t,e){const n={...t,id:t.id||`image-${e}`,image:null,bufferView:void 0!==t.bufferView?this.getBufferView(t.bufferView):void 0},i=this.images[e];return i&&(n.image=i),n}_resolveBufferView(t,e){const n=t.buffer,i=this.buffers[n].arrayBuffer;let r=this.buffers[n].byteOffset||0;t.byteOffset&&(r+=t.byteOffset);return{id:`bufferView-${e}`,...t,buffer:this.buffers[n],data:new Uint8Array(i,r,t.byteLength)}}_resolveCamera(t,e){const n={...t,id:t.id||`camera-${e}`};return n.perspective,n.orthographic,n}}function m(t,e){return(new g).postProcess(t,e)}},13711:(t,e,n)=>{"use strict";n.d(e,{$j:()=>i,E9:()=>r});const i={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},r={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4}},17071:(t,e,n)=>{"use strict";n.d(e,{S3:()=>A,aF:()=>f,rA:()=>p,v7:()=>d});var i=n(64878),r=n(13711);const o=1.33,s=["SCALAR","VEC2","VEC3","VEC4"],a=[[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Uint32Array,5125],[Float32Array,5126],[Float64Array,5130]],l=new Map(a),c={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},u={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},h={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function d(t){return s[t-1]||s[0]}function p(t){const e=l.get(t.constructor);if(!e)throw new Error("Illegal typed array");return e}function f(t,e){const n=h[t.componentType],o=c[t.type],s=u[t.componentType],a=t.count*o,l=t.count*o*s;(0,i.v)(l>=0&&l<=e.byteLength);return{ArrayType:n,length:a,byteLength:l,componentByteSize:r.E9[t.componentType],numberOfComponentsInElement:r.$j[t.type]}}function A(t){let{images:e,bufferViews:n}=t;e=e||[],n=n||[];const i=e.map((t=>t.bufferView));n=n.filter((t=>!i.includes(t)));const r=n.reduce(((t,e)=>t+e.byteLength),0),s=e.reduce(((t,e)=>{const{width:n,height:i}=e.image;return t+n*i}),0);return r+Math.ceil(4*s*o)}},64878:(t,e,n)=>{"use strict";function i(t,e){if(!t)throw new Error(e||"assert failed: gltf")}n.d(e,{v:()=>i})},83474:(t,e,n)=>{"use strict";n.d(e,{$:()=>v});var i=n(21402),r=n(24814);const o=globalThis.loaders?.parseImageNode,s="undefined"!==typeof Image,a="undefined"!==typeof ImageBitmap,l=Boolean(o),c=!!r.Bd||l;var u=n(32143);const h=/^data:image\/svg\+xml/,d=/\.svg((\?|#).*)?$/;function p(t){return t&&(h.test(t)||d.test(t))}function f(t,e){if(p(e))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(t)])}async function A(t,e,n){const i=function(t,e){if(p(e)){let e=(new TextDecoder).decode(t);try{"function"===typeof unescape&&"function"===typeof encodeURIComponent&&(e=unescape(encodeURIComponent(e)))}catch(n){throw new Error(n.message)}return`data:image/svg+xml;base64,${btoa(e)}`}return f(t,e)}(t,n),r=self.URL||self.webkitURL,o="string"!==typeof i&&r.createObjectURL(i);try{return await async function(t,e){const n=new Image;if(n.src=t,e.image&&e.image.decode&&n.decode)return await n.decode(),n;return await new Promise(((t,e)=>{try{n.onload=()=>t(n),n.onerror=t=>{const n=t instanceof Error?t.message:"error";e(new Error(n))}}catch(i){e(i)}}))}(o||i,e)}finally{o&&r.revokeObjectURL(o)}}const g={};let m=!0;async function y(t,e,n){let i;if(p(n)){i=await A(t,e,n)}else i=f(t,n);const r=e&&e.imagebitmap;return await async function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;!function(t){for(const e in t||g)return!1;return!0}(e)&&m||(e=null);if(e)try{return await createImageBitmap(t,e)}catch(n){console.warn(n),m=!1}return await createImageBitmap(t)}(i,r)}var _=n(9961);const v={dataType:null,batchType:null,id:"image",module:"images",name:"Images",version:"4.2.4",mimeTypes:["image/png","image/jpeg","image/gif","image/webp","image/avif","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],extensions:["png","jpg","jpeg","gif","webp","bmp","ico","svg","avif"],parse:async function(t,e,n){const r=((e=e||{}).image||{}).type||"auto",{url:o}=n||{};let l;switch(function(t){switch(t){case"auto":case"data":return function(){if(a)return"imagebitmap";if(s)return"image";if(c)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}();default:return function(t){switch(t){case"auto":return a||s||c;case"imagebitmap":return a;case"image":return s;case"data":return c;default:throw new Error(`@loaders.gl/images: image ${t} not supported in this environment`)}}(t),t}}(r)){case"imagebitmap":l=await y(t,e,o);break;case"image":l=await A(t,e,o);break;case"data":l=await async function(t){const{mimeType:e}=(0,_.m)(t)||{},n=globalThis.loaders?.parseImageNode;return(0,i.v)(n),await n(t,e)}(t);break;default:(0,i.v)(!1)}return"data"===r&&(l=(0,u.M5)(l)),l},tests:[t=>Boolean((0,_.m)(new DataView(t)))],options:{image:{type:"auto",decode:!0}}}},9961:(t,e,n)=>{"use strict";function i(t){return function(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const i=(r=e,[...r].map((t=>t.charCodeAt(0))));var r;for(let o=0;o<i.length;++o)if(i[o]!==t[o+n])return!1;return!0}(t,"ftyp",4)?0===(96&t[8])?null:function(t){switch((e=t,n=8,i=12,String.fromCharCode(...e.slice(n,i))).replace("\0"," ").trim()){case"avif":case"avis":return{extension:"avif",mimeType:"image/avif"};default:return null}var e,n,i}(t):null}n.d(e,{m:()=>s});const r=!1,o=!0;function s(t){const e=a(t);return function(t){const e=a(t),n=e.byteLength>=24&&2303741511===e.getUint32(0,r);if(!n)return null;return{mimeType:"image/png",width:e.getUint32(16,r),height:e.getUint32(20,r)}}(e)||function(t){const e=a(t),n=e.byteLength>=3&&65496===e.getUint16(0,r)&&255===e.getUint8(2);if(!n)return null;const{tableMarkers:i,sofMarkers:o}=function(){const t=new Set([65499,65476,65484,65501,65534]);for(let n=65504;n<65520;++n)t.add(n);const e=new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502]);return{tableMarkers:t,sofMarkers:e}}();let s=2;for(;s+9<e.byteLength;){const t=e.getUint16(s,r);if(o.has(t))return{mimeType:"image/jpeg",height:e.getUint16(s+5,r),width:e.getUint16(s+7,r)};if(!i.has(t))return null;s+=2,s+=e.getUint16(s,r)}return null}(e)||function(t){const e=a(t),n=e.byteLength>=10&&1195984440===e.getUint32(0,r);if(!n)return null;return{mimeType:"image/gif",width:e.getUint16(6,o),height:e.getUint16(8,o)}}(e)||function(t){const e=a(t),n=e.byteLength>=14&&16973===e.getUint16(0,r)&&e.getUint32(2,o)===e.byteLength;if(!n)return null;return{mimeType:"image/bmp",width:e.getUint32(18,o),height:e.getUint32(22,o)}}(e)||function(t){const e=new Uint8Array(t instanceof DataView?t.buffer:t),n=i(e);if(!n)return null;return{mimeType:n.mimeType,width:0,height:0}}(e)}function a(t){if(t instanceof DataView)return t;if(ArrayBuffer.isView(t))return new DataView(t.buffer);if(t instanceof ArrayBuffer)return new DataView(t);throw new Error("toDataView")}},32143:(t,e,n)=>{"use strict";function i(t){const e=o(t);if(!e)throw new Error("Not an image");return e}function r(t){switch(i(t)){case"data":return t;case"image":case"imagebitmap":const e=document.createElement("canvas"),n=e.getContext("2d");if(!n)throw new Error("getImageData");return e.width=t.width,e.height=t.height,n.drawImage(t,0,0),n.getImageData(0,0,t.width,t.height);default:throw new Error("getImageData")}}function o(t){return"undefined"!==typeof ImageBitmap&&t instanceof ImageBitmap?"imagebitmap":"undefined"!==typeof Image&&t instanceof Image?"image":t&&"object"===typeof t&&t.data&&t.width&&t.height?"data":null}n.d(e,{M5:()=>r})},5738:(t,e,n)=>{"use strict";function i(t,e,n){if(n=n||t.byteLength,t.byteLength<n||e.byteLength<n)return!1;const i=new Uint8Array(t),r=new Uint8Array(e);for(let o=0;o<i.length;++o)if(i[o]!==r[o])return!1;return!0}function r(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return function(t){const e=t.map((t=>t instanceof ArrayBuffer?new Uint8Array(t):t)),n=e.reduce(((t,e)=>t+e.byteLength),0),i=new Uint8Array(n);let r=0;for(const o of e)i.set(o,r),r+=o.byteLength;return i.buffer}(e)}function o(t,e,n){const i=void 0!==n?new Uint8Array(t).subarray(e,e+n):new Uint8Array(t).subarray(e);return new Uint8Array(i).buffer}n.d(e,{AQ:()=>r,YV:()=>i,_m:()=>o})},21402:(t,e,n)=>{"use strict";function i(t,e){if(!t)throw new Error(e||"loader assertion failed.")}n.d(e,{v:()=>i})},24814:(t,e,n)=>{"use strict";n.d(e,{Bd:()=>i});"undefined"!==typeof self&&self,"undefined"!==typeof window&&window,"undefined"!==typeof global&&global,"undefined"!==typeof document&&document;const i=Boolean("object"!==typeof process||"[object process]"!==String(process)||process.browser),r="undefined"!==typeof process&&process.version&&/v([0-9]*)/.exec(process.version);r&&parseFloat(r[1])},59328:(t,e,n)=>{"use strict";function i(t,e){return r(t||{},e)}function r(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(n>3)return e;const i={...t};for(const[o,s]of Object.entries(e))s&&"object"===typeof s&&!Array.isArray(s)?i[o]=r(i[o]||{},e[o],n+1):i[o]=e[o];return i}n.d(e,{y:()=>i})},19804:(t,e,n)=>{"use strict";function i(){if("undefined"!==typeof process&&"undefined"!==typeof process.cwd)return process.cwd();const t=window.location?.pathname;return t?.slice(0,t.lastIndexOf("/")+1)||""}function r(t){const e=t?t.lastIndexOf("/"):-1;return e>=0?t.substr(e+1):""}function o(t){const e=t?t.lastIndexOf("/"):-1;return e>=0?t.substr(0,e):""}function s(){const t=[];for(let i=0;i<arguments.length;i++)t[i]=i<0||arguments.length<=i?void 0:arguments[i];let e,n="",r=!1;for(let o=t.length-1;o>=-1&&!r;o--){let s;o>=0?s=t[o]:(void 0===e&&(e=i()),s=e),0!==s.length&&(n=`${s}/${n}`,r=s.charCodeAt(0)===a)}return n=function(t,e){let n,i="",r=-1,o=0,s=!1;for(let c=0;c<=t.length;++c){if(c<t.length)n=t.charCodeAt(c);else{if(n===a)break;n=a}if(n===a){if(r===c-1||1===o);else if(r!==c-1&&2===o){if(i.length<2||!s||i.charCodeAt(i.length-1)!==l||i.charCodeAt(i.length-2)!==l)if(i.length>2){const t=i.length-1;let e=t;for(;e>=0&&i.charCodeAt(e)!==a;--e);if(e!==t){i=-1===e?"":i.slice(0,e),r=c,o=0,s=!1;continue}}else if(2===i.length||1===i.length){i="",r=c,o=0,s=!1;continue}e&&(i.length>0?i+="/..":i="..",s=!0)}else{const e=t.slice(r+1,c);i.length>0?i+=`/${e}`:i=e,s=!1}r=c,o=0}else n===l&&-1!==o?++o:o=-1}return i}(n,!r),r?`/${n}`:n.length>0?n:"."}n.d(e,{pD:()=>o,iW:()=>r,hd:()=>s});const a=47,l=46},50297:(t,e,n)=>{"use strict";n.d(e,{A:()=>o});var i=n(1021);const r={id:"request-scheduler",throttleRequests:!0,maxRequests:6,debounceTime:0};class o{props;stats;activeRequestCount=0;requestQueue=[];requestMap=new Map;updateTimer=null;constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.props={...r,...t},this.stats=new i.A({id:this.props.id}),this.stats.get("Queued Requests"),this.stats.get("Active Requests"),this.stats.get("Cancelled Requests"),this.stats.get("Queued Requests Ever"),this.stats.get("Active Requests Ever")}scheduleRequest(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>0;if(!this.props.throttleRequests)return Promise.resolve({done:()=>{}});if(this.requestMap.has(t))return this.requestMap.get(t);const n={handle:t,priority:0,getPriority:e},i=new Promise((t=>(n.resolve=t,n)));return this.requestQueue.push(n),this.requestMap.set(t,i),this._issueNewRequests(),i}_issueRequest(t){const{handle:e,resolve:n}=t;let i=!1;const r=()=>{i||(i=!0,this.requestMap.delete(e),this.activeRequestCount--,this._issueNewRequests())};return this.activeRequestCount++,n?n({done:r}):Promise.resolve({done:r})}_issueNewRequests(){null!==this.updateTimer&&clearTimeout(this.updateTimer),this.updateTimer=setTimeout((()=>this._issueNewRequestsAsync()),this.props.debounceTime)}_issueNewRequestsAsync(){null!==this.updateTimer&&clearTimeout(this.updateTimer),this.updateTimer=null;const t=Math.max(this.props.maxRequests-this.activeRequestCount,0);if(0!==t){this._updateAllRequests();for(let e=0;e<t;++e){const t=this.requestQueue.shift();t&&this._issueRequest(t)}}}_updateAllRequests(){const t=this.requestQueue;for(let e=0;e<t.length;++e){const n=t[e];this._updateRequest(n)||(t.splice(e,1),this.requestMap.delete(n.handle),e--)}t.sort(((t,e)=>t.priority-e.priority))}_updateRequest(t){return t.priority=t.getPriority(t.handle),!(t.priority<0)||(t.resolve(null),!1)}}},62967:(t,e,n)=>{"use strict";async function i(t,e,n,i){return i._parse(t,e,n,i)}n.d(e,{N9:()=>i})},78981:(t,e,n)=>{"use strict";function i(t){let e=1/0,n=1/0,i=1/0,r=-1/0,o=-1/0,s=-1/0;const a=t.POSITION?t.POSITION.value:[],l=a&&a.length;for(let c=0;c<l;c+=3){const t=a[c],l=a[c+1],u=a[c+2];e=t<e?t:e,n=l<n?l:n,i=u<i?u:i,r=t>r?t:r,o=l>o?l:o,s=u>s?u:s}return[[e,n,i],[r,o,s]]}n.d(e,{l:()=>i})},69727:(t,e,n)=>{"use strict";function i(t,e){if(!t)throw new Error(e||"loaders.gl assertion failed.")}n.d(e,{v:()=>i})},69213:(t,e,n)=>{"use strict";n.d(e,{Bd:()=>i,Fr:()=>o,xD:()=>r});"undefined"!==typeof self&&self,"undefined"!==typeof window&&window,"undefined"!==typeof global&&global,"undefined"!==typeof document&&document;const i="object"!==typeof process||"[object process]"!==String(process)||process.browser,r="function"===typeof importScripts,o="undefined"!==typeof window&&"undefined"!==typeof window.orientation,s="undefined"!==typeof process&&process.version&&/v([0-9]*)/.exec(process.version);s&&parseFloat(s[1])},67241:(t,e,n)=>{"use strict";n.d(e,{Q:()=>r,x:()=>i});const i="latest";const r=(globalThis._loadersgl_?.version||(globalThis._loadersgl_=globalThis._loadersgl_||{},globalThis._loadersgl_.version="4.2.4"),globalThis._loadersgl_.version)},29886:(t,e,n)=>{"use strict";n.d(e,{_:()=>a});var i=n(69213),r=n(69727),o=n(67241);const s={};async function a(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return e&&(t=function(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;if(!n.useLocalLibraries&&t.startsWith("http"))return t;s=s||t;const a=n.modules||{};if(a[s])return a[s];if(!i.Bd)return`modules/${e}/dist/libs/${s}`;if(n.CDN)return(0,r.v)(n.CDN.startsWith("http")),`${n.CDN}/${e}@${o.Q}/dist/libs/${s}`;if(i.xD)return`../src/libs/${s}`;return`modules/${e}/src/libs/${s}`}(t,e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},arguments.length>3&&void 0!==arguments[3]?arguments[3]:null)),s[t]=s[t]||async function(t){if(t.endsWith("wasm"))return await async function(t){const{readFileAsArrayBuffer:e}=globalThis.loaders||{};if(i.Bd||!e||t.startsWith("http")){const e=await fetch(t);return await e.arrayBuffer()}return await e(t)}(t);if(!i.Bd)try{const{requireFromFile:e}=globalThis.loaders||{};return await(e?.(t))}catch(n){return console.error(n),null}if(i.xD)return importScripts(t);const e=await async function(t){const{readFileAsText:e}=globalThis.loaders||{};if(i.Bd||!e||t.startsWith("http")){const e=await fetch(t);return await e.text()}return await e(t)}(t);return function(t,e){if(!i.Bd){const{requireFromString:n}=globalThis.loaders||{};return n?.(t,e)}if(i.xD)return eval.call(globalThis,t),null;const n=document.createElement("script");n.id=e;try{n.appendChild(document.createTextNode(t))}catch(r){n.text=t}return document.body.appendChild(n),null}(e,t)}(t),await s[t]}},99861:(t,e,n)=>{"use strict";n.d(e,{Mr:()=>c,PV:()=>l,GE:()=>d});var i=n(44261);const r={f32:["f32",1],"vec2<f32>":["f32",2],"vec3<f32>":["f32",3],"vec4<f32>":["f32",4],f16:["f16",1],"vec2<f16>":["f16",2],"vec3<f16>":["f16",3],"vec4<f16>":["f16",4],i32:["i32",1],"vec2<i32>":["i32",2],"vec3<i32>":["i32",3],"vec4<i32>":["i32",4],u32:["u32",1],"vec2<u32>":["u32",2],"vec3<u32>":["u32",3],"vec4<u32>":["u32",4]},o={f32:4,f16:2,i32:4,u32:4};var s=n(84980);function a(t){let e;t.endsWith("-webgl")&&(t.replace("-webgl",""),e=!0);const[n,i]=t.split("x"),r=n,o=i?parseInt(i):1,a=(0,s.l)(r),l={type:r,components:o,byteLength:a.byteLength*o,integer:a.integer,signed:a.signed,normalized:a.normalized};return e&&(l.webglOnly=!0),l}function l(t,e){const n={};for(const i of t.attributes)n[i.name]=u(t,e,i.name);return n}function c(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:16;const i=l(t,e),r=new Array(n).fill(null);for(const o of Object.values(i))r[o.location]=o;return r}function u(t,e,n){const s=function(t,e){const n=t.attributes.find((t=>t.name===e));n||i.R.warn(`shader layout attribute "${e}" not present in shader`);return n||null}(t,n),l=function(t,e){h(t);let n=function(t,e){for(const n of t)if(n.format&&n.name===e)return{attributeName:n.name,bufferName:e,stepMode:n.stepMode,vertexFormat:n.format,byteOffset:0,byteStride:n.byteStride||0};return null}(t,e);if(n)return n;if(n=function(t,e){for(const n of t){let t=n.byteStride;if("number"!==typeof n.byteStride)for(const e of n.attributes||[]){t+=a(e.format).byteLength}const i=n.attributes?.find((t=>t.attribute===e));if(i)return{attributeName:i.attribute,bufferName:n.name,stepMode:n.stepMode,vertexFormat:i.format,byteOffset:i.byteOffset,byteStride:t}}return null}(t,e),n)return n;return i.R.warn(`layout for attribute "${e}" not present in buffer layout`),null}(e,n);if(!s)return null;const c=function(t){const[e,n]=r[t],i="i32"===e||"u32"===e,s="u32"!==e,a=o[e]*n,l=function(t,e){let n;switch(t){case"f32":n="float32";break;case"i32":n="sint32";break;case"u32":n="uint32";break;case"f16":return e<=2?"float16x2":"float16x4"}return 1===e?n:`${n}x${e}`}(e,n);return{dataType:e,components:n,defaultVertexFormat:l,byteLength:a,integer:i,signed:s}}(s.type),u=l?.vertexFormat||c.defaultVertexFormat,d=a(u);return{attributeName:l?.attributeName||s.name,bufferName:l?.bufferName||s.name,location:s.location,shaderType:s.type,shaderDataType:c.dataType,shaderComponents:c.components,vertexFormat:u,bufferDataType:d.type,bufferComponents:d.components,normalized:d.normalized,integer:c.integer,stepMode:l?.stepMode||s.stepMode,byteOffset:l?.byteOffset||0,byteStride:l?.byteStride||0}}function h(t){for(const e of t)(e.attributes&&e.format||!e.attributes&&!e.format)&&i.R.warn(`BufferLayout ${name} must have either 'attributes' or 'format' field`)}function d(t,e){const n={...t,attributes:t.attributes.map((t=>({...t})))};for(const r of e?.attributes||[]){const t=n.attributes.find((t=>t.name===r.name));t?(t.type=r.type||t.type,t.stepMode=r.stepMode||t.stepMode):i.R.warn(`shader layout attribute ${r.name} not present in shader`)}return n}},86561:(t,e,n)=>{"use strict";n.d(e,{h:()=>r});var i=n(98383);class r extends i.F{static defaultProps={...i.F.defaultProps,usage:0,byteLength:0,byteOffset:0,data:null,indexType:"uint16",mappedAtCreation:!1};static MAP_READ=1;static MAP_WRITE=2;static COPY_SRC=4;static COPY_DST=8;static INDEX=16;static VERTEX=32;static UNIFORM=64;static STORAGE=128;static INDIRECT=256;static QUERY_RESOLVE=512;get[Symbol.toStringTag](){return"Buffer"}usage;indexType;updateTimestamp;constructor(t,e){const n={...e};(e.usage||0)&r.INDEX&&!e.indexType&&(e.data instanceof Uint32Array?n.indexType="uint32":e.data instanceof Uint16Array&&(n.indexType="uint16")),super(t,n,r.defaultProps),this.usage=e.usage||0,this.indexType=n.indexType,this.updateTimestamp=t.incrementTimestamp()}readSyncWebGL(t,e){throw new Error("not implemented")}static DEBUG_DATA_MAX_LENGTH=32;debugData=new ArrayBuffer(0);_setDebugData(t,e,n){const i=ArrayBuffer.isView(t)?t.buffer:t,o=Math.min(t?t.byteLength:n,r.DEBUG_DATA_MAX_LENGTH);null===t?this.debugData=new ArrayBuffer(o):0===e&&n===t.byteLength?this.debugData=i.slice(0,o):this.debugData=i.slice(e,e+o)}}},74446:(t,e,n)=>{"use strict";n.d(e,{r:()=>r});var i=n(98383);class r extends i.F{static defaultProps={...i.F.defaultProps,vs:null,vertexEntryPoint:"vertexMain",vsConstants:{},fs:null,fragmentEntryPoint:"fragmentMain",fsConstants:{},shaderLayout:null,bufferLayout:[],topology:"triangle-list",parameters:{},bindings:{},uniforms:{}};get[Symbol.toStringTag](){return"RenderPipeline"}shaderLayout;bufferLayout;linkStatus="pending";hash="";constructor(t,e){super(t,e,r.defaultProps),this.shaderLayout=this.props.shaderLayout,this.bufferLayout=this.props.bufferLayout||[]}setUniformsWebGL(t){throw new Error("Use uniform blocks")}}},98383:(t,e,n)=>{"use strict";n.d(e,{F:()=>r});var i=n(99294);class r{static defaultProps={id:"undefined",handle:void 0,userData:void 0};id;props;userData={};_device;destroyed=!1;allocatedBytes=0;_attachedResources=new Set;constructor(t,e,n){if(!t)throw new Error("no device");this._device=t,this.props=function(t,e){const n={...e};for(const i in t)void 0!==t[i]&&(n[i]=t[i]);return n}(e,n);const r="undefined"!==this.props.id?this.props.id:(0,i.L)(this[Symbol.toStringTag]);this.props.id=r,this.id=r,this.userData=this.props.userData||{},this.addStats()}destroy(){this.destroyResource()}delete(){return this.destroy(),this}toString(){return`${this[Symbol.toStringTag]||this.constructor.name}(${this.id})`}getProps(){return this.props}attachResource(t){this._attachedResources.add(t)}detachResource(t){this._attachedResources.delete(t)}destroyAttachedResource(t){this._attachedResources.delete(t)&&t.destroy()}destroyAttachedResources(){for(const t of Object.values(this._attachedResources))t.destroy();this._attachedResources=new Set}destroyResource(){this.destroyAttachedResources(),this.removeStats(),this.destroyed=!0}removeStats(){const t=this._device.statsManager.getStats("Resource Counts"),e=this[Symbol.toStringTag];t.get(`${e}s Active`).decrementCount()}trackAllocatedMemory(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this[Symbol.toStringTag];const n=this._device.statsManager.getStats("Resource Counts");n.get("GPU Memory").addCount(t),n.get(`${e} Memory`).addCount(t),this.allocatedBytes=t}trackDeallocatedMemory(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this[Symbol.toStringTag];const e=this._device.statsManager.getStats("Resource Counts");e.get("GPU Memory").subtractCount(this.allocatedBytes),e.get(`${t} Memory`).subtractCount(this.allocatedBytes),this.allocatedBytes=0}addStats(){const t=this._device.statsManager.getStats("Resource Counts"),e=this[Symbol.toStringTag];t.get("Resources Created").incrementCount(),t.get(`${e}s Created`).incrementCount(),t.get(`${e}s Active`).incrementCount()}}},7251:(t,e,n)=>{"use strict";n.d(e,{L:()=>r});var i=n(98383);class r extends i.F{static defaultProps={...i.F.defaultProps,type:"color-sampler",addressModeU:"clamp-to-edge",addressModeV:"clamp-to-edge",addressModeW:"clamp-to-edge",magFilter:"nearest",minFilter:"nearest",mipmapFilter:"nearest",lodMinClamp:0,lodMaxClamp:32,compare:"less-equal",maxAnisotropy:1};get[Symbol.toStringTag](){return"Sampler"}constructor(t,e){super(t,e,r.defaultProps)}}},39936:(t,e,n)=>{"use strict";n.d(e,{M:()=>u});var i=n(98383),r=n(99294);function o(t,e,n,i){if(i?.inlineSource){const i=function(t,e,n){let i="";for(let r=e-2;r<=e;r++){const o=t[r-1];void 0!==o&&(i+=s(o,e,n))}return i}(e,n);return`\n${i}${t.linePos>0?`${" ".repeat(t.linePos+5)}^^^\n`:""}${t.type.toUpperCase()}: ${t.message}\n\n`}return i?.html?`<div class='luma-compiler-log-error' style="color:red;"><b> ${t.type.toUpperCase()}: ${t.message}</b></div>`:`${t.type.toUpperCase()}: ${t.message}`}function s(t,e,n){const i=n?.html?t.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""").replaceAll("'","'"):t;return`${function(t,e){let n="";for(let i=t.length;i<e;++i)n+=" ";return n+t}(String(e),4)}: ${i}${n?.html?"<br/>":"\n"}`}function a(t,e){return{name:l(t,e),language:"glsl",version:c(t)}}function l(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"unnamed";const n=/#define[\s*]SHADER_NAME[\s*]([A-Za-z0-9_-]+)[\s*]/.exec(t);return n?n[1]:e}function c(t){let e=100;const n=t.match(/[^\s]+/g);if(n&&n.length>=2&&"#version"===n[0]){const t=parseInt(n[1],10);Number.isFinite(t)&&(e=t)}return e}class u extends i.F{static defaultProps={...i.F.defaultProps,language:"auto",stage:void 0,source:"",sourceMap:null,entryPoint:"main",debug:"errors"};get[Symbol.toStringTag](){return"Shader"}stage;source;compilationStatus="pending";constructor(t,e){super(t,{id:h(e),...e},u.defaultProps),this.stage=this.props.stage,this.source=this.props.source}getCompilationInfoSync(){return null}getTranslatedSource(){return null}async debugShader(){switch(arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props.debug){case"never":return;case"errors":if("success"===this.compilationStatus)return}const t=await this.getCompilationInfo();"warnings"===this.props.debug&&0===t?.length||this._displayShaderLog(t)}_displayShaderLog(t){if("undefined"===typeof document||!document?.createElement)return;const e=a(this.source).name,n=`${this.stage} ${e}`;let i=function(t,e,n){let i="";const r=e.split(/\r?\n/),a=t.slice().sort(((t,e)=>t.lineNum-e.lineNum));switch(n?.showSourceCode||"no"){case"all":let e=0;for(let t=1;t<=r.length;t++)for(i+=s(r[t-1],t,n);a.length>e&&a[e].lineNum===t;){const t=a[e++];i+=o(t,r,t.lineNum,{...n,inlineSource:!1})}return i;case"issues":case"no":for(const s of t)i+=o(s,r,s.lineNum,{inlineSource:"no"!==n?.showSourceCode});return i}}(t,this.source,{showSourceCode:"all",html:!0});const r=this.getTranslatedSource();r&&(i+=`<br /><br /><h1>Translated Source</h1><br /><br /><code style="user-select:text;"><pre>${r}</pre></code>`);const l=document.createElement("Button");l.innerHTML=`\n<h1>Shader Compilation Error in ${n}</h1><br /><br />\n<code style="user-select:text;"><pre>\n${i}\n</pre></code>`,l.style.top="10px",l.style.left="10px",l.style.position="absolute",l.style.zIndex="9999",l.style.width="100%",l.style.textAlign="left",document.body.appendChild(l);const c=document.getElementsByClassName("luma-compiler-log-error");c[0]?.scrollIntoView&&c[0].scrollIntoView(),l.onclick=()=>{const t=`data:text/plain,${encodeURIComponent(this.source)}`;navigator.clipboard.writeText(t)}}}function h(t){return a(t.source).name||t.id||(0,r.L)(`unnamed ${t.stage}-shader`)}},90516:(t,e,n)=>{"use strict";n.d(e,{X:()=>r});var i=n(98383);class r extends i.F{static defaultProps={...i.F.defaultProps,format:void 0,dimension:void 0,aspect:"all",baseMipLevel:0,mipLevelCount:void 0,baseArrayLayer:0,arrayLayerCount:void 0};get[Symbol.toStringTag](){return"TextureView"}constructor(t,e){super(t,e,r.defaultProps)}}},44980:(t,e,n)=>{"use strict";n.d(e,{g:()=>r});var i=n(98383);class r extends i.F{static defaultProps={...i.F.defaultProps,data:null,dimension:"2d",format:"rgba8unorm",width:void 0,height:void 0,depth:1,mipmaps:!0,compressed:!1,usage:0,mipLevels:void 0,samples:void 0,type:void 0,sampler:{},view:void 0};static COPY_SRC=1;static COPY_DST=2;static TEXTURE_BINDING=4;static STORAGE_BINDING=8;static RENDER_ATTACHMENT=16;get[Symbol.toStringTag](){return"Texture"}dimension;format;width;height;depth;updateTimestamp;constructor(t,e){super(t,e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:r.defaultProps),this.dimension=this.props.dimension,this.format=this.props.format,this.width=this.props.width,this.height=this.props.height,this.depth=this.props.depth,this.updateTimestamp=t.incrementTimestamp()}}},84980:(t,e,n)=>{"use strict";function i(t){const e=function(t){const e=o[t];return e}(r[t]),n=t.includes("norm"),i=!n&&!t.startsWith("float"),s=t.startsWith("s");return{dataType:r[t],byteLength:e,integer:i,signed:s,normalized:n}}n.d(e,{l:()=>i});const r={uint8:"uint8",sint8:"sint8",unorm8:"uint8",snorm8:"sint8",uint16:"uint16",sint16:"sint16",unorm16:"uint16",snorm16:"sint16",float16:"float16",float32:"float32",uint32:"uint32",sint32:"sint32"},o={uint8:1,sint8:1,uint16:2,sint16:2,float16:2,float32:4,uint32:4,sint32:4}},6376:(t,e,n)=>{"use strict";function i(t){const e=ArrayBuffer.isView(t)?t.constructor:t;switch(e){case Float32Array:return"float32";case Uint16Array:return"uint16";case Uint32Array:return"uint32";case Uint8Array:case Uint8ClampedArray:return"uint8";case Int8Array:return"sint8";case Int16Array:return"sint16";case Int32Array:return"sint32";default:throw new Error(e.constructor.name)}}function r(t){switch(t){case"float32":return Float32Array;case"uint32":return Uint32Array;case"sint32":return Int32Array;case"uint16":case"unorm16":return Uint16Array;case"sint16":case"snorm16":return Int16Array;case"uint8":case"unorm8":return Uint8Array;case"sint8":case"snorm8":return Int8Array;default:throw new Error(t)}}function o(t,e,n){if(!e||e>4)throw new Error(`size ${e}`);const r=e;let o=i(t);if("uint8"===o&&n&&1===r)return"unorm8-webgl";if("uint8"===o&&n&&3===r)return"unorm8x3-webgl";if("uint8"===o||"sint8"===o){if(1===r||3===r)throw new Error(`size: ${e}`);return n&&(o=o.replace("int","norm")),`${o}x${r}`}if("uint16"===o||"sint16"===o){if(1===r||3===r)throw new Error(`size: ${e}`);return n&&(o=o.replace("int","norm")),`${o}x${r}`}return 1===r?o:`${o}x${r}`}n.d(e,{OB:()=>o,UE:()=>i,Y0:()=>r})},19519:(t,e,n)=>{"use strict";n.d(e,{l:()=>r});var i=n(91931);function r(t){const e={bindings:{},uniforms:{}};return Object.keys(t).forEach((n=>{const r=t[n];var o;o=r,null!==(0,i.p)(o)||"number"===typeof o||"boolean"===typeof o?e.uniforms[n]=r:e.bindings[n]=r})),e}},8988:(t,e,n)=>{"use strict";let i;function r(t){return(!i||i.byteLength<t)&&(i=new ArrayBuffer(t)),i}function o(t,e){return new t(r(t.BYTES_PER_ELEMENT*e),0,e)}function s(t){const{target:e,source:n,start:i=0,count:r=1}=t,o=n.length,s=r*o;let a=0;for(let l=i;a<o;a++)e[l++]=n[a];for(;a<s;)a<s-a?(e.copyWithin(i+a,i,i+a),a*=2):(e.copyWithin(i+a,i,i+s-a),a=s);return t.target}n.d(e,{R2:()=>s,oF:()=>o,oK:()=>r})},25077:(t,e,n)=>{"use strict";function i(t,e){if(!t)throw new Error(e||"luma.gl: assertion failed.")}n.d(e,{v:()=>i})},91931:(t,e,n)=>{"use strict";function i(t){return Array.isArray(t)?0===t.length||"number"===typeof t[0]?t:null:function(t){return!ArrayBuffer.isView(t)||t instanceof DataView?null:t}(t)}n.d(e,{p:()=>i})},44261:(t,e,n)=>{"use strict";n.d(e,{R:()=>i});const i=new(n(24990).t)({id:"luma.gl"})},99294:(t,e,n)=>{"use strict";n.d(e,{L:()=>r,Z:()=>o});const i={};function r(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"id";i[t]=i[t]||1;return`${t}-${i[t]++}`}function o(t){let e=!0;for(const n in t){e=!1;break}return e}},18839:(t,e,n)=>{"use strict";n.d(e,{c9:()=>o});var i=n(99294),r=n(83647);class o extends r.V{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{id:e=(0,i.L)("cube-geometry"),indices:n=!0}=t;super(n?{...t,id:e,topology:"triangle-list",indices:{size:1,value:s},attributes:{...p,...t.attributes}}:{...t,id:e,topology:"triangle-list",indices:void 0,attributes:{...f,...t.attributes}})}}const s=new Uint16Array([0,1,2,0,2,3,4,5,6,4,6,7,8,9,10,8,10,11,12,13,14,12,14,15,16,17,18,16,18,19,20,21,22,20,22,23]),a=new Float32Array([-1,-1,1,1,-1,1,1,1,1,-1,1,1,-1,-1,-1,-1,1,-1,1,1,-1,1,-1,-1,-1,1,-1,-1,1,1,1,1,1,1,1,-1,-1,-1,-1,1,-1,-1,1,-1,1,-1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,-1,1,-1,-1,-1,-1,-1,1,-1,1,1,-1,1,-1]),l=new Float32Array([0,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0]),c=new Float32Array([0,0,1,0,1,1,0,1,1,0,1,1,0,1,0,0,0,1,0,0,1,0,1,1,1,1,0,1,0,0,1,0,1,0,1,1,0,1,0,0,0,0,1,0,1,1,0,1]),u=new Float32Array([1,-1,1,-1,-1,1,-1,-1,-1,1,-1,-1,1,-1,1,-1,-1,-1,1,1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,-1,-1,-1,1,1,1,1,1,1,1,-1,-1,1,-1,-1,1,1,1,1,-1,-1,-1,1,-1,1,1,-1,1,-1,-1,-1,-1,-1,-1,1,-1,1,-1,1,1,1,-1,1,1,-1,-1,1,-1,-1,1,1,-1,1,1,1,1,1,-1,-1,-1,-1,-1,-1,1,-1,1,1,-1,1,-1,-1,-1,1,-1]),h=new Float32Array([1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,0,0,1,0,1,1,1,1,0,1,0,0,1,0,1,1,0,0]),d=new Float32Array([1,0,1,1,0,0,1,1,0,0,0,1,1,0,0,1,1,0,1,1,0,0,0,1,1,1,1,1,1,0,1,1,1,0,0,1,1,1,0,1,1,1,1,1,1,0,0,1,0,1,1,1,1,1,1,1,1,1,0,1,0,1,0,1,0,1,1,1,1,1,0,1,0,0,1,1,0,1,1,1,0,1,0,1,0,0,0,1,0,0,1,1,0,1,0,1,1,1,1,1,0,1,1,1,0,0,1,1,0,0,1,1,1,0,1,1,1,1,1,1,1,0,0,1,0,0,0,1,0,1,0,1,1,1,0,1,1,0,0,1,0,1,0,1]),p={POSITION:{size:3,value:a},NORMAL:{size:3,value:l},TEXCOORD_0:{size:2,value:c}},f={POSITION:{size:3,value:u},TEXCOORD_0:{size:2,value:h},COLOR_0:{size:3,value:d}}},83647:(t,e,n)=>{"use strict";n.d(e,{V:()=>o});var i=n(99294),r=n(25077);class o{id;topology;vertexCount;indices;attributes;userData={};constructor(t){const{attributes:e={},indices:n=null,vertexCount:o=null}=t;this.id=t.id||(0,i.L)("geometry"),this.topology=t.topology,n&&(this.indices=ArrayBuffer.isView(n)?{value:n,size:1}:n),this.attributes={};for(const[i,s]of Object.entries(e)){const t=ArrayBuffer.isView(s)?{value:s}:s;(0,r.v)(ArrayBuffer.isView(t.value),`${this._print(i)}: must be typed array or object with value as typed array`),"POSITION"!==i&&"positions"!==i||t.size||(t.size=3),"indices"===i?((0,r.v)(!this.indices),this.indices=t):this.attributes[i]=t}this.indices&&void 0!==this.indices.isIndexed&&(this.indices=Object.assign({},this.indices),delete this.indices.isIndexed),this.vertexCount=o||this._calculateVertexCount(this.attributes,this.indices)}getVertexCount(){return this.vertexCount}getAttributes(){return this.indices?{indices:this.indices,...this.attributes}:this.attributes}_print(t){return`Geometry ${this.id} attribute ${t}`}_setAttributes(t,e){return this}_calculateVertexCount(t,e){if(e)return e.value.length;let n=1/0;for(const i of Object.values(t)){const{value:t,size:e,constant:r}=i;!r&&t&&e>=1&&(n=Math.min(n,t.length/e))}return(0,r.v)(Number.isFinite(n)),n}}},30141:(t,e,n)=>{"use strict";n.d(e,{K:()=>ce});var i=n(90516),r=n(86561),o=n(44980),s=n(7251),a=n(74446),l=n(91931);class c{name;uniforms={};modifiedUniforms={};modified=!0;bindingLayout={};needsRedraw="initialized";constructor(t){if(this.name=t?.name,t?.name&&t?.shaderLayout){const e=t?.shaderLayout.bindings?.find((e=>"uniform"===e.type&&e.name===t?.name));if(!e)throw new Error(t?.name);const n=e;for(const t of n.uniforms||[])this.bindingLayout[t.name]=t}}setUniforms(t){for(const[e,n]of Object.entries(t))this._setUniform(e,n),this.needsRedraw||this.setNeedsRedraw(`${this.name}.${e}=${n}`)}setNeedsRedraw(t){this.needsRedraw=this.needsRedraw||t}getAllUniforms(){return this.modifiedUniforms={},this.needsRedraw=!1,this.uniforms||{}}_setUniform(t,e){(function(t,e){if(t!==e)return!1;const n=(0,l.p)(t);if(!n)return!1;const i=(0,l.p)(e);if(i&&n.length===i.length)for(let r=0;r<n.length;++r)if(i[r]!==n[r])return!1;return!0})(this.uniforms[t],e)||(this.uniforms[t]=function(t){const e=(0,l.p)(t);return e?e.slice():t}(e),this.modifiedUniforms[t]=!0,this.modified=!0)}}var u=n(25077);const h={f32:{type:"f32",components:1},i32:{type:"i32",components:1},u32:{type:"u32",components:1},"vec2<f32>":{type:"f32",components:2},"vec3<f32>":{type:"f32",components:3},"vec4<f32>":{type:"f32",components:4},"vec2<i32>":{type:"i32",components:2},"vec3<i32>":{type:"i32",components:3},"vec4<i32>":{type:"i32",components:4},"vec2<u32>":{type:"u32",components:2},"vec3<u32>":{type:"u32",components:3},"vec4<u32>":{type:"u32",components:4},"mat2x2<f32>":{type:"f32",components:4},"mat2x3<f32>":{type:"f32",components:6},"mat2x4<f32>":{type:"f32",components:8},"mat3x2<f32>":{type:"f32",components:6},"mat3x3<f32>":{type:"f32",components:9},"mat3x4<f32>":{type:"f32",components:12},"mat4x2<f32>":{type:"f32",components:8},"mat4x3<f32>":{type:"f32",components:12},"mat4x4<f32>":{type:"f32",components:16}};function d(t){const e=h[t];return(0,u.v)(t),e}function p(t,e){switch(e){case 1:return t;case 2:return t+t%2;default:return t+(4-t%4)%4}}var f=n(8988),A=n(44261);class g{layout={};byteLength;constructor(t){let e=0;for(const[i,r]of Object.entries(t)){const t=d(r),{type:n,components:o}=t;e=p(e,o);const s=e;e+=o,this.layout[i]={type:n,size:o,offset:s}}e+=(4-e%4)%4;const n=4*e;this.byteLength=Math.max(n,1024)}getData(t){const e=Math.max(this.byteLength,1024),n=(0,f.oK)(e),i={i32:new Int32Array(n),u32:new Uint32Array(n),f32:new Float32Array(n),f16:new Uint16Array(n)};for(const[r,o]of Object.entries(t)){const t=this.layout[r];if(!t){A.R.warn(`Supplied uniform value ${r} not present in uniform block layout`)();continue}const{type:e,size:n,offset:s}=t,a=i[e];if(1===n){if("number"!==typeof o&&"boolean"!==typeof o){A.R.warn(`Supplied value for single component uniform ${r} is not a number: ${o}`)();continue}a[s]=Number(o)}else{const t=(0,l.p)(o);if(!t){A.R.warn(`Supplied value for multi component / array uniform ${r} is not a numeric array: ${o}`)();continue}a.set(t,s)}}return new Uint8Array(n)}has(t){return Boolean(this.layout[t])}get(t){return this.layout[t]}}class m{uniformBlocks=new Map;uniformBufferLayouts=new Map;uniformBuffers=new Map;constructor(t){for(const[e,n]of Object.entries(t)){const t=e,i=new g(n.uniformTypes||{});this.uniformBufferLayouts.set(t,i);const r=new c({name:e});r.setUniforms(n.defaultUniforms||{}),this.uniformBlocks.set(t,r)}}destroy(){for(const t of this.uniformBuffers.values())t.destroy()}setUniforms(t){for(const[e,n]of Object.entries(t))this.uniformBlocks.get(e).setUniforms(n);this.updateUniformBuffers()}getUniformBufferByteLength(t){return this.uniformBufferLayouts.get(t).byteLength}getUniformBufferData(t){const e=this.uniformBlocks.get(t).getAllUniforms();return this.uniformBufferLayouts.get(t).getData(e)}createUniformBuffer(t,e,n){n&&this.setUniforms(n);const i=this.getUniformBufferByteLength(e),o=t.createBuffer({usage:r.h.UNIFORM|r.h.COPY_DST,byteLength:i}),s=this.getUniformBufferData(e);return o.write(s),o}getManagedUniformBuffer(t,e){if(!this.uniformBuffers.get(e)){const n=this.getUniformBufferByteLength(e),i=t.createBuffer({usage:r.h.UNIFORM|r.h.COPY_DST,byteLength:n});this.uniformBuffers.set(e,i)}return this.uniformBuffers.get(e)}updateUniformBuffers(){let t=!1;for(const e of this.uniformBlocks.keys()){const n=this.updateUniformBuffer(e);t||=n}return t&&A.R.log(3,`UniformStore.updateUniformBuffers(): ${t}`)(),t}updateUniformBuffer(t){const e=this.uniformBlocks.get(t);let n=!1;if(this.uniformBuffers.get(t)&&e.needsRedraw){n||=e.needsRedraw;const i=this.getUniformBufferData(t);this.uniformBuffers.get(t).write(i);const r=this.uniformBlocks.get(t).getAllUniforms();A.R.log(4,`Writing to uniform buffer ${String(t)}`,i,r)()}return n}}var y=n(99294);function _(t,e,n){if(t===e)return!0;if(!n||!t||!e)return!1;if(Array.isArray(t)){if(!Array.isArray(e)||t.length!==e.length)return!1;for(let i=0;i<t.length;i++)if(!_(t[i],e[i],n-1))return!1;return!0}if(Array.isArray(e))return!1;if("object"===typeof t&&"object"===typeof e){const i=Object.keys(t),r=Object.keys(e);if(i.length!==r.length)return!1;for(const o of i){if(!e.hasOwnProperty(o))return!1;if(!_(t[o],e[o],n-1))return!1}return!0}return!1}var v,b,x,w,E,C=n(19519),T=n(99861),S=n(6376),P=n(32479);class M{constructor(){this.constants=new Map,this.aliases=new Map,this.structs=new Map}}class I{constructor(){}get isAstNode(){return!0}get astNodeType(){return""}evaluate(t){throw new Error("Cannot evaluate node")}evaluateString(t){return this.evaluate(t).toString()}search(t){}searchBlock(t,e){if(t){e(B.instance);for(const n of t)n instanceof Array?this.searchBlock(n,e):n.search(e);e(R.instance)}}}class B extends I{}B.instance=new B;class R extends I{}R.instance=new R;class L extends I{constructor(){super()}}class O extends L{constructor(t,e,n,i,r,o){super(),this.calls=new Set,this.name=t,this.args=e,this.returnType=n,this.body=i,this.startLine=r,this.endLine=o}get astNodeType(){return"function"}search(t){this.searchBlock(this.body,t)}}class D extends L{constructor(t){super(),this.expression=t}get astNodeType(){return"staticAssert"}search(t){this.expression.search(t)}}class k extends L{constructor(t,e){super(),this.condition=t,this.body=e}get astNodeType(){return"while"}search(t){this.condition.search(t),this.searchBlock(this.body,t)}}class F extends L{constructor(t){super(),this.body=t}get astNodeType(){return"continuing"}search(t){this.searchBlock(this.body,t)}}class N extends L{constructor(t,e,n,i){super(),this.init=t,this.condition=e,this.increment=n,this.body=i}get astNodeType(){return"for"}search(t){var e,n,i;null===(e=this.init)||void 0===e||e.search(t),null===(n=this.condition)||void 0===n||n.search(t),null===(i=this.increment)||void 0===i||i.search(t),this.searchBlock(this.body,t)}}class z extends L{constructor(t,e,n,i,r){super(),this.name=t,this.type=e,this.storage=n,this.access=i,this.value=r}get astNodeType(){return"var"}search(t){var e;t(this),null===(e=this.value)||void 0===e||e.search(t)}}class U extends L{constructor(t,e,n){super(),this.name=t,this.type=e,this.value=n}get astNodeType(){return"override"}search(t){var e;null===(e=this.value)||void 0===e||e.search(t)}}class G extends L{constructor(t,e,n,i,r){super(),this.name=t,this.type=e,this.storage=n,this.access=i,this.value=r}get astNodeType(){return"let"}search(t){var e;t(this),null===(e=this.value)||void 0===e||e.search(t)}}class V extends L{constructor(t,e,n,i,r){super(),this.name=t,this.type=e,this.storage=n,this.access=i,this.value=r}get astNodeType(){return"const"}evaluate(t){return this.value.evaluate(t)}search(t){var e;t(this),null===(e=this.value)||void 0===e||e.search(t)}}!function(t){t.increment="++",t.decrement="--"}(v||(v={})),function(t){t.parse=function(e){const n=e;if("parse"==n)throw new Error("Invalid value for IncrementOperator");return t[n]}}(v||(v={}));class j extends L{constructor(t,e){super(),this.operator=t,this.variable=e}get astNodeType(){return"increment"}search(t){this.variable.search(t)}}!function(t){t.assign="=",t.addAssign="+=",t.subtractAssin="-=",t.multiplyAssign="*=",t.divideAssign="/=",t.moduloAssign="%=",t.andAssign="&=",t.orAssign="|=",t.xorAssign="^=",t.shiftLeftAssign="<<=",t.shiftRightAssign=">>="}(b||(b={})),function(t){t.parse=function(t){const e=t;if("parse"==e)throw new Error("Invalid value for AssignOperator");return e}}(b||(b={}));class H extends L{constructor(t,e,n){super(),this.operator=t,this.variable=e,this.value=n}get astNodeType(){return"assign"}search(t){this.variable.search(t),this.value.search(t)}}class W extends L{constructor(t,e){super(),this.name=t,this.args=e}get astNodeType(){return"call"}search(t){for(const e of this.args)e.search(t);t(this)}}class q extends L{constructor(t,e){super(),this.body=t,this.continuing=e}get astNodeType(){return"loop"}}class Z extends L{constructor(t,e){super(),this.condition=t,this.body=e}get astNodeType(){return"body"}}class X extends L{constructor(t,e,n,i){super(),this.condition=t,this.body=e,this.elseif=n,this.else=i}get astNodeType(){return"if"}search(t){this.condition.search(t),this.searchBlock(this.body,t),this.searchBlock(this.elseif,t),this.searchBlock(this.else,t)}}class K extends L{constructor(t){super(),this.value=t}get astNodeType(){return"return"}search(t){var e;null===(e=this.value)||void 0===e||e.search(t)}}class Q extends L{constructor(t){super(),this.name=t}get astNodeType(){return"enable"}}class J extends L{constructor(t){super(),this.extensions=t}get astNodeType(){return"requires"}}class Y extends L{constructor(t,e){super(),this.severity=t,this.rule=e}get astNodeType(){return"diagnostic"}}class $ extends L{constructor(t,e){super(),this.name=t,this.type=e}get astNodeType(){return"alias"}}class tt extends L{constructor(){super()}get astNodeType(){return"discard"}}class et extends L{constructor(){super()}get astNodeType(){return"break"}}class nt extends L{constructor(){super()}get astNodeType(){return"continue"}}class it extends L{constructor(t){super(),this.name=t}get astNodeType(){return"type"}get isStruct(){return!1}get isArray(){return!1}}class rt extends it{constructor(t,e,n,i){super(t),this.members=e,this.startLine=n,this.endLine=i}get astNodeType(){return"struct"}get isStruct(){return!0}getMemberIndex(t){for(let e=0;e<this.members.length;e++)if(this.members[e].name==t)return e;return-1}}class ot extends it{constructor(t,e,n){super(t),this.format=e,this.access=n}get astNodeType(){return"template"}}class st extends it{constructor(t,e,n,i){super(t),this.storage=e,this.type=n,this.access=i}get astNodeType(){return"pointer"}}class at extends it{constructor(t,e,n,i){super(t),this.attributes=e,this.format=n,this.count=i}get astNodeType(){return"array"}get isArray(){return!0}}class lt extends it{constructor(t,e,n){super(t),this.format=e,this.access=n}get astNodeType(){return"sampler"}}class ct extends I{constructor(){super()}}class ut extends ct{constructor(t){super(),this.value=t}get astNodeType(){return"stringExpr"}toString(){return this.value}evaluateString(){return this.value}}class ht extends ct{constructor(t,e){super(),this.type=t,this.args=e}get astNodeType(){return"createExpr"}search(t){t(this);for(const e of this.args)e.search(t)}}class dt extends ct{constructor(t,e){super(),this.name=t,this.args=e}get astNodeType(){return"callExpr"}evaluate(t){switch(this.name){case"abs":return Math.abs(this.args[0].evaluate(t));case"acos":return Math.acos(this.args[0].evaluate(t));case"acosh":return Math.acosh(this.args[0].evaluate(t));case"asin":return Math.asin(this.args[0].evaluate(t));case"asinh":return Math.asinh(this.args[0].evaluate(t));case"atan":return Math.atan(this.args[0].evaluate(t));case"atan2":return Math.atan2(this.args[0].evaluate(t),this.args[1].evaluate(t));case"atanh":return Math.atanh(this.args[0].evaluate(t));case"ceil":return Math.ceil(this.args[0].evaluate(t));case"clamp":return Math.min(Math.max(this.args[0].evaluate(t),this.args[1].evaluate(t)),this.args[2].evaluate(t));case"cos":return Math.cos(this.args[0].evaluate(t));case"degrees":return 180*this.args[0].evaluate(t)/Math.PI;case"distance":return Math.sqrt(Math.pow(this.args[0].evaluate(t)-this.args[1].evaluate(t),2));case"dot":case"exp":return Math.exp(this.args[0].evaluate(t));case"exp2":return Math.pow(2,this.args[0].evaluate(t));case"floor":return Math.floor(this.args[0].evaluate(t));case"fma":return this.args[0].evaluate(t)*this.args[1].evaluate(t)+this.args[2].evaluate(t);case"fract":case"modf":return this.args[0].evaluate(t)-Math.floor(this.args[0].evaluate(t));case"inverseSqrt":return 1/Math.sqrt(this.args[0].evaluate(t));case"log":return Math.log(this.args[0].evaluate(t));case"log2":return Math.log2(this.args[0].evaluate(t));case"max":return Math.max(this.args[0].evaluate(t),this.args[1].evaluate(t));case"min":return Math.min(this.args[0].evaluate(t),this.args[1].evaluate(t));case"mix":return this.args[0].evaluate(t)*(1-this.args[2].evaluate(t))+this.args[1].evaluate(t)*this.args[2].evaluate(t);case"pow":return Math.pow(this.args[0].evaluate(t),this.args[1].evaluate(t));case"radians":return this.args[0].evaluate(t)*Math.PI/180;case"round":return Math.round(this.args[0].evaluate(t));case"sign":return Math.sign(this.args[0].evaluate(t));case"sin":return Math.sin(this.args[0].evaluate(t));case"sinh":return Math.sinh(this.args[0].evaluate(t));case"saturate":return Math.min(Math.max(this.args[0].evaluate(t),0),1);case"smoothstep":return this.args[0].evaluate(t)*this.args[0].evaluate(t)*(3-2*this.args[0].evaluate(t));case"sqrt":return Math.sqrt(this.args[0].evaluate(t));case"step":return this.args[0].evaluate(t)<this.args[1].evaluate(t)?0:1;case"tan":return Math.tan(this.args[0].evaluate(t));case"tanh":return Math.tanh(this.args[0].evaluate(t));case"trunc":return Math.trunc(this.args[0].evaluate(t));default:throw new Error("Non const function: "+this.name)}}search(t){for(const e of this.args)e.search(t);t(this)}}class pt extends ct{constructor(t){super(),this.name=t}get astNodeType(){return"varExpr"}search(t){t(this),this.postfix&&this.postfix.search(t)}evaluate(t){const e=t.constants.get(this.name);if(!e)throw new Error("Cannot evaluate node");return e.evaluate(t)}}class ft extends ct{constructor(t,e){super(),this.name=t,this.initializer=e}get astNodeType(){return"constExpr"}evaluate(t){var e,n;if(this.initializer instanceof ht){const i=null===(e=this.postfix)||void 0===e?void 0:e.evaluateString(t),r=null===(n=this.initializer.type)||void 0===n?void 0:n.name,o=t.structs.get(r),s=null===o||void 0===o?void 0:o.getMemberIndex(i);if(-1!=s){return this.initializer.args[s].evaluate(t)}console.log(s)}return this.initializer.evaluate(t)}search(t){this.initializer.search(t)}}class At extends ct{constructor(t){super(),this.value=t}get astNodeType(){return"literalExpr"}evaluate(){return this.value}}class gt extends ct{constructor(t,e){super(),this.type=t,this.value=e}get astNodeType(){return"bitcastExpr"}search(t){this.value.search(t)}}class mt extends ct{constructor(t,e){super(),this.type=t,this.args=e}get astNodeType(){return"typecastExpr"}evaluate(t){return this.args[0].evaluate(t)}search(t){this.searchBlock(this.args,t)}}class yt extends ct{constructor(t){super(),this.contents=t}get astNodeType(){return"groupExpr"}evaluate(t){return this.contents[0].evaluate(t)}search(t){this.searchBlock(this.contents,t)}}class _t extends ct{constructor(t){super(),this.index=t}search(t){this.index.search(t)}}class vt extends ct{constructor(){super()}}class bt extends vt{constructor(t,e){super(),this.operator=t,this.right=e}get astNodeType(){return"unaryOp"}evaluate(t){switch(this.operator){case"+":return this.right.evaluate(t);case"-":return-this.right.evaluate(t);case"!":return this.right.evaluate(t)?0:1;case"~":return~this.right.evaluate(t);default:throw new Error("Unknown unary operator: "+this.operator)}}search(t){this.right.search(t)}}class xt extends vt{constructor(t,e,n){super(),this.operator=t,this.left=e,this.right=n}get astNodeType(){return"binaryOp"}evaluate(t){switch(this.operator){case"+":return this.left.evaluate(t)+this.right.evaluate(t);case"-":return this.left.evaluate(t)-this.right.evaluate(t);case"*":return this.left.evaluate(t)*this.right.evaluate(t);case"/":return this.left.evaluate(t)/this.right.evaluate(t);case"%":return this.left.evaluate(t)%this.right.evaluate(t);case"==":return this.left.evaluate(t)==this.right.evaluate(t)?1:0;case"!=":return this.left.evaluate(t)!=this.right.evaluate(t)?1:0;case"<":return this.left.evaluate(t)<this.right.evaluate(t)?1:0;case">":return this.left.evaluate(t)>this.right.evaluate(t)?1:0;case"<=":return this.left.evaluate(t)<=this.right.evaluate(t)?1:0;case">=":return this.left.evaluate(t)>=this.right.evaluate(t)?1:0;case"&&":return this.left.evaluate(t)&&this.right.evaluate(t)?1:0;case"||":return this.left.evaluate(t)||this.right.evaluate(t)?1:0;default:throw new Error(`Unknown operator ${this.operator}`)}}search(t){this.left.search(t),this.right.search(t)}}class wt extends I{constructor(){super()}}class Et extends wt{constructor(t,e){super(),this.selector=t,this.body=e}get astNodeType(){return"case"}search(t){this.searchBlock(this.body,t)}}class Ct extends wt{constructor(t){super(),this.body=t}get astNodeType(){return"default"}search(t){this.searchBlock(this.body,t)}}class Tt extends I{constructor(t,e,n){super(),this.name=t,this.type=e,this.attributes=n}get astNodeType(){return"argument"}}class St extends I{constructor(t,e){super(),this.condition=t,this.body=e}get astNodeType(){return"elseif"}search(t){this.condition.search(t),this.searchBlock(this.body,t)}}class Pt extends I{constructor(t,e,n){super(),this.name=t,this.type=e,this.attributes=n}get astNodeType(){return"member"}}class Mt extends I{constructor(t,e){super(),this.name=t,this.value=e}get astNodeType(){return"attribute"}}!function(t){t[t.token=0]="token",t[t.keyword=1]="keyword",t[t.reserved=2]="reserved"}(w||(w={}));class It{constructor(t,e,n){this.name=t,this.type=e,this.rule=n}toString(){return this.name}}class Bt{}x=Bt,Bt.none=new It("",w.reserved,""),Bt.eof=new It("EOF",w.token,""),Bt.reserved={asm:new It("asm",w.reserved,"asm"),bf16:new It("bf16",w.reserved,"bf16"),do:new It("do",w.reserved,"do"),enum:new It("enum",w.reserved,"enum"),f16:new It("f16",w.reserved,"f16"),f64:new It("f64",w.reserved,"f64"),handle:new It("handle",w.reserved,"handle"),i8:new It("i8",w.reserved,"i8"),i16:new It("i16",w.reserved,"i16"),i64:new It("i64",w.reserved,"i64"),mat:new It("mat",w.reserved,"mat"),premerge:new It("premerge",w.reserved,"premerge"),regardless:new It("regardless",w.reserved,"regardless"),typedef:new It("typedef",w.reserved,"typedef"),u8:new It("u8",w.reserved,"u8"),u16:new It("u16",w.reserved,"u16"),u64:new It("u64",w.reserved,"u64"),unless:new It("unless",w.reserved,"unless"),using:new It("using",w.reserved,"using"),vec:new It("vec",w.reserved,"vec"),void:new It("void",w.reserved,"void")},Bt.keywords={array:new It("array",w.keyword,"array"),atomic:new It("atomic",w.keyword,"atomic"),bool:new It("bool",w.keyword,"bool"),f32:new It("f32",w.keyword,"f32"),i32:new It("i32",w.keyword,"i32"),mat2x2:new It("mat2x2",w.keyword,"mat2x2"),mat2x3:new It("mat2x3",w.keyword,"mat2x3"),mat2x4:new It("mat2x4",w.keyword,"mat2x4"),mat3x2:new It("mat3x2",w.keyword,"mat3x2"),mat3x3:new It("mat3x3",w.keyword,"mat3x3"),mat3x4:new It("mat3x4",w.keyword,"mat3x4"),mat4x2:new It("mat4x2",w.keyword,"mat4x2"),mat4x3:new It("mat4x3",w.keyword,"mat4x3"),mat4x4:new It("mat4x4",w.keyword,"mat4x4"),ptr:new It("ptr",w.keyword,"ptr"),sampler:new It("sampler",w.keyword,"sampler"),sampler_comparison:new It("sampler_comparison",w.keyword,"sampler_comparison"),struct:new It("struct",w.keyword,"struct"),texture_1d:new It("texture_1d",w.keyword,"texture_1d"),texture_2d:new It("texture_2d",w.keyword,"texture_2d"),texture_2d_array:new It("texture_2d_array",w.keyword,"texture_2d_array"),texture_3d:new It("texture_3d",w.keyword,"texture_3d"),texture_cube:new It("texture_cube",w.keyword,"texture_cube"),texture_cube_array:new It("texture_cube_array",w.keyword,"texture_cube_array"),texture_multisampled_2d:new It("texture_multisampled_2d",w.keyword,"texture_multisampled_2d"),texture_storage_1d:new It("texture_storage_1d",w.keyword,"texture_storage_1d"),texture_storage_2d:new It("texture_storage_2d",w.keyword,"texture_storage_2d"),texture_storage_2d_array:new It("texture_storage_2d_array",w.keyword,"texture_storage_2d_array"),texture_storage_3d:new It("texture_storage_3d",w.keyword,"texture_storage_3d"),texture_depth_2d:new It("texture_depth_2d",w.keyword,"texture_depth_2d"),texture_depth_2d_array:new It("texture_depth_2d_array",w.keyword,"texture_depth_2d_array"),texture_depth_cube:new It("texture_depth_cube",w.keyword,"texture_depth_cube"),texture_depth_cube_array:new It("texture_depth_cube_array",w.keyword,"texture_depth_cube_array"),texture_depth_multisampled_2d:new It("texture_depth_multisampled_2d",w.keyword,"texture_depth_multisampled_2d"),texture_external:new It("texture_external",w.keyword,"texture_external"),u32:new It("u32",w.keyword,"u32"),vec2:new It("vec2",w.keyword,"vec2"),vec3:new It("vec3",w.keyword,"vec3"),vec4:new It("vec4",w.keyword,"vec4"),bitcast:new It("bitcast",w.keyword,"bitcast"),block:new It("block",w.keyword,"block"),break:new It("break",w.keyword,"break"),case:new It("case",w.keyword,"case"),continue:new It("continue",w.keyword,"continue"),continuing:new It("continuing",w.keyword,"continuing"),default:new It("default",w.keyword,"default"),diagnostic:new It("diagnostic",w.keyword,"diagnostic"),discard:new It("discard",w.keyword,"discard"),else:new It("else",w.keyword,"else"),enable:new It("enable",w.keyword,"enable"),fallthrough:new It("fallthrough",w.keyword,"fallthrough"),false:new It("false",w.keyword,"false"),fn:new It("fn",w.keyword,"fn"),for:new It("for",w.keyword,"for"),function:new It("function",w.keyword,"function"),if:new It("if",w.keyword,"if"),let:new It("let",w.keyword,"let"),const:new It("const",w.keyword,"const"),loop:new It("loop",w.keyword,"loop"),while:new It("while",w.keyword,"while"),private:new It("private",w.keyword,"private"),read:new It("read",w.keyword,"read"),read_write:new It("read_write",w.keyword,"read_write"),return:new It("return",w.keyword,"return"),requires:new It("requires",w.keyword,"requires"),storage:new It("storage",w.keyword,"storage"),switch:new It("switch",w.keyword,"switch"),true:new It("true",w.keyword,"true"),alias:new It("alias",w.keyword,"alias"),type:new It("type",w.
2keyword,"type"),uniform:new It("uniform",w.keyword,"uniform"),var:new It("var",w.keyword,"var"),override:new It("override",w.keyword,"override"),workgroup:new It("workgroup",w.keyword,"workgroup"),write:new It("write",w.keyword,"write"),r8unorm:new It("r8unorm",w.keyword,"r8unorm"),r8snorm:new It("r8snorm",w.keyword,"r8snorm"),r8uint:new It("r8uint",w.keyword,"r8uint"),r8sint:new It("r8sint",w.keyword,"r8sint"),r16uint:new It("r16uint",w.keyword,"r16uint"),r16sint:new It("r16sint",w.keyword,"r16sint"),r16float:new It("r16float",w.keyword,"r16float"),rg8unorm:new It("rg8unorm",w.keyword,"rg8unorm"),rg8snorm:new It("rg8snorm",w.keyword,"rg8snorm"),rg8uint:new It("rg8uint",w.keyword,"rg8uint"),rg8sint:new It("rg8sint",w.keyword,"rg8sint"),r32uint:new It("r32uint",w.keyword,"r32uint"),r32sint:new It("r32sint",w.keyword,"r32sint"),r32float:new It("r32float",w.keyword,"r32float"),rg16uint:new It("rg16uint",w.keyword,"rg16uint"),rg16sint:new It("rg16sint",w.keyword,"rg16sint"),rg16float:new It("rg16float",w.keyword,"rg16float"),rgba8unorm:new It("rgba8unorm",w.keyword,"rgba8unorm"),rgba8unorm_srgb:new It("rgba8unorm_srgb",w.keyword,"rgba8unorm_srgb"),rgba8snorm:new It("rgba8snorm",w.keyword,"rgba8snorm"),rgba8uint:new It("rgba8uint",w.keyword,"rgba8uint"),rgba8sint:new It("rgba8sint",w.keyword,"rgba8sint"),bgra8unorm:new It("bgra8unorm",w.keyword,"bgra8unorm"),bgra8unorm_srgb:new It("bgra8unorm_srgb",w.keyword,"bgra8unorm_srgb"),rgb10a2unorm:new It("rgb10a2unorm",w.keyword,"rgb10a2unorm"),rg11b10float:new It("rg11b10float",w.keyword,"rg11b10float"),rg32uint:new It("rg32uint",w.keyword,"rg32uint"),rg32sint:new It("rg32sint",w.keyword,"rg32sint"),rg32float:new It("rg32float",w.keyword,"rg32float"),rgba16uint:new It("rgba16uint",w.keyword,"rgba16uint"),rgba16sint:new It("rgba16sint",w.keyword,"rgba16sint"),rgba16float:new It("rgba16float",w.keyword,"rgba16float"),rgba32uint:new It("rgba32uint",w.keyword,"rgba32uint"),rgba32sint:new It("rgba32sint",w.keyword,"rgba32sint"),rgba32float:ne
vendor: 45,618 bytes, line 2
2w It("rgba32float",w.keyword,"rgba32float"),static_assert:new It("static_assert",w.keyword,"static_assert")},Bt.tokens={decimal_float_literal:new It("decimal_float_literal",w.token,/((-?[0-9]*\.[0-9]+|-?[0-9]+\.[0-9]*)((e|E)(\+|-)?[0-9]+)?f?)|(-?[0-9]+(e|E)(\+|-)?[0-9]+f?)|([0-9]+f)/),hex_float_literal:new It("hex_float_literal",w.token,/-?0x((([0-9a-fA-F]*\.[0-9a-fA-F]+|[0-9a-fA-F]+\.[0-9a-fA-F]*)((p|P)(\+|-)?[0-9]+f?)?)|([0-9a-fA-F]+(p|P)(\+|-)?[0-9]+f?))/),int_literal:new It("int_literal",w.token,/-?0x[0-9a-fA-F]+|0i?|-?[1-9][0-9]*i?/),uint_literal:new It("uint_literal",w.token,/0x[0-9a-fA-F]+u|0u|[1-9][0-9]*u/),ident:new It("ident",w.token,/[_a-zA-Z][0-9a-zA-Z_]*/),and:new It("and",w.token,"&"),and_and:new It("and_and",w.token,"&&"),arrow:new It("arrow ",w.token,"->"),attr:new It("attr",w.token,"@"),forward_slash:new It("forward_slash",w.token,"/"),bang:new It("bang",w.token,"!"),bracket_left:new It("bracket_left",w.token,"["),bracket_right:new It("bracket_right",w.token,"]"),brace_left:new It("brace_left",w.token,"{"),brace_right:new It("brace_right",w.token,"}"),colon:new It("colon",w.token,":"),comma:new It("comma",w.token,","),equal:new It("equal",w.token,"="),equal_equal:new It("equal_equal",w.token,"=="),not_equal:new It("not_equal",w.token,"!="),greater_than:new It("greater_than",w.token,">"),greater_than_equal:new It("greater_than_equal",w.token,">="),shift_right:new It("shift_right",w.token,">>"),less_than:new It("less_than",w.token,"<"),less_than_equal:new It("less_than_equal",w.token,"<="),shift_left:new It("shift_left",w.token,"<<"),modulo:new It("modulo",w.token,"%"),minus:new It("minus",w.token,"-"),minus_minus:new It("minus_minus",w.token,"--"),period:new It("period",w.token,"."),plus:new It("plus",w.token,"+"),plus_plus:new It("plus_plus",w.token,"++"),or:new It("or",w.token,"|"),or_or:new It("or_or",w.token,"||"),paren_left:new It("paren_left",w.token,"("),paren_right:new It("paren_right",w.token,")"),semicolon:new It("semicolon",w.token,";"),star:new It("star",w.token,"*"),tilde:new It("tilde",w.token,"~"),underscore:new It("underscore",w.token,"_"),xor:new It("xor",w.token,"^"),plus_equal:new It("plus_equal",w.token,"+="),minus_equal:new It("minus_equal",w.token,"-="),times_equal:new It("times_equal",w.token,"*="),division_equal:new It("division_equal",w.token,"/="),modulo_equal:new It("modulo_equal",w.token,"%="),and_equal:new It("and_equal",w.token,"&="),or_equal:new It("or_equal",w.token,"|="),xor_equal:new It("xor_equal",w.token,"^="),shift_right_equal:new It("shift_right_equal",w.token,">>="),shift_left_equal:new It("shift_left_equal",w.token,"<<=")},Bt.simpleTokens={"@":x.tokens.attr,"{":x.tokens.brace_left,"}":x.tokens.brace_right,":":x.tokens.colon,",":x.tokens.comma,"(":x.tokens.paren_left,")":x.tokens.paren_right,";":x.tokens.semicolon},Bt.literalTokens={"&":x.tokens.and,"&&":x.tokens.and_and,"->":x.tokens.arrow,"/":x.tokens.forward_slash,"!":x.tokens.bang,"[":x.tokens.bracket_left,"]":x.tokens.bracket_right,"=":x.tokens.equal,"==":x.tokens.equal_equal,"!=":x.tokens.not_equal,">":x.tokens.greater_than,">=":x.tokens.greater_than_equal,">>":x.tokens.shift_right,"<":x.tokens.less_than,"<=":x.tokens.less_than_equal,"<<":x.tokens.shift_left,"%":x.tokens.modulo,"-":x.tokens.minus,"--":x.tokens.minus_minus,".":x.tokens.period,"+":x.tokens.plus,"++":x.tokens.plus_plus,"|":x.tokens.or,"||":x.tokens.or_or,"*":x.tokens.star,"~":x.tokens.tilde,_:x.tokens.underscore,"^":x.tokens.xor,"+=":x.tokens.plus_equal,"-=":x.tokens.minus_equal,"*=":x.tokens.times_equal,"/=":x.tokens.division_equal,"%=":x.tokens.modulo_equal,"&=":x.tokens.and_equal,"|=":x.tokens.or_equal,"^=":x.tokens.xor_equal,">>=":x.tokens.shift_right_equal,"<<=":x.tokens.shift_left_equal},Bt.regexTokens={decimal_float_literal:x.tokens.decimal_float_literal,hex_float_literal:x.tokens.hex_float_literal,int_literal:x.tokens.int_literal,uint_literal:x.tokens.uint_literal,ident:x.tokens.ident},Bt.storage_class=[x.keywords.function,x.keywords.private,x.keywords.workgroup,x.keywords.uniform,x.keywords.storage],Bt.access_mode=[x.keywords.read,x.keywords.write,x.keywords.read_write],Bt.sampler_type=[x.keywords.sampler,x.keywords.sampler_comparison],Bt.sampled_texture_type=[x.keywords.texture_1d,x.keywords.texture_2d,x.keywords.texture_2d_array,x.keywords.texture_3d,x.keywords.texture_cube,x.keywords.texture_cube_array],Bt.multisampled_texture_type=[x.keywords.texture_multisampled_2d],Bt.storage_texture_type=[x.keywords.texture_storage_1d,x.keywords.texture_storage_2d,x.keywords.texture_storage_2d_array,x.keywords.texture_storage_3d],Bt.depth_texture_type=[x.keywords.texture_depth_2d,x.keywords.texture_depth_2d_array,x.keywords.texture_depth_cube,x.keywords.texture_depth_cube_array,x.keywords.texture_depth_multisampled_2d],Bt.texture_external_type=[x.keywords.texture_external],Bt.any_texture_type=[...x.sampled_texture_type,...x.multisampled_texture_type,...x.storage_texture_type,...x.depth_texture_type,...x.texture_external_type],Bt.texel_format=[x.keywords.r8unorm,x.keywords.r8snorm,x.keywords.r8uint,x.keywords.r8sint,x.keywords.r16uint,x.keywords.r16sint,x.keywords.r16float,x.keywords.rg8unorm,x.keywords.rg8snorm,x.keywords.rg8uint,x.keywords.rg8sint,x.keywords.r32uint,x.keywords.r32sint,x.keywords.r32float,x.keywords.rg16uint,x.keywords.rg16sint,x.keywords.rg16float,x.keywords.rgba8unorm,x.keywords.rgba8unorm_srgb,x.keywords.rgba8snorm,x.keywords.rgba8uint,x.keywords.rgba8sint,x.keywords.bgra8unorm,x.keywords.bgra8unorm_srgb,x.keywords.rgb10a2unorm,x.keywords.rg11b10float,x.keywords.rg32uint,x.keywords.rg32sint,x.keywords.rg32float,x.keywords.rgba16uint,x.keywords.rgba16sint,x.keywords.rgba16float,x.keywords.rgba32uint,x.keywords.rgba32sint,x.keywords.rgba32float],Bt.const_literal=[x.tokens.int_literal,x.tokens.uint_literal,x.tokens.decimal_float_literal,x.tokens.hex_float_literal,x.keywords.true,x.keywords.false],Bt.literal_or_ident=[x.tokens.ident,x.tokens.int_literal,x.tokens.uint_literal,x.tokens.decimal_float_literal,x.tokens.hex_float_literal],Bt.element_count_expression=[x.tokens.int_literal,x.tokens.uint_literal,x.tokens.ident],Bt.template_types=[x.keywords.vec2,x.keywords.vec3,x.keywords.vec4,x.keywords.mat2x2,x.keywords.mat2x3,x.keywords.mat2x4,x.keywords.mat3x2,x.keywords.mat3x3,x.keywords.mat3x4,x.keywords.mat4x2,x.keywords.mat4x3,x.keywords.mat4x4,x.keywords.atomic,x.keywords.bitcast,...x.any_texture_type],Bt.attribute_name=[x.tokens.ident,x.keywords.block,x.keywords.diagnostic],Bt.assignment_operators=[x.tokens.equal,x.tokens.plus_equal,x.tokens.minus_equal,x.tokens.times_equal,x.tokens.division_equal,x.tokens.modulo_equal,x.tokens.and_equal,x.tokens.or_equal,x.tokens.xor_equal,x.tokens.shift_right_equal,x.tokens.shift_left_equal],Bt.increment_operators=[x.tokens.plus_plus,x.tokens.minus_minus];class Rt{constructor(t,e,n){this.type=t,this.lexeme=e,this.line=n}toString(){return this.lexeme}isTemplateType(){return-1!=Bt.template_types.indexOf(this.type)}isArrayType(){return this.type==Bt.keywords.array}isArrayOrTemplateType(){return this.isArrayType()||this.isTemplateType()}}class Lt{constructor(t){this._tokens=[],this._start=0,this._current=0,this._line=1,this._source=null!==t&&void 0!==t?t:""}scanTokens(){for(;!this._isAtEnd();)if(this._start=this._current,!this.scanToken())throw`Invalid syntax at line ${this._line}`;return this._tokens.push(new Rt(Bt.eof,"",this._line)),this._tokens}scanToken(){let t=this._advance();if("\n"==t)return this._line++,!0;if(this._isWhitespace(t))return!0;if("/"==t){if("/"==this._peekAhead()){for(;"\n"!=t;){if(this._isAtEnd())return!0;t=this._advance()}return this._line++,!0}if("*"==this._peekAhead()){this._advance();let e=1;for(;e>0;){if(this._isAtEnd())return!0;if(t=this._advance(),"\n"==t)this._line++;else if("*"==t){if("/"==this._peekAhead()&&(this._advance(),e--,0==e))return!0}else"/"==t&&"*"==this._peekAhead()&&(this._advance(),e++)}return!0}}const e=Bt.simpleTokens[t];if(e)return this._addToken(e),!0;let n=Bt.none;const i=this._isAlpha(t),r="_"===t;if(this._isAlphaNumeric(t)){let e=this._peekAhead();for(;this._isAlphaNumeric(e);)t+=this._advance(),e=this._peekAhead()}if(i){const e=Bt.keywords[t];if(e)return this._addToken(e),!0}if(i||r)return this._addToken(Bt.tokens.ident),!0;for(;;){let e=this._findType(t);const i=this._peekAhead();if("-"==t&&this._tokens.length>0){if("="==i)return this._current++,t+=i,this._addToken(Bt.tokens.minus_equal),!0;if("-"==i)return this._current++,t+=i,this._addToken(Bt.tokens.minus_minus),!0;const n=this._tokens.length-1;if((-1!=Bt.literal_or_ident.indexOf(this._tokens[n].type)||this._tokens[n].type==Bt.tokens.paren_right)&&">"!=i)return this._addToken(e),!0}if(">"==t&&(">"==i||"="==i)){let t=!1,n=this._tokens.length-1;for(let e=0;e<5&&n>=0&&-1===Bt.assignment_operators.indexOf(this._tokens[n].type);++e,--n)if(this._tokens[n].type===Bt.tokens.less_than){n>0&&this._tokens[n-1].isArrayOrTemplateType()&&(t=!0);break}if(t)return this._addToken(e),!0}if(e===Bt.none){let i=t,r=0;const o=2;for(let t=0;t<o;++t)if(i+=this._peekAhead(t),e=this._findType(i),e!==Bt.none){r=t;break}if(e===Bt.none)return n!==Bt.none&&(this._current--,this._addToken(n),!0);t=i,this._current+=r+1}if(n=e,this._isAtEnd())break;t+=this._advance()}return n!==Bt.none&&(this._addToken(n),!0)}_findType(t){for(const n in Bt.regexTokens){const e=Bt.regexTokens[n];if(this._match(t,e.rule))return e}const e=Bt.literalTokens[t];return e||Bt.none}_match(t,e){const n=e.exec(t);return n&&0==n.index&&n[0]==t}_isAtEnd(){return this._current>=this._source.length}_isAlpha(t){return t>="a"&&t<="z"||t>="A"&&t<="Z"}_isAlphaNumeric(t){return t>="a"&&t<="z"||t>="A"&&t<="Z"||"_"==t||t>="0"&&t<="9"}_isWhitespace(t){return" "==t||"\t"==t||"\r"==t}_advance(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=this._source[this._current];return t=t||0,t++,this._current+=t,e}_peekAhead(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return t=t||0,this._current+t>=this._source.length?"\0":this._source[this._current+t]}_addToken(t){const e=this._source.substring(this._start,this._current);this._tokens.push(new Rt(t,e,this._line))}}class Ot{constructor(){this._tokens=[],this._current=0,this._currentLine=0,this._context=new M,this._deferArrayCountEval=[]}parse(t){this._initialize(t),this._deferArrayCountEval.length=0;const e=[];for(;!this._isAtEnd();){const t=this._global_decl_or_directive();if(!t)break;e.push(t)}if(this._deferArrayCountEval.length>0){for(const t of this._deferArrayCountEval){const e=t.arrayType,i=t.countNode;if(i instanceof pt){const t=i.name,r=this._context.constants.get(t);if(r)try{const t=r.evaluate(this._context);e.count=t}catch(n){}}}this._deferArrayCountEval.length=0}return e}_initialize(t){if(t)if("string"==typeof t){const e=new Lt(t);this._tokens=e.scanTokens()}else this._tokens=t;else this._tokens=[];this._current=0}_error(t,e){return{token:t,message:e,toString:function(){return`${e}`}}}_isAtEnd(){return this._current>=this._tokens.length||this._peek().type==Bt.eof}_match(t){if(t instanceof It)return!!this._check(t)&&(this._advance(),!0);for(let e=0,n=t.length;e<n;++e){const n=t[e];if(this._check(n))return this._advance(),!0}return!1}_consume(t,e){if(this._check(t))return this._advance();throw this._error(this._peek(),e)}_check(t){if(this._isAtEnd())return!1;const e=this._peek();if(t instanceof Array){const n=e.type;return-1!=t.indexOf(n)}return e.type==t}_advance(){var t,e;return this._currentLine=null!==(e=null===(t=this._peek())||void 0===t?void 0:t.line)&&void 0!==e?e:-1,this._isAtEnd()||this._current++,this._previous()}_peek(){return this._tokens[this._current]}_previous(){return this._tokens[this._current-1]}_global_decl_or_directive(){for(;this._match(Bt.tokens.semicolon)&&!this._isAtEnd(););if(this._match(Bt.keywords.alias)){const t=this._type_alias();return this._consume(Bt.tokens.semicolon,"Expected ';'"),t}if(this._match(Bt.keywords.diagnostic)){const t=this._diagnostic();return this._consume(Bt.tokens.semicolon,"Expected ';'"),t}if(this._match(Bt.keywords.requires)){const t=this._requires_directive();return this._consume(Bt.tokens.semicolon,"Expected ';'"),t}if(this._match(Bt.keywords.enable)){const t=this._enable_directive();return this._consume(Bt.tokens.semicolon,"Expected ';'"),t}const t=this._attribute();if(this._check(Bt.keywords.var)){const e=this._global_variable_decl();return null!=e&&(e.attributes=t),this._consume(Bt.tokens.semicolon,"Expected ';'."),e}if(this._check(Bt.keywords.override)){const e=this._override_variable_decl();return null!=e&&(e.attributes=t),this._consume(Bt.tokens.semicolon,"Expected ';'."),e}if(this._check(Bt.keywords.let)){const e=this._global_let_decl();return null!=e&&(e.attributes=t),this._consume(Bt.tokens.semicolon,"Expected ';'."),e}if(this._check(Bt.keywords.const)){const e=this._global_const_decl();return null!=e&&(e.attributes=t),this._consume(Bt.tokens.semicolon,"Expected ';'."),e}if(this._check(Bt.keywords.struct)){const e=this._struct_decl();return null!=e&&(e.attributes=t),e}if(this._check(Bt.keywords.fn)){const e=this._function_decl();return null!=e&&(e.attributes=t),e}return null}_function_decl(){if(!this._match(Bt.keywords.fn))return null;const t=this._currentLine,e=this._consume(Bt.tokens.ident,"Expected function name.").toString();this._consume(Bt.tokens.paren_left,"Expected '(' for function arguments.");const n=[];if(!this._check(Bt.tokens.paren_right))do{if(this._check(Bt.tokens.paren_right))break;const t=this._attribute(),e=this._consume(Bt.tokens.ident,"Expected argument name.").toString();this._consume(Bt.tokens.colon,"Expected ':' for argument type.");const i=this._attribute(),r=this._type_decl();null!=r&&(r.attributes=i,n.push(new Tt(e,r,t)))}while(this._match(Bt.tokens.comma));this._consume(Bt.tokens.paren_right,"Expected ')' after function arguments.");let i=null;if(this._match(Bt.tokens.arrow)){const t=this._attribute();i=this._type_decl(),null!=i&&(i.attributes=t)}const r=this._compound_statement(),o=this._currentLine;return new O(e,n,i,r,t,o)}_compound_statement(){const t=[];for(this._consume(Bt.tokens.brace_left,"Expected '{' for block.");!this._check(Bt.tokens.brace_right);){const e=this._statement();null!==e&&t.push(e)}return this._consume(Bt.tokens.brace_right,"Expected '}' for block."),t}_statement(){for(;this._match(Bt.tokens.semicolon)&&!this._isAtEnd(););if(this._check(Bt.tokens.attr)&&this._attribute(),this._check(Bt.keywords.if))return this._if_statement();if(this._check(Bt.keywords.switch))return this._switch_statement();if(this._check(Bt.keywords.loop))return this._loop_statement();if(this._check(Bt.keywords.for))return this._for_statement();if(this._check(Bt.keywords.while))return this._while_statement();if(this._check(Bt.keywords.continuing))return this._continuing_statement();if(this._check(Bt.keywords.static_assert))return this._static_assert_statement();if(this._check(Bt.tokens.brace_left))return this._compound_statement();let t=null;return t=this._check(Bt.keywords.return)?this._return_statement():this._check([Bt.keywords.var,Bt.keywords.let,Bt.keywords.const])?this._variable_statement():this._match(Bt.keywords.discard)?new tt:this._match(Bt.keywords.break)?new et:this._match(Bt.keywords.continue)?new nt:this._increment_decrement_statement()||this._func_call_statement()||this._assignment_statement(),null!=t&&this._consume(Bt.tokens.semicolon,"Expected ';' after statement."),t}_static_assert_statement(){if(!this._match(Bt.keywords.static_assert))return null;const t=this._optional_paren_expression();return new D(t)}_while_statement(){if(!this._match(Bt.keywords.while))return null;const t=this._optional_paren_expression();this._check(Bt.tokens.attr)&&this._attribute();const e=this._compound_statement();return new k(t,e)}_continuing_statement(){if(!this._match(Bt.keywords.continuing))return null;const t=this._compound_statement();return new F(t)}_for_statement(){if(!this._match(Bt.keywords.for))return null;this._consume(Bt.tokens.paren_left,"Expected '('.");const t=this._check(Bt.tokens.semicolon)?null:this._for_init();this._consume(Bt.tokens.semicolon,"Expected ';'.");const e=this._check(Bt.tokens.semicolon)?null:this._short_circuit_or_expression();this._consume(Bt.tokens.semicolon,"Expected ';'.");const n=this._check(Bt.tokens.paren_right)?null:this._for_increment();this._consume(Bt.tokens.paren_right,"Expected ')'."),this._check(Bt.tokens.attr)&&this._attribute();const i=this._compound_statement();return new N(t,e,n,i)}_for_init(){return this._variable_statement()||this._func_call_statement()||this._assignment_statement()}_for_increment(){return this._func_call_statement()||this._increment_decrement_statement()||this._assignment_statement()}_variable_statement(){if(this._check(Bt.keywords.var)){const t=this._variable_decl();if(null===t)throw this._error(this._peek(),"Variable declaration expected.");let e=null;return this._match(Bt.tokens.equal)&&(e=this._short_circuit_or_expression()),new z(t.name,t.type,t.storage,t.access,e)}if(this._match(Bt.keywords.let)){const t=this._consume(Bt.tokens.ident,"Expected name for let.").toString();let e=null;if(this._match(Bt.tokens.colon)){const t=this._attribute();e=this._type_decl(),null!=e&&(e.attributes=t)}this._consume(Bt.tokens.equal,"Expected '=' for let.");const n=this._short_circuit_or_expression();return new G(t,e,null,null,n)}if(this._match(Bt.keywords.const)){const t=this._consume(Bt.tokens.ident,"Expected name for const.").toString();let e=null;if(this._match(Bt.tokens.colon)){const t=this._attribute();e=this._type_decl(),null!=e&&(e.attributes=t)}this._consume(Bt.tokens.equal,"Expected '=' for const.");const n=this._short_circuit_or_expression();return new V(t,e,null,null,n)}return null}_increment_decrement_statement(){const t=this._current,e=this._unary_expression();if(null==e)return null;if(!this._check(Bt.increment_operators))return this._current=t,null;const n=this._consume(Bt.increment_operators,"Expected increment operator");return new j(n.type===Bt.tokens.plus_plus?v.increment:v.decrement,e)}_assignment_statement(){let t=null;if(this._check(Bt.tokens.brace_right))return null;let e=this._match(Bt.tokens.underscore);if(e||(t=this._unary_expression()),!e&&null==t)return null;const n=this._consume(Bt.assignment_operators,"Expected assignment operator."),i=this._short_circuit_or_expression();return new H(b.parse(n.lexeme),t,i)}_func_call_statement(){if(!this._check(Bt.tokens.ident))return null;const t=this._current,e=this._consume(Bt.tokens.ident,"Expected function name."),n=this._argument_expression_list();return null===n?(this._current=t,null):new W(e.lexeme,n)}_loop_statement(){if(!this._match(Bt.keywords.loop))return null;this._check(Bt.tokens.attr)&&this._attribute(),this._consume(Bt.tokens.brace_left,"Expected '{' for loop.");const t=[];let e=this._statement();for(;null!==e;){if(Array.isArray(e))for(let n of e)t.push(n);else t.push(e);e=this._statement()}let n=null;return this._match(Bt.keywords.continuing)&&(n=this._compound_statement()),this._consume(Bt.tokens.brace_right,"Expected '}' for loop."),new q(t,n)}_switch_statement(){if(!this._match(Bt.keywords.switch))return null;const t=this._optional_paren_expression();this._check(Bt.tokens.attr)&&this._attribute(),this._consume(Bt.tokens.brace_left,"Expected '{' for switch.");const e=this._switch_body();if(null==e||0==e.length)throw this._error(this._previous(),"Expected 'case' or 'default'.");return this._consume(Bt.tokens.brace_right,"Expected '}' for switch."),new Z(t,e)}_switch_body(){const t=[];if(this._match(Bt.keywords.case)){const e=this._case_selectors();this._match(Bt.tokens.colon),this._check(Bt.tokens.attr)&&this._attribute(),this._consume(Bt.tokens.brace_left,"Exected '{' for switch case.");const n=this._case_body();this._consume(Bt.tokens.brace_right,"Exected '}' for switch case."),t.push(new Et(e,n))}if(this._match(Bt.keywords.default)){this._match(Bt.tokens.colon),this._check(Bt.tokens.attr)&&this._attribute(),this._consume(Bt.tokens.brace_left,"Exected '{' for switch default.");const e=this._case_body();this._consume(Bt.tokens.brace_right,"Exected '}' for switch default."),t.push(new Ct(e))}if(this._check([Bt.keywords.default,Bt.keywords.case])){const e=this._switch_body();t.push(e[0])}return t}_case_selectors(){const t=[this._shift_expression()];for(;this._match(Bt.tokens.comma);)t.push(this._shift_expression());return t}_case_body(){if(this._match(Bt.keywords.fallthrough))return this._consume(Bt.tokens.semicolon,"Expected ';'"),[];let t=this._statement();if(null==t)return[];t instanceof Array||(t=[t]);const e=this._case_body();return 0==e.length?t:[...t,e[0]]}_if_statement(){if(!this._match(Bt.keywords.if))return null;const t=this._optional_paren_expression();this._check(Bt.tokens.attr)&&this._attribute();const e=this._compound_statement();let n=[];this._match_elseif()&&(this._check(Bt.tokens.attr)&&this._attribute(),n=this._elseif_statement(n));let i=null;return this._match(Bt.keywords.else)&&(this._check(Bt.tokens.attr)&&this._attribute(),i=this._compound_statement()),new X(t,e,n,i)}_match_elseif(){return this._tokens[this._current].type===Bt.keywords.else&&this._tokens[this._current+1].type===Bt.keywords.if&&(this._advance(),this._advance(),!0)}_elseif_statement(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const e=this._optional_paren_expression(),n=this._compound_statement();return t.push(new St(e,n)),this._match_elseif()&&(this._check(Bt.tokens.attr)&&this._attribute(),this._elseif_statement(t)),t}_return_statement(){if(!this._match(Bt.keywords.return))return null;const t=this._short_circuit_or_expression();return new K(t)}_short_circuit_or_expression(){let t=this._short_circuit_and_expr();for(;this._match(Bt.tokens.or_or);)t=new xt(this._previous().toString(),t,this._short_circuit_and_expr());return t}_short_circuit_and_expr(){let t=this._inclusive_or_expression();for(;this._match(Bt.tokens.and_and);)t=new xt(this._previous().toString(),t,this._inclusive_or_expression());return t}_inclusive_or_expression(){let t=this._exclusive_or_expression();for(;this._match(Bt.tokens.or);)t=new xt(this._previous().toString(),t,this._exclusive_or_expression());return t}_exclusive_or_expression(){let t=this._and_expression();for(;this._match(Bt.tokens.xor);)t=new xt(this._previous().toString(),t,this._and_expression());return t}_and_expression(){let t=this._equality_expression();for(;this._match(Bt.tokens.and);)t=new xt(this._previous().toString(),t,this._equality_expression());return t}_equality_expression(){const t=this._relational_expression();return this._match([Bt.tokens.equal_equal,Bt.tokens.not_equal])?new xt(this._previous().toString(),t,this._relational_expression()):t}_relational_expression(){let t=this._shift_expression();for(;this._match([Bt.tokens.less_than,Bt.tokens.greater_than,Bt.tokens.less_than_equal,Bt.tokens.greater_than_equal]);)t=new xt(this._previous().toString(),t,this._shift_expression());return t}_shift_expression(){let t=this._additive_expression();for(;this._match([Bt.tokens.shift_left,Bt.tokens.shift_right]);)t=new xt(this._previous().toString(),t,this._additive_expression());return t}_additive_expression(){let t=this._multiplicative_expression();for(;this._match([Bt.tokens.plus,Bt.tokens.minus]);)t=new xt(this._previous().toString(),t,this._multiplicative_expression());return t}_multiplicative_expression(){let t=this._unary_expression();for(;this._match([Bt.tokens.star,Bt.tokens.forward_slash,Bt.tokens.modulo]);)t=new xt(this._previous().toString(),t,this._unary_expression());return t}_unary_expression(){return this._match([Bt.tokens.minus,Bt.tokens.bang,Bt.tokens.tilde,Bt.tokens.star,Bt.tokens.and])?new bt(this._previous().toString(),this._unary_expression()):this._singular_expression()}_singular_expression(){const t=this._primary_expression(),e=this._postfix_expression();return e&&(t.postfix=e),t}_postfix_expression(){if(this._match(Bt.tokens.bracket_left)){const t=this._short_circuit_or_expression();this._consume(Bt.tokens.bracket_right,"Expected ']'.");const e=new _t(t),n=this._postfix_expression();return n&&(e.postfix=n),e}if(this._match(Bt.tokens.period)){const t=this._consume(Bt.tokens.ident,"Expected member name."),e=this._postfix_expression(),n=new ut(t.lexeme);return e&&(n.postfix=e),n}return null}_getStruct(t){if(this._context.aliases.has(t)){return this._context.aliases.get(t).type}if(this._context.structs.has(t)){return this._context.structs.get(t)}return null}_primary_expression(){if(this._match(Bt.tokens.ident)){const t=this._previous().toString();if(this._check(Bt.tokens.paren_left)){const e=this._argument_expression_list(),n=this._getStruct(t);return null!=n?new ht(n,e):new dt(t,e)}if(this._context.constants.has(t)){const e=this._context.constants.get(t);return new ft(t,e.value)}return new pt(t)}if(this._match(Bt.const_literal))return new At(parseFloat(this._previous().toString()));if(this._check(Bt.tokens.paren_left))return this._paren_expression();if(this._match(Bt.keywords.bitcast)){this._consume(Bt.tokens.less_than,"Expected '<'.");const t=this._type_decl();this._consume(Bt.tokens.greater_than,"Expected '>'.");const e=this._paren_expression();return new gt(t,e)}const t=this._type_decl(),e=this._argument_expression_list();return new mt(t,e)}_argument_expression_list(){if(!this._match(Bt.tokens.paren_left))return null;const t=[];do{if(this._check(Bt.tokens.paren_right))break;const e=this._short_circuit_or_expression();t.push(e)}while(this._match(Bt.tokens.comma));return this._consume(Bt.tokens.paren_right,"Expected ')' for agument list"),t}_optional_paren_expression(){this._match(Bt.tokens.paren_left);const t=this._short_circuit_or_expression();return this._match(Bt.tokens.paren_right),new yt([t])}_paren_expression(){this._consume(Bt.tokens.paren_left,"Expected '('.");const t=this._short_circuit_or_expression();return this._consume(Bt.tokens.paren_right,"Expected ')'."),new yt([t])}_struct_decl(){if(!this._match(Bt.keywords.struct))return null;const t=this._currentLine,e=this._consume(Bt.tokens.ident,"Expected name for struct.").toString();this._consume(Bt.tokens.brace_left,"Expected '{' for struct body.");const n=[];for(;!this._check(Bt.tokens.brace_right);){const t=this._attribute(),e=this._consume(Bt.tokens.ident,"Expected variable name.").toString();this._consume(Bt.tokens.colon,"Expected ':' for struct member type.");const i=this._attribute(),r=this._type_decl();null!=r&&(r.attributes=i),this._check(Bt.tokens.brace_right)?this._match(Bt.tokens.comma):this._consume(Bt.tokens.comma,"Expected ',' for struct member."),n.push(new Pt(e,r,t))}this._consume(Bt.tokens.brace_right,"Expected '}' after struct body.");const i=this._currentLine,r=new rt(e,n,t,i);return this._context.structs.set(e,r),r}_global_variable_decl(){const t=this._variable_decl();return t&&this._match(Bt.tokens.equal)&&(t.value=this._const_expression()),t}_override_variable_decl(){const t=this._override_decl();return t&&this._match(Bt.tokens.equal)&&(t.value=this._const_expression()),t}_global_const_decl(){if(!this._match(Bt.keywords.const))return null;const t=this._consume(Bt.tokens.ident,"Expected variable name");let e=null;if(this._match(Bt.tokens.colon)){const t=this._attribute();e=this._type_decl(),null!=e&&(e.attributes=t)}let n=null;if(this._match(Bt.tokens.equal)){const t=this._short_circuit_or_expression();if(t instanceof ht)n=t;else if(t instanceof ft&&t.initializer instanceof ht)n=t.initializer;else try{const e=t.evaluate(this._context);n=new At(e)}catch(x){n=t}}const i=new V(t.toString(),e,"","",n);return this._context.constants.set(i.name,i),i}_global_let_decl(){if(!this._match(Bt.keywords.let))return null;const t=this._consume(Bt.tokens.ident,"Expected variable name");let e=null;if(this._match(Bt.tokens.colon)){const t=this._attribute();e=this._type_decl(),null!=e&&(e.attributes=t)}let n=null;return this._match(Bt.tokens.equal)&&(n=this._const_expression()),new G(t.toString(),e,"","",n)}_const_expression(){if(this._match(Bt.const_literal))return new ut(this._previous().toString());const t=this._type_decl();this._consume(Bt.tokens.paren_left,"Expected '('.");let e=[];for(;!this._check(Bt.tokens.paren_right)&&(e.push(this._const_expression()),this._check(Bt.tokens.comma));)this._advance();return this._consume(Bt.tokens.paren_right,"Expected ')'."),new ht(t,e)}_variable_decl(){if(!this._match(Bt.keywords.var))return null;let t="",e="";this._match(Bt.tokens.less_than)&&(t=this._consume(Bt.storage_class,"Expected storage_class.").toString(),this._match(Bt.tokens.comma)&&(e=this._consume(Bt.access_mode,"Expected access_mode.").toString()),this._consume(Bt.tokens.greater_than,"Expected '>'."));const n=this._consume(Bt.tokens.ident,"Expected variable name");let i=null;if(this._match(Bt.tokens.colon)){const t=this._attribute();i=this._type_decl(),null!=i&&(i.attributes=t)}return new z(n.toString(),i,t,e,null)}_override_decl(){if(!this._match(Bt.keywords.override))return null;const t=this._consume(Bt.tokens.ident,"Expected variable name");let e=null;if(this._match(Bt.tokens.colon)){const t=this._attribute();e=this._type_decl(),null!=e&&(e.attributes=t)}return new U(t.toString(),e,null)}_diagnostic(){this._consume(Bt.tokens.paren_left,"Expected '('");const t=this._consume(Bt.tokens.ident,"Expected severity control name.");this._consume(Bt.tokens.comma,"Expected ','");const e=this._consume(Bt.tokens.ident,"Expected diagnostic rule name.");return this._consume(Bt.tokens.paren_right,"Expected ')'"),new Y(t.toString(),e.toString())}_enable_directive(){const t=this._consume(Bt.tokens.ident,"identity expected.");return new Q(t.toString())}_requires_directive(){const t=[this._consume(Bt.tokens.ident,"identity expected.").toString()];for(;this._match(Bt.tokens.comma);){const e=this._consume(Bt.tokens.ident,"identity expected.");t.push(e.toString())}return new J(t)}_type_alias(){const t=this._consume(Bt.tokens.ident,"identity expected.");this._consume(Bt.tokens.equal,"Expected '=' for type alias.");let e=this._type_decl();if(null===e)throw this._error(this._peek(),"Expected Type for Alias.");this._context.aliases.has(e.name)&&(e=this._context.aliases.get(e.name).type);const n=new $(t.toString(),e);return this._context.aliases.set(n.name,n),n}_type_decl(){if(this._check([Bt.tokens.ident,...Bt.texel_format,Bt.keywords.bool,Bt.keywords.f32,Bt.keywords.i32,Bt.keywords.u32])){const t=this._advance(),e=t.toString();return this._context.structs.has(e)?this._context.structs.get(e):this._context.aliases.has(e)?this._context.aliases.get(e).type:new it(t.toString())}let t=this._texture_sampler_types();if(t)return t;if(this._check(Bt.template_types)){let t=this._advance().toString(),e=null,n=null;return this._match(Bt.tokens.less_than)&&(e=this._type_decl(),n=null,this._match(Bt.tokens.comma)&&(n=this._consume(Bt.access_mode,"Expected access_mode for pointer").toString()),this._consume(Bt.tokens.greater_than,"Expected '>' for type.")),new ot(t,e,n)}if(this._match(Bt.keywords.ptr)){let t=this._previous().toString();this._consume(Bt.tokens.less_than,"Expected '<' for pointer.");const e=this._consume(Bt.storage_class,"Expected storage_class for pointer");this._consume(Bt.tokens.comma,"Expected ',' for pointer.");const n=this._type_decl();let i=null;return this._match(Bt.tokens.comma)&&(i=this._consume(Bt.access_mode,"Expected access_mode for pointer").toString()),this._consume(Bt.tokens.greater_than,"Expected '>' for pointer."),new st(t,e.toString(),n,i)}const e=this._attribute();if(this._match(Bt.keywords.array)){let t=null,i=-1;const r=this._previous();let o=null;if(this._match(Bt.tokens.less_than)){t=this._type_decl(),this._context.aliases.has(t.name)&&(t=this._context.aliases.get(t.name).type);let e="";if(this._match(Bt.tokens.comma)){o=this._shift_expression();try{e=o.evaluate(this._context).toString(),o=null}catch(n){e="1"}}this._consume(Bt.tokens.greater_than,"Expected '>' for array."),i=e?parseInt(e):0}const s=new at(r.toString(),e,t,i);return o&&this._deferArrayCountEval.push({arrayType:s,countNode:o}),s}return null}_texture_sampler_types(){if(this._match(Bt.sampler_type))return new lt(this._previous().toString(),null,null);if(this._match(Bt.depth_texture_type))return new lt(this._previous().toString(),null,null);if(this._match(Bt.sampled_texture_type)||this._match(Bt.multisampled_texture_type)){const t=this._previous();this._consume(Bt.tokens.less_than,"Expected '<' for sampler type.");const e=this._type_decl();return this._consume(Bt.tokens.greater_than,"Expected '>' for sampler type."),new lt(t.toString(),e,null)}if(this._match(Bt.storage_texture_type)){const t=this._previous();this._consume(Bt.tokens.less_than,"Expected '<' for sampler type.");const e=this._consume(Bt.texel_format,"Invalid texel format.").toString();this._consume(Bt.tokens.comma,"Expected ',' after texel format.");const n=this._consume(Bt.access_mode,"Expected access mode for storage texture type.").toString();return this._consume(Bt.tokens.greater_than,"Expected '>' for sampler type."),new lt(t.toString(),e,n)}return null}_attribute(){let t=[];for(;this._match(Bt.tokens.attr);){const e=this._consume(Bt.attribute_name,"Expected attribute name"),n=new Mt(e.toString(),null);if(this._match(Bt.tokens.paren_left)){if(n.value=this._consume(Bt.literal_or_ident,"Expected attribute value").toString(),this._check(Bt.tokens.comma)){this._advance();do{const t=this._consume(Bt.literal_or_ident,"Expected attribute value").toString();n.value instanceof Array||(n.value=[n.value]),n.value.push(t)}while(this._match(Bt.tokens.comma))}this._consume(Bt.tokens.paren_right,"Expected ')'")}t.push(n)}return 0==t.length?null:t}}class Dt{constructor(t,e){this.name=t,this.attributes=e,this.size=0}get isArray(){return!1}get isStruct(){return!1}get isTemplate(){return!1}}class kt{constructor(t,e,n){this.name=t,this.type=e,this.attributes=n,this.offset=0,this.size=0}get isArray(){return this.type.isArray}get isStruct(){return this.type.isStruct}get isTemplate(){return this.type.isTemplate}get align(){return this.type.isStruct?this.type.align:0}get members(){return this.type.isStruct?this.type.members:null}get format(){return this.type.isArray||this.type.isTemplate?this.type.format:null}get count(){return this.type.isArray?this.type.count:0}get stride(){return this.type.isArray?this.type.stride:this.size}}class Ft extends Dt{constructor(t,e){super(t,e),this.members=[],this.align=0,this.startLine=-1,this.endLine=-1,this.inUse=!1}get isStruct(){return!0}}class Nt extends Dt{constructor(t,e){super(t,e),this.count=0,this.stride=0}get isArray(){return!0}}class zt extends Dt{constructor(t,e,n,i){super(t,n),this.format=e,this.access=i}get isTemplate(){return!0}}!function(t){t[t.Uniform=0]="Uniform",t[t.Storage=1]="Storage",t[t.Texture=2]="Texture",t[t.Sampler=3]="Sampler",t[t.StorageTexture=4]="StorageTexture"}(E||(E={}));class Ut{constructor(t,e,n,i,r,o,s){this.name=t,this.type=e,this.group=n,this.binding=i,this.attributes=r,this.resourceType=o,this.access=s}get isArray(){return this.type.isArray}get isStruct(){return this.type.isStruct}get isTemplate(){return this.type.isTemplate}get size(){return this.type.size}get align(){return this.type.isStruct?this.type.align:0}get members(){return this.type.isStruct?this.type.members:null}get format(){return this.type.isArray||this.type.isTemplate?this.type.format:null}get count(){return this.type.isArray?this.type.count:0}get stride(){return this.type.isArray?this.type.stride:this.size}}class Gt{constructor(t,e){this.name=t,this.type=e}}class Vt{constructor(t,e){this.align=t,this.size=e}}class jt{constructor(t,e,n,i){this.name=t,this.type=e,this.locationType=n,this.location=i,this.interpolation=null}}class Ht{constructor(t,e,n,i){this.name=t,this.type=e,this.locationType=n,this.location=i}}class Wt{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this.stage=null,this.inputs=[],this.outputs=[],this.resources=[],this.startLine=-1,this.endLine=-1,this.inUse=!1,this.calls=new Set,this.name=t,this.stage=e}}class qt{constructor(){this.vertex=[],this.fragment=[],this.compute=[]}}class Zt{constructor(t,e,n,i){this.name=t,this.type=e,this.attributes=n,this.id=i}}class Xt{constructor(t){this.resources=null,this.inUse=!1,this.info=null,this.node=t}}class Kt{constructor(t){this.uniforms=[],this.storage=[],this.textures=[],this.samplers=[],this.aliases=[],this.overrides=[],this.structs=[],this.entry=new qt,this.functions=[],this._types=new Map,this._functions=new Map,t&&this.update(t)}_isStorageTexture(t){return"texture_storage_1d"==t.name||"texture_storage_2d"==t.name||"texture_storage_2d_array"==t.name||"texture_storage_3d"==t.name}update(t){const e=(new Ot).parse(t);for(const n of e)n instanceof O&&this._functions.set(n.name,new Xt(n));for(const n of e)if(n instanceof rt){const t=this._getTypeInfo(n,null);t instanceof Ft&&this.structs.push(t)}for(const n of e)if(n instanceof $)this.aliases.push(this._getAliasInfo(n));else if(n instanceof U){const t=n,e=this._getAttributeNum(t.attributes,"id",0),i=null!=t.type?this._getTypeInfo(t.type,t.attributes):null;this.overrides.push(new Zt(t.name,i,t.attributes,e))}else if(this._isUniformVar(n)){const t=n,e=this._getAttributeNum(t.attributes,"group",0),i=this._getAttributeNum(t.attributes,"binding",0),r=this._getTypeInfo(t.type,t.attributes),o=new Ut(t.name,r,e,i,t.attributes,E.Uniform,t.access);this.uniforms.push(o)}else if(this._isStorageVar(n)){const t=n,e=this._getAttributeNum(t.attributes,"group",0),i=this._getAttributeNum(t.attributes,"binding",0),r=this._getTypeInfo(t.type,t.attributes),o=this._isStorageTexture(r),s=new Ut(t.name,r,e,i,t.attributes,o?E.StorageTexture:E.Storage,t.access);this.storage.push(s)}else if(this._isTextureVar(n)){const t=n,e=this._getAttributeNum(t.attributes,"group",0),i=this._getAttributeNum(t.attributes,"binding",0),r=this._getTypeInfo(t.type,t.attributes),o=this._isStorageTexture(r),s=new Ut(t.name,r,e,i,t.attributes,o?E.StorageTexture:E.Texture,t.access);o?this.storage.push(s):this.textures.push(s)}else if(this._isSamplerVar(n)){const t=n,e=this._getAttributeNum(t.attributes,"group",0),i=this._getAttributeNum(t.attributes,"binding",0),r=this._getTypeInfo(t.type,t.attributes),o=new Ut(t.name,r,e,i,t.attributes,E.Sampler,t.access);this.samplers.push(o)}else if(n instanceof O){const t=this._getAttribute(n,"vertex"),e=this._getAttribute(n,"fragment"),i=this._getAttribute(n,"compute"),r=t||e||i,o=new Wt(n.name,null===r||void 0===r?void 0:r.name);o.startLine=n.startLine,o.endLine=n.endLine,this.functions.push(o),this._functions.get(n.name).info=o,r&&(this._functions.get(n.name).inUse=!0,o.inUse=!0,o.resources=this._findResources(n,!!r),o.inputs=this._getInputs(n.args),o.outputs=this._getOutputs(n.returnType),this.entry[r.name].push(o))}else;for(const n of this._functions.values())n.info&&(n.info.inUse=n.inUse,this._addCalls(n.node,n.info.calls));for(const n of this.uniforms)this._markStructsInUse(n.type);for(const n of this.storage)this._markStructsInUse(n.type)}_markStructsInUse(t){if(t.isStruct){t.inUse=!0;for(const e of t.members)this._markStructsInUse(e.type)}else if(t.isArray)this._markStructsInUse(t.format);else if(t.isTemplate)this._markStructsInUse(t.format);else{const e=this._getAlias(t.name);e&&this._markStructsInUse(e)}}_addCalls(t,e){var n;for(const i of t.calls){const t=null===(n=this._functions.get(i.name))||void 0===n?void 0:n.info;t&&e.add(t)}}findResource(t,e){for(const n of this.uniforms)if(n.group==t&&n.binding==e)return n;for(const n of this.storage)if(n.group==t&&n.binding==e)return n;for(const n of this.textures)if(n.group==t&&n.binding==e)return n;for(const n of this.samplers)if(n.group==t&&n.binding==e)return n;return null}_findResource(t){for(const e of this.uniforms)if(e.name==t)return e;for(const e of this.storage)if(e.name==t)return e;for(const e of this.textures)if(e.name==t)return e;for(const e of this.samplers)if(e.name==t)return e;return null}_markStructsFromAST(t){const e=this._getTypeInfo(t,null);this._markStructsInUse(e)}_findResources(t,e){const n=[],i=this,r=[];return t.search((o=>{if(o instanceof B)r.push({});else if(o instanceof R)r.pop();else if(o instanceof z){const t=o;e&&null!==t.type&&this._markStructsFromAST(t.type),r.length>0&&(r[r.length-1][t.name]=t)}else if(o instanceof ht){const t=o;e&&null!==t.type&&this._markStructsFromAST(t.type)}else if(o instanceof G){const t=o;e&&null!==t.type&&this._markStructsFromAST(t.type),r.length>0&&(r[r.length-1][t.name]=t)}else if(o instanceof pt){const t=o;if(r.length>0){if(r[r.length-1][t.name])return}const e=i._findResource(t.name);e&&n.push(e)}else if(o instanceof dt){const r=o,s=i._functions.get(r.name);s&&(e&&(s.inUse=!0),t.calls.add(s.node),null===s.resources&&(s.resources=i._findResources(s.node,e)),n.push(...s.resources))}else if(o instanceof W){const r=o,s=i._functions.get(r.name);s&&(e&&(s.inUse=!0),t.calls.add(s.node),null===s.resources&&(s.resources=i._findResources(s.node,e)),n.push(...s.resources))}})),[...new Map(n.map((t=>[t.name,t]))).values()]}getBindGroups(){const t=[];function e(e,n){e>=t.length&&(t.length=e+1),void 0===t[e]&&(t[e]=[]),n>=t[e].length&&(t[e].length=n+1)}for(const n of this.uniforms){e(n.group,n.binding);t[n.group][n.binding]=n}for(const n of this.storage){e(n.group,n.binding);t[n.group][n.binding]=n}for(const n of this.textures){e(n.group,n.binding);t[n.group][n.binding]=n}for(const n of this.samplers){e(n.group,n.binding);t[n.group][n.binding]=n}return t}_getOutputs(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;if(void 0===e&&(e=[]),t instanceof rt)this._getStructOutputs(t,e);else{const n=this._getOutputInfo(t);null!==n&&e.push(n)}return e}_getStructOutputs(t,e){for(const n of t.members)if(n.type instanceof rt)this._getStructOutputs(n.type,e);else{const t=this._getAttribute(n,"location")||this._getAttribute(n,"builtin");if(null!==t){const i=this._getTypeInfo(n.type,n.type.attributes),r=this._parseInt(t.value),o=new Ht(n.name,i,t.name,r);e.push(o)}}}_getOutputInfo(t){const e=this._getAttribute(t,"location")||this._getAttribute(t,"builtin");if(null!==e){const n=this._getTypeInfo(t,t.attributes),i=this._parseInt(e.value);return new Ht("",n,e.name,i)}return null}_getInputs(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;void 0===e&&(e=[]);for(const n of t)if(n.type instanceof rt)this._getStructInputs(n.type,e);else{const t=this._getInputInfo(n);null!==t&&e.push(t)}return e}_getStructInputs(t,e){for(const n of t.members)if(n.type instanceof rt)this._getStructInputs(n.type,e);else{const t=this._getInputInfo(n);null!==t&&e.push(t)}}_getInputInfo(t){const e=this._getAttribute(t,"location")||this._getAttribute(t,"builtin");if(null!==e){const n=this._getAttribute(t,"interpolation"),i=this._getTypeInfo(t.type,t.attributes),r=this._parseInt(e.value),o=new jt(t.name,i,e.name,r);return null!==n&&(o.interpolation=this._parseString(n.value)),o}return null}_parseString(t){return t instanceof Array&&(t=t[0]),t}_parseInt(t){t instanceof Array&&(t=t[0]);const e=parseInt(t);return isNaN(e)?t:e}_getAlias(t){for(const e of this.aliases)if(e.name==t)return e.type;return null}_getAliasInfo(t){return new Gt(t.name,this._getTypeInfo(t.type,null))}_getTypeInfo(t,e){if(this._types.has(t))return this._types.get(t);if(t instanceof at){const n=t,i=this._getTypeInfo(n.format,n.attributes),r=new Nt(n.name,e);return r.format=i,r.count=n.count,this._types.set(t,r),this._updateTypeInfo(r),r}if(t instanceof rt){const n=t,i=new Ft(n.name,e);i.startLine=n.startLine,i.endLine=n.endLine;for(const t of n.members){const e=this._getTypeInfo(t.type,t.attributes);i.members.push(new kt(t.name,e,t.attributes))}return this._types.set(t,i),this._updateTypeInfo(i),i}if(t instanceof lt){const n=t,i=n.format instanceof it,r=n.format?i?this._getTypeInfo(n.format,null):new Dt(n.format,null):null,o=new zt(n.name,r,e,n.access);return this._types.set(t,o),this._updateTypeInfo(o),o}if(t instanceof ot){const n=t,i=n.format?this._getTypeInfo(n.format,null):null,r=new zt(n.name,i,e,n.access);return this._types.set(t,r),this._updateTypeInfo(r),r}const n=new Dt(t.name,e);return this._types.set(t,n),this._updateTypeInfo(n),n}_updateTypeInfo(t){var e,n;const i=this._getTypeSize(t);if(t.size=null!==(e=null===i||void 0===i?void 0:i.size)&&void 0!==e?e:0,t instanceof Nt){const e=this._getTypeSize(t.format);t.stride=null!==(n=null===e||void 0===e?void 0:e.size)&&void 0!==n?n:0,this._updateTypeInfo(t.format)}t instanceof Ft&&this._updateStructInfo(t)}_updateStructInfo(t){var e;let n=0,i=0,r=0,o=0;for(let s=0,a=t.members.length;s<a;++s){const a=t.members[s],l=this._getTypeSize(a);if(!l)continue;null!==(e=this._getAlias(a.type.name))&&void 0!==e||a.type;const c=l.align,u=l.size;n=this._roundUp(c,n+i),i=u,r=n,o=Math.max(o,c),a.offset=n,a.size=u,this._updateTypeInfo(a.type)}t.size=this._roundUp(o,r+i),t.align=o}_getTypeSize(t){var e,n;if(null===t||void 0===t)return null;const i=this._getAttributeNum(t.attributes,"size",0),r=this._getAttributeNum(t.attributes,"align",0);if(t instanceof kt&&(t=t.type),t instanceof Dt){const e=this._getAlias(t.name);null!==e&&(t=e)}{const n=Kt._typeInfo[t.name];if(void 0!==n){const o="f16"===(null===(e=t.format)||void 0===e?void 0:e.name)?2:1;return new Vt(Math.max(r,n.align/o),Math.max(i,n.size/o))}}{const e=Kt._typeInfo[t.name.substring(0,t.name.length-1)];if(e){const n="h"===t.name[t.name.length-1]?2:1;return new Vt(Math.max(r,e.align/n),Math.max(i,e.size/n))}}if(t instanceof Nt){let e=t,o=8,s=8;const a=this._getTypeSize(e.format);null!==a&&(s=a.size,o=a.align);return s=e.count*this._getAttributeNum(null!==(n=null===t||void 0===t?void 0:t.attributes)&&void 0!==n?n:null,"
2stride",this._roundUp(o,s)),i&&(s=i),new Vt(Math.max(r,o),Math.max(i,s))}if(t instanceof Ft){let e=0,n=0,o=0,s=0,a=0;for(const i of t.members){const t=this._getTypeSize(i.type);null!==t&&(e=Math.max(t.align,e),o=this._roundUp(t.align,o+s),s=t.size,a=o)}return n=this._roundUp(e,a+s),new Vt(Math.max(r,e),Math.max(i,n))}return null}_isUniformVar(t){return t instanceof z&&"uniform"==t.storage}_isStorageVar(t){return t instanceof z&&"storage"==t.storage}_isTextureVar(t){return t instanceof z&&null!==t.type&&-1!=Kt._textureTypes.indexOf(t.type.name)}_isSamplerVar(t){return t instanceof z&&null!==t.type&&-1!=Kt._samplerTypes.indexOf(t.type.name)}_getAttribute(t,e){const n=t;if(!n||!n.attributes)return null;const i=n.attributes;for(let r of i)if(r.name==e)return r;return null}_getAttributeNum(t,e,n){if(null===t)return n;for(let i of t)if(i.name==e){let t=null!==i&&null!==i.value?i.value:n;return t instanceof Array&&(t=t[0]),"number"===typeof t?t:"string"===typeof t?parseInt(t):n}return n}_roundUp(t,e){return Math.ceil(e/t)*t}}function Qt(t){const e={attributes:[],bindings:[]};let n;try{n=function(t){try{return new Kt(t)}catch(e){if(e instanceof Error)throw e;let t="WGSL parse error";throw"object"===typeof e&&e?.message&&(t+=`: ${e.message} `),"object"===typeof e&&e?.token&&(t+=e.token.line||""),new Error(t,{cause:e})}}(t)}catch(o){return A.R.error(o.message)(),e}for(const s of n.uniforms){const t=[];for(const e of s.type?.members||[])t.push({name:e.name,type:Jt(e.type)});e.bindings.push({type:"uniform",name:s.name,location:s.binding,group:s.group,members:t})}const i=n.entry.vertex[0],r=i?.inputs.length||0;for(let s=0;s<r;s++){const t=i.inputs[s];if("location"===t.locationType){const n=Jt(t.type);e.attributes.push({name:t.name,location:Number(t.location),type:n})}}return e}function Jt(t){return t.format?`${t.name}<${t.format.name}>`:t.name}Kt._typeInfo={f16:{align:2,size:2},i32:{align:4,size:4},u32:{align:4,size:4},f32:{align:4,size:4},atomic:{align:4,size:4},vec2:{align:8,size:8},vec3:{align:16,size:12},vec4:{align:16,size:16},mat2x2:{align:8,size:16},mat3x2:{align:8,size:24},mat4x2:{align:8,size:32},mat2x3:{align:16,size:32},mat3x3:{align:16,size:48},mat4x3:{align:16,size:64},mat2x4:{align:16,size:32},mat3x4:{align:16,size:48},mat4x4:{align:16,size:64}},Kt._textureTypes=Bt.any_texture_type.map((t=>t.name)),Kt._samplerTypes=Bt.sampler_type.map((t=>t.name));class Yt{id;userData={};topology;bufferLayout=[];vertexCount;indices;attributes;constructor(t){this.id=t.id||(0,y.L)("geometry"),this.topology=t.topology,this.indices=t.indices||null,this.attributes=t.attributes,this.vertexCount=t.vertexCount,this.bufferLayout=t.bufferLayout||[],this.indices&&(0,u.v)(this.indices.usage===r.h.INDEX)}destroy(){this.indices?.destroy();for(const t of Object.values(this.attributes))t.destroy()}getVertexCount(){return this.vertexCount}getAttributes(){return this.attributes}getIndexes(){return this.indices}_calculateVertexCount(t){return t.byteLength/12}}function $t(t,e){if(e instanceof Yt)return e;const n=function(t,e){if(!e.indices)return;const n=e.indices.value;return t.createBuffer({usage:r.h.INDEX,data:n})}(t,e),{attributes:i,bufferLayout:o}=function(t,e){const n=[],i={};for(const[o,s]of Object.entries(e.attributes)){let e=o;switch(o){case"POSITION":e="positions";break;case"NORMAL":e="normals";break;case"TEXCOORD_0":e="texCoords";break;case"COLOR_0":e="colors"}i[e]=t.createBuffer({data:s.value,id:`${o}-buffer`});const{value:r,size:a,normalized:l}=s;n.push({name:e,format:(0,S.OB)(r,a,l)})}const r=e._calculateVertexCount(e.attributes,e.indices);return{attributes:i,bufferLayout:n,vertexCount:r}}(t,e);return new Yt({topology:e.topology||"triangle-list",bufferLayout:o,vertexCount:e.vertexCount,indices:n,attributes:i})}var te=n(76985);class ee{modules;moduleUniforms;moduleBindings;moduleUniformsChanged;constructor(t){const e=(0,te.KC)(Object.values(t).filter((t=>t.dependencies)));for(const n of e)t[n.name]=n;A.R.log(1,"Creating ShaderInputs with modules",Object.keys(t))(),this.modules=t,this.moduleUniforms={},this.moduleBindings={};for(const[n,i]of Object.entries(t)){const t=n;this.moduleUniforms[t]=i.defaultUniforms||{},this.moduleBindings[t]={}}}destroy(){}setProps(t){for(const e of Object.keys(t)){const n=e,i=t[n],r=this.modules[n];if(!r){A.R.warn(`Module ${e} not found`)();continue}const o=this.moduleUniforms[n],s=this.moduleBindings[n],a=r.getUniforms?.(i,o)||i,{uniforms:l,bindings:c}=(0,C.l)(a);this.moduleUniforms[n]={...o,...l},this.moduleBindings[n]={...s,...c}}}getModules(){return Object.values(this.modules)}getUniformValues(){return this.moduleUniforms}getBindings(){const t={};
vendor: 33,154 bytes, line 2
2for(const e of Object.values(this.moduleBindings))Object.assign(t,e);return t}getDebugTable(){const t={};for(const[e,n]of Object.entries(this.moduleUniforms))for(const[i,r]of Object.entries(n))t[`${e}.${i}`]={type:this.modules[e].uniformTypes?.[i],value:String(r)};return t}}var ne=n(98383);class ie extends ne.F{static defaultProps={...ne.F.defaultProps,shader:void 0,entryPoint:void 0,constants:{},shaderLayout:void 0};get[Symbol.toStringTag](){return"ComputePipeline"}hash="";constructor(t,e){super(t,e,ie.defaultProps)}}class re{static defaultProps={...a.r.defaultProps};device;_hashCounter=0;_hashes={};_renderPipelineCache={};_computePipelineCache={};static getDefaultPipelineFactory(t){return t._lumaData.defaultPipelineFactory=t._lumaData.defaultPipelineFactory||new re(t),t._lumaData.defaultPipelineFactory}constructor(t){this.device=t}createRenderPipeline(t){const e={...a.r.defaultProps,...t},n=this._hashRenderPipeline(e);if(!this._renderPipelineCache[n]){const t=this.device.createRenderPipeline({...e,id:e.id?`${e.id}-cached`:void 0});t.hash=n,this._renderPipelineCache[n]={pipeline:t,useCount:0}}return this._renderPipelineCache[n].useCount++,this._renderPipelineCache[n].pipeline}createComputePipeline(t){const e={...ie.defaultProps,...t},n=this._hashComputePipeline(e);if(!this._computePipelineCache[n]){const t=this.device.createComputePipeline({...e,id:e.id?`${e.id}-cached`:void 0});t.hash=n,this._computePipelineCache[n]={pipeline:t,useCount:0}}return this._computePipelineCache[n].useCount++,this._computePipelineCache[n].pipeline}release(t){const e=t.hash,n=t instanceof ie?this._computePipelineCache:this._renderPipelineCache;n[e].useCount--,0===n[e].useCount&&(n[e].pipeline.destroy(),delete n[e])}_hashComputePipeline(t){return`${this._getHash(t.shader.source)}`}_hashRenderPipeline(t){const e=this._getHash(t.vs.source),n=t.fs?this._getHash(t.fs.source):0,i=this._getHash(JSON.stringify(t.bufferLayout));if("webgl"===this.device.type)return`${e}/${n}V-BL${i}`;{const r=this._getHash(JSON.stringify(t.parameters));return`${e}/${n}V-T${t.topology}P${r}BL${i}`}}_getHash(t){return void 0===this._hashes[t]&&(this._hashes[t]=this._hashCounter++),this._hashes[t]}}var oe=n(39936);class se{static defaultProps={...oe.M.defaultProps};device;_cache={};static getDefaultShaderFactory(t){return t._lumaData.defaultShaderFactory||=new se(t),t._lumaData.defaultShaderFactory}constructor(t){this.device=t}createShader(t){const e=this._hashShader(t);let n=this._cache[e];if(!n){const i=this.device.createShader({...t,id:t.id?`${t.id}-cached`:void 0});this._cache[e]=n={shader:i,useCount:0}}return n.useCount++,n.shader}release(t){const e=this._hashShader(t),n=this._cache[e];n&&(n.useCount--,0===n.useCount&&(delete this._cache[e],n.shader.destroy()))}_hashShader(t){return`${t.stage}:${t.source}`}}let ae=null,le=null;class ce{static defaultProps={...a.r.defaultProps,source:null,vs:null,fs:null,id:"unnamed",handle:void 0,userData:{},defines:{},modules:[],moduleSettings:void 0,geometry:null,indexBuffer:null,attributes:{},constantAttributes:{},varyings:[],isInstanced:void 0,instanceCount:0,vertexCount:0,shaderInputs:void 0,pipelineFactory:void 0,shaderFactory:void 0,transformFeedback:void 0,shaderAssembler:P._.getDefaultShaderAssembler(),debugShaders:void 0,disableWarnings:void 0};device;id;source;vs;fs;pipelineFactory;shaderFactory;userData={};parameters;topology;bufferLayout;isInstanced=void 0;instanceCount=0;vertexCount;indexBuffer=null;bufferAttributes={};constantAttributes={};bindings={};uniforms={};vertexArray;transformFeedback=null;pipeline;shaderInputs;_uniformStore;_attributeInfos={};_gpuGeometry=null;_getModuleUniforms;props;_pipelineNeedsUpdate="newly created";_needsRedraw="initializing";_destroyed=!1;_lastDrawTimestamp=-1;constructor(t,e){this.props={...ce.defaultProps,...e},e=this.props,this.id=e.id||(0,y.L)("model"),this.device=t,Object.assign(this.userData,e.userData);const n=Object.fromEntries(this.props.modules?.map((t=>[t.name,t]))||[]);this.setShaderInputs(e.shaderInputs||new ee(n));const i=function(t){return{type:t.type,shaderLanguage:t.info.shadingLanguage,shaderLanguageVersion:t.info.shadingLanguageVersion,gpu:t.info.gpu,features:t.features}}(t),r=(this.props.modules?.length>0?this.props.modules:this.shaderInputs?.getModules())||[];if("webgpu"===this.device.type&&this.props.source){this.props.shaderLayout||=Qt(this.props.source);const{source:t,getUniforms:e}=this.props.shaderAssembler.assembleShader({platformInfo:i,...this.props,modules:r});this.source=t,this._getModuleUniforms=e}else{const{vs:t,fs:e,getUniforms:n}=this.props.shaderAssembler.assembleShaderPair({platformInfo:i,...this.props,modules:r});this.vs=t,this.fs=e,this._getModuleUniforms=n}this.vertexCount=this.props.vertexCount,this.instanceCount=this.props.instanceCount,this.topology=this.props.topology,this.bufferLayout=this.props.bufferLayout,this.parameters=this.props.parameters,e.geometry&&this.setGeometry(e.geometry),this.pipelineFactory=e.pipelineFactory||re.getDefaultPipelineFactory(this.device),this.shaderFactory=e.shaderFactory||se.getDefaultShaderFactory(this.device),this.pipeline=this._updatePipeline(),this.vertexArray=t.createVertexArray({renderPipeline:this.pipeline}),this._gpuGeometry&&this._setGeometryAttributes(this._gpuGeometry),"isInstanced"in e&&(this.isInstanced=e.isInstanced),e.instanceCount&&this.setInstanceCount(e.instanceCount),e.vertexCount&&this.setVertexCount(e.vertexCount),e.indexBuffer&&this.setIndexBuffer(e.indexBuffer),e.attributes&&this.setAttributes(e.attributes),e.constantAttributes&&this.setConstantAttributes(e.constantAttributes),e.bindings&&this.setBindings(e.bindings),e.uniforms&&this.setUniforms(e.uniforms),e.moduleSettings&&this.updateModuleSettings(e.moduleSettings),e.transformFeedback&&(this.transformFeedback=e.transformFeedback),Object.seal(this)}destroy(){this._destroyed||(this.pipelineFactory.release(this.pipeline),this.shaderFactory.release(this.pipeline.vs),this.pipeline.fs&&this.shaderFactory.release(this.pipeline.fs),this._uniformStore.destroy(),this._gpuGeometry?.destroy(),this._destroyed=!0)}needsRedraw(){this._getBindingsUpdateTimestamp()>this._lastDrawTimestamp&&this.setNeedsRedraw("contents of bound textures or buffers updated");const t=this._needsRedraw;return this._needsRedraw=!1,t}setNeedsRedraw(t){this._needsRedraw||=t}predraw(){this.updateShaderInputs(),this.pipeline=this._updatePipeline()}draw(t){let e;this.predraw();try{this._logDrawCallStart(),this.pipeline=this._updatePipeline(),this.pipeline.setBindings(this.bindings,{disableWarnings:this.props.disableWarnings}),(0,y.Z)(this.uniforms)||this.pipeline.setUniformsWebGL(this.uniforms);const{indexBuffer:n}=this.vertexArray,i=n?n.byteLength/("uint32"===n.indexType?4:2):void 0;e=this.pipeline.draw({renderPass:t,vertexArray:this.vertexArray,isInstanced:this.isInstanced,vertexCount:this.vertexCount,instanceCount:this.instanceCount,indexCount:i,transformFeedback:this.transformFeedback||void 0,parameters:this.parameters,topology:this.topology})}finally{this._logDrawCallEnd()}return this._logFramebuffer(t),e?(this._lastDrawTimestamp=this.device.timestamp,this._needsRedraw=!1):this._needsRedraw="waiting for resource initialization",e}setGeometry(t){this._gpuGeometry?.destroy();const e=t&&$t(this.device,t);e&&(this.setTopology(e.topology||"triangle-list"),this.bufferLayout=ue(e.bufferLayout,this.bufferLayout),this.vertexArray&&this._setGeometryAttributes(e)),this._gpuGeometry=e}setTopology(t){t!==this.topology&&(this.topology=t,this._setPipelineNeedsUpdate("topology"))}setBufferLayout(t){this.bufferLayout=this._gpuGeometry?ue(t,this._gpuGeometry.bufferLayout):t,this._setPipelineNeedsUpdate("bufferLayout"),this.pipeline=this._updatePipeline(),this.vertexArray=this.device.createVertexArray({renderPipeline:this.pipeline}),this._gpuGeometry&&this._setGeometryAttributes(this._gpuGeometry)}setParameters(t){_(t,this.parameters,2)||(this.parameters=t,this._setPipelineNeedsUpdate("parameters"))}setInstanceCount(t){this.instanceCount=t,void 0===this.isInstanced&&t>0&&(this.isInstanced=!0),this.setNeedsRedraw("instanceCount")}setVertexCount(t){this.vertexCount=t,this.setNeedsRedraw("vertexCount")}setShaderInputs(t){this.shaderInputs=t,this._uniformStore=new m(this.shaderInputs.modules);for(const e of Object.keys(this.shaderInputs.modules)){const t=this._uniformStore.getManagedUniformBuffer(this.device,e);this.bindings[`${e}Uniforms`]=t}this.setNeedsRedraw("shaderInputs")}updateShaderInputs(){this._uniformStore.setUniforms(this.shaderInputs.getUniformValues()),this.setBindings(this.shaderInputs.getBindings()),this.setNeedsRedraw("shaderInputs")}setBindings(t){Object.assign(this.bindings,t),this.setNeedsRedraw("bindings")}setTransformFeedback(t){this.transformFeedback=t,this.setNeedsRedraw("transformFeedback")}setIndexBuffer(t){this.vertexArray.setIndexBuffer(t),this.setNeedsRedraw("indexBuffer")}setAttributes(t,e){t.indices&&A.R.warn(`Model:${this.id} setAttributes() - indexBuffer should be set using setIndexBuffer()`)();for(const[n,i]of Object.entries(t)){const t=this.bufferLayout.find((t=>he(t).includes(n)));if(!t){A.R.warn(`Model(${this.id}): Missing layout for buffer "${n}".`)();continue}const r=he(t);let o=!1;for(const e of r){const t=this._attributeInfos[e];t&&(this.vertexArray.setBuffer(t.location,i),o=!0)}o||(e?.disableWarnings??this.props.disableWarnings)||A.R.warn(`Model(${this.id}): Ignoring buffer "${i.id}" for unknown attribute "${n}"`)()}this.setNeedsRedraw("attributes")}setConstantAttributes(t,e){for(const[n,i]of Object.entries(t)){const t=this._attributeInfos[n];t?this.vertexArray.setConstantWebGL(t.location,i):(e?.disableWarnings??this.props.disableWarnings)||A.R.warn(`Model "${this.id}: Ignoring constant supplied for unknown attribute "${n}"`)()}this.setNeedsRedraw("constants")}setUniforms(t){(0,y.Z)(t)||(this.pipeline.setUniformsWebGL(t),Object.assign(this.uniforms,t)),this.setNeedsRedraw("uniforms")}updateModuleSettings(t){const{bindings:e,uniforms:n}=(0,C.l)(this._getModuleUniforms(t));Object.assign(this.bindings,e),Object.assign(this.uniforms,n),this.setNeedsRedraw("moduleSettings")}_getBindingsUpdateTimestamp(){let t=0;for(const e of Object.values(this.bindings))e instanceof i.X?t=Math.max(t,e.texture.updateTimestamp):e instanceof r.h||e instanceof o.g?t=Math.max(t,e.updateTimestamp):e instanceof s.L||(t=Math.max(t,e.buffer.updateTimestamp));return t}_setGeometryAttributes(t){const e={...t.attributes};for(const[n]of Object.entries(e))this.pipeline.shaderLayout.attributes.find((t=>t.name===n))||"positions"===n||delete e[n];this.vertexCount=t.vertexCount,this.setIndexBuffer(t.indices||null),this.setAttributes(t.attributes,{disableWarnings:!0}),this.setAttributes(e,{disableWarnings:this.props.disableWarnings}),this.setNeedsRedraw("geometry attributes")}_setPipelineNeedsUpdate(t){this._pipelineNeedsUpdate||=t,this.setNeedsRedraw(t)}_updatePipeline(){if(this._pipelineNeedsUpdate){let t=null,e=null;this.pipeline&&(A.R.log(1,`Model ${this.id}: Recreating pipeline because "${this._pipelineNeedsUpdate}".`)(),t=this.pipeline.vs,e=this.pipeline.fs),this._pipelineNeedsUpdate=!1;const n=this.shaderFactory.createShader({id:`${this.id}-vertex`,stage:"vertex",source:this.source||this.vs,debug:this.props.debugShaders});let i=null;this.source?i=n:this.fs&&(i=this.shaderFactory.createShader({id:`${this.id}-fragment`,stage:"fragment",source:this.source||this.fs,debug:this.props.debugShaders})),this.pipeline=this.pipelineFactory.createRenderPipeline({...this.props,bufferLayout:this.bufferLayout,topology:this.topology,parameters:this.parameters,vs:n,fs:i}),this._attributeInfos=(0,T.PV)(this.pipeline.shaderLayout,this.bufferLayout),t&&this.shaderFactory.release(t),e&&this.shaderFactory.release(e)}return this.pipeline}_lastLogTime=0;_logOpen=!1;_logDrawCallStart(){const t=A.R.level>3?0:1e4;A.R.level<2||Date.now()-this._lastLogTime<t||(this._lastLogTime=Date.now(),this._logOpen=!0,A.R.group(2,`>>> DRAWING MODEL ${this.id}`,{collapsed:A.R.level<=2})())}_logDrawCallEnd(){if(this._logOpen){const t=function(t){const e={},n="Values";if(0===t.attributes.length&&!t.varyings?.length)return{"No attributes or varyings":{[n]:"N/A"}};for(const i of t.attributes)i&&(e[`in ${i.location} ${i.name}: ${i.type}`]={[n]:i.stepMode||"vertex"});for(const i of t.varyings||[])e[`out ${i.location} ${i.name}`]={[n]:JSON.stringify(i.accessor)};return e}(this.pipeline.shaderLayout,this.id);A.R.table(2,t)();const e=this.shaderInputs.getDebugTable();for(const[i,r]of Object.entries(this.uniforms))e[i]={value:r};A.R.table(2,e)();const n=this._getAttributeDebugTable();A.R.table(2,this._attributeInfos)(),A.R.table(2,n)(),A.R.groupEnd(2)(),this._logOpen=!1}}_drawCount=0;_logFramebuffer(t){const e=A.R.get("framebuffer");if(this._drawCount++,!e||this._drawCount++>3&&this._drawCount%60)return;const n=t.props.framebuffer;n&&function(t,e){let{id:n,minimap:i,opaque:r,top:o="0",left:s="0",rgbaScale:a=1}=e;ae||(ae=document.createElement("canvas"),ae.id=n,ae.title=n,ae.style.zIndex="100",ae.style.position="absolute",ae.style.top=o,ae.style.left=s,ae.style.border="blue 1px solid",ae.style.transform="scaleY(-1)",document.body.appendChild(ae),le=ae.getContext("2d")),ae.width===t.width&&ae.height===t.height||(ae.width=t.width/2,ae.height=t.height/2,ae.style.width="400px",ae.style.height="400px");const l=t.device.readPixelsToArrayWebGL(t),c=le.createImageData(t.width,t.height);for(let u=0;u<l.length;u+=4)c.data[0+u+0]=l[u+0]*a,c.data[0+u+1]=l[u+1]*a,c.data[0+u+2]=l[u+2]*a,c.data[0+u+3]=r?255:l[u+3]*a;le.putImageData(c,0,0)}(n,{id:n.id,minimap:!0})}_getAttributeDebugTable(){const t={};for(const[e,n]of Object.entries(this._attributeInfos))t[n.location]={name:e,type:n.shaderType,values:this._getBufferOrConstantValues(this.vertexArray.attributes[n.location],n.bufferDataType)};if(this.vertexArray.indexBuffer){const{indexBuffer:e}=this.vertexArray,n="uint32"===e.indexType?new Uint32Array(e.debugData):new Uint16Array(e.debugData);t.indices={name:"indices",type:e.indexType,values:n.toString()}}return t}_getBufferOrConstantValues(t,e){const n=(0,S.Y0)(e);return(t instanceof r.h?new n(t.debugData):t).toString()}}function ue(t,e){const n=[...t];for(const i of e){const t=n.findIndex((t=>t.name===i.name));t<0?n.push(i):n[t]=i}return n}function he(t){return t.attributes?t.attributes?.map((t=>t.attribute)):[t.name]}},86182:(t,e,n)=>{"use strict";n.d(e,{l:()=>o});var i,r=n(44261);function o(t,e,n,o){const a={defines:{MANUAL_SRGB:1,SRGB_FAST_APPROXIMATION:1},bindings:{},uniforms:{u_Camera:[0,0,0],u_MetallicRoughnessValues:[1,1]},parameters:{},glParameters:{},generatedTextures:[]};a.defines.USE_TEX_LOD=1;const{imageBasedLightingEnvironment:l}=o;return l&&(a.bindings.u_DiffuseEnvSampler=l.diffuseEnvSampler,a.bindings.u_SpecularEnvSampler=l.specularEnvSampler,a.bindings.u_brdfLUT=l.brdfLutTexture,a.uniforms.u_ScaleIBLAmbient=[1,1]),o?.pbrDebug&&(a.defines.PBR_DEBUG=1,a.uniforms.u_ScaleDiffBaseMR=[0,0,0,0],a.uniforms.u_ScaleFGDSpec=[0,0,0,0]),n.NORMAL&&(a.defines.HAS_NORMALS=1),n.TANGENT&&o?.useTangents&&(a.defines.HAS_TANGENTS=1),n.TEXCOORD_0&&(a.defines.HAS_UV=1),o?.imageBasedLightingEnvironment&&(a.defines.USE_IBL=1),o?.lights&&(a.defines.USE_LIGHTS=1),e&&function(t,e,n){n.uniforms.pbr_uUnlit=Boolean(e.unlit),e.pbrMetallicRoughness&&function(t,e,n){e.baseColorTexture&&s(t,e.baseColorTexture,"u_BaseColorSampler","HAS_BASECOLORMAP",n);n.uniforms.u_BaseColorFactor=e.baseColorFactor||[1,1,1,1],e.metallicRoughnessTexture&&s(t,e.metallicRoughnessTexture,"u_MetallicRoughnessSampler","HAS_METALROUGHNESSMAP",n);const{metallicFactor:i=1,roughnessFactor:r=1}=e;n.uniforms.u_MetallicRoughnessValues=[i,r]}(t,e.pbrMetallicRoughness,n);if(e.normalTexture){s(t,e.normalTexture,"u_NormalSampler","HAS_NORMALMAP",n);const{scale:i=1}=e.normalTexture;n.uniforms.u_NormalScale=i}if(e.occlusionTexture){s(t,e.occlusionTexture,"u_OcclusionSampler","HAS_OCCLUSIONMAP",n);const{strength:i=1}=e.occlusionTexture;n.uniforms.u_OcclusionStrength=i}e.emissiveTexture&&(s(t,e.emissiveTexture,"u_EmissiveSampler","HAS_EMISSIVEMAP",n),n.uniforms.u_EmissiveFactor=e.emissiveFactor||[0,0,0]);switch(e.alphaMode){case"MASK":const{alphaCutoff:t=.5}=e;n.defines.ALPHA_CUTOFF=1,n.uniforms.u_AlphaCutoff=t;break;case"BLEND":r.R.warn("glTF BLEND alphaMode might not work well because it requires mesh sorting")(),n.parameters.blendColorOperation="add",n.parameters.blendColorSrcFactor="src-alpha",n.parameters.blendColorDstFactor="one-minus-src-alpha",n.parameters.blendAlphaOperation="add",n.parameters.blendAlphaSrcFactor="one",n.parameters.blendAlphaDstFactor="one-minus-src-alpha",n.glParameters.blend=!0,n.glParameters.blendEquation=i.FUNC_ADD,n.glParameters.blendFunc=[i.SRC_ALPHA,i.ONE_MINUS_SRC_ALPHA,i.ONE,i.ONE_MINUS_SRC_ALPHA]}}(t,e,a),a}function s(t,e,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,o=arguments.length>4?arguments[4]:void 0;const s=e?.texture?.sampler?.parameters||{},a=e.texture.source.image;let l,c={};a.compressed?(l=a,c={[i.TEXTURE_MIN_FILTER]:a.data.length>1?i.LINEAR_MIPMAP_NEAREST:i.LINEAR}):l={data:a};const u=t.createTexture({id:e.uniformName||e.id,parameters:{...s,...c},pixelStore:{[i.UNPACK_FLIP_Y_WEBGL]:!1},...l});o.bindings[n]=u,r&&(o.defines[r]=1),o.generatedTextures.push(u)}!function(t){t[t.FUNC_ADD=32774]="FUNC_ADD",t[t.ONE=1]="ONE",t[t.SRC_ALPHA=770]="SRC_ALPHA",t[t.ONE_MINUS_SRC_ALPHA=771]="ONE_MINUS_SRC_ALPHA",t[t.TEXTURE_MIN_FILTER=10241]="TEXTURE_MIN_FILTER",t[t.LINEAR=9729]="LINEAR",t[t.LINEAR_MIPMAP_NEAREST=9985]="LINEAR_MIPMAP_NEAREST",t[t.UNPACK_FLIP_Y_WEBGL=37440]="UNPACK_FLIP_Y_WEBGL"}(i||(i={}))},86402:(t,e,n)=>{"use strict";n.d(e,{Wk:()=>r});const i="#version 300 es\nout vec4 transform_output;\nvoid main() {\ntransform_output = vec4(0);\n}";function r(t){const{input:e,inputChannels:n,output:r}=t||{};if(!e)return i;if(!n)throw new Error("inputChannels");return`#version 300 es\nin ${function(t){switch(t){case 1:return"float";case 2:return"vec2";case 3:return"vec3";case 4:return"vec4";default:throw new Error(`invalid channels: ${t}`)}}(n)} ${e};\nout vec4 ${r};\nvoid main() {\n ${r} = ${function(t,e){switch(e){case 1:return`vec4(${t}, 0.0, 0.0, 1.0)`;case 2:return`vec4(${t}, 0.0, 1.0)`;case 3:return`vec4(${t}, 1.0)`;case 4:return t;default:throw new Error(`invalid channels: ${e}`)}}(e,n)};\n}`}},32479:(t,e,n)=>{"use strict";n.d(e,{_:()=>w});var i=n(57027);function r(t){if(t.source&&"webgpu"===t.platformInfo.type){return{...t,vs:void 0,fs:void 0}}if(!t.vs)throw new Error("no vertex shader");const e=o(t.platformInfo,t.vs);let n;return t.fs&&(n=o(t.platformInfo,t.fs)),{...t,vs:e,fs:n}}function o(t,e){if("string"===typeof e)return e;if("webgpu"===t.type){if(e?.wgsl)return e.wgsl;throw new Error("WebGPU does not support GLSL shaders")}if(e?.glsl)return e.glsl;throw new Error("WebGL does not support WGSL shaders")}var s=n(76985);var a=n(31950);const l=[[/^(#version[ \t]+(100|300[ \t]+es))?[ \t]*\n/,"#version 300 es\n"],[/\btexture(2D|2DProj|Cube)Lod(EXT)?\(/g,"textureLod("],[/\btexture(2D|2DProj|Cube)(EXT)?\(/g,"texture("]],c=[...l,[d("attribute"),"in $1"],[d("varying"),"out $1"]],u=[...l,[d("varying"),"in $1"]];function h(t,e){for(const[n,i]of e)t=t.replace(n,i);return t}function d(t){return new RegExp(`\\b${t}[ \\t]+(\\w+[ \\t]+\\w+(\\[\\w+\\])?;)`,"g")}function p(t,e){let n="";for(const i in t){const r=t[i];if(n+=`void ${r.signature} {\n`,r.header&&(n+=` ${r.header}`),e[i]){const t=e[i];t.sort(((t,e)=>t.order-e.order));for(const e of t)n+=` ${e.injection}\n`}r.footer&&(n+=` ${r.footer}`),n+="}\n"}return n}function f(t){const e={vertex:{},fragment:{}};for(const n of t){let t,i;"string"!==typeof n?(t=n,i=t.hook):(t={},i=n),i=i.trim();const[r,o]=i.split(":"),s=i.replace(/\(.+/,""),a=Object.assign(t,{signature:o});switch(r){case"vs":e.vertex[s]=a;break;case"fs":e.fragment[s]=a;break;default:throw new Error(r)}}return e}var A=n(34216);function g(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"unnamed";const n=/#define[^\S\r\n]*SHADER_NAME[^\S\r\n]*([A-Za-z0-9_-]+)\s*/.exec(t);return n?n[1]:e}function m(t){let e=100;const n=t.match(/[^\s]+/g);if(n&&n.length>=2&&"#version"===n[0]){const t=parseInt(n[1],10);Number.isFinite(t)&&(e=t)}if(100!==e&&300!==e)throw new Error(`Invalid GLSL version ${e}`);return e}const y=`\n\n${a.O_}\n`,_="precision highp float;\n";function v(t,e){const{source:n,stage:i,modules:r,hookFunctions:o=[],inject:s={},log:l}=e;(0,A.v)("string"===typeof n,"shader source must be a string");const c=n;let u="";const h=f(o),d={},g={},m={};for(const a in s){const t="string"===typeof s[a]?{injection:s[a],order:0}:s[a],e=/^(v|f)s:(#)?([\w-]+)$/.exec(a);if(e){const n=e[2],i=e[3];n?"decl"===i?g[a]=[t]:m[a]=[t]:d[a]=[t]}else m[a]=[t]}const _="webgpu"!==t.type?r:[];for(const a of _){l&&a.checkDeprecations(c,l);u+=a.getModuleSource(i,"wgsl");const t=a.injections[i];for(const e in t){const n=/^(v|f)s:#([\w-]+)$/.exec(e);if(n){const i="decl"===n[2]?g:m;i[e]=i[e]||[],i[e].push(t[e])}else d[e]=d[e]||[],d[e].push(t[e])}}return u+=y,u=(0,a.bv)(u,i,g),u+=p(h[i],d),u+=c,u=(0,a.bv)(u,i,m),u}function b(t,e){const{id:n,source:i,stage:r,language:o="glsl",modules:s,defines:l={},hookFunctions:d=[],inject:v={},prologue:b=!0,log:x}=e;(0,A.v)("string"===typeof i,"shader source must be a string");const w="glsl"===o?function(t,e){return{name:g(t,e),language:"glsl",version:m(t)}}(i).version:-1,E=t.shaderLanguageVersion,C=100===w?"#version 100":"#version 300 es",T=i.split("\n").slice(1).join("\n"),S={};s.forEach((t=>{Object.assign(S,t.getDefines())})),Object.assign(S,l);let P="";switch(o){case"wgsl":break;case"glsl":P=b?`${C}\n\n// ----- PROLOGUE -------------------------\n${function(t){const{id:e,source:n,stage:i}=t,r=e&&-1===n.indexOf("SHADER_NAME");return r?`\n#define SHADER_NAME ${e}_${i}\n\n`:""}({id:n,source:i,stage:r})}\n#define SHADER_TYPE_${r.toUpperCase()}\n${function(t){switch(t?.gpu.toLowerCase()){case"apple":return"#define APPLE_GPU\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n#define LUMA_FP32_TAN_PRECISION_WORKAROUND 1\n#define LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND 1\n";case"nvidia":return"#define NVIDIA_GPU\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n";case"intel":return"#define INTEL_GPU\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n#define LUMA_FP32_TAN_PRECISION_WORKAROUND 1\n#define LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND 1\n";case"amd":return"#define AMD_GPU\n";default:return"#define DEFAULT_GPU\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n#define LUMA_FP32_TAN_PRECISION_WORKAROUND 1\n#define LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND 1\n"}}(t)}\n${"fragment"===r?_:""}\n\n// ----- APPLICATION DEFINES -------------------------\n\n${function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e="";for(const n in t){const i=t[n];(i||Number.isFinite(i))&&(e+=`#define ${n.toUpperCase()} ${t[n]}\n`)}return e}(S)}\n\n`:`${C}\n`}const M=f(d),I={},B={},R={};for(const a in v){const t="string"===typeof v[a]?{injection:v[a],order:0}:v[a],e=/^(v|f)s:(#)?([\w-]+)$/.exec(a);if(e){const n=e[2],i=e[3];n?"decl"===i?B[a]=[t]:R[a]=[t]:I[a]=[t]}else R[a]=[t]}for(const a of s){x&&a.checkDeprecations(T,x);P+=a.getModuleSource(r);const t=a.injections[r];for(const e in t){const n=/^(v|f)s:#([\w-]+)$/.exec(e);if(n){const i="decl"===n[2]?B:R;i[e]=i[e]||[],i[e].push(t[e])}else I[e]=I[e]||[],I[e].push(t[e])}}return P+="// ----- MAIN SHADER SOURCE -------------------------",P+=y,P=(0,a.bv)(P,r,B),P+=p(M[r],I),P+=T,P=(0,a.bv)(P,r,R),"glsl"===o&&w!==E&&(P=function(t,e){if(300!==Number(t.match(/^#version[ \t]+(\d+)/m)?.[1]||100))throw new Error("luma.gl v9 only supports GLSL 3.00 shader sources");switch(e){case"vertex":return h(t,c);case"fragment":return h(t,u);default:throw new Error(e)}}(P,r)),P.trim()}function x(t){return function(e){const n={};for(const i of t){const t=i.getUniforms(e,n);Object.assign(n,t)}return n}}class w{static defaultShaderAssembler;_hookFunctions=[];_defaultModules=[];static getDefaultShaderAssembler(){return w.defaultShaderAssembler=w.defaultShaderAssembler||new w,w.defaultShaderAssembler}addDefaultModule(t){this._defaultModules.find((e=>e.name===("string"===typeof t?t:t.name)))||this._defaultModules.push(t)}removeDefaultModule(t){const e="string"===typeof t?t:t.name;this._defaultModules=this._defaultModules.filter((t=>t.name!==e))}addShaderHook(t,e){e&&(t=Object.assign(e,{hook:t})),this._hookFunctions.push(t)}assembleShader(t){const e=this._getModuleList(t.modules),n=this._hookFunctions,i=r(t),o=function(t){const e=(0,s.KC)(t.modules||[]);return{source:v(t.platformInfo,{...t,source:t.source,stage:"vertex",modules:e}),getUniforms:x(e)}}({platformInfo:t.platformInfo,...i,modules:e,hookFunctions:n});return{...o,modules:e}}assembleShaderPair(t){const e=r(t),n=this._getModuleList(t.modules),i=this._hookFunctions,{platformInfo:o}=t,a="wgsl"===t.platformInfo.shaderLanguage?function(t){const e=(0,s.KC)(t.modules||[]);return{vs:v(t.platformInfo,{...t,source:t.vs,stage:"vertex",modules:e}),fs:v(t.platformInfo,{...t,source:t.fs,stage:"fragment",modules:e}),getUniforms:x(e)}}({platformInfo:o,...e,modules:n,hookFunctions:i}):function(t){const{vs:e,fs:n}=t,i=(0,s.KC)(t.modules||[]);return{vs:b(t.platformInfo,{...t,source:e,stage:"vertex",modules:i}),fs:b(t.platformInfo,{...t,source:n,stage:"fragment",modules:i}),getUniforms:x(i)}}({platformInfo:o,...e,modules:n,hookFunctions:i});return{...a,modules:n}}_getModuleList(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const e=new Array(this._defaultModules.length+t.length),n={};let r=0;for(let i=0,o=this._defaultModules.length;i<o;++i){const t=this._defaultModules[i],o=t.name;e[r++]=t,n[o]=!0}for(let i=0,o=t.length;i<o;++i){const o=t[i],s=o.name;n[s]||(e[r++]=o,n[s]=!0)}return e.length=r,i.z.instantiateModules(e)}}},76985:(t,e,n)=>{"use strict";n.d(e,{KC:()=>r});var i=n(57027);function r(t){return o(i.z.instantiateModules(t))}function o(t){const e={},n={};return s({modules:t,level:0,moduleMap:e,moduleDepth:n}),Object.keys(n).sort(((t,e)=>n[e]-n[t])).map((t=>e[t]))}function s(t){const{modules:e,level:n,moduleMap:i,moduleDepth:r}=t;if(n>=5)throw new Error("Possible loop in shader dependency graph");for(const o of e)i[o.name]=o,(void 0===r[o.name]||r[o.name]<n)&&(r[o.name]=n);for(const o of e)o.dependencies&&s({modules:o.dependencies,level:n+1,moduleMap:i,moduleDepth:r})}},31950:(t,e,n)=>{"use strict";n.d(e,{O_:()=>a,bv:()=>u,Uu:()=>l});const i={vertex:"#ifdef MODULE_LOGDEPTH\nlogdepth_adjustPosition(gl_Position);\n#endif\n",fragment:"#ifdef MODULE_MATERIAL\ngl_FragColor = material_filterColor(gl_FragColor);\n#endif\n#ifdef MODULE_LIGHTING\ngl_FragColor = lighting_filterColor(gl_FragColor);\n#endif\n#ifdef MODULE_FOG\ngl_FragColor = fog_filterColor(gl_FragColor);\n#endif\n#ifdef MODULE_PICKING\ngl_FragColor = picking_filterHighlightColor(gl_FragColor);\ngl_FragColor = picking_filterPickingColor(gl_FragColor);\n#endif\n#ifdef MODULE_LOGDEPTH\nlogdepth_setFragDepth();\n#endif\n"},r=/void\s+main\s*\([^)]*\)\s*\{\n?/,o=/}\n?[^{}]*$/,s=[],a="__LUMA_INJECT_DECLARATIONS__";function l(t){const e={vertex:{},fragment:{}};for(const n in t){let i=t[n];"string"===typeof i&&(i={order:0,injection:i}),e[c(n)][n]=i}return e}function c(t){const e=t.slice(0,2);switch(e){case"vs":return"vertex";case"fs":return"fragment";default:throw new Error(e)}}function u(t,e,n){let l=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const c="vertex"===e;for(const i in n){const e=n[i];e.sort(((t,e)=>t.order-e.order)),s.length=e.length;for(let t=0,n=e.length;t<n;++t)s[t]=e[t].injection;const l=`${s.join("\n")}\n`;switch(i){case"vs:#decl":c&&(t=t.replace(a,l));break;case"vs:#main-start":c&&(t=t.replace(r,(t=>t+l)));break;case"vs:#main-end":c&&(t=t.replace(o,(t=>l+t)));break;case"fs:#decl":c||(t=t.replace(a,l));break;case"fs:#main-start":c||(t=t.replace(r,(t=>t+l)));break;case"fs:#main-end":c||(t=t.replace(o,(t=>l+t)));break;default:t=t.replace(i,(t=>t+l))}}return t=t.replace(a,""),l&&(t=t.replace(/\}\s*$/,(t=>t+i[e]))),t}},57027:(t,e,n)=>{"use strict";n.d(e,{z:()=>c});var i=n(34216);const r={number:{type:"number",validate:(t,e)=>Number.isFinite(t)&&"object"===typeof e&&(void 0===e.max||t<=e.max)&&(void 0===e.min||t>=e.min)},array:{type:"array",validate:(t,e)=>Array.isArray(t)||ArrayBuffer.isView(t)}};function o(t){let e=s(t);if("object"!==e)return{value:t,...r[e],type:e};if("object"===typeof t)return t?void 0!==t.type?{...t,...r[t.type],type:t.type}:void 0===t.value?{type:"object",value:t}:(e=s(t.value),{...t,...r[e],type:e}):{type:"object",value:null};throw new Error("props")}function s(t){return Array.isArray(t)||ArrayBuffer.isView(t)?"array":typeof t}var a=n(31950);let l=1;class c{name;vs;fs;getModuleUniforms;dependencies;deprecations;defines;injections;uniforms={};uniformTypes={};static instantiateModules(t){return t.map((t=>{if(t instanceof c)return t;(0,i.v)("string"!==typeof t,`Shader module use by name is deprecated. Import shader module '${JSON.stringify(t)}' and use it directly.`),t.name||(console.warn("shader module has no name"),t.name="shader-module-"+l++);const e=new c(t);return e.dependencies=c.instantiateModules(t.dependencies||[]),e}))}constructor(t){const{name:e,vs:n,fs:r,dependencies:s=[],uniformTypes:l={},uniformPropTypes:u={},getUniforms:h,deprecations:d=[],defines:p={},inject:f={}}=t;(0,i.v)("string"===typeof e),this.name=e,this.vs=n,this.fs=r,this.getModuleUniforms=h,this.dependencies=c.instantiateModules(s),this.deprecations=this._parseDeprecationDefinitions(d),this.defines=p,this.injections=(0,a.Uu)(f),this.uniformTypes=l,u&&(this.uniforms=function(t){const e={};for(const[n,i]of Object.entries(t))e[n]=o(i);return e}(u))}getModuleSource(t){let e;switch(t){case"vertex":e=this.vs||"";break;case"fragment":e=this.fs||"";break;default:(0,i.v)(!1)}const n=this.name.toUpperCase().replace(/[^0-9a-z]/gi,"_");return`// ----- MODULE ${this.name} ---------------\n\n#define MODULE_${n}\n${e}\n\n`}getUniforms(t,e){return this.getModuleUniforms?this.getModuleUniforms(t,e):function(t,e,n){const r={};for(const[o,s]of Object.entries(e))t&&o in t&&!s.private?(s.validate&&(0,i.v)(s.validate(t[o],s),`${n}: invalid ${o}`),r[o]=t[o]):r[o]=s.value;return r}(t,this.uniforms,this.name)}getDefines(){return this.defines}checkDeprecations(t,e){this.deprecations.forEach((n=>{n.regex?.test(t)&&(n.deprecated?e.deprecated(n.old,n.new)():e.removed(n.old,n.new)())}))}_parseDeprecationDefinitions(t){return t.forEach((t=>{if("function"===t.type)t.regex=new RegExp(`\\b${t.old}\\(`);else t.regex=new RegExp(`${t.type} ${t.old};`)})),t}_defaultGetUniforms(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const e={},n=this.uniforms;for(const r in n){const o=n[r];r in t&&!o.private?(o.validate&&(0,i.v)(o.validate(t[r],o),`${this.name}: invalid ${r}`),e[r]=t[r]):e[r]=o.value}return e}}},34216:(t,e,n)=>{"use strict";function i(t,e){if(!t)throw new Error(e||"shadertools: assertion failed.")}n.d(e,{v:()=>i})},48944:(t,e,n)=>{"use strict";n.d(e,{_:()=>s});const i="#if (defined(SHADER_TYPE_FRAGMENT) && defined(LIGHTING_FRAGMENT)) || (defined(SHADER_TYPE_VERTEX) && defined(LIGHTING_VERTEX))\nstruct AmbientLight {\nvec3 color;\n};\nstruct PointLight {\nvec3 color;\nvec3 position;\nvec3 attenuation;\n};\nstruct DirectionalLight {\nvec3 color;\nvec3 direction;\n};\nuniform AmbientLight lighting_uAmbientLight;\nuniform PointLight lighting_uPointLight[MAX_LIGHTS];\nuniform DirectionalLight lighting_uDirectionalLight[MAX_LIGHTS];\nuniform int lighting_uPointLightCount;\nuniform int lighting_uDirectionalLightCount;\nuniform bool lighting_uEnabled;\nfloat getPointLightAttenuation(PointLight pointLight, float distance) {\nreturn pointLight.attenuation.x\n+ pointLight.attenuation.y * distance\n+ pointLight.attenuation.z * distance * distance;\n}\n#endif\n",r={lightSources:{}};function o(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{color:e=[0,0,0],intensity:n=1}=t;return e.map((t=>t*n/255))}const s={name:"lights",vs:i,fs:i,getUniforms:function t(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:r;if("lightSources"in e){const{ambientLight:t,pointLights:n,directionalLights:i}=e.lightSources||{};return t||n&&n.length>0||i&&i.length>0?Object.assign({},function(t){let{ambientLight:e,pointLights:n=[],directionalLights:i=[]}=t;const r={};return r["lighting_uAmbientLight.color"]=e?o(e):[0,0,0],n.forEach(((t,e)=>{r[`lighting_uPointLight[${e}].color`]=o(t),r[`lighting_uPointLight[${e}].position`]=t.position,r[`lighting_uPointLight[${e}].attenuation`]=t.attenuation||[1,0,0]})),r.lighting_uPointLightCount=n.length,i.forEach(((t,e)=>{r[`lighting_uDirectionalLight[${e}].color`]=o(t),r[`lighting_uDirectionalLight[${e}].direction`]=t.direction})),r.lighting_uDirectionalLightCount=i.length,r}({ambientLight:t,pointLights:n,directionalLights:i}),{lighting_uEnabled:!0}):{lighting_uEnabled:!1}}if("lights"in e){const n={pointLights:[],directionalLights:[]};for(const t of e.lights||[])switch(t.type){case"ambient":n.ambientLight=t;break;case"directional":n.directionalLights?.push(t);break;case"point":n.pointLights?.push(t)}return t({lightSources:n})}return{}},defines:{MAX_LIGHTS:3}}},4172
vendor: 9,427 bytes, line 2
2:(t,e,n)=>{"use strict";n.d(e,{R:()=>i});const i={name:"pbr",vs:"uniform mat4 u_MVPMatrix;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_NormalMatrix;\nout vec3 pbr_vPosition;\nout vec2 pbr_vUV;\n#ifdef HAS_NORMALS\n# ifdef HAS_TANGENTS\nout mat3 pbr_vTBN;\n# else\nout vec3 pbr_vNormal;\n# endif\n#endif\nvoid pbr_setPositionNormalTangentUV(vec4 position, vec4 normal, vec4 tangent, vec2 uv)\n{\nvec4 pos = u_ModelMatrix * position;\npbr_vPosition = vec3(pos.xyz) / pos.w;\n#ifdef HAS_NORMALS\n#ifdef HAS_TANGENTS\nvec3 normalW = normalize(vec3(u_NormalMatrix * vec4(normal.xyz, 0.0)));\nvec3 tangentW = normalize(vec3(u_ModelMatrix * vec4(tangent.xyz, 0.0)));\nvec3 bitangentW = cross(normalW, tangentW) * tangent.w;\npbr_vTBN = mat3(tangentW, bitangentW, normalW);\n#else\npbr_vNormal = normalize(vec3(u_ModelMatrix * vec4(normal.xyz, 0.0)));\n#endif\n#endif\n#ifdef HAS_UV\npbr_vUV = uv;\n#else\npbr_vUV = vec2(0.,0.);\n#endif\n}\n",fs:"precision highp float;\nuniform bool pbr_uUnlit;\n#ifdef USE_IBL\nuniform samplerCube u_DiffuseEnvSampler;\nuniform samplerCube u_SpecularEnvSampler;\nuniform sampler2D u_brdfLUT;\nuniform vec2 u_ScaleIBLAmbient;\n#endif\n#ifdef HAS_BASECOLORMAP\nuniform sampler2D u_BaseColorSampler;\n#endif\n#ifdef HAS_NORMALMAP\nuniform sampler2D u_NormalSampler;\nuniform float u_NormalScale;\n#endif\n#ifdef HAS_EMISSIVEMAP\nuniform sampler2D u_EmissiveSampler;\nuniform vec3 u_EmissiveFactor;\n#endif\n#ifdef HAS_METALROUGHNESSMAP\nuniform sampler2D u_MetallicRoughnessSampler;\n#endif\n#ifdef HAS_OCCLUSIONMAP\nuniform sampler2D u_OcclusionSampler;\nuniform float u_OcclusionStrength;\n#endif\n#ifdef ALPHA_CUTOFF\nuniform float u_AlphaCutoff;\n#endif\nuniform vec2 u_MetallicRoughnessValues;\nuniform vec4 u_BaseColorFactor;\nuniform vec3 u_Camera;\n#ifdef PBR_DEBUG\nuniform vec4 u_ScaleDiffBaseMR;\nuniform vec4 u_ScaleFGDSpec;\n#endif\nin vec3 pbr_vPosition;\nin vec2 pbr_vUV;\n#ifdef HAS_NORMALS\n#ifdef HAS_TANGENTS\nin mat3 pbr_vTBN;\n#else\nin vec3 pbr_vNormal;\n#endif\n#endif\nstruct PBRInfo\n{\nfloat NdotL;\nfloat NdotV;\nfloat NdotH;\nfloat LdotH;\nfloat VdotH;\nfloat perceptualRoughness;\nfloat metalness;\nvec3 reflectance0;\nvec3 reflectance90;\nfloat alphaRoughness;\nvec3 diffuseColor;\nvec3 specularColor;\nvec3 n;\nvec3 v;\n};\nconst float M_PI = 3.141592653589793;\nconst float c_MinRoughness = 0.04;\nvec4 SRGBtoLINEAR(vec4 srgbIn)\n{\n#ifdef MANUAL_SRGB\n#ifdef SRGB_FAST_APPROXIMATION\nvec3 linOut = pow(srgbIn.xyz,vec3(2.2));\n#else\nvec3 bLess = step(vec3(0.04045),srgbIn.xyz);\nvec3 linOut = mix( srgbIn.xyz/vec3(12.92), pow((srgbIn.xyz+vec3(0.055))/vec3(1.055),vec3(2.4)), bLess );\n#endif\nreturn vec4(linOut,srgbIn.w);;\n#else\nreturn srgbIn;\n#endif\n}\nvec3 getNormal()\n{\n#ifndef HAS_TANGENTS\nvec3 pos_dx = dFdx(pbr_vPosition);\nvec3 pos_dy = dFdy(pbr_vPosition);\nvec3 tex_dx = dFdx(vec3(pbr_vUV, 0.0));\nvec3 tex_dy = dFdy(vec3(pbr_vUV, 0.0));\nvec3 t = (tex_dy.t * pos_dx - tex_dx.t * pos_dy) / (tex_dx.s * tex_dy.t - tex_dy.s * tex_dx.t);\n#ifdef HAS_NORMALS\nvec3 ng = normalize(pbr_vNormal);\n#else\nvec3 ng = cross(pos_dx, pos_dy);\n#endif\nt = normalize(t - ng * dot(ng, t));\nvec3 b = normalize(cross(ng, t));\nmat3 tbn = mat3(t, b, ng);\n#else\nmat3 tbn = pbr_vTBN;\n#endif\n#ifdef HAS_NORMALMAP\nvec3 n = texture(u_NormalSampler, pbr_vUV).rgb;\nn = normalize(tbn * ((2.0 * n - 1.0) * vec3(u_NormalScale, u_NormalScale, 1.0)));\n#else\nvec3 n = normalize(tbn[2].xyz);\n#endif\nreturn n;\n}\n#ifdef USE_IBL\nvec3 getIBLContribution(PBRInfo pbrInputs, vec3 n, vec3 reflection)\n{\nfloat mipCount = 9.0;\nfloat lod = (pbrInputs.perceptualRoughness * mipCount);\nvec3 brdf = SRGBtoLINEAR(texture(u_brdfLUT,\nvec2(pbrInputs.NdotV, 1.0 - pbrInputs.perceptualRoughness))).rgb;\nvec3 diffuseLight = SRGBtoLINEAR(textureCube(u_DiffuseEnvSampler, n)).rgb;\n#ifdef USE_TEX_LOD\nvec3 specularLight = SRGBtoLINEAR(textureCubeLod(u_SpecularEnvSampler, reflection, lod)).rgb;\n#else\nvec3 specularLight = SRGBtoLINEAR(textureCube(u_SpecularEnvSampler, reflection)).rgb;\n#endif\nvec3 diffuse = diffuseLight * pbrInputs.diffuseColor;\nvec3 specular = specularLight * (pbrInputs.specularColor * brdf.x + brdf.y);\ndiffuse *= u_ScaleIBLAmbient.x;\nspecular *= u_ScaleIBLAmbient.y;\nreturn diffuse + specular;\n}\n#endif\nvec3 diffuse(PBRInfo pbrInputs)\n{\nreturn pbrInputs.diffuseColor / M_PI;\n}\nvec3 specularReflection(PBRInfo pbrInputs)\n{\nreturn pbrInputs.reflectance0 +\n(pbrInputs.reflectance90 - pbrInputs.reflectance0) *\npow(clamp(1.0 - pbrInputs.VdotH, 0.0, 1.0), 5.0);\n}\nfloat geometricOcclusion(PBRInfo pbrInputs)\n{\nfloat NdotL = pbrInputs.NdotL;\nfloat NdotV = pbrInputs.NdotV;\nfloat r = pbrInputs.alphaRoughness;\nfloat attenuationL = 2.0 * NdotL / (NdotL + sqrt(r * r + (1.0 - r * r) * (NdotL * NdotL)));\nfloat attenuationV = 2.0 * NdotV / (NdotV + sqrt(r * r + (1.0 - r * r) * (NdotV * NdotV)));\nreturn attenuationL * attenuationV;\n}\nfloat microfacetDistribution(PBRInfo pbrInputs)\n{\nfloat roughnessSq = pbrInputs.alphaRoughness * pbrInputs.alphaRoughness;\nfloat f = (pbrInputs.NdotH * roughnessSq - pbrInputs.NdotH) * pbrInputs.NdotH + 1.0;\nreturn roughnessSq / (M_PI * f * f);\n}\nvoid PBRInfo_setAmbientLight(inout PBRInfo pbrInputs) {\npbrInputs.NdotL = 1.0;\npbrInputs.NdotH = 0.0;\npbrInputs.LdotH = 0.0;\npbrInputs.VdotH = 1.0;\n}\nvoid PBRInfo_setDirectionalLight(inout PBRInfo pbrInputs, vec3 lightDirection) {\nvec3 n = pbrInputs.n;\nvec3 v = pbrInputs.v;\nvec3 l = normalize(lightDirection);\nvec3 h = normalize(l+v);\npbrInputs.NdotL = clamp(dot(n, l), 0.001, 1.0);\npbrInputs.NdotH = clamp(dot(n, h), 0.0, 1.0);\npbrInputs.LdotH = clamp(dot(l, h), 0.0, 1.0);\npbrInputs.VdotH = clamp(dot(v, h), 0.0, 1.0);\n}\nvoid PBRInfo_setPointLight(inout PBRInfo pbrInputs, PointLight pointLight) {\nvec3 light_direction = normalize(pointLight.position - pbr_vPosition);\nPBRInfo_setDirectionalLight(pbrInputs, light_direction);\n}\nvec3 calculateFinalColor(PBRInfo pbrInputs, vec3 lightColor) {\nvec3 F = specularReflection(pbrInputs);\nfloat G = geometricOcclusion(pbrInputs);\nfloat D = microfacetDistribution(pbrInputs);\nvec3 diffuseContrib = (1.0 - F) * diffuse(pbrInputs);\nvec3 specContrib = F * G * D / (4.0 * pbrInputs.NdotL * pbrInputs.NdotV);\nreturn pbrInputs.NdotL * lightColor * (diffuseContrib + specContrib);\n}\nvec4 pbr_filterColor(vec4 colorUnused)\n{\n#ifdef HAS_BASECOLORMAP\nvec4 baseColor = SRGBtoLINEAR(texture(u_BaseColorSampler, pbr_vUV)) * u_BaseColorFactor;\n#else\nvec4 baseColor = u_BaseColorFactor;\n#endif\n#ifdef ALPHA_CUTOFF\nif (baseColor.a < u_AlphaCutoff) {\ndiscard;\n}\n#endif\nvec3 color = vec3(0, 0, 0);\nif(pbr_uUnlit){\ncolor.rgb = baseColor.rgb;\n}\nelse{\nfloat perceptualRoughness = u_MetallicRoughnessValues.y;\nfloat metallic = u_MetallicRoughnessValues.x;\n#ifdef HAS_METALROUGHNESSMAP\nvec4 mrSample = texture(u_MetallicRoughnessSampler, pbr_vUV);\nperceptualRoughness = mrSample.g * perceptualRoughness;\nmetallic = mrSample.b * metallic;\n#endif\nperceptualRoughness = clamp(perceptualRoughness, c_MinRoughness, 1.0);\nmetallic = clamp(metallic, 0.0, 1.0);\nfloat alphaRoughness = perceptualRoughness * perceptualRoughness;\nvec3 f0 = vec3(0.04);\nvec3 diffuseColor = baseColor.rgb * (vec3(1.0) - f0);\ndiffuseColor *= 1.0 - metallic;\nvec3 specularColor = mix(f0, baseColor.rgb, metallic);\nfloat reflectance = max(max(specularColor.r, specularColor.g), specularColor.b);\nfloat reflectance90 = clamp(reflectance * 25.0, 0.0, 1.0);\nvec3 specularEnvironmentR0 = specularColor.rgb;\nvec3 specularEnvironmentR90 = vec3(1.0, 1.0, 1.0) * reflectance90;\nvec3 n = getNormal();\nvec3 v = normalize(u_Camera - pbr_vPosition);\nfloat NdotV = clamp(abs(dot(n, v)), 0.001, 1.0);\nvec3 reflection = -normalize(reflect(v, n));\nPBRInfo pbrInputs = PBRInfo(\n0.0,\nNdotV,\n0.0,\n0.0,\n0.0,\nperceptualRoughness,\nmetallic,\nspecularEnvironmentR0,\nspecularEnvironmentR90,\nalphaRoughness,\ndiffuseColor,\nspecularColor,\nn,\nv\n);\n#ifdef USE_LIGHTS\nPBRInfo_setAmbientLight(pbrInputs);\ncolor += calculateFinalColor(pbrInputs, lighting_uAmbientLight.color);\nfor(int i = 0; i < lighting_uDirectionalLightCount; i++) {\nif (i < lighting_uDirectionalLightCount) {\nPBRInfo_setDirectionalLight(pbrInputs, lighting_uDirectionalLight[i].direction);\ncolor += calculateFinalColor(pbrInputs, lighting_uDirectionalLight[i].color);\n}\n}\nfor(int i = 0; i < lighting_uPointLightCount; i++) {\nif (i < lighting_uPointLightCount) {\nPBRInfo_setPointLight(pbrInputs, lighting_uPointLight[i]);\nfloat attenuation = getPointLightAttenuation(lighting_uPointLight[i], distance(lighting_uPointLight[i].position, pbr_vPosition));\ncolor += calculateFinalColor(pbrInputs, lighting_uPointLight[i].color / attenuation);\n}\n}\n#endif\n#ifdef USE_IBL\ncolor += getIBLContribution(pbrInputs, n, reflection);\n#endif\n#ifdef HAS_OCCLUSIONMAP\nfloat ao = texture(u_OcclusionSampler, pbr_vUV).r;\ncolor = mix(color, color * ao, u_OcclusionStrength);\n#endif\n#ifdef HAS_EMISSIVEMAP\nvec3 emissive = SRGBtoLINEAR(texture(u_EmissiveSampler, pbr_vUV)).rgb * u_EmissiveFactor;\ncolor += emissive;\n#endif\n#ifdef PBR_DEBUG\ncolor = mix(color, baseColor.rgb, u_ScaleDiffBaseMR.y);\ncolor = mix(color, vec3(metallic), u_ScaleDiffBaseMR.z);\ncolor = mix(color, vec3(perceptualRoughness), u_ScaleDiffBaseMR.w);\n#endif\n}\nreturn vec4(pow(color,vec3(1.0/2.2)), baseColor.a);\n}\n",defines:{LIGHTING_FRAGMENT:1},dependencies:[n(
vendor: 4,540 bytes, line 2
248944)._]}},63351:(t,e,n)=>{"use strict";n.d(e,{K:()=>a,p:()=>l});var i=n(48944);const r="uniform float lighting_uAmbient;\nuniform float lighting_uDiffuse;\nuniform float lighting_uShininess;\nuniform vec3 lighting_uSpecularColor;\nvec3 lighting_getLightColor(vec3 surfaceColor, vec3 light_direction, vec3 view_direction, vec3 normal_worldspace, vec3 color) {\nvec3 halfway_direction = normalize(light_direction + view_direction);\nfloat lambertian = dot(light_direction, normal_worldspace);\nfloat specular = 0.0;\nif (lambertian > 0.0) {\nfloat specular_angle = max(dot(normal_worldspace, halfway_direction), 0.0);\nspecular = pow(specular_angle, lighting_uShininess);\n}\nlambertian = max(lambertian, 0.0);\nreturn (lambertian * lighting_uDiffuse * surfaceColor + specular * lighting_uSpecularColor) * color;\n}\nvec3 lighting_getLightColor(vec3 surfaceColor, vec3 cameraPosition, vec3 position_worldspace, vec3 normal_worldspace) {\nvec3 lightColor = surfaceColor;\nif (lighting_uEnabled) {\nvec3 view_direction = normalize(cameraPosition - position_worldspace);\nlightColor = lighting_uAmbient * surfaceColor * lighting_uAmbientLight.color;\nfor (int i = 0; i < MAX_LIGHTS; i++) {\nif (i >= lighting_uPointLightCount) {\nbreak;\n}\nPointLight pointLight = lighting_uPointLight[i];\nvec3 light_position_worldspace = pointLight.position;\nvec3 light_direction = normalize(light_position_worldspace - position_worldspace);\nlightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color);\n}\nfor (int i = 0; i < MAX_LIGHTS; i++) {\nif (i >= lighting_uDirectionalLightCount) {\nbreak;\n}\nDirectionalLight directionalLight = lighting_uDirectionalLight[i];\nlightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);\n}\n}\nreturn lightColor;\n}\nvec3 lighting_getSpecularLightColor(vec3 cameraPosition, vec3 position_worldspace, vec3 normal_worldspace) {\nvec3 lightColor = vec3(0, 0, 0);\nvec3 surfaceColor = vec3(0, 0, 0);\nif (lighting_uEnabled) {\nvec3 view_direction = normalize(cameraPosition - position_worldspace);\nfor (int i = 0; i < MAX_LIGHTS; i++) {\nif (i >= lighting_uPointLightCount) {\nbreak;\n}\nPointLight pointLight = lighting_uPointLight[i];\nvec3 light_position_worldspace = pointLight.position;\nvec3 light_direction = normalize(light_position_worldspace - position_worldspace);\nlightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color);\n}\nfor (int i = 0; i < MAX_LIGHTS; i++) {\nif (i >= lighting_uDirectionalLightCount) {\nbreak;\n}\nDirectionalLight directionalLight = lighting_uDirectionalLight[i];\nlightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);\n}\n}\nreturn lightColor;\n}\n",o={};function s(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:o;if(!("material"in t))return{};const{material:e}=t;return e?function(t){const{ambient:e=.35,diffuse:n=.6,shininess:i=32,specularColor:r=[30,30,30]}=t;return{lighting_uAmbient:e,lighting_uDiffuse:n,lighting_uShininess:i,lighting_uSpecularColor:r.map((t=>t/255))}}(e):{lighting_uEnabled:!1}}const a={name:"gouraud-lighting",dependencies:[i._],vs:r,defines:{LIGHTING_VERTEX:1},getUniforms:s},l={name:"phong-lighting",dependencies:[i._],fs:r,defines:{LIGHTING_FRAGMENT:1},getUniforms:s}},63170:(t,e,n)=>{"use strict";function i(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const i=Math.fround(t),r=t-i;return e[n]=i,e[n+1]=r,e}function r(t){return t-Math.fround(t)}function o(t){const e=new Float32Array(32);for(let n=0;n<4;++n)for(let r=0;r<4;++r){const o=4*n+r;i(t[4*r+n],e,2*o)}return e}n.d(e,{dI:()=>a});const s={ONE:1};const a={name:"fp64-arithmetic",vs:"uniform float ONE;\nvec2 split(float a) {\nconst float SPLIT = 4097.0;\nfloat t = a * SPLIT;\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\nfloat a_hi = t * ONE - (t - a);\nfloat a_lo = a * ONE - a_hi;\n#else\nfloat a_hi = t - (t - a);\nfloat a_lo = a - a_hi;\n#endif\nreturn vec2(a_hi, a_lo);\n}\nvec2 split2(vec2 a) {\nvec2 b = split(a.x);\nb.y += a.y;\nreturn b;\n}\nvec2 quickTwoSum(float a, float b) {\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\nfloat sum = (a + b) * ONE;\nfloat err = b - (sum - a) * ONE;\n#else\nfloat sum = a + b;\nfloat err = b - (sum - a);\n#endif\nreturn vec2(sum, err);\n}
2\nvec2 twoSum(float a, float b) {\nfloat s = (a + b);\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\nfloat v = (s * ONE - a) * ONE;\nfloat err = (a - (s - v) * ONE) * ONE * ONE * ONE + (b - v);\n#else\nfloat v = s - a;\nfloat err = (a - (s - v)) + (b - v);\n#endif\nreturn vec2(s, err);\n}\nvec2 twoSub(float a, float b) {\nfloat s = (a - b);\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\nfloat v = (s * ONE - a) * ONE;\nfloat err = (a - (s - v) * ONE) * ONE * ONE * ONE - (b + v);\n#else\nfloat v = s - a;\nfloat err = (a - (s - v)) - (b + v);\n#endif\nreturn vec2(s, err);\n}\nvec2 twoSqr(float a) {\nfloat prod = a * a;\nvec2 a_fp64 = split(a);\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\nfloat err = ((a_fp64.x * a_fp64.x - prod) * ONE + 2.0 * a_fp64.x *\na_fp64.y * ONE * ONE) + a_fp64.y * a_fp64.y * ONE * ONE * ONE;\n#else\nfloat err = ((a_fp64.x * a_fp64.x - prod) + 2.0 * a_fp64.x * a_fp64.y) + a_fp64.y * a_fp64.y;\n#endif\nreturn vec2(prod, err);\n}\nvec2 twoProd(float a, float b) {\nfloat prod = a * b;\nvec2 a_fp64 = split(a);\nvec2 b_fp64 = split(b);\nfloat err = ((a_fp64.x * b_fp64.x - prod) + a_fp64.x * b_fp64.y +\na_fp64.y * b_fp64.x) + a_fp64.y * b_fp64.y;\nreturn vec2(prod, err);\n}\nvec2 sum_fp64(vec2 a, vec2 b) {\nvec2 s, t;\ns = twoSum(a.x, b.x);\nt = twoSum(a.y, b.y);\ns.y += t.x;\ns = quickTwoSum(s.x, s.y);\ns.y += t.y;\ns = quickTwoSum(s.x, s.y);\nreturn s;\n}\nvec2 sub_fp64(vec2 a, vec2 b) {\nvec2 s, t;\ns = twoSub(a.x, b.x);\nt = twoSub(a.y, b.y);\ns.y += t.x;\ns = quickTwoSum(s.x, s.y);\ns.y += t.y;\ns = quickTwoSum(s.x, s.y);\nreturn s;\n}\nvec2 mul_fp64(vec2 a, vec2 b) {\nvec2 prod = twoProd(a.x, b.x);\nprod.y += a.x * b.y;\n#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND)\nprod = split2(prod);\n#endif\nprod = quickTwoSum(prod.x, prod.y);\nprod.y += a.y * b.x;\n#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND)\nprod = split2(prod);\n#endif\nprod = quickTwoSum(prod.x, prod.y);\nreturn prod;\n}\nvec2 div_fp64(vec2 a, vec2 b) {\nfloat xn = 1.0 / b.x;\n#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND)\nvec2 yn = mul_fp64(a, vec2(xn, 0));\n#else\nvec2 yn = a * xn;\n#endif\nfloat diff = (sub_fp64(a, mul_fp64(b, yn))).x;\nvec2 prod = twoProd(xn, diff);\nreturn sum_fp64(yn, prod);\n}\nvec2 sqrt_fp64(vec2 a) {\nif (a.x == 0.0 && a.y == 0.0) return vec2(0.0, 0.0);\nif (a.x < 0.0) return vec2(0.0 / 0.0, 0.0 / 0.0);\nfloat x = 1.0 / sqrt(a.x);\nfloat yn = a.x * x;\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\nvec2 yn_sqr = twoSqr(yn) * ONE;\n#else\nvec2 yn_sqr = twoSqr(yn);\n#endif\nfloat diff = sub_fp64(a, yn_sqr).x;\nvec2 prod = twoProd(x * 0.5, diff);\n#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND)\nreturn sum_fp64(split(yn), prod);\n#else\nreturn sum_fp64(vec2(yn, 0.0), prod);\n#endif\n}\n",getUniforms:function(){return s},fp64ify:i,fp64LowPart:r,fp64ifyMatrix4:o}},55779:(t,e,n)=>{"use strict";n.d(e,{a:()=>r});var i=n(25195);class r extends Array{clone(){return(new this.constructor).copy(this)}fromArray(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;for(let n=0;n<this.ELEMENTS;++n)this[n]=t[n+e];return this.check()}toArray(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;for(let n=0;n<this.ELEMENTS;++n)t[e+n]=this[n];return t}toObject(t){return t}from(t){return Array.isArray(t)?this.copy(t):this.fromObject(t)}to(t){return t===this?this:(0,i.cy)(t)?this.toArray(t):this.toObject(t)}toTarget(t){return t?this.to(t):this}toFloat32Array(){return new Float32Array(this)}toString(){return this.formatString(i.$W)}formatString(t){let e="";for(let n=0;n<this.ELEMENTS;++n)e+=(n>0?", ":"")+(0,i.Fl)(this[n],t);return`${t.printTypes?this.constructor.name:""}[${e}]`}equals(t){if(!t||this.length!==t.length)return!1;for(let e=0;e<this.ELEMENTS;++e)if(!(0,i.aI)(this[e],t[e]))return!1;return!0}exactEquals(t){if(!t||this.length!==t.length)return!1;for(let e=0;e<this.ELEMENTS;++e)if(this[e]!==t[e])return!1;return!0}negate(){for(let t=0;t<this.ELEMENTS;++t)this[t]=-this[t];return this.check()}lerp(t,e,n){if(void 0===n)return this.lerp(this,t,e);for(let i=0;i<this.ELEMENTS;++i){const r=t[i],o="number"===typeof e?e:e[i];this[i]=r+n*(o-r)}return this.check()}min(t){for(let e=0;e<this.ELEMENTS;++e)this[e]=Math.min(t[e],this[e]);return this.check()}max(t){for(let e=0;e<this.ELEMENTS;++e)this[e]=Math.max(t[e],this[e]);return this.check()}clamp(t,e){for(let n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],t[n]),e[n]);return this.check()}add(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];for(const i of e)for(let t=0;t<this.ELEMENTS;++t)this[t]+=i[t];return this.check()}subtract(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];for(const i of e)for(let t=0;t<this.ELEMENTS;++t)this[t]-=i[t];return this.check()}scale(t){if("number"===typeof t)for(let e=0;e<this.ELEMENTS;++e)this[e]*=t;else for(let e=0;e<this.ELEMENTS&&e<t.length;++e)this[e]*=t[e];return this.check()}multiplyByScalar(t){for(let e=0;e<this.ELEMENTS;++e)this[e]*=t;return this.check()}check(){if(i.$W.debug&&!this.validate())throw new Error(`math.gl: ${this.constructor.name}
2 some fields set to invalid numbers'`);return this}validate(){let t=this.length===this.ELEMENTS;for(let e=0;e<this.ELEMENTS;++e)t=t&&Number.isFinite(this[e]);return t}sub(t){return this.subtract(t)}setScalar(t){for(let e=0;e<this.ELEMENTS;++e)this[e]=t;return this.check()}addScalar(t){for(let e=0;e<this.ELEMENTS;++e)this[e]+=t;return this.check()}subScalar(t){return this.addScalar(-t)}multiplyScalar(t){for(let e=0;e<this.ELEMENTS;++e)this[e]*=t;return this.check()}divideScalar(t){return this.multiplyByScalar(1/t)}clampScalar(t,e){for(let n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],t),e);return this.check()}get elements(){return this}}},14756:(t,e,n)=>{"use strict";n.d(e,{u:()=>s});var i=n(55779),r=n(72033),o=n(25195);class s extends i.a{toString(){let t="[";if(o.$W.printRowMajor){t+="row-major:";for(let e=0;e<this.RANK;++e)for(let n=0;n<this.RANK;++n)t+=` ${this[n*this.RANK+e]}`}else{t+="column-major:";for(let e=0;e<this.ELEMENTS;++e)t+=` ${this[e]}`}return t+="]",t}getElementIndex(t,e){return e*this.RANK+t}getElement(t,e){return this[e*this.RANK+t]}setElement(t,e,n){return this[e*this.RANK+t]=(0,r.ws)(n),this}getColumn(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Array(this.RANK).fill(-0);const n=t*this.RANK;for(let i=0;i<this.RANK;++i)e[i]=this[n+i];return e}setColumn(t,e){const n=t*this.RANK;for(let i=0;i<this.RANK;++i)this[n+i]=e[i];return this}}},10042:(t,e,n)=>{"use strict";n.d(e,{M:()=>s});var i=n(55779),r=n(72033),o=n(84584);class s extends i.a{get x(){return this[0]}set x(t){this[0]=(0,r.ws)(t)}get y(){return this[1]}set y(t){this[1]=(0,r.ws)(t)}len(){return Math.sqrt(this.lengthSquared())}magnitude(){return this.len()}lengthSquared(){let t=0;for(let e=0;e<this.ELEMENTS;++e)t+=this[e]*this[e];return t}magnitudeSquared(){return this.lengthSquared()}distance(t){return Math.sqrt(this.distanceSquared(t))}distanceSquared(t){let e=0;for(let n=0;n<this.ELEMENTS;++n){const i=this[n]-t[n];e+=i*i}return(0,r.ws)(e)}dot(t){let e=0;for(let n=0;n<this.ELEMENTS;++n)e+=this[n]*t[n];return(0,r.ws)(e)}normalize(){const t=this.magnitude();if(0!==t)for(let e=0;e<this.ELEMENTS;++e)this[e]/=t;return this.check()}multiply(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];for(const i of e)for(let t=0;t<this.ELEMENTS;++t)this[t]*=i[t];return this.check()}divide(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];for(const i of e)for(let t=0;t<this.ELEMENTS;++t)this[t]/=i[t];return this.check()}lengthSq(){return this.lengthSquared()}distanceTo(t){return this.distance(t)}distanceToSquared(t){return this.distanceSquared(t)}getComponent(t){return(0,o.v)(t>=0&&t<this.ELEMENTS,"index is out of range"),(0,r.ws)(this[t])}setComponent(t,e){return(0,o.v)(t>=0&&t<this.ELEMENTS,"index is out of range"),this[t]=e,this.check()}addVectors(t,e){return this.copy(t).add(e)}subVectors(t,e){return this.copy(t).subtract(e)}multiplyVectors(t,e){return this.copy(t).multiply(e)}addScaledVector(t,e){return this.add(new this.constructor(t).multiplyScalar(e))}}},63869:(t,e,n)=>{"use strict";n.d(e,{d:()=>h});var i,r=n(14756),o=n(72033),s=n(24879),a=n(23169),l=n(28442),c=n(98953);!function(t){t[t.COL0ROW0=0]="COL0ROW0",t[t.COL0ROW1=1]="COL0ROW1",t[t.COL0ROW2=2]="COL0ROW2",t[t.COL1ROW0=3]="COL1ROW0",t[t.COL1ROW1=4]="COL1ROW1",t[t.COL1ROW2=5]="COL1ROW2",t[t.COL2ROW0=6]="COL2ROW0",t[t.COL2ROW1=7]="COL2ROW1",t[t.COL2ROW2=8]="COL2ROW2"}(i||(i={}));const u=Object.freeze([1,0,0,0,1,0,0,0,1]);class h extends r.u{static get IDENTITY(){return function(){p||(p=new h,Object.freeze(p));return p}()}static get ZERO(){return function(){d||(d=new h([0,0,0,0,0,0,0,0,0]),Object.freeze(d));return d}()}get ELEMENTS(){return 9}get RANK(){return 3}get INDICES(){return i}constructor(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];super(-0,-0,-0,-0,-0,-0,-0,-0,-0),1===arguments.length&&Array.isArray(t)?this.copy(t):n.length>0?this.copy([t,...n]):this.identity()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this[4]=t[4],this[5]=t[5],this[6]=t[6],this[7]=t[7],this[8]=t[8],this.check()}identity(){return this.copy(u)}fromObject(t){return this.check()}fromQuaternion(t){return(0,a.I0)(this,t),this.check()}set(t,e,n,i,r,o,s,a,l){return this[0]=t,this[1]=e,this[2]=n,this[3]=i,this[4]=r,this[5]=o,this[6]=s,this[7]=a,this[8]=l,this.check()}setRowMajor(t,e,n,i,r,o,s,a,l){return this[0]=t,this[1]=i,this[2]=s,this[3]=e,this[4]=r,this[5]=a,this[6]=n,this[7]=o,this[8]=l,this.check()}determinant(){return(0,a.a4)(this)}transpose(){return(0,a.mg)(this,this),this.check()}invert(){return(0,a.B8)(this,this),this.check()}multiplyLeft(t){return(0,a.lw)(this,t,this),this.check()}multiplyRight(t){return(0,a.lw)(this,this,t),this.check()}rotate(t){return(0,a.e$)(this,this,t),this.check()}scale(t){return Array.isArray(t)?(0,a.hs)(this,this,t):(0,a.hs)(this,this,[t,t]),this.check()}translate(t){return(0,a.Tl)(this,this,t),this.check()}transform(t,e){let n;switch(t.length){case 2:n=(0,l.ei)(e||[-0,-0],t,this);break;case 3:n=(0,c.ei)(e||[-0,-0,-0],t,this);break;case 4:n=(0,s.vE)(e||[-0,-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}
vendor: 40,666 bytes, line 2
2return(0,o.qk)(n,t.length),n}transformVector(t,e){return this.transform(t,e)}transformVector2(t,e){return this.transform(t,e)}transformVector3(t,e){return this.transform(t,e)}}let d,p=null},33128:(t,e,n)=>{"use strict";n.d(e,{k:()=>g});var i,r=n(14756),o=n(72033),s=n(24879),a=n(95572),l=n(28442),c=n(98953),u=n(7964);!function(t){t[t.COL0ROW0=0]="COL0ROW0",t[t.COL0ROW1=1]="COL0ROW1",t[t.COL0ROW2=2]="COL0ROW2",t[t.COL0ROW3=3]="COL0ROW3",t[t.COL1ROW0=4]="COL1ROW0",t[t.COL1ROW1=5]="COL1ROW1",t[t.COL1ROW2=6]="COL1ROW2",t[t.COL1ROW3=7]="COL1ROW3",t[t.COL2ROW0=8]="COL2ROW0",t[t.COL2ROW1=9]="COL2ROW1",t[t.COL2ROW2=10]="COL2ROW2",t[t.COL2ROW3=11]="COL2ROW3",t[t.COL3ROW0=12]="COL3ROW0",t[t.COL3ROW1=13]="COL3ROW1",t[t.COL3ROW2=14]="COL3ROW2",t[t.COL3ROW3=15]="COL3ROW3"}(i||(i={}));const h=45*Math.PI/180,d=1,p=.1,f=500,A=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]);class g extends r.u{static get IDENTITY(){return function(){y||(y=new g,Object.freeze(y));return y}()}static get ZERO(){return function(){m||(m=new g([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Object.freeze(m));return m}()}get ELEMENTS(){return 16}get RANK(){return 4}get INDICES(){return i}constructor(t){super(-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0),1===arguments.length&&Array.isArray(t)?this.copy(t):this.identity()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this[4]=t[4],this[5]=t[5],this[6]=t[6],this[7]=t[7],this[8]=t[8],this[9]=t[9],this[10]=t[10],this[11]=t[11],this[12]=t[12],this[13]=t[13],this[14]=t[14],this[15]=t[15],this.check()}set(t,e,n,i,r,o,s,a,l,c,u,h,d,p,f,A){return this[0]=t,this[1]=e,this[2]=n,this[3]=i,this[4]=r,this[5]=o,this[6]=s,this[7]=a,this[8]=l,this[9]=c,this[10]=u,this[11]=h,this[12]=d,this[13]=p,this[14]=f,this[15]=A,this.check()}setRowMajor(t,e,n,i,r,o,s,a,l,c,u,h,d,p,f,A){return this[0]=t,this[1]=r,this[2]=l,this[3]=d,this[4]=e,this[5]=o,this[6]=c,this[7]=p,this[8]=n,this[9]=s,this[10]=u,this[11]=f,this[12]=i,this[13]=a,this[14]=h,this[15]=A,this.check()}toRowMajor(t){return t[0]=this[0],t[1]=this[4],t[2]=this[8],t[3]=this[12],t[4]=this[1],t[5]=this[5],t[6]=this[9],t[7]=this[13],t[8]=this[2],t[9]=this[6],t[10]=this[10],t[11]=this[14],t[12]=this[3],t[13]=this[7],t[14]=this[11],t[15]=this[15],t}identity(){return this.copy(A)}fromObject(t){return this.check()}fromQuaternion(t){return(0,a.I0)(this,t),this.check()}frustum(t){const{left:e,right:n,bottom:i,top:r,near:o=p,far:s=f}=t;return s===1/0?function(t,e,n,i,r,o){const s=2*o/(n-e),a=2*o/(r-i),l=(n+e)/(n-e),c=(r+i)/(r-i),u=-1,h=-1,d=-2*o;t[0]=s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=l,t[9]=c,t[10]=u,t[11]=h,t[12]=0,t[13]=0,t[14]=d,t[15]=0}(this,e,n,i,r,o):(0,a.$h)(this,e,n,i,r,o,s),this.check()}lookAt(t){const{eye:e,center:n=[0,0,0],up:i=[0,1,0]}=t;return(0,a.t5)(this,e,n,i),this.check()}ortho(t){const{left:e,right:n,bottom:i,top:r,near:o=p,far:s=f}=t;return(0,a.v3)(this,e,n,i,r,o,s),this.check()}orthographic(t){const{fovy:e=h,aspect:n=d,focalDistance:i=1,near:r=p,far:o=f}=t;_(e);const s=e/2,a=i*Math.tan(s),l=a*n;return this.ortho({left:-l,right:l,bottom:-a,top:a,near:r,far:o})}perspective(t){const{fovy:e=45*Math.PI/180,aspect:n=1,near:i=.1,far:r=500}=t;return _(e),(0,a.fN)(this,e,n,i,r),this.check()}determinant(){return(0,a.a4)(this)}getScale(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[-0,-0,-0];return t[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),t[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),t[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),t}getTranslation(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[-0,-0,-0];return t[0]=this[12],t[1]=this[13],t[2]=this[14],t}getRotation(t,e){t=t||[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],e=e||[-0,-0,-0];const n=this.getScale(e),i=1/n[0],r=1/n[1],o=1/n[2];return t[0]=this[0]*i,t[1]=this[1]*r,t[2]=this[2]*o,t[3]=0,t[4]=this[4]*i,t[5]=this[5]*r,t[6]=this[6]*o,t[7]=0,t[8]=this[8]*i,t[9]=this[9]*r,t[10]=this[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}getRotationMatrix3(t,e){t=t||[-0,-0,-0,-0,-0,-0,-0,-0,-0],e=e||[-0,-0,-0];const n=this.getScale(e),i=1/n[0],r=1/n[1],o=1/n[2];return t[0]=this[0]*i,t[1]=this[1]*r,t[2]=this[2]*o,t[3]=this[4]*i,t[4]=this[5]*r,t[5]=this[6]*o,t[6]=this[8]*i,t[7]=this[9]*r,t[8]=this[10]*o,t}transpose(){return(0,a.mg)(this,this),this.check()}invert(){return(0,a.B8)(this,this),this.check()}multiplyLeft(t){return(0,a.lw)(this,t,this),this.check()}multiplyRight(t){return(0,a.lw)(this,this,t),this.check()}rotateX(t){return(0,a.eL)(this,this,t),this.check()}rotateY(t){return(0,a.Z8)(this,this,t),this.check()}rotateZ(t){return(0,a.Qr)(this,this,t),this.check()}rotateXYZ(t){return this.rotateX(t[0]).rotateY(t[1]).rotateZ(t[2])}rotateAxis(t,e){return(0,a.e$)(this,this,t,e),this.check()}scale(t){return(0,a.hs)(this,this,Array.isArray(t)?t:[t,t,t]),this.check()}translate(t){return(0,a.Tl)(this,this,t),this.check()}transform(t,e){return 4===t.length?(e=(0,u.Z0)(e||[-0,-0,-0,-0],t,this),(0,o.qk)(e,4),e):this.transformAsPoint(t,e)}transformAsPoint(t,e){const{length:n}=t;let i;switch(n){case 2:i=(0,l.Z0)(e||[-0,-0],t,this);break;case 3:i=(0,c.Z0)(e||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return(0,o.qk)(i,t.length),i}transformAsVector(t,e){let n;switch(t.length){case 2:n=(0,s.B$)(e||[-0,-0],t,this);break;case 3:n=(0,s.cL)(e||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return(0,o.qk)(n,t.length),n}transformPoint(t,e){return this.transformAsPoint(t,e)}transformVector(t,e){return this.transformAsPoint(t,e)}transformDirection(t,e){return this.transformAsVector(t,e)}makeRotationX(t){return this.identity().rotateX(t)}makeTranslation(t,e,n){return this.identity().translate([t,e,n])}}let m,y;function _(t){if(t>2*Math.PI)throw Error("expected radians")}},68032:(t,e,n)=>{"use strict";n.d(e,{P:()=>P});var i=n(55779),r=n(72033),o=n(98953),s=n(24879),a=n(10042),l=n(25195);let c;class u extends a.M{static get ZERO(){return c||(c=new u(0,0,0,0),Object.freeze(c)),c}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;super(-0,-0,-0,-0),(0,l.cy)(t)&&1===arguments.length?this.copy(t):(l.$W.debug&&((0,r.ws)(t),(0,r.ws)(e),(0,r.ws)(n),(0,r.ws)(i)),this[0]=t,this[1]=e,this[2]=n,this[3]=i)}set(t,e,n,i){return this[0]=t,this[1]=e,this[2]=n,this[3]=i,this.check()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this.check()}fromObject(t){return l.$W.debug&&((0,r.ws)(t.x),(0,r.ws)(t.y),(0,r.ws)(t.z),(0,r.ws)(t.w)),this[0]=t.x,this[1]=t.y,this[2]=t.z,this[3]=t.w,this}toObject(t){return t.x=this[0],t.y=this[1],t.z=this[2],t.w=this[3],t}get ELEMENTS(){return 4}get z(){return this[2]}set z(t){this[2]=(0,r.ws)(t)}get w(){return this[3]}set w(t){this[3]=(0,r.ws)(t)}transform(t){return(0,o.Z0)(this,this,t),this.check()}transformByMatrix3(t){return(0,s.vE)(this,this,t),this.check()}transformByMatrix2(t){return(0,s.Cg)(this,this,t),this.check()}transformByQuaternion(t){return(0,o.gL)(this,this,t),this.check()}applyMatrix4(t){return t.transform(this,this),this}}var h=n(27119),d=n(23169),p=n(7964);function f(){const t=new h.tb(4);return h.tb!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function A(t,e,n){n*=.5;const i=Math.sin(n);return t[0]=i*e[0],t[1]=i*e[1],t[2]=i*e[2],t[3]=Math.cos(n),t}function g(t,e,n){const i=e[0],r=e[1],o=e[2],s=e[3],a=n[0],l=n[1],c=n[2],u=n[3];return t[0]=i*u+s*a+r*c-o*l,t[1]=r*u+s*l+o*a-i*c,t[2]=o*u+s*c+i*l-r*a,t[3]=s*u-i*a-r*l-o*c,t}function m(t,e,n,i){const r=e[0],o=e[1],s=e[2],a=e[3];let l,c,u,d,p,f=n[0],A=n[1],g=n[2],m=n[3];return l=r*f+o*A+s*g+a*m,l<0&&(l=-l,f=-f,A=-A,g=-g,m=-m),1-l>h.p8?(c=Math.acos(l),p=Math.sin(c),u=Math.sin((1-i)*c)/p,d=Math.sin(i*c)/p):(u=1-i,d=i),t[0]=u*r+d*f,t[1]=u*o+d*A,t[2]=u*s+d*g,t[3]=u*a+d*m,t}function y(t,e){const n=e[0]+e[4]+e[8];let i;if(n>0)i=Math.sqrt(n+1),t[3]=.5*i,i=.5/i,t[0]=(e[5]-e[7])*i,t[1]=(e[6]-e[2])*i,t[2]=(e[1]-e[3])*i;else{let n=0;e[4]>e[0]&&(n=1),e[8]>e[3*n+n]&&(n=2);const r=(n+1)%3,o=(n+2)%3;i=Math.sqrt(e[3*n+n]-e[3*r+r]-e[3*o+o]+1),t[n]=.5*i,i=.5/i,t[3]=(e[3*r+o]-e[3*o+r])*i,t[r]=(e[3*r+n]+e[3*n+r])*i,t[o]=(e[3*o+n]+e[3*n+o])*i}return t}p.o8,p.fA,p.C,p.hZ;const _=p.WQ,v=p.hs,b=p.Om,x=p.Cc,w=p.Bw,E=p.m3,C=p.S8;p.t2;const T=function(){const t=o.vt(),e=o.fA(1,0,0),n=o.fA(0,1,0);return function(i,r,s){const a=o.Om(r,s);return a<-.999999?(o.$A(t,e,r),o.Il(t)<1e-6&&o.$A(t,n,r),o.S8(t,t),A(i,t,Math.PI),i):a>.999999?(i[0]=0,i[1]=0,i[2]=0,i[3]=1,i):(o.$A(t,r,s),i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=1+a,C(i,i))}}(),S=(function(){const t=f(),e=f()}(),function(){const t=d.vt()}(),[0,0,0,1]);class P extends i.a{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;super(-0,-0,-0,-0),Array.isArray(t)&&1===arguments.length?this.copy(t):this.set(t,e,n,i)}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this.check()}set(t,e,n,i){return this[0]=t,this[1]=e,this[2]=n,this[3]=i,this.check()}fromObject(t){return this[0]=t.x,this[1]=t.y,this[2]=t.z,this[3]=t.w,this.check()}fromMatrix3(t){return y(this,t),this.check()}fromAxisRotation(t,e){return A(this,t,e),this.check()}identity(){var t;return(t=this)[0]=0,t[1]=0,t[2]=0,t[3]=1,this.check()}setAxisAngle(t,e){return this.fromAxisRotation(t,e)}get ELEMENTS(){return 4}get x(){return this[0]}set x(t){this[0]=(0,r.ws)(t)}get y(){return this[1]}set y(t){this[1]=(0,r.ws)(t)}get z(){return this[2]}set z(t){this[2]=(0,r.ws)(t)}get w(){return this[3]}set w(t){this[3]=(0,r.ws)(t)}len(){return w(this)}lengthSquared(){return E(this)}dot(t){return b(this,t)}rotationTo(t,e){return T(this,t,e),this.check()}add(t){return _(this,this,t),this.check()}calculateW(){return function(t,e){const n=e[0],i=e[1],r=e[2];t[0]=n,t[1]=i,t[2]=r,t[3]=Math.sqrt(Math.abs(1-n*n-i*i-r*r))}(this,this),this.check()}conjugate(){var t,e;return e=this,(t=this)[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],this.check()}invert(){return function(t,e){const n=e[0],i=e[1],r=e[2],o=e[3],s=n*n+i*i+r*r+o*o,a=s?1/s:0;t[0]=-n*a,t[1]=-i*a,t[2]=-r*a,t[3]=o*a}(this,this),this.check()}lerp(t,e,n){return void 0===n?this.lerp(this,t,e):(x(this,t,e,n),this.check())}multiplyRight(t){return g(this,this,t),this.check()}multiplyLeft(t){return g(this,t,this),this.check()}normalize(){const t=this.len(),e=t>0?1/t:0;return this[0]=this[0]*e,this[1]=this[1]*e,this[2]=this[2]*e,this[3]=this[3]*e,0===t&&(this[3]=1),this.check()}rotateX(t){return function(t,e,n){n*=.5;const i=e[0],r=e[1],o=e[2],s=e[3],a=Math.sin(n),l=Math.cos(n);t[0]=i*l+s*a,t[1]=r*l+o*a,t[2]=o*l-r*a,t[3]=s*l-i*a}(this,this,t),this.check()}rotateY(t){return function(t,e,n){n*=.5;const i=e[0],r=e[1],o=e[2],s=e[3],a=Math.sin(n),l=Math.cos(n);t[0]=i*l-o*a,t[1]=r*l+s*a,t[2]=o*l+i*a,t[3]=s*l-r*a}(this,this,t),this.check()}rotateZ(t){return function(t,e,n){n*=.5;const i=e[0],r=e[1],o=e[2],s=e[3],a=Math.sin(n),l=Math.cos(n);t[0]=i*l+r*a,t[1]=r*l-i*a,t[2]=o*l+s*a,t[3]=s*l-o*a}(this,this,t),this.check()}scale(t){return v(this,this,t),this.check()}slerp(t,e,n){let i,r,o;switch(arguments.length){case 1:({start:i=S,target:r,ratio:o}=t);break;case 2:i=this,r=t,o=e;break;default:i=t,r=e,o=n}return m(this,i,r,o),this.check()}transformVector4(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new u;return(0,p.gL)(e,t,this),(0,r.qk)(e,4)}lengthSq(){return this.lengthSquared()}setFromAxisAngle(t,e){return this.setAxisAngle(t,e)}premultiply(t){return this.multiplyLeft(t)}multiply(t){return this.multiplyRight(t)}}},15183:(t,e,n)=>{"use strict";n.d(e,{P:()=>u});var i=n(10042),r=n(25195),o=n(72033),s=n(98953),a=n(24879);const l=[0,0,0];let c;class u extends i.M{static get ZERO(){return c||(c=new u(0,0,0),Object.freeze(c)),c}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;super(-0,-0,-0),1===arguments.length&&(0,r.cy)(t)?this.copy(t):(r.$W.debug&&((0,o.ws)(t),(0,o.ws)(e),(0,o.ws)(n)),this[0]=t,this[1]=e,this[2]=n)}set(t,e,n){return this[0]=t,this[1]=e,this[2]=n,this.check()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this.check()}fromObject(t){return r.$W.debug&&((0,o.ws)(t.x),(0,o.ws)(t.y),(0,o.ws)(t.z)),this[0]=t.x,this[1]=t.y,this[2]=t.z,this.check()}toObject(t){return t.x=this[0],t.y=this[1],t.z=this[2],t}get ELEMENTS(){return 3}get z(){return this[2]}set z(t){this[2]=(0,o.ws)(t)}angle(t){return(0,s.g7)(this,t)}cross(t){return(0,s.$A)(this,this,t),this.check()}rotateX(t){let{radians:e,origin:n=l}=t;return(0,s.eL)(this,this,n,e),this.check()}rotateY(t){let{radians:e,origin:n=l}=t;return(0,s.Z8)(this,this,n,e),this.check()}rotateZ(t){let{radians:e,origin:n=l}=t;return(0,s.x6)(this,this,n,e),this.check()}transform(t){return this.transformAsPoint(t)}transformAsPoint(t){return(0,s.Z0)(this,this,t),this.check()}transformAsVector(t){return(0,a.cL)(this,this,t),this.check()}transformByMatrix3(t){return(0,s.ei)(this,this,t),this.check()}transformByMatrix2(t){return(0,a.J4)(this,this,t),this.check()}transformByQuaternion(t){return(0,s.gL)(this,this,t),this.check()}}},27119:(t,e,n)=>{"use strict";n.d(e,{p8:()=>i,tb:()=>r});const i=1e-6;let r="undefined"!==typeof Float32Array?Float32Array:Array;Math.random;Math.PI},23169:(t,e,n)=>{"use strict";n.d(e,{B8:()=>s,I0:()=>d,Tl:()=>c,a4:()=>a,e$:()=>u,hs:()=>h,lw:()=>l,mg:()=>o,vt:()=>r});var i=n(27119);function r(){const t=new i.tb(9);return i.tb!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function o(t,e){if(t===e){const n=e[1],i=e[2],r=e[5];t[1]=e[3],t[2]=e[6],t[3]=n,t[5]=e[7],t[6]=i,t[7]=r}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t}function s(t,e){const n=e[0],i=e[1],r=e[2],o=e[3],s=e[4],a=e[5],l=e[6],c=e[7],u=e[8],h=u*s-a*c,d=-u*o+a*l,p=c*o-s*l;let f=n*h+i*d+r*p;return f?(f=1/f,t[0]=h*f,t[1]=(-u*i+r*c)*f,t[2]=(a*i-r*s)*f,t[3]=d*f,t[4]=(u*n-r*l)*f,t[5]=(-a*n+r*o)*f,t[6]=p*f,t[7]=(-c*n+i*l)*f,t[8]=(s*n-i*o)*f,t):null}function a(t){const e=t[0],n=t[1],i=t[2],r=t[3],o=t[4],s=t[5],a=t[6],l=t[7],c=t[8];return e*(c*o-s*l)+n*(-c*r+s*a)+i*(l*r-o*a)}function l(t,e,n){const i=e[0],r=e[1],o=e[2],s=e[3],a=e[4],l=e[5],c=e[6],u=e[7],h=e[8],d=n[0],p=n[1],f=n[2],A=n[3],g=n[4],m=n[5],y=n[6],_=n[7],v=n[8];return t[0]=d*i+p*s+f*c,t[1]=d*r+p*a+f*u,t[2]=d*o+p*l+f*h,t[3]=A*i+g*s+m*c,t[4]=A*r+g*a+m*u,t[5]=A*o+g*l+m*h,t[6]=y*i+_*s+v*c,t[7]=y*r+_*a+v*u,t[8]=y*o+_*l+v*h,t}function c(t,e,n){const i=e[0],r=e[1],o=e[2],s=e[3],a=e[4],l=e[5],c=e[6],u=e[7],h=e[8],d=n[0],p=n[1];return t[0]=i,t[1]=r,t[2]=o,t[3]=s,t[4]=a,t[5]=l,t[6]=d*i+p*s+c,t[7]=d*r+p*a+u,t[8]=d*o+p*l+h,t}function u(t,e,n){const i=e[0],r=e[1],o=e[2],s=e[3],a=e[4],l=e[5],c=e[6],u=e[7],h=e[8],d=Math.sin(n),p=Math.cos(n);return t[0]=p*i+d*s,t[1]=p*r+d*a,t[2]=p*o+d*l,t[3]=p*s-d*i,t[4]=p*a-d*r,t[5]=p*l-d*o,t[6]=c,t[7]=u,t[8]=h,t}function h(t,e,n){const i=n[0],r=n[1];return t[0]=i*e[0],t[1]=i*e[1],t[2]=i*e[2],t[3]=r*e[3],t[4]=r*e[4],t[5]=r*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function d(t,e){const n=e[0],i=e[1],r=e[2],o=e[3],s=n+n,a=i+i,l=r+r,c=n*s,u=i*s,h=i*a,d=r*s,p=r*a,f=r*l,A=o*s,g=o*a,m=o*l;return t[0]=1-h-f,t[3]=u-m,t[6]=d+g,t[1]=u+m,t[4]=1-c-f,t[7]=p-A,t[2]=d-g,t[5]=p+A,t[8]=1-c-h,t}},95572:(t,e,n)=>{"use strict";n.d(e,{$h:()=>g,B8:()=>o,I0:()=>A,IL:()=>f,Qr:()=>p,Tl:()=>l,Z8:()=>d,a4:()=>s,e$:()=>u,eL:()=>h,fN:()=>m,hs:()=>c,lw:()=>a,mg:()=>r,t5:()=>_,v3:()=>y});var i=n(27119);function r(t,e){if(t===e){const n=e[1],i=e[2],r=e[3],o=e[6],s=e[7],a=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[6]=e[9],t[7]=e[13],t[8]=i,t[9]=o,t[11]=e[14],t[12]=r,t[13]=s,t[14]=a}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}function o(t,e){const n=e[0],i=e[1],r=e[2],o=e[3],s=e[4],a=e[5],l=e[6],c=e[7],u=e[8],h=e[9],d=e[10],p=e[11],f=e[12],A=e[13],g=e[14],m=e[15],y=n*a-i*s,_=n*l-r*s,v=n*c-o*s,b=i*l-r*a,x=i*c-o*a,w=r*c-o*l,E=u*A-h*f,C=u*g-d*f,T=u*m-p*f,S=h*g-d*A,P=h*m-p*A,M=d*m-p*g;let I=y*M-_*P+v*S+b*T-x*C+w*E;return I?(I=1/I,t[0]=(a*M-l*P+c*S)*I,t[1]=(r*P-i*M-o*S)*I,t[2]=(A*w-g*x+m*b)*I,t[3]=(d*x-h*w-p*b)*I,t[4]=(l*T-s*M-c*C)*I,t[5]=(n*M-r*T+o*C)*I,t[6]=(g*v-f*w-m*_)*I,t[7]=(u*w-d*v+p*_)*I,t[8]=(s*P-a*T+c*E)*I,t[9]=(i*T-n*P-o*E)*I,t[10]=(f*x-A*v+m*y)*I,t[11]=(h*v-u*x-p*y)*I,t[12]=(a*C-s*S-l*E)*I,t[13]=(n*S-i*C+r*E)*I,t[14]=(A*_-f*b-g*y)*I,t[15]=(u*b-h*_+d*y)*I,t):null}function s(t){const e=t[0],n=t[1],i=t[2],r=t[3],o=t[4],s=t[5],a=t[6],l=t[7],c=t[8],u=t[9],h=t[10],d=t[11],p=t[12],f=t[13],A=t[14],g=e*s-n*o,m=e*a-i*o,y=n*a-i*s,_=c*f-u*p,v=c*A-h*p,b=u*A-h*f;return l*(e*b-n*v+i*_)-r*(o*b-s*v+a*_)+t[15]*(c*y-u*m+h*g)-d*(p*y-f*m+A*g)}function a(t,e,n){const i=e[0],r=e[1],o=e[2],s=e[3],a=e[4],l=e[5],c=e[6],u=e[7],h=e[8],d=e[9],p=e[10],f=e[11],A=e[12],g=e[13],m=e[14],y=e[15];let _=n[0],v=n[1],b=n[2],x=n[3];return t[0]=_*i+v*a+b*h+x*A,t[1]=_*r+v*l+b*d+x*g,t[2]=_*o+v*c+b*p+x*m,t[3]=_*s+v*u+b*f+x*y,_=n[4],v=n[5],b=n[6],x=n[7],t[4]=_*i+v*a+b*h+x*A,t[5]=_*r+v*l+b*d+x*g,t[6]=_*o+v*c+b*p+x*m,t[7]=_*s+v*u+b*f+x*y,_=n[8],v=n[9],b=n[10],x=n[11],t[8]=_*i+v*a+b*h+x*A,t[9]=_*r+v*l+b*d+x*g,t[10]=_*o+v*c+b*p+x*m,t[11]=_*s+v*u+b*f+x*y,_=n[12],v=n[13],b=n[14],x=n[15],t[12]=_*i+v*a+b*h+x*A,t[13]=_*r+v*l+b*d+x*g,t[14]=_*o+v*c+b*p+x*m,t[15]=_*s+v*u+b*f+x*y,t}function l(t,e,n){const i=n[0],r=n[1],o=n[2];let s,a,l,c,u,h,d,p,f,A,g,m;return e===t?(t[12]=e[0]*i+e[4]*r+e[8]*o+e[12],t[13]=e[1]*i+e[5]*r+e[9]*o+e[13],t[14]=e[2]*i+e[6]*r+e[10]*o+e[14],t[15]=e[3]*i+e[7]*r+e[11]*o+e[15]):(s=e[0],a=e[1],l=e[2],c=e[3],u=e[4],h=e[5],d=e[6],p=e[7],f=e[8],A=e[9],g=e[10],m=e[11],t[0]=s,t[1]=a,t[2]=l,t[3]=c,t[4]=u,t[5]=h,t[6]=d,t[7]=p,t[8]=f,t[9]=A,t[10]=g,t[11]=m,t[12]=s*i+u*r+f*o+e[12],t[13]=a*i+h*r+A*o+e[13],t[14]=l*i+d*r+g*o+e[14],t[15]=c*i+p*r+m*o+e[15]),t}function c(t,e,n){const i=n[0],r=n[1],o=n[2];return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t[3]=e[3]*i,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*o,t[9]=e[9]*o,t[10]=e[10]*o,t[11]=e[11]*o,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function u(t,e,n,r){let o,s,a,l,c,u,h,d,p,f,A,g,m,y,_,v,b,x,w,E,C,T,S,P,M=r[0],I=r[1],B=r[2],R=Math.sqrt(M*M+I*I+B*B);return R<i.p8?null:(R=1/R,M*=R,I*=R,B*=R,s=Math.sin(n),o=Math.cos(n),a=1-o,l=e[0],c=e[1],u=e[2],h=e[3],d=e[4],p=e[5],f=e[6],A=e[7],g=e[8],m=e[9],y=e[10],_=e[11],v=M*M*a+o,b=I*M*a+B*s,x=B*M*a-I*s,w=M*I*a-B*s,E=I*I*a+o,C=B*I*a+M*s,T=M*B*a+I*s,S=I*B*a-M*s,P=B*B*a+o,t[0]=l*v+d*b+g*x,t[1]=c*v+p*b+m*x,t[2]=u*v+f*b+y*x,t[3]=h*v+A*b+_*x,t[4]=l*w+d*E+g*C,t[5]=c*w+p*E+m*C,t[6]=u*w+f*E+y*C,t[7]=h*w+A*E+_*C,t[8]=l*T+d*S+g*P,t[9]=c*T+p*S+m*P,t[10]=u*T+f*S+y*P,t[11]=h*T+A*S+_*P,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)}function h(t,e,n){const i=Math.sin(n),r=Math.cos(n),o=e[4],s=e[5],a=e[6],l=e[7],c=e[8],u=e[9],h=e[10],d=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=o*r+c*i,t[5]=s*r+u*i,t[6]=a*r+h*i,t[7]=l*r+d*i,t[8]=c*r-o*i,t[9]=u*r-s*i,t[10]=h*r-a*i,t[11]=d*r-l*i,t}function d(t,e,n){const i=Math.sin(n),r=Math.cos(n),o=e[0],s=e[1],a=e[2],l=e[3],c=e[8],u=e[9],h=e[10],d=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*r-c*i,t[1]=s*r-u*i,t[2]=a*r-h*i,t[3]=l*r-d*i,t[8]=o*i+c*r,t[9]=s*i+u*r,t[10]=a*i+h*r,t[11]=l*i+d*r,t}function p(t,e,n){const i=Math.sin(n),r=Math.cos(n),o=e[0],s=e[1],a=e[2],l=e[3],c=e[4],u=e[5],h=e[6],d=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*r+c*i,t[1]=s*r+u*i,t[2]=a*r+h*i,t[3]=l*r+d*i,t[4]=c*r-o*i,t[5]=u*r-s*i,t[6]=h*r-a*i,t[7]=d*r-l*i,t}function f(t,e){const n=e[0],i=e[1],r=e[2],o=e[4],s=e[5],a=e[6],l=e[8],c=e[9],u=e[10];return t[0]=Math.sqrt(n*n+i*i+r*r),t[1]=Math.sqrt(o*o+s*s+a*a),t[2]=Math.sqrt(l*l+c*c+u*u),t}function A(t,e){const n=e[0],i=e[1],r=e[2],o=e[3],s=n+n,a=i+i,l=r+r,c=n*s,u=i*s,h=i*a,d=r*s,p=r*a,f=r*l,A=o*s,g=o*a,m=o*l;return t[0]=1-h-f,t[1]=u+m,t[2]=d-g,t[3]=0,t[4]=u-m,t[5]=1-c-f,t[6]=p+A,t[7]=0,t[8]=d+g,t[9]=p-A,t[10]=1-c-h,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function g(t,e,n,i,r,o,s){const a=1/(n-e),l=1/(r-i),c=1/(o-s);return t[0]=2*o*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*o*l,t[6]=0,t[7]=0,t[8]=(n+e)*a,t[9]=(r+i)*l,t[10]=(s+o)*c,t[11]=-1,t[12]=0,t[13]=0,t[14]=s*o*2*c,t[15]=0,t}const m=function(t,e,n,i,r){const o=1/Math.tan(e/2);if(t[0]=o/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=r&&r!==1/0){const e=1/(i-r);t[10]=(r+i)*e,t[14]=2*r*i*e}else t[10]=-1,t[14]=-2*i;return t};const y=function(t,e,n,i,r,o,s){const a=1/(e-n),l=1/(i-r),c=1/(o-s);return t[0]=-2*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(e+n)*a,t[13]=(r+i)*l,t[14]=(s+o)*c,t[15]=1,t};function _(t,e,n,r){let o,s,a,l,c,u,h,d,p,f;const A=e[0],g=e[1],m=e[2],y=r[0],_=r[1],v=r[2],b=n[0],x=n[1],w=n[2];return Math.abs(A-b)<i.p8&&Math.abs(g-x)<i.p8&&Math.abs(m-w)<i.p8?function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}(t):(d=A-b,p=g-x,f=m-w,o=1/Math.sqrt(d*d+p*p+f*f),d*=o,p*=o,f*=o,s=_*f-v*p,a=v*d-y*f,l=y*p-_*d,o=Math.sqrt(s*s+a*a+l*l),o?(o=1/o,s*=o,a*=o,l*=o):(s=0,a=0,l=0),c=p*l-f*a,u=f*s-d*l,h=d*a-p*s,o=Math.sqrt(c*c+u*u+h*h),o?(o=1/o,c*=o,u*=o,h*=o):(c=0,u=0,h=0),t[0]=s,t[1]=c,t[2]=d,t[3]=0,t[4]=a,t[5]=u,t[6]=p,t[7]=0,t[8]=l,t[9]=h,t[10]=f,t[11]=0,t[12]=-(s*A+a*g+l*m),t[13]=-(c*A+u*g+h*m),t[14]=-(d*A+p*g+f*m),t[15]=1,t)}},28442:(t,e,n)=>{"use strict";n.d(e,{Cc:()=>s,WQ:()=>r,Z0:()=>u,ZF:()=>a,ei:()=>c,l0:()=>l,ze:()=>o});var i=n(27119);function r(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t}function o(t,e){return t[0]=-e[0],t[1]=-e[1],t}function s(t,e,n,i){const r=e[0],o=e[1];return t[0]=r+i*(n[0]-r),t[1]=o+i*(n[1]-o),t}function a(t,e,n){const i=e[0],r=e[1];return t[0]=n[0]*i+n[2]*r,t[1]=n[1]*i+n[3]*r,t}function l(t,e,n){const i=e[0],r=e[1];return t[0]=n[0]*i+n[2]*r+n[4],t[1]=n[1]*i+n[3]*r+n[5],t}function c(t,e,n){const i=e[0],r=e[1];return t[0]=n[0]*i+n[3]*r+n[6],t[1]=n[1]*i+n[4]*r+n[7],t}function u(t,e,n){const i=e[0],r=e[1];return t[0]=n[0]*i+n[4]*r+n[12],t[1]=n[1]*i+n[5]*r+n[13],t}!function(){const t=function(){const t=new i.tb(2);return i.tb!=Float32Array&&(t[0]=0,t[1]=0),t}()}()},98953:(t,e,n)=>{"use strict";n.d(e,{$A:()=>u,Bw:()=>o,Cc:()=>h,Il:()=>v,Om:()=>c,S8:()=>l,Z0:()=>d,Z8:()=>g,eL:()=>A,ei:()=>p,fA:()=>s,g7:()=>y,gL:()=>f,jb:()=>_,uE:()=>b,vt:()=>r,x6:()=>m,ze:()=>a});var i=n(27119);function r(){const t=new i.tb(3);return i.tb!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function o(t){const e=t[0],n=t[1],i=t[2];return Math.sqrt(e*e+n*n+i*i)}function s(t,e,n){const r=new i.tb(3);return r[0]=t,r[1]=e,r[2]=n,r}function a(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t}function l(t,e){const n=e[0],i=e[1],r=e[2];let o=n*n+i*i+r*r;return o>0&&(o=1/Math.sqrt(o)),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o,t}function c(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function u(t,e,n){const i=e[0],r=e[1],o=e[2],s=n[0],a=n[1],l=n[2];return t[0]=r*l-o*a,t[1]=o*s-i*l,t[2]=i*a-r*s,t}function h(t,e,n,i){const r=e[0],o=e[1],s=e[2];return t[0]=r+i*(n[0]-r),t[1]=o+i*(n[1]-o),t[2]=s+i*(n[2]-s),t}function d(t,e,n){const i=e[0],r=e[1],o=e[2];let s=n[3]*i+n[7]*r+n[11]*o+n[15];return s=s||1,t[0]=(n[0]*i+n[4]*r+n[8]*o+n[12])/s,t[1]=(n[1]*i+n[5]*r+n[9]*o+n[13])/s,t[2]=(n[2]*i+n[6]*r+n[10]*o+n[14])/s,t}function p(t,e,n){const i=e[0],r=e[1],o=e[2];return t[0]=i*n[0]+r*n[3]+o*n[6],t[1]=i*n[1]+r*n[4]+o*n[7],t[2]=i*n[2]+r*n[5]+o*n[8],t}function f(t,e,n){const i=n[0],r=n[1],o=n[2],s=n[3],a=e[0],l=e[1],c=e[2];let u=r*c-o*l,h=o*a-i*c,d=i*l-r*a,p=r*d-o*h,f=o*u-i*d,A=i*h-r*u;const g=2*s;return u*=g,h*=g,d*=g,p*=2,f*=2,A*=2,t[0]=a+u+p,t[1]=l+h+f,t[2]=c+d+A,t}function A(t,e,n,i){const r=[],o=[];return r[0]=e[0]-n[0],r[1]=e[1]-n[1],r[2]=e[2]-n[2],o[0]=r[0],o[1]=r[1]*Math.cos(i)-r[2]*Math.sin(i),o[2]=r[1]*Math.sin(i)+r[2]*Math.cos(i),t[0]=o[0]+n[0],t[1]=o[1]+n[1],t[2]=o[2]+n[2],t}function g(t,e,n,i){const r=[],o=[];return r[0]=e[0]-n[0],r[1]=e[1]-n[1],r[2]=e[2]-n[2],o[0]=r[2]*Math.sin(i)+r[0]*Math.cos(i),o[1]=r[1],o[2]=r[2]*Math.cos(i)-r[0]*Math.sin(i),t[0]=o[0]+n[0],t[1]=o[1]+n[1],t[2]=o[2]+n[2],t}function m(t,e,n,i){const r=[],o=[];return r[0]=e[0]-n[0],r[1]=e[1]-n[1],r[2]=e[2]-n[2],o[0]=r[0]*Math.cos(i)-r[1]*Math.sin(i),o[1]=r[0]*Math.sin(i)+r[1]*Math.cos(i),o[2]=r[2],t[0]=o[0]+n[0],t[1]=o[1]+n[1],t[2]=o[2]+n[2],t}function y(t,e){const n=t[0],i=t[1],r=t[2],o=e[0],s=e[1],a=e[2],l=Math.sqrt((n*n+i*i+r*r)*(o*o+s*s+a*a)),u=l&&c(t,e)/l;return Math.acos(Math.min(Math.max(u,-1),1))}const _=function(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t},v=o,b=function(t){const e=t[0],n=t[1],i=t[2];return e*e+n*n+i*i};!function(){const t=r()}()},7964:(t,e,n)=>{"use strict";n.d(e,{Bw:()=>u,C:()=>s,Cc:()=>f,Om:()=>p,S8:()=>d,WQ:()=>l,Z0:()=>A,fA:()=>o,gL:()=>g,hZ:()=>a,hs:()=>c,m3:()=>h,o8:()=>r,t2:()=>m});var i=n(27119);function r(t){const e=new i.tb(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function o(t,e,n,r){const o=new i.tb(4);return o[0]=t,o[1]=e,o[2]=n,o[3]=r,o}function s(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function a(t,e,n,i,r){return t[0]=e,t[1]=n,t[2]=i,t[3]=r,t}function l(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t}function c(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t}function u(t){const e=t[0],n=t[1],i=t[2],r=t[3];return Math.sqrt(e*e+n*n+i*i+r*r)}function h(t){const e=t[0],n=t[1],i=t[2],r=t[3];return e*e+n*n+i*i+r*r}function d(t,e){const n=e[0],i=e[1],r=e[2],o=e[3];let s=n*n+i*i+r*r+o*o;return s>0&&(s=1/Math.sqrt(s)),t[0]=n*s,t[1]=i*s,t[2]=r*s,t[3]=o*s,t}function p(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}function f(t,e,n,i){const r=e[0],o=e[1],s=e[2],a=e[3];return t[0]=r+i*(n[0]-r),t[1]=o+i*(n[1]-o),t[2]=s+i*(n[2]-s),t[3]=a+i*(n[3]-a),t}function A(t,e,n){const i=e[0],r=e[1],o=e[2],s=e[3];return t[0]=n[0]*i+n[4]*r+n[8]*o+n[12]*s,t[1]=n[1]*i+n[5]*r+n[9]*o+n[13]*s,t[2]=n[2]*i+n[6]*r+n[10]*o+n[14]*s,t[3]=n[3]*i+n[7]*r+n[11]*o+n[15]*s,t}function g(t,e,n){const i=e[0],r=e[1],o=e[2],s=n[0],a=n[1],l=n[2],c=n[3],u=c*i+a*o-l*r,h=c*r+l*i-s*o,d=c*o+s*r-a*i,p=-s*i-a*r-l*o;return t[0]=u*c+p*-s+h*-l-d*-a,t[1]=h*c+p*-a+d*-s-u*-l,t[2]=d*c+p*-l+u*-a-h*-s,t[3]=e[3],t}function m(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]}!function(){const t=function(){const t=new i.tb(4);return i.tb!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}()}()},84584:(t,e,n)=>{"use strict";function i(t,e){if(!t)throw new Error(`math.gl assertion ${e}`)}n.d(e,{v:()=>i})},25195:(t,e,n)=>{"use strict";n.d(e,{$W:()=>o,Cc:()=>d,Fl:()=>s,aI:()=>p,cy:()=>a,eh:()=>l,qE:()=>h,uj:()=>u,xW:()=>c});const i=1/Math.PI*180,r=1/180*Math.PI;globalThis.mathgl=globalThis.mathgl||{config:{EPSILON:1e-12,debug:!1,precision:4,printTypes:!1,printDegrees:!1,printRowMajor:!0,_cartographicRadians:!1}};const o=globalThis.mathgl.config;function s(t){let{precision:e=o.precision}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t=function(t){return Math.round(t/o.EPSILON)*o.EPSILON}(t),`${parseFloat(t.toPrecision(e))}`}function a(t){return Array.isArray(t)||ArrayBuffer.isView(t)&&!(t instanceof DataView)}function l(t){return function(t,e){return f(t,(t=>t*r),e)}(t)}function c(t){return u(t)}function u(t,e){return f(t,(t=>t*i),e)}function h(t,e,n){return f(t,(t=>Math.max(e,Math.min(n,t))))}function d(t,e,n){return a(t)?t.map(((t,i)=>d(t,e[i],n))):n*e+(1-n)*t}function p(t,e,n){const i=o.EPSILON;n&&(o.EPSILON=n);try{if(t===e)return!0;if(a(t)&&a(e)){if(t.length!==e.length)return!1;for(let n=0;n<t.length;++n)if(!p(t[n],e[n]))return!1;return!0}return t&&t.equals?t.equals(e):e&&e.equals?e.equals(t):"number"===typeof t&&"number"===typeof e&&Math.abs(t-e)<=o.EPSILON*Math.max(1,Math.abs(t),Math.abs(e))}finally{o.EPSILON=i}}function f(t,e,n){if(a(t)){const i=t;n=n||function(t){return t.clone?t.clone():new Array(t.length)}(i);for(let r=0;r<n.length&&r<i.length;++r){const i="number"===typeof t?t:t[r];n[r]=e(i,r,n)}return n}return e(t)}},24879:(t,e,n)=>{"use strict";function i(t,e,n){const i=e[0],r=e[1],o=n[3]*i+n[7]*r||1;return t[0]=(n[0]*i+n[4]*r)/o,t[1]=(n[1]*i+n[5]*r)/o,t}function r(t,e,n){const i=e[0],r=e[1],o=e[2],s=n[3]*i+n[7]*r+n[11]*o||1;return t[0]=(n[0]*i+n[4]*r+n[8]*o)/s,t[1]=(n[1]*i+n[5]*r+n[9]*o)/s,t[2]=(n[2]*i+n[6]*r+n[10]*o)/s,t}function o(t,e,n){const i=e[0],r=e[1];return t[0]=n[0]*i+n[2]*r,t[1]=n[1]*i+n[3]*r,t[2]=e[2],t}function s(t,e,n){const i=e[0],r=e[1];return t[0]=n[0]*i+n[2]*r,t[1]=n[1]*i+n[3]*r,t[2]=e[2],t[3]=e[3],t}function a(t,e,n){const i=e[0],r=e[1],o=e[2];return t[0]=n[0]*i+n[3]*r+n[6]*o,t[1]=n[1]*i+n[4]*r+n[7]*o,t[2]=n[2]*i+n[5]*r+n[8]*o,t[3]=e[3],t}n.d(e,{B$:()=>i,Cg:()=>s,J4:()=>o,cL:()=>r,vE:()=>a})},11728:(t,e,n)=>{"use strict";n.d(e,{B$:()=>s,IU:()=>r,Ix:()=>i,Pq:()=>o});const i=.1,r=1e-12,o=1e-15,s=1e-20;Math.PI,Math.PI,Math.PI,Math.PI},72033:(t,e,n)=>{"use strict";n.d(e,{qk:()=>o,ws:()=>r});var i=n(25195);function r(t){if(!Number.isFinite(t))throw new Error(`Invalid number ${JSON.stringify(t)}`);return t}function o(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(i.$W.debug&&!function(t,e){if(t.length!==e)return!1;for(let n=0;n<t.length;++n)if(!Number.isFinite(t[n]))return!1;return!0}(t,e))throw new Error(`math.gl: ${n} some fields set to invalid numbers'`);return t}},820:(t,e,n)=>{"use strict";n.d(e,{dO:()=>c,ie:()=>p,R2:()=>G,CB:()=>R,Zc:()=>F,ZZ:()=>st});const i=-1,r=0,o=1;var s=n(15183);const a=new s.P,l=new s.P;class c{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[0,0,0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0],n=arguments.length>2?arguments[2]:void 0;n=n||a.copy(t).add(e).scale(.5),this.center=new s.P(n),this.halfDiagonal=new s.P(e).subtract(this.center),this.minimum=new s.P(t),this.maximum=new s.P(e)}clone(){return new c(this.minimum,this.maximum,this.center)}equals(t){return this===t||Boolean(t)&&this.minimum.equals(t.minimum)&&this.maximum.equals(t.maximum)}transform(t){return this.center.transformAsPoint(t),this.halfDiagonal.transform(t),this.minimum.transform(t),this.maximum.transform(t),this}intersectPlane(t){const{halfDiagonal:e}=this,n=l.from(t.normal),s=e.x*Math.abs(n.x)+e.y*Math.abs(n.y)+e.z*Math.abs(n.z),a=this.center.dot(n)+t.distance;return a-s>0?o:a+s<0?i:r}distanceTo(t){return Math.sqrt(this.distanceSquaredTo(t))}distanceSquaredTo(t){const e=a.from(t).subtract(this.center),{halfDiagonal:n}=this;let i,r=0;return i=Math.abs(e.x)-n.x,i>0&&(r+=i*i),i=Math.abs(e.y)-n.y,i>0&&(r+=i*i),i=Math.abs(e.z)-n.z,i>0&&(r+=i*i),r}}var u=n(95572);const h=new s.P,d=new s.P;class p{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[0,0,0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.radius=-0,this.center=new s.P,this.fromCenterRadius(t,e)}fromCenterRadius(t,e){return this.center.from(t),this.radius=e,this}fromCornerPoints(t,e){return e=h.from(e),this.center=(new s.P).from(t).add(e).scale(.5),this.radius=this.center.distance(e),this}equals(t){return this===t||Boolean(t)&&this.center.equals(t.center)&&this.radius===t.radius}clone(){return new p(this.center,this.radius)}union(t){const e=this.center,n=this.radius,i=t.center,r=t.radius,o=h.copy(i).subtract(e),s=o.magnitude();if(n>=s+r)return this.clone();if(r>=s+n)return t.clone();const a=.5*(n+s+r);return d.copy(o).scale((-n+a)/s).add(e),this.center.copy(d),this.radius=a,this}expand(t){const e=h.from(t).subtract(this.center).magnitude();return e>this.radius&&(this.radius=e),this}transform(t){this.center.transform(t);const e=u.IL(h,t);return this.radius=Math.max(e[0],Math.max(e[1],e[2]))*this.radius,this}distanceSquaredTo(t){const e=this.distanceTo(t);return e*e}distanceTo(t){const e=h.from(t).subtract(this.center);return Math.max(0,e.len()-this.radius)}intersectPlane(t){const e=this.center,n=this.radius,s=t.normal.dot(e)+t.distance;return s<-n?i:s<n?r:o}}var f=n(63869),A=n(68032);const g=new s.P,m=new s.P,y=new s.P,_=new s.P,v=new s.P,b=new s.P,x=new s.P,w=0,E=1,C=2,T=3,S=4,P=5,M=6,I=7,B=8;class R{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[0,0,0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0,0,0,0,0,0,0];this.center=(new s.P).from(t),this.halfAxes=new f.d(e)}get halfSize(){const t=this.halfAxes.getColumn(0),e=this.halfAxes.getColumn(1),n=this.halfAxes.getColumn(2);return[new s.P(t).len(),new s.P(e).len(),new s.P(n).len()]}get quaternion(){const t=this.halfAxes.getColumn(0),e=this.halfAxes.getColumn(1),n=this.halfAxes.getColumn(2),i=new s.P(t).normalize(),r=new s.P(e).normalize(),o=new s.P(n).normalize();return(new A.P).fromMatrix3(new f.d([...i,...r,...o]))}fromCenterHalfSizeQuaternion(t,e,n){const i=new A.P(n),r=(new f.d).fromQuaternion(i);return r[0]=r[0]*e[0],r[1]=r[1]*e[0],r[2]=r[2]*e[0],r[3]=r[3]*e[1],r[4]=r[4]*e[1],r[5]=r[5]*e[1],r[6]=r[6]*e[2],r[7]=r[7]*e[2],r[8]=r[8]*e[2],this.center=(new s.P).from(t),this.halfAxes=r,this}clone(){return new R(this.center,this.halfAxes)}equals(t){return this===t||Boolean(t)&&this.center.equals(t.center)&&this.halfAxes.equals(t.halfAxes)}getBoundingSphere(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new p;const e=this.halfAxes,n=e.getColumn(0,y),i=e.getColumn(1,_),r=e.getColumn(2,v),o=g.copy(n).add(i).add(r);return t.center.copy(this.center),t.radius=o.magnitude(),t}intersectPlane(t){const e=this.center,n=t.normal,s=this.halfAxes,a=n.x,l=n.y,c=n.z,u=Math.abs(a*s[w]+l*s[E]+c*s[C])+Math.abs(a*s[T]+l*s[S]+c*s[P])+Math.abs(a*s[M]+l*s[I]+c*s[B]),h=n.dot(e)+t.distance;return h<=-u?i:h>=u?o:r}distanceTo(t){return Math.sqrt(this.distanceSquaredTo(t))}distanceSquaredTo(t){const e=m.from(t).subtract(this.center),n=this.halfAxes,i=n.getColumn(0,y),r=n.getColumn(1,_),o=n.getColumn(2,v),s=i.magnitude(),a=r.magnitude(),l=o.magnitude();i.normalize(),r.normalize(),o.normalize();let c,u=0;return c=Math.abs(e.dot(i))-s,c>0&&(u+=c*c),c=Math.abs(e.dot(r))-a,c>0&&(u+=c*c),c=Math.abs(e.dot(o))-l,c>0&&(u+=c*c),u}computePlaneDistances(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[-0,-0],i=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY;const o=this.center,s=this.halfAxes,a=s.getColumn(0,y),l=s.getColumn(1,_),c=s.getColumn(2,v),u=b.copy(a).add(l).add(c).add(o),h=x.copy(u).subtract(t);let d=e.dot(h);return i=Math.min(d,i),r=Math.max(d,r),u.copy(o).add(a).add(l).subtract(c),h.copy(u).subtract(t),d=e.dot(h),i=Math.min(d,i),r=Math.max(d,r),u.copy(o).add(a).subtract(l).add(c),h.copy(u).subtract(t),d=e.dot(h),i=Math.min(d,i),r=Math.max(d,r),u.copy(o).add(a).subtract(l).subtract(c),h.copy(u).subtract(t),d=e.dot(h),i=Math.min(d,i),r=Math.max(d,r),o.copy(u).subtract(a).add(l).add(c),h.copy(u).subtract(t),d=e.dot(h),i=Math.min(d,i),r=Math.max(d,r),o.copy(u).subtract(a).add(l).subtract(c),h.copy(u).subtract(t),d=e.dot(h),i=Math.min(d,i),r=Math.max(d,r),o.copy(u).subtract(a).subtract(l).add(c),h.copy(u).subtract(t),d=e.dot(h),i=Math.min(d,i),r=Math.max(d,r),o.copy(u).subtract(a).subtract(l).subtract(c),h.copy(u).subtract(t),d=e.dot(h),i=Math.min(d,i),r=Math.max(d,r),n[0]=i,n[1]=r,n}transform(t){this.center.transformAsPoint(t);const e=this.halfAxes.getColumn(0,y);e.transformAsPoint(t);const n=this.halfAxes.getColumn(1,_);n.transformAsPoint(t);const i=this.halfAxes.getColumn(2,v);return i.transformAsPoint(t),this.halfAxes=new f.d([...e,...n,...i]),this}getTransform(){throw new Error("not implemented")}}var L=n(84584),O=n(25195);const D=new s.P,k=new s.P;class F{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[0,0,1],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.normal=new s.P,this.distance=-0,this.fromNormalDistance(t,e)}fromNormalDistance(t,e){return(0,L.v)(Number.isFinite(e)),this.normal.from(t).normalize(),this.distance=e,this}fromPointNormal(t,e){t=D.from(t),this.normal.from(e).normalize();const n=-this.normal.dot(t);return this.distance=n,this}fromCoefficients(t,e,n,i){return this.normal.set(t,e,n),(0,L.v)((0,O.aI)(this.normal.len(),1)),this.distance=i,this}clone(){return new F(this.normal,this.distance)}equals(t){return(0,O.aI)(this.distance,t.distance)&&(0,O.aI)(this.normal,t.normal)}getPointDistance(t){return this.normal.dot(t)+this.distance}transform(t){const e=k.copy(this.normal).transformAsVector(t).normalize(),n=this.normal.scale(-this.distance).transform(t);return this.fromPointNormal(n,e)}projectPointOntoPlane(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];const n=D.from(t),i=this.getPointDistance(n),r=k.copy(this.normal).scale(i);return n.subtract(r).to(e)}}const N=[new s.P([1,0,0]),new s.P([0,1,0]),new s.P([0,0,1])],z=new s.P,U=new s.P;class G{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.planes=t}fromBoundingSphere(t){this.planes.length=2*N.length;const e=t.center,n=t.radius;let i=0;for(const r of N){let t=this.planes[i],o=this.planes[i+1];t||(t=this.planes[i]=new F),o||(o=this.planes[i+1]=new F);const s=z.copy(r).scale(-n).add(e);t.fromPointNormal(s,r);const a=z.copy(r).scale(n).add(e),l=U.copy(r).negate();o.fromPointNormal(a,l),i+=2}return this}computeVisibility(t){let e=o;for(const n of this.planes){switch(t.intersectPlane(n)){case i:return i;case r:e=r}}return e}computeVisibilityWithPlaneMask(t,e){if((0,L.v)(Number.isFinite(e),"parentPlaneMask is required."),e===G.MASK_OUTSIDE||e===G.MASK_INSIDE)return e;let n=G.MASK_INSIDE;const o=this.planes;for(let s=0;s<this.planes.length;++s){const a=s<31?1<<s:0;if(s<31&&0===(e&a))continue;const l=o[s],c=t.intersectPlane(l);if(c===i)return G.MASK_OUTSIDE;c===r&&(n|=a)}return n}}G.MASK_OUTSIDE=4294967295,G.MASK_INSIDE=0,G.MASK_INDETERMINATE=2147483647;new s.P,new s.P,new s.P,new s.P,new s.P;new s.P,new s.P,new s.P,new s.P,new s.P,new s.P,new s.P,new s.P,new s.P,new s.P,new s.P,new s.P;var V=n(11728);const j=new f.d,H=new f.d,W=new f.d,q=new f.d,Z=new f.d;function X(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=V.B$;let i=0,r=0;const o=H,s=W;o.identity(),s.copy(t);const a=n*function(t){let e=0;for(let n=0;n<9;++n){const i=t[n];e+=i*i}return Math.sqrt(e)}(s);for(;r<10&&J(s)>a;)Y(s,q),Z.copy(q).transpose(),s.multiplyRight(q),s.multiplyLeft(Z),o.multiplyRight(q),++i>2&&(++r,i=0);return e.unitary=o.toTarget(e.unitary),e.diagonal=s.toTarget(e.diagonal),e}const K=[1,0,0],Q=[2,2,1];function J(t){let e=0;for(let n=0;n<3;++n){const i=t[j.getElementIndex(Q[n],K[n])];e+=2*i*i}return Math.sqrt(e)}function Y(t,e){const n=V.Pq;let i=0,r=1;for(let c=0;c<3;++c){const e=Math.abs(t[j.getElementIndex(Q[c],K[c])]);e>i&&(r=c,i=e)}const o=K[r],s=Q[r];let a=1,l=0;if(Math.abs(t[j.getElementIndex(s,o)])>n){const e=(t[j.getElementIndex(s,s)]-t[j.getElementIndex(o,o)])/2/t[j.getElementIndex(s,o)];let n;n=e<0?-1/(-e+Math.sqrt(1+e*e)):1/(e+Math.sqrt(1+e*e)),a=1/Math.sqrt(1+n*n),l=n*a}return f.d.IDENTITY.to(e),e[j.getElementIndex(o,o)]=e[j.getElementIndex(s,s)]=a,e[j.getElementIndex(s,o)]=l,e[j.getElementIndex(o,s)]=-l,e}const $=new s.P,tt=new s.P,et=new s.P,nt=new s.P,it=new s.P,rt=new f.d,ot={diagonal:new f.d,unitary:new f.d};function st(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new R;if(!t||0===t.length)return e.halfAxes=new f.d([0,0,0,0,0,0,0,0,0]),e.center=new s.P,e;const n=t.length,i=new s.P(0,0,0);for(const s of t)i.add(s);const r=1/n;i.multiplyByScalar(r);let o=0,a=0,l=0,c=0,u=0,h=0;for(const s of t){const t=$.copy(s).subtract(i);o+=t.x*t.x,a+=t.x*t.y,l+=t.x*t.z,c+=t.y*t.y,u+=t.y*t.z,h+=t.z*t.z}o*=r,a*=r,l*=r,c*=r,u*=r,h*=r;const d=rt;d[0]=o,d[1]=a,d[2]=l,d[3]=a,d[4]=c,d[5]=u,d[6]=l,d[7]=u,d[8]=h;const{unitary:p}=X(d,ot),A=e.halfAxes.copy(p);let g=A.getColumn(0,et),m=A.getColumn(1,nt),y=A.getColumn(2,it),_=-Number.MAX_VALUE,v=-Number.MAX_VALUE,b=-Number.MAX_VALUE,x=Number.MAX_VALUE,w=Number.MAX_VALUE,E=Number.MAX_VALUE;for(const s of t)$.copy(s),_=Math.max($.dot(g),_),v=Math.max($.dot(m),v),b=Math.max($.dot(y),b),x=Math.min($.dot(g),x),w=Math.min($.dot(m),w),E=Math.min($.dot(y),E);g=g.multiplyByScalar(.5*(x+_)),m=m.multiplyByScalar(.5*(w+v)),y=y.multiplyByScalar(.5*(E+b)),e.center.copy(g).add(m).add(y);const C=tt.set(_-x,v-w,b-E).multiplyByScalar(.5),T=new f.d([C[0],0,0,0,C[1],0,0,0,C[2]]);return e.halfAxes.multiplyRight(T),e}},3348
vendor: 11,510 bytes, line 2
2:(t,e,n)=>{"use strict";n.d(e,{rJ:()=>i,wk:()=>U,Eg:()=>X,Mk:()=>F,Iy:()=>Z,hY:()=>a,IC:()=>s,UD:()=>r});const i={CLOCKWISE:1,COUNTER_CLOCKWISE:-1};function r(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Math.sign(s(t,e))}(t,n);return i!==e&&(function(t,e){const{start:n=0,end:i=t.length,size:r=2}=e,o=(i-n)/r,s=Math.floor(o/2);for(let a=0;a<s;++a){const e=n+a*r,i=n+(o-1-a)*r;for(let n=0;n<r;++n){const r=t[e+n];t[e+n]=t[i+n],t[i+n]=r}}}(t,n),!0)}const o={x:0,y:1,z:2};function s(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{start:n=0,end:i=t.length,plane:r="xy"}=e,s=e.size||2;let a=0;const l=o[r[0]],c=o[r[1]];for(let o=n,u=i-s;o<i;o+=s)a+=(t[o+l]-t[u+l])*(t[o+c]+t[u+c]),u=o;return a/2}function a(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2,i=arguments.length>3?arguments[3]:void 0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"xy";const o=e&&e.length,s=o?e[0]*n:t.length;let a=l(t,0,s,n,!0,i&&i[0],r);const c=[];if(!a||a.next===a.prev)return c;let h,d,p,f,m,y,v;if(o&&(a=function(t,e,n,i,r,o){const s=[];let a,c,u,h,d;for(a=0,c=e.length;a<c;a++)u=e[a]*i,h=a<c-1?e[a+1]*i:t.length,d=l(t,u,h,i,!1,r&&r[a+1],o),d===d.next&&(d.steiner=!0),s.push(_(d));for(s.sort(A),a=0;a<s.length;a++)n=g(s[a],n);return n}(t,e,a,n,i,r)),t.length>80*n){f=d=t[0],m=p=t[1];for(let e=n;e<s;e+=n)y=t[e],v=t[e+1],y<f&&(f=y),v<m&&(m=v),y>d&&(d=y),v>p&&(p=v);h=Math.max(d-f,p-m),h=0!==h?32767/h:0}return u(a,c,n,f,m,h,0),c}function l(t,e,n,i,r,a,l){let c,u;void 0===a&&(a=s(t,{start:e,end:n,size:i,plane:l}));let h=o[l[0]],d=o[l[1]];if(r===a<0)for(c=e;c<n;c+=i)u=M(c,t[c+h],t[c+d],u);else for(c=n-i;c>=e;c-=i)u=M(c,t[c+h],t[c+d],u);return u&&w(u,u.next)&&(I(u),u=u.next),u}function c(t,e){if(!t)return t;e||(e=t);let n,i=t;do{if(n=!1,i.steiner||!w(i,i.next)&&0!==x(i.prev,i,i.next))i=i.next;else{if(I(i),i=e=i.prev,i===i.next)break;n=!0}}while(n||i!==e);return e}function u(t,e,n,i,r,o,s){if(!t)return;!s&&o&&function(t,e,n,i){let r=t;do{0===r.z&&(r.z=y(r.x,r.y,e,n,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,function(t){let e,n,i,r,o,s,a,l,c=1;do{for(r=t,t=null,l=null,i=0;r;){for(i++,s=r,o=0,n=0;n<c&&(o++,s=s.nextZ,s);n++);for(a=c;o>0||a>0&&s;)0!==o&&(0===a||!s||r.z<=s.z)?(e=r,r=r.nextZ,o--):(e=s,s=s.nextZ,a--),l?l.nextZ=e:t=e,e.prevZ=l,l=e;r=s}l.nextZ=null,c*=2}while(i>1)}(r)}(t,i,r,o);let a,l,A=t;for(;t.prev!==t.next;)if(a=t.prev,l=t.next,o?d(t,i,r,o):h(t))e.push(a.i/n|0),e.push(t.i/n|0),e.push(l.i/n|0),I(t),t=l.next,A=l.next;else if((t=l)===A){s?1===s?u(t=p(c(t),e,n),e,n,i,r,o,2):2===s&&f(t,e,n,i,r,o):u(c(t),e,n,i,r,o,1);break}}function h(t){const e=t.prev,n=t,i=t.next;if(x(e,n,i)>=0)return!1;const r=e.x,o=n.x,s=i.x,a=e.y,l=n.y,c=i.y,u=r<o?r<s?r:s:o<s?o:s,h=a<l?a<c?a:c:l<c?l:c,d=r>o?r>s?r:s:o>s?o:s,p=a>l?a>c?a:c:l>c?l:c;let f=i.next;for(;f!==e;){if(f.x>=u&&f.x<=d&&f.y>=h&&f.y<=p&&v(r,a,o,l,s,c,f.x,f.y)&&x(f.prev,f,f.next)>=0)return!1;f=f.next}return!0}function d(t,e,n,i){const r=t.prev,o=t,s=t.next;if(x(r,o,s)>=0)return!1;const a=r.x,l=o.x,c=s.x,u=r.y,h=o.y,d=s.y,p=a<l?a<c?a:c:l<c?l:c,f=u<h?u<d?u:d:h<d?h:d,A=a>l?a>c?a:c:l>c?l:c,g=u>h?u>d?u:d:h>d?h:d,m=y(p,f,e,n,i),_=y(A,g,e,n,i);let b=t.prevZ,w=t.nextZ;for(;b&&b.z>=m&&w&&w.z<=_;){if(b.x>=p&&b.x<=A&&b.y>=f&&b.y<=g&&b!==r&&b!==s&&v(a,u,l,h,c,d,b.x,b.y)&&x(b.prev,b,b.next)>=0)return!1;if(b=b.prevZ,w.x>=p&&w.x<=A&&w.y>=f&&w.y<=g&&w!==r&&w!==s&&v(a,u,l,h,c,d,w.x,w.y)&&x(w.prev,w,w.next)>=0)return!1;w=w.nextZ}for(;b&&b.z>=m;){if(b.x>=p&&b.x<=A&&b.y>=f&&b.y<=g&&b!==r&&b!==s&&v(a,u,l,h,c,d,b.x,b.y)&&x(b.prev,b,b.next)>=0)return!1;b=b.prevZ}for(;w&&w.z<=_;){if(w.x>=p&&w.x<=A&&w.y>=f&&w.y<=g&&w!==r&&w!==s&&v(a,u,l,h,c,d,w.x,w.y)&&x(w.prev,w,w.next)>=0)return!1;w=w.nextZ}return!0}function p(t,e,n){let i=t;do{const r=i.prev,o=i.next.next;!w(r,o)&&E(r,i,i.next,o)&&S(r,o)&&S(o,r)&&(e.push(r.i/n|0),e.push(i.i/n|0),e.push(o.i/n|0),I(i),I(i.next),i=t=o),i=i.next}while(i!==t);return c(i)}function f(t,e,n,i,r,o){let s=t;do{let t=s.next.next;for(;t!==s.prev;){if(s.i!==t.i&&b(s,t)){let a=P(s,t);return s=c(s,s.next),a=c(a,a.next),u(s,e,n,i,r,o,0),void u(a,e,n,i,r,o,0)}t=t.next}s=s.next}while(s!==t)}function A(t,e){return t.x-e.x}function g(t,e){const n=function(t,e){let n=e;const i=t.x,r=t.y;let o,s=-1/0;do{if(r<=n.y&&r>=n.next.y&&n.next.y!==n.y){const t=n.x+(r-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(t<=i&&t>s&&(s=t,o=n.x<n.next.x?n:n.next,t===i))return o}n=n.next}while(n!==e);if(!o)return null;const a=o,l=o.x,c=o.y;let u,h=1/0;n=o;do{i>=n.x&&n.x>=l&&i!==n.x&&v(r<c?i:s,r,l,c,r<c?s:i,r,n.x,n.y)&&(u=Math.abs(r-n.y)/(i-n.x),S(n,t)&&(u<h||u===h&&(n.x>o.x||n.x===o.x&&m(o,n)))&&(o=n,h=u)),n=n.next}while(n!==a);return o}(t,e);if(!n)return e;const i=P(n,t);return c(i,i.next),c(n,n.next)}function m(t,e){return x(t.prev,t,e.prev)<0&&x(e.next,t,t.next)<0}function y(t,e,n,i,r){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-n)*r|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-i)*r|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function _(t){let e=t,n=t;do{(e.x<n.x||e.x===n.x&&e.y<n.y)&&(n=e),e=e.next}while(e!==t);return n}function v(t,e,n,i,r,o,s,a){return(r-s)*(e-a)>=(t-s)*(o-a)&&(t-s)*(i-a)>=(n-s)*(e-a)&&(n-s)*(o-a)>=(r-s)*(i-a)}function b(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){let n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&E(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}(t,e)&&(S(t,e)&&S(e,t)&&function(t,e){let n=t,i=!1;const r=(t.x+e.x)/2,o=(t.y+e.y)/2;do{n.y>o!==n.next.y>o&&n.next.y!==n.y&&r<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next}while(n!==t);return i}(t,e)&&(x(t.prev,t,e.prev)||x(t,e.prev,e))||w(t,e)&&x(t.prev,t,t.next)>0&&x(e.prev,e,e.next)>0)}function x(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function w(t,e){return t.x===e.x&&t.y===e.y}function E(t,e,n,i){const r=T(x(t,e,n)),o=T(x(t,e,i)),s=T(x(n,i,t)),a=T(x(n,i,e));return r!==o&&s!==a||(!(0!==r||!C(t,n,e))||(!(0!==o||!C(t,i,e))||(!(0!==s||!C(n,t,i))||!(0!==a||!C(n,e,i)))))}function C(t,e,n){return e.x<=Math.max(t.x,n.x)&&e.x>=Math.min(t.x,n.x)&&e.y<=Math.max(t.y,n.y)&&e.y>=Math.min(t.y,n.y)}function T(t){return t>0?1:t<0?-1:0}function S(t,e){return x(t.prev,t,t.next)<0?x(t,e,t.next)>=0&&x(t,t.prev,e)>=0:x(t,e,t.prev)<0||x(t,t.next,e)<0}function P(t,e){const n=new B(t.i,t.x,t.y),i=new B(e.i,e.x,e.y),r=t.next,o=e.prev;return t.next=e,e.prev=t,n.next=r,r.prev=n,i.next=n,n.prev=i,o.next=i,i.prev=o,i}function M(t,e,n,i){const r=new B(t,e,n);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function I(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}class B{constructor(t,e,n){this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1,this.i=t,this.x=e,this.y=n}}function R(t,e,n,i){let r,o,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];if(8&n)r=(i[3]-t[1])/(e[1]-t[1]),o=3;else if(4&n)r=(i[1]-t[1])/(e[1]-t[1]),o=1;else if(2&n)r=(i[2]-t[0])/(e[0]-t[0]),o=2;else{if(!(1&n))return null;r=(i[0]-t[0])/(e[0]-t[0]),o=0}for(let a=0;a<t.length;a++)s[a]=(1&o)===a?i[o]:r*(e[a]-t[a])+t[a];return s}function L(t,e){let n=0;return t[0]<e[0]?n|=1:t[0]>e[2]&&(n|=2),t[1]<e[1]?n|=4:t[1]>e[3]&&(n|=8),n}function O(t,e){const n=e.length,i=t.length;if(i>0){let r=!0;for(let o=0;o<n;o++)if(t[i-n+o]!==e[o]){r=!1;break}if(r)return!1}for(let r=0;r<n;r++)t[i+r]=e[r];return!0}function D(t,e){const n=e.length;for(let i=0;i<n;i++)t[i]=e[i]}function k(t,e,n,i){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];const o=i+e*n;for(let s=0;s<n;s++)r[s]=t[o+s];return r}function F(t,e){const{size:n=2,broken:i=!1,gridResolution:r=10,gridOffset:o=[0,0],startIndex:s=0,endIndex:a=t.length}=e||{},l=(a-s)/n;let c=[];const u=[c],h=k(t,0,n,s);let d,p;const f=V(h,r,o,[]),A=[];O(c,h);for(let g=1;g<l;g++){for(d=k(t,g,n,s,d),p=L(d,f);p;){R(h,d,p,f,A);const t=L(A,f);t&&(R(h,A,t,f,A),p=t),O(c,A),D(h,A),j(f,r,p),i&&c.length>n&&(c=[],u.push(c),O(c,h)),p=L(d,f)}O(c,d),D(h,d)}return i?u:u[0]}const N=0,z=1;function U(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2?arguments[2]:void 0;if(!t.length)return[];const{size:i=2,gridResolution:r=10,gridOffset:o=[0,0],edgeTypes:s=!1}=n||{},a=[],l=[{pos:t,types:s?new Array(t.length/i).fill(z):null,holes:e||[]}],c=[[],[]];let u=[];for(;l.length;){const{pos:t,types:e,holes:n}=l.shift();H(t,i,n[0]||t.length,c),u=V(c[0],r,o,u);const h=L(c[1],u);if(h){let r=G(t,e,i,0,n[0]||t.length,u,h);const o={pos:r[0].pos,types:r[0].types,holes:[]},a={pos:r[1].pos,types:r[1].types,holes:[]};l.push(o,a);for(let l=0;l<n.length;l++)r=G(t,e,i,n[l],n[l+1]||t.length,u,h),r[0]&&(o.holes.push(o.pos.length),o.pos=W(o.pos,r[0].pos),s&&(o.types=W(o.types,r[0].types))),r[1]&&(a.holes.push(a.pos.length),a.pos=W(a.pos,r[1].pos),s&&(a.types=W(a.types,r[1].types)))}else{const i={positions:t};s&&(i.edgeTypes=e),n.length&&(i.holeIndices=n),a.push(i)}}return a}function G(t,e,n,i,r,o,s){const a=(r-i)/n,l=[],c=[],u=[],h=[],d=[];let p,f,A;const g=k(t,a-1,n,i);let m=Math.sign(8&s?g[1]-o[3]:g[0]-o[2]),y=e&&e[a-1],_=0,v=0;for(let b=0;b<a;b++)p=k(t,b,n,i,p),f=Math.sign(8&s?p[1]-o[3]:p[0]-o[2]),A=e&&e[i/n+b],f&&m&&m!==f&&(R(g,p,s,o,d),O(l,d)&&u.push(y),O(c,d)&&h.push(y)),f<=0?(O(l,p)&&u.push(A),_-=f):u.length&&(u[u.length-1]=N),f>=0?(O(c,p)&&h.push(A),v+=f):h.length&&(h[h.length-1]=N),D(g,p),m=f,y=A;return[_?{pos:l,types:e&&u}:null,v?{pos:c,types:e&&h}:null]}function V(t,e,n,i){const r=Math.floor((t[0]-n[0])/e)*e+n[0],o=Math.floor((t[1]-n[1])/e)*e+n[1];return i[0]=r,i[1]=o,i[2]=r+e,i[3]=o+e,i}function j(t,e,n){8&n?(t[1]+=e,t[3]+=e):4&n?(t[1]-=e,t[3]-=e):2&n?(t[0]+=e,t[2]+=e):1&n&&(t[0]-=e,t[2]-=e)}function H(t,e,n,i){let r=1/0,o=-1/0,s=1/0,a=-1/0;for(let l=0;l<n;l+=e){const e=t[l],n=t[l+1];r=e<r?e:r,o=e>o?e:o,s=n<s?n:s,a=n>a?n:a}return i[0][0]=r,i[0][1]=s,i[1][0]=o,i[1][1]=a,i}function W(t,e){for(let n=0;n<e.length;n++)t.push(e[n]);return t}const q=85.051129;function Z(t,e){const{size:n=2,startIndex:i=0,endIndex:r=t.length,normalize:o=!0}=e||{},s=t.slice(i,r);J(s,n,0,r-i);const a=F(s,{size:n,broken:!0,gridResolution:360,gridOffset:[-180,-180]});if(o)for(const l of a)Y(l,n);return a}function X(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2?arguments[2]:void 0;const{size:i=2,normalize:r=!0,edgeTypes:o=!1}=n||{};e=e||[];const s=[],a=[];let l=0,c=0;for(let h=0;h<=e.length;h++){const r=e[h]||t.length,o=c,u=K(t,i,l,r);for(let e=u;e<r;e++)s[c++]=t[e];for(let e=l;e<u;e++)s[c++]=t[e];J(s,i,o,c),Q(s,i,o,c,n?.maxLatitude),l=r,a[h]=c}a.pop();const u=U(s,a,{size:i,gridResolution:360,gridOffset:[-180,-180],edgeTypes:o});if(r)for(const h of u)Y(h.positions,i);return u}function K(t,e,n,i){let r=-1,o=-1;for(let s=n+1;s<i;s+=e){const e=Math.abs(t[s]);e>r&&(r=e,o=s-1)}return o}function Q(t,e,n,i){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:q;const o=t[n],s=t[i-e];if(Math.abs(o-s)>180){const i=k(t,0,e,n);i[0]+=360*Math.round((s-o)/360),O(t,i),i[1]=Math.sign(i[1])*r,O(t,i),i[0]=o,O(t,i)}}function J(t,e,n,i){let r,o=t[0];for(let s=n;s<i;s+=e){r=t[s];const e=r-o;(e>180||e<-180)&&(r-=360*Math.round(e/360)),t[s]=o=r}}function Y(t,e){let n;const i=t.length/e;for(let o=0;o<i&&(n=t[o*e],(n+180)%360===0);o++);const r=360*-Math.round(n/360);if(0!==r)for(let o=0;o<i;o++)t[o*e]+=r}},
vendor: 13,903 bytes, line 2
268945:(t,e,n)=>{"use strict";n.d(e,{dT:()=>C,Os:()=>P,Fe:()=>R,wZ:()=>M,gW:()=>O,nI:()=>E,fO:()=>x,om:()=>S,rY:()=>T,Gw:()=>v,CK:()=>F,xJ:()=>B,mY:()=>w,iV:()=>b,VJ:()=>I});var i=n(7964);function r(t,e){const n=i.Z0([],e,t);return i.hs(n,n,1/n[3]),n}function o(t,e){const n=t%e;return n<0?e+n:n}function s(t,e,n){return t<e?e:t>n?n:t}const a=Math.log2||function(t){return Math.log(t)*Math.LOG2E};var l=n(95572),c=n(98953),u=n(28442);function h(t,e){if(!t)throw new Error(e||"@math.gl/web-mercator: assertion failed.")}const d=Math.PI,p=d/4,f=d/180,A=180/d,g=512,m=4003e4,y=85.051129,_=1.5;function v(t){const[e,n]=t;h(Number.isFinite(e)),h(Number.isFinite(n)&&n>=-90&&n<=90,"invalid latitude");const i=n*f;return[g*(e*f+d)/(2*d),g*(d+Math.log(Math.tan(p+.5*i)))/(2*d)]}function b(t){const[e,n]=t,i=e/g*(2*d)-d,r=2*(Math.atan(Math.exp(n/g*(2*d)-d))-p);return[i*A,r*A]}function x(t){const{latitude:e}=t;h(Number.isFinite(e));const n=Math.cos(e*f);return a(m*n)-9}function w(t){const e=Math.cos(t*f);return g/m/e}function E(t){const{latitude:e,longitude:n,highPrecision:i=!1}=t;h(Number.isFinite(e)&&Number.isFinite(n));const r=g,o=Math.cos(e*f),s=r/360,a=s/o,l=r/m/o,c={unitsPerMeter:[l,l,l],metersPerUnit:[1/l,1/l,1/l],unitsPerDegree:[s,a,l],degreesPerUnit:[1/s,1/a,1/l]};if(i){const t=f*Math.tan(e*f)/o,n=s*t/2,i=r/m*t,u=i/a*l;c.unitsPerDegree2=[0,n,i],c.unitsPerMeter2=[u,0,u]}return c}function C(t,e){const[n,i,r]=t,[o,s,a]=e,{unitsPerMeter:l,unitsPerMeter2:c}=E({longitude:n,latitude:i,highPrecision:!0}),u=v(t);u[0]+=o*(l[0]+c[0]*s),u[1]+=s*(l[1]+c[1]*s);const h=b(u),d=(r||0)+(a||0);return Number.isFinite(r)||Number.isFinite(a)?[h[0],h[1],d]:h}function T(t){const{height:e,pitch:n,bearing:i,altitude:r,scale:o,center:s}=t,a=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];l.Tl(a,a,[0,0,-r]),l.eL(a,a,-n*f),l.Qr(a,a,i*f);const u=o/e;return l.hs(a,a,[u,u,u]),s&&l.Tl(a,a,c.ze([],s)),a}function S(t){const{width:e,height:n,altitude:i,pitch:r=0,offset:o,center:a,scale:l,nearZMultiplier:c=1,farZMultiplier:u=1}=t;let{fovy:h=P(_)}=t;void 0!==i&&(h=P(i));const d=h*f,p=r*f,A=M(h);let g=A;a&&(g+=a[2]*l/Math.cos(p)/n);const m=d*(.5+(o?o[1]:0)/n),y=Math.sin(m)*g/Math.sin(s(Math.PI/2-p-m,.01,Math.PI-.01)),v=Math.sin(p)*y+g,b=10*g;return{fov:d,aspect:e/n,focalDistance:A,near:c,far:Math.min(v*u,b)}}function P(t){return 2*Math.atan(.5/t)*A}function M(t){return.5/Math.tan(.5*t*f)}function I(t,e){const[n,i,o=0]=t;return h(Number.isFinite(n)&&Number.isFinite(i)&&Number.isFinite(o)),r(e,[n,i,o,1])}function B(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const[i,o,s]=t;if(h(Number.isFinite(i)&&Number.isFinite(o),"invalid pixel coordinate"),Number.isFinite(s)){return r(e,[i,o,s,1])}const a=r(e,[i,o,0,1]),l=r(e,[i,o,1,1]),c=a[2],d=l[2],p=c===d?0:((n||0)-c)/(d-c);return u.Cc([],a,l,p)}function R(t){const{width:e,height:n,bounds:i,minExtent:r=0,maxZoom:o=24,offset:l=[0,0]}=t,[[c,u],[d,p]]=i,f=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if("number"===typeof t)return{top:t,bottom:t,left:t,right:t};return h(Number.isFinite(t.top)&&Number.isFinite(t.bottom)&&Number.isFinite(t.left)&&Number.isFinite(t.right)),t}(t.padding),A=v([c,s(p,-y,y)]),g=v([d,s(u,-y,y)]),m=[Math.max(Math.abs(g[0]-A[0]),r),Math.max(Math.abs(g[1]-A[1]),r)],_=[e-f.left-f.right-2*Math.abs(l[0]),n-f.top-f.bottom-2*Math.abs(l[1])];h(_[0]>0&&_[1]>0);const x=_[0]/m[0],w=_[1]/m[1],E=(f.right-f.left)/2/x,C=(f.top-f.bottom)/2/w,T=b([(g[0]+A[0])/2+E,(g[1]+A[1])/2+C]),S=Math.min(o,a(Math.abs(Math.min(x,w))));return h(Number.isFinite(S)),{longitude:T[0],latitude:T[1],zoom:S}}const L=Math.PI/180;function O(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const{width:n,height:i,unproject:r}=t,o={targetZ:e},s=r([0,i],o),a=r([n,i],o);let l,c;return(t.fovy?.5*t.fovy*L:Math.atan(.5/t.altitude))>(90-t.pitch)*L-.01?(l=D(t,0,e),c=D(t,n,e)):(l=r([0,0],o),c=r([n,0],o)),[s,a,c,l]}function D(t,e,n){const{pixelUnprojectionMatrix:i}=t,o=r(i,[e,0,1,1]),s=r(i,[e,t.height,1,1]),a=(n*t.distanceScales.unitsPerMeter[2]-o[2])/(s[2]-o[2]),l=b(u.Cc([],o,s,a));return l.push(n),l}const k=512;function F(t){const{width:e,height:n,pitch:i=0}=t;let{longitude:r,latitude:s,zoom:l,bearing:c=0}=t;(r<-180||r>180)&&(r=o(r+180,360)-180),(c<-180||c>180)&&(c=o(c+180,360)-180);const u=a(n/k);if(l<=u)l=u,s=0;else{const t=n/2/Math.pow(2,l),e=b([0,t])[1];if(s<e)s=e;else{const e=b([0,k-t])[1];s>e&&(s=e)}}return{width:e,height:n,longitude:r,latitude:s,zoom:l,pitch:i,bearing:c}}},77192:(t,e,n)=>{"use strict";n.d(e,{eh:()=>r,gM:()=>o,x:()=>i});const i=globalThis,r=(globalThis.document,globalThis.process||{}),o=(globalThis.console,globalThis.navigator||{})},68595:(t,e,n)=>{"use strict";n.d(e,{B:()=>r});var i=n(76325);function r(){return!("object"===typeof process&&"[object process]"===String(process)&&!process?.browser)||(0,i.b)()}},76325:(t,e,n)=>{"use strict";function i(t){if("undefined"!==typeof window&&"renderer"===window.process?.type)return!0;if("undefined"!==typeof process&&Boolean(process.versions?.electron))return!0;const e="undefined"!==typeof navigator&&navigator.userAgent,n=t||e;return Boolean(n&&n.indexOf("Electron")>=0)}n.d(e,{b:()=>i})},24990:(t,e,n)=>{"use strict";n.d(e,{t:()=>m});var i=n(68595);const r="4.0.7";class o{constructor(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"sessionStorage";this.storage=function(t){try{const e=window[t],n="__storage_test__";return e.setItem(n,n),e.removeItem(n),e}catch(e){return null}}(n),this.id=t,this.config=e,this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(t){if(Object.assign(this.config,t),this.storage){const t=JSON.stringify(this.config);this.storage.setItem(this.id,t)}}_loadConfiguration(){let t={};if(this.storage){const e=this.storage.getItem(this.id);t=e?JSON.parse(e):{}}return Object.assign(this.config,t),this}}var s;!function(t){t[t.BLACK=30]="BLACK",t[t.RED=31]="RED",t[t.GREEN=32]="GREEN",t[t.YELLOW=33]="YELLOW",t[t.BLUE=34]="BLUE",t[t.MAGENTA=35]="MAGENTA",t[t.CYAN=36]="CYAN",t[t.WHITE=37]="WHITE",t[t.BRIGHT_BLACK=90]="BRIGHT_BLACK",t[t.BRIGHT_RED=91]="BRIGHT_RED",t[t.BRIGHT_GREEN=92]="BRIGHT_GREEN",t[t.BRIGHT_YELLOW=93]="BRIGHT_YELLOW",t[t.BRIGHT_BLUE=94]="BRIGHT_BLUE",t[t.BRIGHT_MAGENTA=95]="BRIGHT_MAGENTA",t[t.BRIGHT_CYAN=96]="BRIGHT_CYAN",t[t.BRIGHT_WHITE=97]="BRIGHT_WHITE"}(s||(s={}));const a=10;function l(t){return"string"!==typeof t?t:(t=t.toUpperCase(),s[t]||s.WHITE)}function c(t,e){if(!t)throw new Error(e||"Assertion failed")}var u=n(77192);function h(){let t;if((0,i.B)()&&u.x.performance)t=u.x?.performance?.now?.();else if("hrtime"in u.eh){const e=u.eh?.hrtime?.();t=1e3*e[0]+e[1]/1e6}else t=Date.now();return t}const d={debug:(0,i.B)()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},p={enabled:!0,level:0};function f(){}const A={},g={once:!0};class m{constructor(){let{id:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{id:""};this.VERSION=r,this._startTs=h(),this._deltaTs=h(),this.userData={},this.LOG_THROTTLE_TIMEOUT=0,this.id=t,this.userData={},this._storage=new o(`__probe-${this.id}__`,p),this.timeStamp(`${this.id} started`),function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["constructor"];const n=Object.getPrototypeOf(t),i=Object.getOwnPropertyNames(n),r=t;for(const o of i){const n=r[o];"function"===typeof n&&(e.find((t=>o===t))||(r[o]=n.bind(t)))}}(this),Object.seal(this)}set level(t){this.setLevel(t)}get level(){return this.getLevel()}isEnabled(){return this._storage.config.enabled}getLevel(){return this._storage.config.level}getTotal(){return Number((h()-this._startTs).toPrecision(10))}getDelta(){return Number((h()-this._deltaTs).toPrecision(10))}set priority(t){this.level=t}get priority(){return this.level}getPriority(){return this.level}enable(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this._storage.setConfiguration({enabled:t}),this}setLevel(t){return this._storage.setConfiguration({level:t}),this}get(t){return this._storage.config[t]}set(t,e){this._storage.setConfiguration({[t]:e})}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}assert(t,e){if(!t)throw new Error(e||"Assertion failed")}warn(t){return this._getLogFunction(0,t,d.warn,arguments,g)}error(t){return this._getLogFunction(0,t,d.error,arguments)}deprecated(t,e){return this.warn(`\`${t}\` is deprecated and will be removed in a later version. Use \`${e}\` instead`)}removed(t,e){return this.error(`\`${t}\` has been removed. Use \`${e}\` instead`)}probe(t,e){return this._getLogFunction(t,e,d.log,arguments,{time:!0,once:!0})}log(t,e){return this._getLogFunction(t,e,d.debug,arguments)}info(t,e){return this._getLogFunction(t,e,console.info,arguments)}once(t,e){return this._getLogFunction(t,e,d.debug||d.info,arguments,g)}table(t,e,n){return e?this._getLogFunction(t,e,console.table||f,n&&[n],{tag:v(e)}):f}time(t,e){return this._getLogFunction(t,e,console.time?console.time:console.info)}timeEnd(t,e){return this._getLogFunction(t,e,console.timeEnd?console.timeEnd:console.info)}timeStamp(t,e){return this._getLogFunction(t,e,console.timeStamp||f)}group(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{collapsed:!1};const i=_({logLevel:t,message:e,opts:n}),{collapsed:r}=n;return i.method=(r?console.groupCollapsed:console.group)||console.info,this._getLogFunction(i)}groupCollapsed(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.group(t,e,Object.assign({},n,{collapsed:!0}))}groupEnd(t){return this._getLogFunction(t,"",console.groupEnd||f)}withGroup(t,e,n){this.group(t,e)();try{n()}finally{this.groupEnd(t)()}}trace(){console.trace&&console.trace()}_shouldLog(t){return this.isEnabled()&&this.getLevel()>=y(t)}_getLogFunction(t,e,n,r,o){if(this._shouldLog(t)){o=_({logLevel:t,message:e,args:r,opts:o}),c(n=n||o.method),o.total=this.getTotal(),o.delta=this.getDelta(),this._deltaTs=h();const s=o.tag||o.message;if(o.once&&s){if(A[s])return f;A[s]=h()}return e=function(t,e,n){if("string"===typeof e){const r=n.time?function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8;const n=Math.max(e-t.length,0);return`${" ".repeat(n)}${t}`}(function(t){let e;return e=t<10?`${t.toFixed(2)}ms`:t<100?`${t.toFixed(1)}ms`:t<1e3?`${t.toFixed(0)}ms`:`${(t/1e3).toFixed(2)}s`,e}(n.total)):"";e=function(t,e,n){i.B||"string"!==typeof t||(e&&(t=`\x1b[${l(e)}m${t}\x1b[39m`),n&&(t=`\x1b[${l(n)+a}m${t}\x1b[49m`));return t}(e=n.time?`${t}: ${r} ${e}`:`${t}: ${e}`,n.color,n.background)}return e}(this.id,o.message,o),n.bind(console,e,...o.args)}return f}}function y(t){if(!t)return 0;let e;switch(typeof t){case"number":e=t;break;case"object":e=t.logLevel||t.priority||0;break;default:return 0}return c(Number.isFinite(e)&&e>=0),e}function _(t){const{logLevel:e,message:n}=t;t.logLevel=y(e);const i=t.args?Array.from(t.args):[];for(;i.length&&i.shift()!==n;);switch(typeof e){case"string":case"function":void 0!==n&&i.unshift(n),t.message=e;break;case"object":Object.assign(t,e)}"function"===typeof t.message&&(t.message=t.message());const r=typeof t.message;return c("string"===r||"object"===r),Object.assign(t,{args:i},t.opts)}function v(t){for(const e in t)for(const n in t[e])return n||"untitled";return"empty"}m.VERSION=r},1021:(t,e,n)=>{"use strict";function i(){let t;if("undefined"!==typeof window&&window.performance)t=window.performance.now();else if("undefined"!==typeof process&&process.hrtime){const e=process.hrtime();t=1e3*e[0]+e[1]/1e6}else t=Date.now();return t}n.d(e,{A:()=>o});class r{constructor(t,e){this.sampleSize=1,this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this.name=t,this.type=e,this.reset()}reset(){return this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this}setSampleSize(t){return this.sampleSize=t,this}incrementCount(){return this.addCount(1),this}decrementCount(){return this.subtractCount(1),this}addCount(t){return this._count+=t,this._samples++,this._checkSampling(),this}subtractCount(t){return this._count-=t,this._samples++,this._checkSampling(),this}addTime(t){return this._time+=t,this.lastTiming=t,this._samples++,this._checkSampling(),this}timeStart(){return this._startTime=i(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(i()-this._startTime),this._timerPending=!1,this._checkSampling(),this):this}getSampleAverageCount(){return this.sampleSize>0?this.lastSampleCount/this.sampleSize:0}getSampleAverageTime(){return this.sampleSize>0?this.lastSampleTime/this.sampleSize:0}getSampleHz(){return this.lastSampleTime>0?this.sampleSize/(this.lastSampleTime/1e3):0}getAverageCount(){return this.samples>0?this.count/this.samples:0}getAverageTime(){return this.samples>0?this.time/this.samples:0}getHz(){return this.time>0?this.samples/(this.time/1e3):0}_checkSampling(){this._samples===this.sampleSize&&(this.lastSampleTime=this._time,this.lastSampleCount=this._count,this.count+=this._count,this.time+=this._time,this.samples+=this._samples,this._time=0,this._count=0,this._samples=0)}}class o{constructor(t){this.stats={},this.id=t.id,this.stats={},this._initializeStats(t.stats),Object.seal(this)}get(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"count";return this._getOrCreate({name:t,type:e})}get size(){return Object.keys(this.stats).length}reset(){for(const t of Object.values(this.stats))t.reset();return this}forEach(t){for(const e of Object.values(this.stats))t(e)}getTable(){const t={};return this.forEach((e=>{t[e.name]={time:e.time||0,count:e.count||0,average:e.getAverageTime()||0,hz:e.getHz()||0}})),t}_initializeStats(){(arguments.length>
20&&void 0!==arguments[0]?arguments[0]:[]).forEach((t=>this._getOrCreate(t)))}_getOrCreate(t){const{name:e,type:n}=t;let i=this.stats[e];return i||(i=t instanceof r?t:new r(e,n),this.stats[e]=i),i}}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.