@deck.gl/geo-layers 8.8.15 → 8.8.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist.min.js CHANGED
@@ -3,4 +3,4 @@
3
3
  * @license long.js (c) 2013 Daniel Wirtz <dcode@dcode.io>
4
4
  * Released under the Apache License, Version 2.0
5
5
  * see: https://github.com/dcodeIO/long.js for details
6
- */i=[],void 0===(o="function"==typeof(n=function(){"use strict";function t(t,e,r){this.low=0|t,this.high=0|e,this.unsigned=!!r}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 r={},n={};function i(t,e){var i,o,s;return e?(s=0<=(t>>>=0)&&t<256)&&(o=n[t])?o:(i=a(t,(0|t)<0?-1:0,!0),s&&(n[t]=i),i):(s=-128<=(t|=0)&&t<128)&&(o=r[t])?o:(i=a(t,t<0?-1:0,!1),s&&(r[t]=i),i)}function o(t,e){if(isNaN(t)||!isFinite(t))return e?v:p;if(e){if(t<0)return v;if(t>=f)return A}else{if(t<=-h)return w;if(t+1>=h)return b}return t<0?o(-t,e).neg():a(t%l|0,t/l|0,e)}function a(e,r,n){return new t(e,r,n)}t.fromInt=i,t.fromNumber=o,t.fromBits=a;var s=Math.pow;function u(t,e,r){if(0===t.length)throw Error("empty string");if("NaN"===t||"Infinity"===t||"+Infinity"===t||"-Infinity"===t)return p;if("number"==typeof e?(r=e,e=!1):e=!!e,(r=r||10)<2||36<r)throw RangeError("radix");var n;if((n=t.indexOf("-"))>0)throw Error("interior hyphen");if(0===n)return u(t.substring(1),e,r).neg();for(var i=o(s(r,8)),a=p,c=0;c<t.length;c+=8){var l=Math.min(8,t.length-c),f=parseInt(t.substring(c,c+l),r);if(l<8){var h=o(s(r,l));a=a.mul(h).add(o(f))}else a=(a=a.mul(i)).add(o(f))}return a.unsigned=e,a}function c(e){return e instanceof t?e:"number"==typeof e?o(e):"string"==typeof e?u(e):a(e.low,e.high,e.unsigned)}t.fromString=u,t.fromValue=c;var l=4294967296,f=l*l,h=f/2,d=i(1<<24),p=i(0);t.ZERO=p;var v=i(0,!0);t.UZERO=v;var y=i(1);t.ONE=y;var g=i(1,!0);t.UONE=g;var m=i(-1);t.NEG_ONE=m;var b=a(-1,2147483647,!1);t.MAX_VALUE=b;var A=a(-1,-1,!0);t.MAX_UNSIGNED_VALUE=A;var w=a(0,-2147483648,!1);t.MIN_VALUE=w;var B=t.prototype;return B.toInt=function(){return this.unsigned?this.low>>>0:this.low},B.toNumber=function(){return this.unsigned?(this.high>>>0)*l+(this.low>>>0):this.high*l+(this.low>>>0)},B.toString=function(t){if((t=t||10)<2||36<t)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(w)){var e=o(t),r=this.div(e),n=r.mul(e).sub(this);return r.toString(t)+n.toInt().toString(t)}return"-"+this.neg().toString(t)}for(var i=o(s(t,6),this.unsigned),a=this,u="";;){var c=a.div(i),l=(a.sub(c.mul(i)).toInt()>>>0).toString(t);if((a=c).isZero())return l+u;for(;l.length<6;)l="0"+l;u=""+l+u}},B.getHighBits=function(){return this.high},B.getHighBitsUnsigned=function(){return this.high>>>0},B.getLowBits=function(){return this.low},B.getLowBitsUnsigned=function(){return this.low>>>0},B.getNumBitsAbs=function(){if(this.isNegative())return this.eq(w)?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},B.isZero=function(){return 0===this.high&&0===this.low},B.isNegative=function(){return!this.unsigned&&this.high<0},B.isPositive=function(){return this.unsigned||this.high>=0},B.isOdd=function(){return 1==(1&this.low)},B.isEven=function(){return 0==(1&this.low)},B.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},B.eq=B.equals,B.notEquals=function(t){return!this.eq(t)},B.neq=B.notEquals,B.lessThan=function(t){return this.comp(t)<0},B.lt=B.lessThan,B.lessThanOrEqual=function(t){return this.comp(t)<=0},B.lte=B.lessThanOrEqual,B.greaterThan=function(t){return this.comp(t)>0},B.gt=B.greaterThan,B.greaterThanOrEqual=function(t){return this.comp(t)>=0},B.gte=B.greaterThanOrEqual,B.compare=function(t){if(e(t)||(t=c(t)),this.eq(t))return 0;var r=this.isNegative(),n=t.isNegative();return r&&!n?-1:!r&&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},B.comp=B.compare,B.negate=function(){return!this.unsigned&&this.eq(w)?w:this.not().add(y)},B.neg=B.negate,B.add=function(t){e(t)||(t=c(t));var r=this.high>>>16,n=65535&this.high,i=this.low>>>16,o=65535&this.low,s=t.high>>>16,u=65535&t.high,l=t.low>>>16,f=0,h=0,d=0,p=0;return d+=(p+=o+(65535&t.low))>>>16,h+=(d+=i+l)>>>16,f+=(h+=n+u)>>>16,f+=r+s,a((d&=65535)<<16|(p&=65535),(f&=65535)<<16|(h&=65535),this.unsigned)},B.subtract=function(t){return e(t)||(t=c(t)),this.add(t.neg())},B.sub=B.subtract,B.multiply=function(t){if(this.isZero())return p;if(e(t)||(t=c(t)),t.isZero())return p;if(this.eq(w))return t.isOdd()?w:p;if(t.eq(w))return this.isOdd()?w:p;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(d)&&t.lt(d))return o(this.toNumber()*t.toNumber(),this.unsigned);var r=this.high>>>16,n=65535&this.high,i=this.low>>>16,s=65535&this.low,u=t.high>>>16,l=65535&t.high,f=t.low>>>16,h=65535&t.low,v=0,y=0,g=0,m=0;return g+=(m+=s*h)>>>16,y+=(g+=i*h)>>>16,g&=65535,y+=(g+=s*f)>>>16,v+=(y+=n*h)>>>16,y&=65535,v+=(y+=i*f)>>>16,y&=65535,v+=(y+=s*l)>>>16,v+=r*h+n*f+i*l+s*u,a((g&=65535)<<16|(m&=65535),(v&=65535)<<16|(y&=65535),this.unsigned)},B.mul=B.multiply,B.divide=function(t){if(e(t)||(t=c(t)),t.isZero())throw Error("division by zero");if(this.isZero())return this.unsigned?v:p;var r,n,i;if(this.unsigned){if(t.unsigned||(t=t.toUnsigned()),t.gt(this))return v;if(t.gt(this.shru(1)))return g;i=v}else{if(this.eq(w))return t.eq(y)||t.eq(m)?w:t.eq(w)?y:(r=this.shr(1).div(t).shl(1)).eq(p)?t.isNegative()?y:m:(n=this.sub(t.mul(r)),i=r.add(n.div(t)));if(t.eq(w))return this.unsigned?v:p;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=p}for(n=this;n.gte(t);){r=Math.max(1,Math.floor(n.toNumber()/t.toNumber()));for(var a=Math.ceil(Math.log(r)/Math.LN2),u=a<=48?1:s(2,a-48),l=o(r),f=l.mul(t);f.isNegative()||f.gt(n);)f=(l=o(r-=u,this.unsigned)).mul(t);l.isZero()&&(l=y),i=i.add(l),n=n.sub(f)}return i},B.div=B.divide,B.modulo=function(t){return e(t)||(t=c(t)),this.sub(this.div(t).mul(t))},B.mod=B.modulo,B.not=function(){return a(~this.low,~this.high,this.unsigned)},B.and=function(t){return e(t)||(t=c(t)),a(this.low&t.low,this.high&t.high,this.unsigned)},B.or=function(t){return e(t)||(t=c(t)),a(this.low|t.low,this.high|t.high,this.unsigned)},B.xor=function(t){return e(t)||(t=c(t)),a(this.low^t.low,this.high^t.high,this.unsigned)},B.shiftLeft=function(t){return e(t)&&(t=t.toInt()),0==(t&=63)?this:t<32?a(this.low<<t,this.high<<t|this.low>>>32-t,this.unsigned):a(0,this.low<<t-32,this.unsigned)},B.shl=B.shiftLeft,B.shiftRight=function(t){return e(t)&&(t=t.toInt()),0==(t&=63)?this:t<32?a(this.low>>>t|this.high<<32-t,this.high>>t,this.unsigned):a(this.high>>t-32,this.high>=0?0:-1,this.unsigned)},B.shr=B.shiftRight,B.shiftRightUnsigned=function(t){if(e(t)&&(t=t.toInt()),0==(t&=63))return this;var r=this.high;return t<32?a(this.low>>>t|r<<32-t,r>>>t,this.unsigned):a(32===t?r:r>>>t-32,0,this.unsigned)},B.shru=B.shiftRightUnsigned,B.toSigned=function(){return this.unsigned?a(this.low,this.high,!1):this},B.toUnsigned=function(){return this.unsigned?this:a(this.low,this.high,!0)},B.toBytes=function(t){return t?this.toBytesLE():this.toBytesBE()},B.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]},B.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=o)},function(t,e,r){var n=r(68);t.exports=function(t){return new n(t)}},function(t,e){},function(t,e){t.exports=r},function(t,e,r){var n=r(114);t.exports=function(t){return function(){return new n(t.apply(this,arguments))}}},function(t,e){t.exports=function(t){var e;if("undefined"!=typeof Symbol){if(Symbol.asyncIterator&&null!=(e=t[Symbol.asyncIterator]))return e.call(t);if(Symbol.iterator&&null!=(e=t[Symbol.iterator]))return e.call(t)}throw new TypeError("Object is not async iterable")}},function(t,e,r){var n=r(87),i=r(88),o=r(62),a=r(89);t.exports=function(t){return n(t)||i(t)||o(t)||a()},t.exports.default=t.exports,t.exports.__esModule=!0},,,,function(t,e){},function(t,e){function r(e){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(t.exports=r=function(t){return typeof t},t.exports.default=t.exports,t.exports.__esModule=!0):(t.exports=r=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.default=t.exports,t.exports.__esModule=!0),r(e)}t.exports=r,t.exports.default=t.exports,t.exports.__esModule=!0},,function(t,e){},function(t,e,r){"use strict";t.exports=i;var n=r(117);function i(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}i.Varint=0,i.Fixed64=1,i.Bytes=2,i.Fixed32=5;var o="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function a(t){return t.type===i.Bytes?t.readVarint()+t.pos:t.pos+1}function s(t,e,r){return r?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function u(t,e,r){var n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));r.realloc(n);for(var i=r.pos-1;i>=t;i--)r.buf[i+n]=r.buf[i]}function c(t,e){for(var r=0;r<t.length;r++)e.writeVarint(t[r])}function l(t,e){for(var r=0;r<t.length;r++)e.writeSVarint(t[r])}function f(t,e){for(var r=0;r<t.length;r++)e.writeFloat(t[r])}function h(t,e){for(var r=0;r<t.length;r++)e.writeDouble(t[r])}function d(t,e){for(var r=0;r<t.length;r++)e.writeBoolean(t[r])}function p(t,e){for(var r=0;r<t.length;r++)e.writeFixed32(t[r])}function v(t,e){for(var r=0;r<t.length;r++)e.writeSFixed32(t[r])}function y(t,e){for(var r=0;r<t.length;r++)e.writeFixed64(t[r])}function g(t,e){for(var r=0;r<t.length;r++)e.writeSFixed64(t[r])}function m(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+16777216*t[e+3]}function b(t,e,r){t[r]=e,t[r+1]=e>>>8,t[r+2]=e>>>16,t[r+3]=e>>>24}function A(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}i.prototype={destroy:function(){this.buf=null},readFields:function(t,e,r){for(r=r||this.length;this.pos<r;){var n=this.readVarint(),i=n>>3,o=this.pos;this.type=7&n,t(i,e,this),this.pos===o&&this.skip(n)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=m(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=A(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=m(this.buf,this.pos)+4294967296*m(this.buf,this.pos+4);return this.pos+=8,t},readSFixed64:function(){var t=m(this.buf,this.pos)+4294967296*A(this.buf,this.pos+4);return this.pos+=8,t},readFloat:function(){var t=n.read(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=n.read(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,r,n=this.buf;return e=127&(r=n[this.pos++]),r<128?e:(e|=(127&(r=n[this.pos++]))<<7,r<128?e:(e|=(127&(r=n[this.pos++]))<<14,r<128?e:(e|=(127&(r=n[this.pos++]))<<21,r<128?e:function(t,e,r){var n,i,o=r.buf;if(i=o[r.pos++],n=(112&i)>>4,i<128)return s(t,n,e);if(i=o[r.pos++],n|=(127&i)<<3,i<128)return s(t,n,e);if(i=o[r.pos++],n|=(127&i)<<10,i<128)return s(t,n,e);if(i=o[r.pos++],n|=(127&i)<<17,i<128)return s(t,n,e);if(i=o[r.pos++],n|=(127&i)<<24,i<128)return s(t,n,e);if(i=o[r.pos++],n|=(1&i)<<31,i<128)return s(t,n,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(r=n[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&&o?function(t,e,r){return o.decode(t.subarray(e,r))}(this.buf,e,t):function(t,e,r){var n="",i=e;for(;i<r;){var o,a,s,u=t[i],c=null,l=u>239?4:u>223?3:u>191?2:1;if(i+l>r)break;1===l?u<128&&(c=u):2===l?128==(192&(o=t[i+1]))&&(c=(31&u)<<6|63&o)<=127&&(c=null):3===l?(o=t[i+1],a=t[i+2],128==(192&o)&&128==(192&a)&&((c=(15&u)<<12|(63&o)<<6|63&a)<=2047||c>=55296&&c<=57343)&&(c=null)):4===l&&(o=t[i+1],a=t[i+2],s=t[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&((c=(15&u)<<18|(63&o)<<12|(63&a)<<6|63&s)<=65535||c>=1114112)&&(c=null)),null===c?(c=65533,l=1):c>65535&&(c-=65536,n+=String.fromCharCode(c>>>10&1023|55296),c=56320|1023&c),n+=String.fromCharCode(c),i+=l}return n}(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!==i.Bytes)return t.push(this.readVarint(e));var r=a(this);for(t=t||[];this.pos<r;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){if(this.type!==i.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!==i.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!==i.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!==i.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!==i.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!==i.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!==i.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!==i.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===i.Varint)for(;this.buf[this.pos++]>127;);else if(e===i.Bytes)this.pos=this.readVarint()+this.pos;else if(e===i.Fixed32)this.pos+=4;else{if(e!==i.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e<this.pos+t;)e*=2;if(e!==this.length){var r=new Uint8Array(e);r.set(this.buf),this.buf=r,this.length=e}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(t){this.realloc(4),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*(1/4294967296)),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*(1/4294967296)),this.pos+4),this.pos+=8},writeVarint:function(t){(t=+t||0)>268435455||t<0?function(t,e){var r,n;t>=0?(r=t%4294967296|0,n=t/4294967296|0):(n=~(-t/4294967296),4294967295^(r=~(-t%4294967296))?r=r+1|0:(r=0,n=n+1|0));if(t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),function(t,e,r){r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos]=127&t}(r,0,e),function(t,e){var r=(7&t)<<4;if(e.buf[e.pos++]|=r|((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}(n,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,r){for(var n,i,o=0;o<e.length;o++){if((n=e.charCodeAt(o))>55295&&n<57344){if(!i){n>56319||o+1===e.length?(t[r++]=239,t[r++]=191,t[r++]=189):i=n;continue}if(n<56320){t[r++]=239,t[r++]=191,t[r++]=189,i=n;continue}n=i-55296<<10|n-56320|65536,i=null}else i&&(t[r++]=239,t[r++]=191,t[r++]=189,i=null);n<128?t[r++]=n:(n<2048?t[r++]=n>>6|192:(n<65536?t[r++]=n>>12|224:(t[r++]=n>>18|240,t[r++]=n>>12&63|128),t[r++]=n>>6&63|128),t[r++]=63&n|128)}return r}(this.buf,t,this.pos);var r=this.pos-e;r>=128&&u(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r},writeFloat:function(t){this.realloc(4),n.write(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),n.write(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var r=0;r<e;r++)this.buf[this.pos++]=t[r]},writeRawMessage:function(t,e){this.pos++;var r=this.pos;t(e,this);var n=this.pos-r;n>=128&&u(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,e,r){this.writeTag(t,i.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,c,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,l,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,d,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,f,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,h,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,p,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,v,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,y,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,g,e)},writeBytesField:function(t,e){this.writeTag(t,i.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,i.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,i.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,i.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,i.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,i.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,i.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,i.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,i.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,i.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}}},,,,,,function(t,e){function r(e,n){return t.exports=r=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},r(e,n)}t.exports=r},function(t,e){t.exports=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,r){var n=r(61);t.exports=function(t,e){if(t){if("string"==typeof t)return n(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(t,e):void 0}},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){},function(t,e,r){var n=r(66);t.exports=function(t,e){if(t){if("string"==typeof t)return n(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(t,e):void 0}}},function(t,e){t.exports=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}},function(t,e){function r(e,n){return t.exports=r=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},r(e,n)}t.exports=r},function(t,e){t.exports=function(t){this.wrapped=t}},function(t,e){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){function r(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}t.exports=function(t,e,n){return e&&r(t.prototype,e),n&&r(t,n),t},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=function(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,r){var n=r(67),i=r(111);function o(e,r,a){return i()?t.exports=o=Reflect.construct:t.exports=o=function(t,e,r){var i=[null];i.push.apply(i,e);var o=new(Function.bind.apply(t,i));return r&&n(o,r.prototype),o},o.apply(null,arguments)}t.exports=o},function(t,e,r){var n=r(115);function i(e,r,o){return"undefined"!=typeof Reflect&&Reflect.get?t.exports=i=Reflect.get:t.exports=i=function(t,e,r){var i=n(t,e);if(i){var o=Object.getOwnPropertyDescriptor(i,e);return o.get?o.get.call(r):o.value}},i(e,r,o||e)}t.exports=i},function(t,e,r){var n=r(60);function i(){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}}function o(e,r,a){return i()?t.exports=o=Reflect.construct:t.exports=o=function(t,e,r){var i=[null];i.push.apply(i,e);var o=new(Function.bind.apply(t,i));return r&&n(o,r.prototype),o},o.apply(null,arguments)}t.exports=o},function(t,e,r){var n=r(118),i=globalThis.deck||{};if(!i.LineLayer)throw new Error("@deck.gl/layers is not found");t.exports=Object.assign(i,n)},,,,,,,,,function(t,e){t.exports=function(t){if(Array.isArray(t))return t}},function(t,e){t.exports=function(t,e){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t)){var r=[],n=!0,i=!1,o=void 0;try{for(var a,s=t[Symbol.iterator]();!(n=(a=s.next()).done)&&(r.push(a.value),!e||r.length!==e);n=!0);}catch(t){i=!0,o=t}finally{try{n||null==s.return||s.return()}finally{if(i)throw o}}return r}}},function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}},function(t,e,r){var n=r(61);t.exports=function(t){if(Array.isArray(t))return n(t)},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=function(t){if(Array.isArray(t))return t},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,o=[],a=!0,s=!1;try{for(r=r.call(t);!(a=(n=r.next()).done)&&(o.push(n.value),!e||o.length!==e);a=!0);}catch(t){s=!0,i=t}finally{try{a||null==r.return||r.return()}finally{if(s)throw i}}return o}},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=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.")},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=function(t){if(Array.isArray(t)){for(var e=0,r=new Array(t.length);e<t.length;e++)r[e]=t[e];return r}}},function(t,e){t.exports=function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}},function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}},function(t,e){function r(e,n){return t.exports=r=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},t.exports.default=t.exports,t.exports.__esModule=!0,r(e,n)}t.exports=r,t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,r){var n=r(63);t.exports=function(t){if(Array.isArray(t))return n(t)},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,r){var n=r(63);t.exports=function(t,e){if(t){if("string"==typeof t)return n(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(t,e):void 0}},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,r){var n=function(t){"use strict";var e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",o=n.asyncIterator||"@@asyncIterator",a=n.toStringTag||"@@toStringTag";function s(t,e,r,n){var i=e&&e.prototype instanceof l?e:l,o=Object.create(i.prototype),a=new B(n||[]);return o._invoke=function(t,e,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return x()}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var s=b(a,r);if(s){if(s===c)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(t,e,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===c)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}(t,r,a),o}function u(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=s;var c={};function l(){}function f(){}function h(){}var d={};d[i]=function(){return this};var p=Object.getPrototypeOf,v=p&&p(p(_([])));v&&v!==e&&r.call(v,i)&&(d=v);var y=h.prototype=l.prototype=Object.create(d);function g(t){["next","throw","return"].forEach((function(e){t[e]=function(t){return this._invoke(e,t)}}))}function m(t){var e;this._invoke=function(n,i){function o(){return new Promise((function(e,o){!function e(n,i,o,a){var s=u(t[n],t,i);if("throw"!==s.type){var c=s.arg,l=c.value;return l&&"object"==typeof l&&r.call(l,"__await")?Promise.resolve(l.__await).then((function(t){e("next",t,o,a)}),(function(t){e("throw",t,o,a)})):Promise.resolve(l).then((function(t){c.value=t,o(c)}),(function(t){return e("throw",t,o,a)}))}a(s.arg)}(n,i,e,o)}))}return e=e?e.then(o,o):o()}}function b(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,b(t,e),"throw"===e.method))return c;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return c}var n=u(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,c;var i=n.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,c):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,c)}function A(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function w(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function B(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(A,this),this.reset(!0)}function _(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:x}}function x(){return{value:void 0,done:!0}}return f.prototype=y.constructor=h,h.constructor=f,h[a]=f.displayName="GeneratorFunction",t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===f||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,h):(t.__proto__=h,a in t||(t[a]="GeneratorFunction")),t.prototype=Object.create(y),t},t.awrap=function(t){return{__await:t}},g(m.prototype),m.prototype[o]=function(){return this},t.AsyncIterator=m,t.async=function(e,r,n,i){var o=new m(s(e,r,n,i));return t.isGeneratorFunction(r)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},g(y),y[a]="Generator",y[i]=function(){return this},y.toString=function(){return"[object Generator]"},t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=_,B.prototype={constructor:B,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(w),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=r.call(o,"catchLoc"),u=r.call(o,"finallyLoc");if(s&&u){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,c):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),c},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),w(r),c}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;w(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:_(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),c}},t}(t.exports);try{regeneratorRuntime=n}catch(t){Function("r","regeneratorRuntime = r")(n)}},function(t,e,r){var n=r(6);t.exports=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=n(t)););return t}},function(t,e,r){var n=function(t){"use strict";var e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",o=n.asyncIterator||"@@asyncIterator",a=n.toStringTag||"@@toStringTag";function s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var i=e&&e.prototype instanceof f?e:f,o=Object.create(i.prototype),a=new _(n||[]);return o._invoke=function(t,e,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return C()}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var s=A(a,r);if(s){if(s===l)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=c(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===l)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}(t,r,a),o}function c(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var l={};function f(){}function h(){}function d(){}var p={};p[i]=function(){return this};var v=Object.getPrototypeOf,y=v&&v(v(x([])));y&&y!==e&&r.call(y,i)&&(p=y);var g=d.prototype=f.prototype=Object.create(p);function m(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function b(t,e){var n;this._invoke=function(i,o){function a(){return new e((function(n,a){!function n(i,o,a,s){var u=c(t[i],t,o);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==typeof f&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){n("next",t,a,s)}),(function(t){n("throw",t,a,s)})):e.resolve(f).then((function(t){l.value=t,a(l)}),(function(t){return n("throw",t,a,s)}))}s(u.arg)}(i,o,n,a)}))}return n=n?n.then(a,a):a()}}function A(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,A(t,e),"throw"===e.method))return l;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var n=c(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,l;var i=n.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,l):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,l)}function w(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function B(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function _(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(w,this),this.reset(!0)}function x(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:C}}function C(){return{value:void 0,done:!0}}return h.prototype=g.constructor=d,d.constructor=h,h.displayName=s(d,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===h||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,s(t,a,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},m(b.prototype),b.prototype[o]=function(){return this},t.AsyncIterator=b,t.async=function(e,r,n,i,o){void 0===o&&(o=Promise);var a=new b(u(e,r,n,i),o);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},m(g),s(g,a,"Generator"),g[i]=function(){return this},g.toString=function(){return"[object Generator]"},t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=x,_.prototype={constructor:_,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(B),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=r.call(o,"catchLoc"),u=r.call(o,"finallyLoc");if(s&&u){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,l):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),l},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),B(r),l}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;B(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:x(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},t}(t.exports);try{regeneratorRuntime=n}catch(t){Function("r","regeneratorRuntime = r")(n)}},function(t,e){t.exports=function(t){if(Array.isArray(t))return t}},function(t,e){t.exports=function(t,e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t)){var r=[],n=!0,i=!1,o=void 0;try{for(var a,s=t[Symbol.iterator]();!(n=(a=s.next()).done)&&(r.push(a.value),!e||r.length!==e);n=!0);}catch(t){i=!0,o=t}finally{try{n||null==s.return||s.return()}finally{if(i)throw o}}return r}}},function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},function(t,e,r){var n=r(66);t.exports=function(t){if(Array.isArray(t))return n(t)}},function(t,e){t.exports=function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}},function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},function(t,e){t.exports=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}}},function(t,e){},function(t,e){},function(t,e,r){var n=r(68);function i(t){var e,r;function i(e,r){try{var a=t[e](r),s=a.value,u=s instanceof n;Promise.resolve(u?s.wrapped:s).then((function(t){u?i("return"===e?"return":"next",t):o(a.done?"return":"normal",t)}),(function(t){i("throw",t)}))}catch(t){o("throw",t)}}function o(t,n){switch(t){case"return":e.resolve({value:n,done:!0});break;case"throw":e.reject(n);break;default:e.resolve({value:n,done:!1})}(e=e.next)?i(e.key,e.arg):r=null}this._invoke=function(t,n){return new Promise((function(o,a){var s={key:t,arg:n,resolve:o,reject:a,next:null};r?r=r.next=s:(e=r=s,i(t,n))}))},"function"!=typeof t.return&&(this.return=void 0)}"function"==typeof Symbol&&Symbol.asyncIterator&&(i.prototype[Symbol.asyncIterator]=function(){return this}),i.prototype.next=function(t){return this._invoke("next",t)},i.prototype.throw=function(t){return this._invoke("throw",t)},i.prototype.return=function(t){return this._invoke("return",t)},t.exports=i},function(t,e,r){var n=r(17);t.exports=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=n(t)););return t}},function(t,e){},function(t,e){e.read=function(t,e,r,n,i){var o,a,s=8*i-n-1,u=(1<<s)-1,c=u>>1,l=-7,f=r?i-1:0,h=r?-1:1,d=t[e+f];for(f+=h,o=d&(1<<-l)-1,d>>=-l,l+=s;l>0;o=256*o+t[e+f],f+=h,l-=8);for(a=o&(1<<-l)-1,o>>=-l,l+=n;l>0;a=256*a+t[e+f],f+=h,l-=8);if(0===o)o=1-c;else{if(o===u)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,n),o-=c}return(d?-1:1)*a*Math.pow(2,o-n)},e.write=function(t,e,r,n,i,o){var a,s,u,c=8*o-i-1,l=(1<<c)-1,f=l>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,p=n?1:-1,v=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=l):(a=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-a))<1&&(a--,u*=2),(e+=a+f>=1?h/u:h*Math.pow(2,1-f))*u>=2&&(a++,u/=2),a+f>=l?(s=0,a=l):a+f>=1?(s=(e*u-1)*Math.pow(2,i),a+=f):(s=e*Math.pow(2,f-1)*Math.pow(2,i),a=0));i>=8;t[r+d]=255&s,d+=p,s/=256,i-=8);for(a=a<<i|s,c+=i;c>0;t[r+d]=255&a,d+=p,a/=256,c-=8);t[r+d-p]|=128*v}},function(t,e,r){"use strict";r.r(e);var n={};r.r(n),r.d(n,"filename",(function(){return Sl})),r.d(n,"dirname",(function(){return Ml})),r.d(n,"join",(function(){return Il}));var i={};r.r(i),r.d(i,"name",(function(){return Xb})),r.d(i,"decode",(function(){return Yb}));var o={};r.r(o),r.d(o,"name",(function(){return aA})),r.d(o,"preprocess",(function(){return sA}));var a={};r.r(a),r.d(a,"name",(function(){return lA})),r.d(a,"preprocess",(function(){return fA}));var s={};r.r(s),r.d(s,"name",(function(){return bA})),r.d(s,"preprocess",(function(){return AA})),r.d(s,"decode",(function(){return wA})),r.d(s,"encode",(function(){return _A}));var u={};r.r(u),r.d(u,"name",(function(){return RA})),r.d(u,"decode",(function(){return LA}));var c={};r.r(c),r.d(c,"name",(function(){return JA})),r.d(c,"decode",(function(){return zA})),r.d(c,"encode",(function(){return qA}));var l={};r.r(l),r.d(l,"name",(function(){return YA})),r.d(l,"decode",(function(){return ZA})),r.d(l,"encode",(function(){return tw}));var f={};r.r(f),r.d(f,"name",(function(){return nw})),r.d(f,"decode",(function(){return iw})),r.d(f,"encode",(function(){return aw}));var h={};r.r(h),r.d(h,"name",(function(){return lw})),r.d(h,"decode",(function(){return fw}));var d=r(5),p=r.n(d),v=r(14),y=r.n(v),g=r(15),m=r.n(g),b=r(6),A=r.n(b),w=r(0),B=r.n(w),_=r(10);function x(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=A()(t);if(e){var i=A()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return m()(this,r)}}var C=function(t){y()(r,t);var e=x(r);function r(){return p()(this,r),e.apply(this,arguments)}return r}(_.ArcLayer);B()(C,"layerName","GreatCircleLayer"),B()(C,"defaultProps",{getHeight:{type:"accessor",value:0},greatCircle:!0});var k=r(7),E=r.n(k);function O(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=A()(t);if(e){var i=A()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return m()(this,r)}}function T(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}var S=function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?T(Object(r),!0).forEach((function(e){B()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):T(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}({},_.PolygonLayer.defaultProps),M=function(t){y()(r,t);var e=O(r);function r(){return p()(this,r),e.apply(this,arguments)}return E()(r,[{key:"indexToBounds",value:function(){return null}},{key:"renderLayers",value:function(){var t=this.props,e=t.elevationScale,r=t.extruded,n=t.wireframe,i=t.filled,o=t.stroked,a=t.lineWidthUnits,s=t.lineWidthScale,u=t.lineWidthMinPixels,c=t.lineWidthMaxPixels,l=t.lineJointRounded,f=t.lineMiterLimit,h=t.lineDashJustified,d=t.getElevation,p=t.getFillColor,v=t.getLineColor,y=t.getLineWidth,g=this.props,m=g.updateTriggers,b=g.material,A=g.transitions;return new(this.getSubLayerClass("cell",_.PolygonLayer))({filled:i,wireframe:n,extruded:r,elevationScale:e,stroked:o,lineWidthUnits:a,lineWidthScale:s,lineWidthMinPixels:u,lineWidthMaxPixels:c,lineJointRounded:l,lineMiterLimit:f,lineDashJustified:h,material:b,transitions:A,getElevation:d,getFillColor:p,getLineColor:v,getLineWidth:y},this.getSubLayerProps({id:"cell",updateTriggers:m&&{getElevation:m.getElevation,getFillColor:m.getFillColor,getLineColor:m.getLineColor,getLineWidth:m.getLineWidth}}),this.indexToBounds())}}]),r}(_.CompositeLayer);B()(M,"layerName","GeoCellLayer"),B()(M,"defaultProps",S);var I=r(12),R=r.n(I),P=r(40),F=r.n(P),D=180/Math.PI;function L(t,e,r){var n=1<<e;return[(t[0]+r[0])/n,(t[1]+r[1])/n]}function j(t){return t>=.5?1/3*(4*t*t-1):1/3*(1-4*(1-t)*(1-t))}function G(t){return[j(t[0]),j(t[1])]}function N(t,e){var r=R()(e,2),n=r[0],i=r[1];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 U(t,e,r,n){if(0===n){1===r&&(e[0]=t-1-e[0],e[1]=t-1-e[1]);var i=e[0];e[0]=e[1],e[1]=i}}function H(t){if("string"==typeof t){if(t.indexOf("/")>0)return t;t=function(t){var e=t.padEnd(16,"0");return F.a.fromString(e,16)}(t)}return function(t){for(var e=F.a.fromString(t,!0,10).toString(2);e.length<64;)e="0"+e;for(var r=e.lastIndexOf("1"),n=e.substring(0,3),i=e.substring(3,r),o=i.length/2,a=F.a.fromString(n,!0,2).toString(10),s=F.a.fromString(i,!0,2).toString(4);s.length<o;)s="0"+s;return"".concat(a,"/").concat(s)}(t.toString())}function V(t){return function(t){for(var e,r,n,i,o,a,s=t.face,u=t.ij,c=t.level,l=[[0,0],[0,1],[1,1],[1,0],[0,0]],f=Math.max(1,Math.ceil(100*Math.pow(2,-c))),h=new Float64Array(4*f*2+2),d=0,p=0,v=0;v<4;v++)for(var y=l[v].slice(0),g=l[v+1],m=(g[0]-y[0])/f,b=(g[1]-y[1])/f,A=0;A<f;A++){y[0]+=m,y[1]+=b;var w=N(s,G(L(u,c,y))),B=(e=w,r=void 0,n=void 0,i=void 0,o=void 0,a=void 0,r=R()(e,3),n=r[0],i=r[1],o=r[2],a=Math.atan2(o,Math.sqrt(n*n+i*i)),[Math.atan2(i,n)*D,a*D]);Math.abs(B[1])>89.999&&(B[0]=p);var _=B[0]-p;B[0]+=_>180?-360:_<-180?360:0,h[d++]=B[0],h[d++]=B[1],p=B[0]}return h[d++]=h[0],h[d++]=h[1],h}(function(t){for(var e,r=t.split("/"),n=parseInt(r[0],10),i=r[1],o=i.length,a=[0,0],s=o-1;s>=0;s--){e=o-s;var u=i[s],c=0,l=0;"1"===u?l=1:"2"===u?(c=1,l=1):"3"===u&&(c=1);var f=Math.pow(2,e-1);U(f,a,c,l),a[0]+=f*c,a[1]+=f*l}if(n%2==1){var h=a[0];a[0]=a[1],a[1]=h}return{face:n,ij:a,level:e}}(H(t)))}function J(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=A()(t);if(e){var i=A()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return m()(this,r)}}var z=function(t){y()(r,t);var e=J(r);function r(){return p()(this,r),e.apply(this,arguments)}return E()(r,[{key:"indexToBounds",value:function(){var t=this.props,e=t.data,r=t.getS2Token;return{data:e,_normalize:!1,positionFormat:"XY",getPolygon:function(t,e){return V(r(t,e))}}}}]),r}(M);B()(z,"layerName","S2Layer"),B()(z,"defaultProps",{getS2Token:{type:"accessor",value:function(t){return t.token}}});r(46);var K=r(28),q=r.n(K);r(69),r(70);var W="undefined"!=typeof Float32Array?Float32Array:Array;Math.random;Math.PI;function Q(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t}function X(t){var e=t[0],r=t[1],n=t[2],i=t[3];return Math.hypot(e,r,n,i)}function Y(t){var e=t[0],r=t[1],n=t[2],i=t[3];return e*e+r*r+n*n+i*i}function Z(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*o+r[12]*a,t[1]=r[1]*n+r[5]*i+r[9]*o+r[13]*a,t[2]=r[2]*n+r[6]*i+r[10]*o+r[14]*a,t[3]=r[3]*n+r[7]*i+r[11]*o+r[15]*a,t}function $(t,e,r){var n=e[0],i=e[1],o=e[2],a=r[0],s=r[1],u=r[2],c=r[3],l=c*n+s*o-u*i,f=c*i+u*n-a*o,h=c*o+a*i-s*n,d=-a*n-s*i-u*o;return t[0]=l*c+d*-a+f*-u-h*-s,t[1]=f*c+d*-s+h*-a-l*-u,t[2]=h*c+d*-u+l*-s-f*-a,t[3]=e[3],t}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});var tt,et;tt=new W(4),W!=Float32Array&&(tt[0]=0,tt[1]=0,tt[2]=0,tt[3]=0),et=tt;Math.log2;function rt(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],c=e[7],l=e[8],f=e[9],h=e[10],d=e[11],p=e[12],v=e[13],y=e[14],g=e[15],m=r*s-n*a,b=r*u-i*a,A=r*c-o*a,w=n*u-i*s,B=n*c-o*s,_=i*c-o*u,x=l*v-f*p,C=l*y-h*p,k=l*g-d*p,E=f*y-h*v,O=f*g-d*v,T=h*g-d*y,S=m*T-b*O+A*E+w*k-B*C+_*x;return S?(S=1/S,t[0]=(s*T-u*O+c*E)*S,t[1]=(i*O-n*T-o*E)*S,t[2]=(v*_-y*B+g*w)*S,t[3]=(h*B-f*_-d*w)*S,t[4]=(u*k-a*T-c*C)*S,t[5]=(r*T-i*k+o*C)*S,t[6]=(y*A-p*_-g*b)*S,t[7]=(l*_-h*A+d*b)*S,t[8]=(a*O-s*k+c*x)*S,t[9]=(n*k-r*O-o*x)*S,t[10]=(p*B-v*A+g*m)*S,t[11]=(f*A-l*B-d*m)*S,t[12]=(s*C-a*E-u*x)*S,t[13]=(r*E-n*C+i*x)*S,t[14]=(v*b-p*w-y*m)*S,t[15]=(l*w-f*b+h*m)*S,t):null}function nt(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=e[6],l=e[7],f=e[8],h=e[9],d=e[10],p=e[11],v=e[12],y=e[13],g=e[14],m=e[15],b=r[0],A=r[1],w=r[2],B=r[3];return t[0]=b*n+A*s+w*f+B*v,t[1]=b*i+A*u+w*h+B*y,t[2]=b*o+A*c+w*d+B*g,t[3]=b*a+A*l+w*p+B*m,b=r[4],A=r[5],w=r[6],B=r[7],t[4]=b*n+A*s+w*f+B*v,t[5]=b*i+A*u+w*h+B*y,t[6]=b*o+A*c+w*d+B*g,t[7]=b*a+A*l+w*p+B*m,b=r[8],A=r[9],w=r[10],B=r[11],t[8]=b*n+A*s+w*f+B*v,t[9]=b*i+A*u+w*h+B*y,t[10]=b*o+A*c+w*d+B*g,t[11]=b*a+A*l+w*p+B*m,b=r[12],A=r[13],w=r[14],B=r[15],t[12]=b*n+A*s+w*f+B*v,t[13]=b*i+A*u+w*h+B*y,t[14]=b*o+A*c+w*d+B*g,t[15]=b*a+A*l+w*p+B*m,t}function it(t,e,r){var n,i,o,a,s,u,c,l,f,h,d,p,v=r[0],y=r[1],g=r[2];return e===t?(t[12]=e[0]*v+e[4]*y+e[8]*g+e[12],t[13]=e[1]*v+e[5]*y+e[9]*g+e[13],t[14]=e[2]*v+e[6]*y+e[10]*g+e[14],t[15]=e[3]*v+e[7]*y+e[11]*g+e[15]):(n=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=e[6],l=e[7],f=e[8],h=e[9],d=e[10],p=e[11],t[0]=n,t[1]=i,t[2]=o,t[3]=a,t[4]=s,t[5]=u,t[6]=c,t[7]=l,t[8]=f,t[9]=h,t[10]=d,t[11]=p,t[12]=n*v+s*y+f*g+e[12],t[13]=i*v+u*y+h*g+e[13],t[14]=o*v+c*y+d*g+e[14],t[15]=a*v+l*y+p*g+e[15]),t}function ot(t,e,r){var n=r[0],i=r[1],o=r[2];return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,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 at(t,e,r){var n=Math.sin(r),i=Math.cos(r),o=e[4],a=e[5],s=e[6],u=e[7],c=e[8],l=e[9],f=e[10],h=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=o*i+c*n,t[5]=a*i+l*n,t[6]=s*i+f*n,t[7]=u*i+h*n,t[8]=c*i-o*n,t[9]=l*i-a*n,t[10]=f*i-s*n,t[11]=h*i-u*n,t}function st(t,e,r){var n=Math.sin(r),i=Math.cos(r),o=e[0],a=e[1],s=e[2],u=e[3],c=e[4],l=e[5],f=e[6],h=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*i+c*n,t[1]=a*i+l*n,t[2]=s*i+f*n,t[3]=u*i+h*n,t[4]=c*i-o*n,t[5]=l*i-a*n,t[6]=f*i-s*n,t[7]=h*i-u*n,t}function ut(t,e){var r=e[0],n=e[1],i=e[2],o=e[4],a=e[5],s=e[6],u=e[8],c=e[9],l=e[10];return t[0]=Math.hypot(r,n,i),t[1]=Math.hypot(o,a,s),t[2]=Math.hypot(u,c,l),t}var ct=function(t,e,r,n,i){var o,a=1/Math.tan(e/2);return t[0]=a/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,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!=i&&i!==1/0?(o=1/(n-i),t[10]=(i+n)*o,t[14]=2*i*n*o):(t[10]=-1,t[14]=-2*n),t};var lt=function(t,e,r,n,i,o,a){var s=1/(e-r),u=1/(n-i),c=1/(o-a);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(e+r)*s,t[13]=(i+n)*u,t[14]=(a+o)*c,t[15]=1,t};function ft(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[3]*i+r[6],t[1]=r[1]*n+r[4]*i+r[7],t}function ht(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[4]*i+r[12],t[1]=r[1]*n+r[5]*i+r[13],t}!function(){var t=function(){var t=new W(2);return W!=Float32Array&&(t[0]=0,t[1]=0),t}()}();function dt(){var t=new W(3);return W!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function pt(t,e,r){var n=new W(3);return n[0]=t,n[1]=e,n[2]=r,n}function vt(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function yt(t,e,r){var n=e[0],i=e[1],o=e[2],a=r[0],s=r[1],u=r[2];return t[0]=i*u-o*s,t[1]=o*a-n*u,t[2]=n*s-i*a,t}function gt(t,e,r){var n=e[0],i=e[1],o=e[2],a=r[3]*n+r[7]*i+r[11]*o+r[15];return a=a||1,t[0]=(r[0]*n+r[4]*i+r[8]*o+r[12])/a,t[1]=(r[1]*n+r[5]*i+r[9]*o+r[13])/a,t[2]=(r[2]*n+r[6]*i+r[10]*o+r[14])/a,t}function mt(t,e,r){var n=e[0],i=e[1],o=e[2];return t[0]=n*r[0]+i*r[3]+o*r[6],t[1]=n*r[1]+i*r[4]+o*r[7],t[2]=n*r[2]+i*r[5]+o*r[8],t}function bt(t,e,r){var n=r[0],i=r[1],o=r[2],a=r[3],s=e[0],u=e[1],c=e[2],l=i*c-o*u,f=o*s-n*c,h=n*u-i*s,d=i*h-o*f,p=o*l-n*h,v=n*f-i*l,y=2*a;return l*=y,f*=y,h*=y,d*=2,p*=2,v*=2,t[0]=s+l+d,t[1]=u+f+p,t[2]=c+h+v,t}var At=function(t){var e=t[0],r=t[1],n=t[2];return Math.hypot(e,r,n)};!function(){var t=dt()}();function wt(t,e){if(!t)throw new Error(e||"@math.gl/web-mercator: assertion failed.")}var Bt=Math.PI,_t=Bt/4,xt=Bt/180,Ct=180/Bt;function kt(t){var e=q()(t,2),r=e[0],n=e[1];wt(Number.isFinite(r)),wt(Number.isFinite(n)&&n>=-90&&n<=90,"invalid latitude");var i=n*xt;return[512*(r*xt+Bt)/(2*Bt),512*(Bt+Math.log(Math.tan(_t+.5*i)))/(2*Bt)]}function Et(t){var e=q()(t,2),r=e[0],n=e[1],i=r/512*(2*Bt)-Bt,o=2*(Math.atan(Math.exp(n/512*(2*Bt)-Bt))-_t);return[i*Ct,o*Ct]}Math.PI;r(71);function Ot(t){var e=function(t){for(var e=0,r=0,n=1<<t.length,i=n/512,o=0;o<t.length;o++){n>>=1;var a=parseInt(t[o]);a%2&&(e|=n),a>1&&(r|=n)}return[[e/i,512-r/i],[(e+.99)/i,512-(r+.99)/i]]}(t),r=R()(e,2),n=r[0],i=r[1],o=Et(n),a=R()(o,2),s=a[0],u=a[1],c=Et(i),l=R()(c,2),f=l[0],h=l[1];return[f,u,f,h,s,h,s,u,f,u]}function Tt(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=A()(t);if(e){var i=A()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return m()(this,r)}}var St=function(t){y()(r,t);var e=Tt(r);function r(){return p()(this,r),e.apply(this,arguments)}return E()(r,[{key:"indexToBounds",value:function(){var t=this.props,e=t.data,r=t.getQuadkey;return{data:e,_normalize:!1,positionFormat:"XY",getPolygon:function(t,e){return Ot(r(t,e))}}}}]),r}(M);B()(St,"layerName","QuadkeyLayer"),B()(St,"defaultProps",{getQuadkey:{type:"accessor",value:function(t){return t.quadkey}}});var Mt=r(36),It=r.n(Mt),Rt=r(32),Pt=r.n(Rt),Ft=function(){function t(e){p()(this,t),B()(this,"index",void 0),B()(this,"isVisible",void 0),B()(this,"isSelected",void 0),B()(this,"parent",void 0),B()(this,"children",void 0),B()(this,"content",void 0),B()(this,"state",void 0),B()(this,"layers",void 0),B()(this,"id",void 0),B()(this,"bbox",void 0),B()(this,"zoom",void 0),B()(this,"userData",void 0),B()(this,"_abortController",void 0),B()(this,"_loader",void 0),B()(this,"_loaderId",void 0),B()(this,"_isLoaded",void 0),B()(this,"_isCancelled",void 0),B()(this,"_needsReload",void 0),this.index=e,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}var e;return E()(t,[{key:"data",get:function(){var t=this;return this.isLoading&&this._loader?this._loader.then((function(){return t.data})):this.content}},{key:"isLoaded",get:function(){return this._isLoaded&&!this._needsReload}},{key:"isLoading",get:function(){return Boolean(this._loader)&&!this._isCancelled}},{key:"needsReload",get:function(){return this._needsReload||this._isCancelled}},{key:"byteLength",get:function(){var t=this.content?this.content.byteLength:0;return Number.isFinite(t)||_.log.error("byteLength not defined in tile data")(),t}},{key:"_loadData",value:(e=It()(Pt.a.mark((function t(e){var r,n,i,o,a,s,u,c,l,f,h,d,p,v;return Pt.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.getData,n=e.requestScheduler,i=e.onLoad,o=e.onError,a=this.index,s=this.id,u=this.bbox,c=this.userData,l=this.zoom,f=this._loaderId,this._abortController=new AbortController,h=this._abortController.signal,t.next=7,n.scheduleRequest(this,(function(t){return t.isSelected?1:-1}));case 7:if(d=t.sent){t.next=11;break}return this._isCancelled=!0,t.abrupt("return");case 11:if(!this._isCancelled){t.next=14;break}return d.done(),t.abrupt("return");case 14:return p=null,t.prev=15,t.next=18,r({index:a,id:s,bbox:u,userData:c,zoom:l,signal:h});case 18:p=t.sent,t.next=24;break;case 21:t.prev=21,t.t0=t.catch(15),v=t.t0||!0;case 24:return t.prev=24,d.done(),t.finish(24);case 27:if(f===this._loaderId){t.next=29;break}return t.abrupt("return");case 29:if(this._loader=void 0,this.content=p,!this._isCancelled||p){t.next=34;break}return this._isLoaded=!1,t.abrupt("return");case 34:this._isLoaded=!0,this._isCancelled=!1,v?o(v,this):i(this);case 37:case"end":return t.stop()}}),t,this,[[15,21,24,27]])}))),function(t){return e.apply(this,arguments)})},{key:"loadData",value:function(t){return this._isLoaded=!1,this._isCancelled=!1,this._needsReload=!1,this._loaderId++,this._loader=this._loadData(t),this._loader}},{key:"setNeedsReload",value:function(){this.isLoading&&(this.abort(),this._loader=void 0),this._needsReload=!0}},{key:"abort",value:function(){var t;this.isLoaded||(this._isCancelled=!0,null===(t=this._abortController)||void 0===t||t.abort())}}]),t}(),Dt=r(16),Lt=r.n(Dt),jt=-1,Gt=0,Nt=1,Ut=r(33),Ht=r.n(Ut),Vt=r(34),Jt=r.n(Vt);function zt(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Kt=r(24),qt=r.n(Kt),Wt=r(25),Qt=r.n(Wt),Xt=r(26),Yt=r.n(Xt),Zt=r(27),$t=r.n(Zt),te=r(20),ee=r.n(te);r(51);function re(t,e){if(!t)throw new Error("math.gl assertion ".concat(e))}Math.PI,Math.PI;var ne={EPSILON:1e-12,debug:!1,precision:4,printTypes:!1,printDegrees:!1,printRowMajor:!0};function ie(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.precision,n=void 0===r?ne.precision:r;return t=ue(t),"".concat(parseFloat(t.toPrecision(n)))}function oe(t){return Array.isArray(t)||ArrayBuffer.isView(t)&&!(t instanceof DataView)}function ae(t,e,r){return oe(t)?t.map((function(t,n){return ae(t,e[n],r)})):r*e+(1-r)*t}function se(t,e,r){var n=ne.EPSILON;r&&(ne.EPSILON=r);try{if(t===e)return!0;if(oe(t)&&oe(e)){if(t.length!==e.length)return!1;for(var i=0;i<t.length;++i)if(!se(t[i],e[i]))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)<=ne.EPSILON*Math.max(1,Math.abs(t),Math.abs(e))}finally{ne.EPSILON=n}}function ue(t){return Math.round(t/ne.EPSILON)*ne.EPSILON}function ce(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=ee()(t);if(e){var i=ee()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return $t()(this,r)}}var le=function(t){Yt()(r,t);var e=ce(r);function r(){return qt()(this,r),e.apply(this,arguments)}return Qt()(r,[{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"fromArray",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=0;r<this.ELEMENTS;++r)this[r]=t[r+e];return this.check()}},{key:"toArray",value:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=0;r<this.ELEMENTS;++r)t[e+r]=this[r];return t}},{key:"from",value:function(t){return Array.isArray(t)?this.copy(t):this.fromObject(t)}},{key:"to",value:function(t){return t===this?this:oe(t)?this.toArray(t):this.toObject(t)}},{key:"toTarget",value:function(t){return t?this.to(t):this}},{key:"toFloat32Array",value:function(){return new Float32Array(this)}},{key:"toString",value:function(){return this.formatString(ne)}},{key:"formatString",value:function(t){for(var e="",r=0;r<this.ELEMENTS;++r)e+=(r>0?", ":"")+ie(this[r],t);return"".concat(t.printTypes?this.constructor.name:"","[").concat(e,"]")}},{key:"equals",value:function(t){if(!t||this.length!==t.length)return!1;for(var e=0;e<this.ELEMENTS;++e)if(!se(this[e],t[e]))return!1;return!0}},{key:"exactEquals",value:function(t){if(!t||this.length!==t.length)return!1;for(var e=0;e<this.ELEMENTS;++e)if(this[e]!==t[e])return!1;return!0}},{key:"negate",value:function(){for(var t=0;t<this.ELEMENTS;++t)this[t]=-this[t];return this.check()}},{key:"lerp",value:function(t,e,r){if(void 0===r)return this.lerp(this,t,e);for(var n=0;n<this.ELEMENTS;++n){var i=t[n];this[n]=i+r*(e[n]-i)}return this.check()}},{key:"min",value:function(t){for(var e=0;e<this.ELEMENTS;++e)this[e]=Math.min(t[e],this[e]);return this.check()}},{key:"max",value:function(t){for(var e=0;e<this.ELEMENTS;++e)this[e]=Math.max(t[e],this[e]);return this.check()}},{key:"clamp",value:function(t,e){for(var r=0;r<this.ELEMENTS;++r)this[r]=Math.min(Math.max(this[r],t[r]),e[r]);return this.check()}},{key:"add",value:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];for(var n=0,i=e;n<i.length;n++)for(var o=i[n],a=0;a<this.ELEMENTS;++a)this[a]+=o[a];return this.check()}},{key:"subtract",value:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];for(var n=0,i=e;n<i.length;n++)for(var o=i[n],a=0;a<this.ELEMENTS;++a)this[a]-=o[a];return this.check()}},{key:"scale",value:function(t){if("number"==typeof t)for(var e=0;e<this.ELEMENTS;++e)this[e]*=t;else for(var r=0;r<this.ELEMENTS&&r<t.length;++r)this[r]*=t[r];return this.check()}},{key:"multiplyByScalar",value:function(t){for(var e=0;e<this.ELEMENTS;++e)this[e]*=t;return this.check()}},{key:"check",value:function(){if(ne.debug&&!this.validate())throw new Error("math.gl: ".concat(this.constructor.name," some fields set to invalid numbers'"));return this}},{key:"validate",value:function(){for(var t=this.length===this.ELEMENTS,e=0;e<this.ELEMENTS;++e)t=t&&Number.isFinite(this[e]);return t}},{key:"sub",value:function(t){return this.subtract(t)}},{key:"setScalar",value:function(t){for(var e=0;e<this.ELEMENTS;++e)this[e]=t;return this.check()}},{key:"addScalar",value:function(t){for(var e=0;e<this.ELEMENTS;++e)this[e]+=t;return this.check()}},{key:"subScalar",value:function(t){return this.addScalar(-t)}},{key:"multiplyScalar",value:function(t){for(var e=0;e<this.ELEMENTS;++e)this[e]*=t;return this.check()}},{key:"divideScalar",value:function(t){return this.multiplyByScalar(1/t)}},{key:"clampScalar",value:function(t,e){for(var r=0;r<this.ELEMENTS;++r)this[r]=Math.min(Math.max(this[r],t),e);return this.check()}},{key:"elements",get:function(){return this}}]),r}(function(t){function e(){var e=Reflect.construct(t,Array.from(arguments));return Object.setPrototypeOf(e,Object.getPrototypeOf(this)),e}return e.prototype=Object.create(t.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t,e}(Array));function fe(t,e){if(t.length!==e)return!1;for(var r=0;r<t.length;++r)if(!Number.isFinite(t[r]))return!1;return!0}function he(t){if(!Number.isFinite(t))throw new Error("Invalid number ".concat(t));return t}function de(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(ne.debug&&!fe(t,e))throw new Error("math.gl: ".concat(r," some fields set to invalid numbers'"));return t}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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=ee()(t);if(e){var i=ee()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return $t()(this,r)}}var ve=function(t){Yt()(r,t);var e=pe(r);function r(){return qt()(this,r),e.apply(this,arguments)}return Qt()(r,[{key:"x",get:function(){return this[0]},set:function(t){this[0]=he(t)}},{key:"y",get:function(){return this[1]},set:function(t){this[1]=he(t)}},{key:"len",value:function(){return Math.sqrt(this.lengthSquared())}},{key:"magnitude",value:function(){return this.len()}},{key:"lengthSquared",value:function(){for(var t=0,e=0;e<this.ELEMENTS;++e)t+=this[e]*this[e];return t}},{key:"magnitudeSquared",value:function(){return this.lengthSquared()}},{key:"distance",value:function(t){return Math.sqrt(this.distanceSquared(t))}},{key:"distanceSquared",value:function(t){for(var e=0,r=0;r<this.ELEMENTS;++r){var n=this[r]-t[r];e+=n*n}return he(e)}},{key:"dot",value:function(t){for(var e=0,r=0;r<this.ELEMENTS;++r)e+=this[r]*t[r];return he(e)}},{key:"normalize",value:function(){var t=this.magnitude();if(0!==t)for(var e=0;e<this.ELEMENTS;++e)this[e]/=t;return this.check()}},{key:"multiply",value:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];for(var n=0,i=e;n<i.length;n++)for(var o=i[n],a=0;a<this.ELEMENTS;++a)this[a]*=o[a];return this.check()}},{key:"divide",value:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];for(var n=0,i=e;n<i.length;n++)for(var o=i[n],a=0;a<this.ELEMENTS;++a)this[a]/=o[a];return this.check()}},{key:"lengthSq",value:function(){return this.lengthSquared()}},{key:"distanceTo",value:function(t){return this.distance(t)}},{key:"distanceToSquared",value:function(t){return this.distanceSquared(t)}},{key:"getComponent",value:function(t){return re(t>=0&&t<this.ELEMENTS,"index is out of range"),he(this[t])}},{key:"setComponent",value:function(t,e){return re(t>=0&&t<this.ELEMENTS,"index is out of range"),this[t]=e,this.check()}},{key:"addVectors",value:function(t,e){return this.copy(t).add(e)}},{key:"subVectors",value:function(t,e){return this.copy(t).subtract(e)}},{key:"multiplyVectors",value:function(t,e){return this.copy(t).multiply(e)}},{key:"addScaledVector",value:function(t,e){return this.add(new this.constructor(t).multiplyScalar(e))}}]),r}(le);function ye(t,e,r){var n=e[0],i=e[1],o=r[3]*n+r[7]*i||1;return t[0]=(r[0]*n+r[4]*i)/o,t[1]=(r[1]*n+r[5]*i)/o,t}function ge(t,e,r){var n=e[0],i=e[1],o=e[2],a=r[3]*n+r[7]*i+r[11]*o||1;return t[0]=(r[0]*n+r[4]*i+r[8]*o)/a,t[1]=(r[1]*n+r[5]*i+r[9]*o)/a,t[2]=(r[2]*n+r[6]*i+r[10]*o)/a,t}function me(t,e,r){var n=e[0],i=e[1],o=e[2];return t[0]=r[0]*n+r[3]*i+r[6]*o,t[1]=r[1]*n+r[4]*i+r[7]*o,t[2]=r[2]*n+r[5]*i+r[8]*o,t[3]=e[3],t}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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=ee()(t);if(e){var i=ee()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return $t()(this,r)}}var Ae,we=[0,0,0],Be=function(t){Yt()(r,t);var e=be(r);function r(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return qt()(this,r),t=e.call(this,-0,-0,-0),1===arguments.length&&oe(n)?t.copy(n):(ne.debug&&(he(n),he(i),he(o)),t[0]=n,t[1]=i,t[2]=o),t}return Qt()(r,[{key:"set",value:function(t,e,r){return this[0]=t,this[1]=e,this[2]=r,this.check()}},{key:"copy",value:function(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this.check()}},{key:"fromObject",value:function(t){return ne.debug&&(he(t.x),he(t.y),he(t.z)),this[0]=t.x,this[1]=t.y,this[2]=t.z,this.check()}},{key:"toObject",value:function(t){return t.x=this[0],t.y=this[1],t.z=this[2],t}},{key:"ELEMENTS",get:function(){return 3}},{key:"z",get:function(){return this[2]},set:function(t){this[2]=he(t)}},{key:"angle",value:function(t){return r=t,n=(e=this)[0],i=e[1],o=e[2],a=r[0],s=r[1],u=r[2],c=Math.sqrt(n*n+i*i+o*o)*Math.sqrt(a*a+s*s+u*u),l=c&&vt(e,r)/c,Math.acos(Math.min(Math.max(l,-1),1));var e,r,n,i,o,a,s,u,c,l}},{key:"cross",value:function(t){return yt(this,this,t),this.check()}},{key:"rotateX",value:function(t){var e=t.radians,r=t.origin;return function(t,e,r,n){var i=[],o=[];i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],o[0]=i[0],o[1]=i[1]*Math.cos(n)-i[2]*Math.sin(n),o[2]=i[1]*Math.sin(n)+i[2]*Math.cos(n),t[0]=o[0]+r[0],t[1]=o[1]+r[1],t[2]=o[2]+r[2]}(this,this,void 0===r?we:r,e),this.check()}},{key:"rotateY",value:function(t){var e=t.radians,r=t.origin;return function(t,e,r,n){var i=[],o=[];i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],o[0]=i[2]*Math.sin(n)+i[0]*Math.cos(n),o[1]=i[1],o[2]=i[2]*Math.cos(n)-i[0]*Math.sin(n),t[0]=o[0]+r[0],t[1]=o[1]+r[1],t[2]=o[2]+r[2]}(this,this,void 0===r?we:r,e),this.check()}},{key:"rotateZ",value:function(t){var e=t.radians,r=t.origin;return function(t,e,r,n){var i=[],o=[];i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],o[0]=i[0]*Math.cos(n)-i[1]*Math.sin(n),o[1]=i[0]*Math.sin(n)+i[1]*Math.cos(n),o[2]=i[2],t[0]=o[0]+r[0],t[1]=o[1]+r[1],t[2]=o[2]+r[2]}(this,this,void 0===r?we:r,e),this.check()}},{key:"transform",value:function(t){return this.transformAsPoint(t)}},{key:"transformAsPoint",value:function(t){return gt(this,this,t),this.check()}},{key:"transformAsVector",value:function(t){return ge(this,this,t),this.check()}},{key:"transformByMatrix3",value:function(t){return mt(this,this,t),this.check()}},{key:"transformByMatrix2",value:function(t){return function(t,e,r){var n=e[0],i=e[1];t[0]=r[0]*n+r[2]*i,t[1]=r[1]*n+r[3]*i,t[2]=e[2]}(this,this,t),this.check()}},{key:"transformByQuaternion",value:function(t){return bt(this,this,t),this.check()}}],[{key:"ZERO",get:function(){return Ae||(Ae=new r(0,0,0),Object.freeze(Ae)),Ae}}]),r}(ve),_e=new Be,xe=new Be,Ce=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[0,0,0],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0],n=arguments.length>2?arguments[2]:void 0;Ht()(this,t),zt(this,"center",void 0),zt(this,"halfDiagonal",void 0),zt(this,"minimum",void 0),zt(this,"maximum",void 0),n=n||_e.copy(e).add(r).scale(.5),this.center=new Be(n),this.halfDiagonal=new Be(r).subtract(this.center),this.minimum=new Be(e),this.maximum=new Be(r)}return Jt()(t,[{key:"clone",value:function(){return new t(this.minimum,this.maximum,this.center)}},{key:"equals",value:function(t){return this===t||Boolean(t)&&this.minimum.equals(t.minimum)&&this.maximum.equals(t.maximum)}},{key:"transform",value:function(t){return this.center.transformAsPoint(t),this.halfDiagonal.transform(t),this.minimum.transform(t),this.maximum.transform(t),this}},{key:"intersectPlane",value:function(t){var e=this.halfDiagonal,r=xe.from(t.normal),n=e.x*Math.abs(r.x)+e.y*Math.abs(r.y)+e.z*Math.abs(r.z),i=this.center.dot(r)+t.distance;return i-n>0?Nt:i+n<0?jt:Gt}},{key:"distanceTo",value:function(t){return Math.sqrt(this.distanceSquaredTo(t))}},{key:"distanceSquaredTo",value:function(t){var e,r=_e.from(t).subtract(this.center),n=this.halfDiagonal,i=0;return(e=Math.abs(r.x)-n.x)>0&&(i+=e*e),(e=Math.abs(r.y)-n.y)>0&&(i+=e*e),(e=Math.abs(r.z)-n.z)>0&&(i+=e*e),i}}]),t}(),ke=new Be,Ee=new Be,Oe=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[0,0,0],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;Ht()(this,t),zt(this,"center",void 0),zt(this,"radius",void 0),this.radius=-0,this.center=new Be,this.fromCenterRadius(e,r)}return Jt()(t,[{key:"fromCenterRadius",value:function(t,e){return this.center.from(t),this.radius=e,this}},{key:"fromCornerPoints",value:function(t,e){return e=ke.from(e),this.center=(new Be).from(t).add(e).scale(.5),this.radius=this.center.distance(e),this}},{key:"equals",value:function(t){return this===t||Boolean(t)&&this.center.equals(t.center)&&this.radius===t.radius}},{key:"clone",value:function(){return new t(this.center,this.radius)}},{key:"union",value:function(t){var e=this.center,r=this.radius,n=t.center,i=t.radius,o=ke.copy(n).subtract(e),a=o.magnitude();if(r>=a+i)return this.clone();if(i>=a+r)return t.clone();var s=.5*(r+a+i);return Ee.copy(o).scale((-r+s)/a).add(e),this.center.copy(Ee),this.radius=s,this}},{key:"expand",value:function(t){var e=ke.from(t).subtract(this.center).magnitude();return e>this.radius&&(this.radius=e),this}},{key:"transform",value:function(t){this.center.transform(t);var e=ut(ke,t);return this.radius=Math.max(e[0],Math.max(e[1],e[2]))*this.radius,this}},{key:"distanceSquaredTo",value:function(t){var e=this.distanceTo(t);return e*e}},{key:"distanceTo",value:function(t){var e=ke.from(t).subtract(this.center);return Math.max(0,e.len()-this.radius)}},{key:"intersectPlane",value:function(t){var e=this.center,r=this.radius,n=t.normal.dot(e)+t.distance;return n<-r?jt:n<r?Gt:Nt}}]),t}(),Te=r(39),Se=r.n(Te);function Me(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=ee()(t);if(e){var i=ee()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return $t()(this,r)}}var Ie=function(t){Yt()(r,t);var e=Me(r);function r(){return qt()(this,r),e.apply(this,arguments)}return Qt()(r,[{key:"toString",value:function(){var t="[";if(ne.printRowMajor){t+="row-major:";for(var e=0;e<this.RANK;++e)for(var r=0;r<this.RANK;++r)t+=" ".concat(this[r*this.RANK+e])}else{t+="column-major:";for(var n=0;n<this.ELEMENTS;++n)t+=" ".concat(this[n])}return t+="]"}},{key:"getElementIndex",value:function(t,e){return e*this.RANK+t}},{key:"getElement",value:function(t,e){return this[e*this.RANK+t]}},{key:"setElement",value:function(t,e,r){return this[e*this.RANK+t]=he(r),this}},{key:"getColumn",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Array(this.RANK).fill(-0),r=t*this.RANK,n=0;n<this.RANK;++n)e[n]=this[r+n];return e}},{key:"setColumn",value:function(t,e){for(var r=t*this.RANK,n=0;n<this.RANK;++n)this[r+n]=e[n];return this}}]),r}(le);function Re(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=e[6],l=e[7],f=e[8],h=r[0],d=r[1],p=r[2],v=r[3],y=r[4],g=r[5],m=r[6],b=r[7],A=r[8];return t[0]=h*n+d*a+p*c,t[1]=h*i+d*s+p*l,t[2]=h*o+d*u+p*f,t[3]=v*n+y*a+g*c,t[4]=v*i+y*s+g*l,t[5]=v*o+y*u+g*f,t[6]=m*n+b*a+A*c,t[7]=m*i+b*s+A*l,t[8]=m*o+b*u+A*f,t}function Pe(t,e,r){var n=r[0],i=r[1];return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=i*e[3],t[4]=i*e[4],t[5]=i*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}var Fe;function De(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=ee()(t);if(e){var i=ee()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return $t()(this,r)}}!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"}(Fe||(Fe={}));var Le,je,Ge,Ne=Object.freeze([1,0,0,0,1,0,0,0,1]),Ue=function(t){Yt()(r,t);var e=De(r);function r(t){for(var n,i=arguments.length,o=new Array(i>1?i-1:0),a=1;a<i;a++)o[a-1]=arguments[a];return qt()(this,r),n=e.call(this,-0,-0,-0,-0,-0,-0,-0,-0,-0),1===arguments.length&&Array.isArray(t)?n.copy(t):o.length>0?n.copy([t].concat(o)):n.identity(),n}return Qt()(r,[{key:"ELEMENTS",get:function(){return 9}},{key:"RANK",get:function(){return 3}},{key:"INDICES",get:function(){return Fe}},{key:"copy",value:function(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()}},{key:"identity",value:function(){return this.copy(Ne)}},{key:"fromObject",value:function(t){return this.check()}},{key:"fromQuaternion",value:function(t){return function(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=r+r,s=n+n,u=i+i,c=r*a,l=n*a,f=n*s,h=i*a,d=i*s,p=i*u,v=o*a,y=o*s,g=o*u;t[0]=1-f-p,t[3]=l-g,t[6]=h+y,t[1]=l+g,t[4]=1-c-p,t[7]=d-v,t[2]=h-y,t[5]=d+v,t[8]=1-c-f}(this,t),this.check()}},{key:"set",value:function(t,e,r,n,i,o,a,s,u){return this[0]=t,this[1]=e,this[2]=r,this[3]=n,this[4]=i,this[5]=o,this[6]=a,this[7]=s,this[8]=u,this.check()}},{key:"setRowMajor",value:function(t,e,r,n,i,o,a,s,u){return this[0]=t,this[1]=n,this[2]=a,this[3]=e,this[4]=i,this[5]=s,this[6]=r,this[7]=o,this[8]=u,this.check()}},{key:"determinant",value:function(){return e=(t=this)[0],r=t[1],n=t[2],i=t[3],o=t[4],a=t[5],s=t[6],u=t[7],c=t[8],e*(c*o-a*u)+r*(-c*i+a*s)+n*(u*i-o*s);var t,e,r,n,i,o,a,s,u,c}},{key:"transpose",value:function(){return function(t,e){if(t===e){var r=e[1],n=e[2],i=e[5];t[1]=e[3],t[2]=e[6],t[3]=r,t[5]=e[7],t[6]=n,t[7]=i}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]}(this,this),this.check()}},{key:"invert",value:function(){return function(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],c=e[7],l=e[8],f=l*a-s*c,h=-l*o+s*u,d=c*o-a*u,p=r*f+n*h+i*d;p&&(p=1/p,t[0]=f*p,t[1]=(-l*n+i*c)*p,t[2]=(s*n-i*a)*p,t[3]=h*p,t[4]=(l*r-i*u)*p,t[5]=(-s*r+i*o)*p,t[6]=d*p,t[7]=(-c*r+n*u)*p,t[8]=(a*r-n*o)*p)}(this,this),this.check()}},{key:"multiplyLeft",value:function(t){return Re(this,t,this),this.check()}},{key:"multiplyRight",value:function(t){return Re(this,this,t),this.check()}},{key:"rotate",value:function(t){return function(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=e[6],l=e[7],f=e[8],h=Math.sin(r),d=Math.cos(r);t[0]=d*n+h*a,t[1]=d*i+h*s,t[2]=d*o+h*u,t[3]=d*a-h*n,t[4]=d*s-h*i,t[5]=d*u-h*o,t[6]=c,t[7]=l,t[8]=f}(this,this,t),this.check()}},{key:"scale",value:function(t){return Array.isArray(t)?Pe(this,this,t):Pe(this,this,[t,t]),this.check()}},{key:"translate",value:function(t){return function(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=e[6],l=e[7],f=e[8],h=r[0],d=r[1];t[0]=n,t[1]=i,t[2]=o,t[3]=a,t[4]=s,t[5]=u,t[6]=h*n+d*a+c,t[7]=h*i+d*s+l,t[8]=h*o+d*u+f}(this,this,t),this.check()}},{key:"transform",value:function(t,e){var r;switch(t.length){case 2:r=ft(e||[-0,-0],t,this);break;case 3:r=mt(e||[-0,-0,-0],t,this);break;case 4:r=me(e||[-0,-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return de(r,t.length),r}},{key:"transformVector",value:function(t,e){return this.transform(t,e)}},{key:"transformVector2",value:function(t,e){return this.transform(t,e)}},{key:"transformVector3",value:function(t,e){return this.transform(t,e)}}],[{key:"IDENTITY",get:function(){return function(){je||(je=new Ue,Object.freeze(je));return je}()}},{key:"ZERO",get:function(){return function(){Le||(Le=new Ue([0,0,0,0,0,0,0,0,0]),Object.freeze(Le));return Le}()}}]),r}(Ie);function He(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=ee()(t);if(e){var i=ee()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return $t()(this,r)}}var Ve=function(t){Yt()(r,t);var e=He(r);function r(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return qt()(this,r),t=e.call(this,-0,-0,-0,-0),oe(n)&&1===arguments.length?t.copy(n):(ne.debug&&(he(n),he(i),he(o),he(a)),t[0]=n,t[1]=i,t[2]=o,t[3]=a),t}return Qt()(r,[{key:"set",value:function(t,e,r,n){return this[0]=t,this[1]=e,this[2]=r,this[3]=n,this.check()}},{key:"copy",value:function(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this.check()}},{key:"fromObject",value:function(t){return ne.debug&&(he(t.x),he(t.y),he(t.z),he(t.w)),this[0]=t.x,this[1]=t.y,this[2]=t.z,this[3]=t.w,this}},{key:"toObject",value:function(t){return t.x=this[0],t.y=this[1],t.z=this[2],t.w=this[3],t}},{key:"ELEMENTS",get:function(){return 4}},{key:"z",get:function(){return this[2]},set:function(t){this[2]=he(t)}},{key:"w",get:function(){return this[3]},set:function(t){this[3]=he(t)}},{key:"transform",value:function(t){return gt(this,this,t),this.check()}},{key:"transformByMatrix3",value:function(t){return me(this,this,t),this.check()}},{key:"transformByMatrix2",value:function(t){return function(t,e,r){var n=e[0],i=e[1];t[0]=r[0]*n+r[2]*i,t[1]=r[1]*n+r[3]*i,t[2]=e[2],t[3]=e[3]}(this,this,t),this.check()}},{key:"transformByQuaternion",value:function(t){return bt(this,this,t),this.check()}},{key:"applyMatrix4",value:function(t){return t.transform(this,this),this}}],[{key:"ZERO",get:function(){return Ge||(Ge=new r(0,0,0,0),Object.freeze(Ge)),Ge}}]),r}(ve);function Je(){var t=new W(4);return W!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function ze(t,e,r){r*=.5;var n=Math.sin(r);return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=Math.cos(r),t}function Ke(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=r[0],u=r[1],c=r[2],l=r[3];return t[0]=n*l+a*s+i*c-o*u,t[1]=i*l+a*u+o*s-n*c,t[2]=o*l+a*c+n*u-i*s,t[3]=a*l-n*s-i*u-o*c,t}function qe(t,e,r,n){var i,o,a,s,u,c=e[0],l=e[1],f=e[2],h=e[3],d=r[0],p=r[1],v=r[2],y=r[3];return(o=c*d+l*p+f*v+h*y)<0&&(o=-o,d=-d,p=-p,v=-v,y=-y),1-o>1e-6?(i=Math.acos(o),a=Math.sin(i),s=Math.sin((1-n)*i)/a,u=Math.sin(n*i)/a):(s=1-n,u=n),t[0]=s*c+u*d,t[1]=s*l+u*p,t[2]=s*f+u*v,t[3]=s*h+u*y,t}function We(t,e){var r,n=e[0]+e[4]+e[8];if(n>0)r=Math.sqrt(n+1),t[3]=.5*r,r=.5/r,t[0]=(e[5]-e[7])*r,t[1]=(e[6]-e[2])*r,t[2]=(e[1]-e[3])*r;else{var i=0;e[4]>e[0]&&(i=1),e[8]>e[3*i+i]&&(i=2);var o=(i+1)%3,a=(i+2)%3;r=Math.sqrt(e[3*i+i]-e[3*o+o]-e[3*a+a]+1),t[i]=.5*r,r=.5/r,t[3]=(e[3*o+a]-e[3*a+o])*r,t[o]=(e[3*o+i]+e[3*i+o])*r,t[a]=(e[3*a+i]+e[3*i+a])*r}return t}var Qe,Xe,Ye,Ze,$e,tr,er=function(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t},rr=Q,nr=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]},ir=function(t,e,r,n){var i=e[0],o=e[1],a=e[2],s=e[3];return t[0]=i+n*(r[0]-i),t[1]=o+n*(r[1]-o),t[2]=a+n*(r[2]-a),t[3]=s+n*(r[3]-s),t},or=X,ar=Y,sr=function(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=r*r+n*n+i*i+o*o;return a>0&&(a=1/Math.sqrt(a)),t[0]=r*a,t[1]=n*a,t[2]=i*a,t[3]=o*a,t},ur=(Qe=dt(),Xe=pt(1,0,0),Ye=pt(0,1,0),function(t,e,r){var n=vt(e,r);return n<-.999999?(yt(Qe,Xe,e),At(Qe)<1e-6&&yt(Qe,Ye,e),function(t,e){var r=e[0],n=e[1],i=e[2],o=r*r+n*n+i*i;o>0&&(o=1/Math.sqrt(o)),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o}(Qe,Qe),ze(t,Qe,Math.PI),t):n>.999999?(t[0]=0,t[1]=0,t[2]=0,t[3]=1,t):(yt(Qe,e,r),t[0]=Qe[0],t[1]=Qe[1],t[2]=Qe[2],t[3]=1+n,sr(t,t))});Ze=Je(),$e=Je(),tr=function(){var t=new W(9);return W!=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 cr(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=ee()(t);if(e){var i=ee()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return $t()(this,r)}}var lr=[0,0,0,1],fr=function(t){Yt()(r,t);var e=cr(r);function r(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;return qt()(this,r),t=e.call(this,-0,-0,-0,-0),Array.isArray(n)&&1===arguments.length?t.copy(n):t.set(n,i,o,a),t}return Qt()(r,[{key:"copy",value:function(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this.check()}},{key:"set",value:function(t,e,r,n){return this[0]=t,this[1]=e,this[2]=r,this[3]=n,this.check()}},{key:"fromObject",value:function(t){return this[0]=t.x,this[1]=t.y,this[2]=t.z,this[3]=t.w,this.check()}},{key:"fromMatrix3",value:function(t){return We(this,t),this.check()}},{key:"fromAxisRotation",value:function(t,e){return ze(this,t,e),this.check()}},{key:"identity",value:function(){return function(t){t[0]=0,t[1]=0,t[2]=0,t[3]=1}(this),this.check()}},{key:"setAxisAngle",value:function(t,e){return this.fromAxisRotation(t,e)}},{key:"ELEMENTS",get:function(){return 4}},{key:"x",get:function(){return this[0]},set:function(t){this[0]=he(t)}},{key:"y",get:function(){return this[1]},set:function(t){this[1]=he(t)}},{key:"z",get:function(){return this[2]},set:function(t){this[2]=he(t)}},{key:"w",get:function(){return this[3]},set:function(t){this[3]=he(t)}},{key:"len",value:function(){return or(this)}},{key:"lengthSquared",value:function(){return ar(this)}},{key:"dot",value:function(t){return nr(this,t)}},{key:"rotationTo",value:function(t,e){return ur(this,t,e),this.check()}},{key:"add",value:function(t){return er(this,this,t),this.check()}},{key:"calculateW",value:function(){return function(t,e){var r=e[0],n=e[1],i=e[2];t[0]=r,t[1]=n,t[2]=i,t[3]=Math.sqrt(Math.abs(1-r*r-n*n-i*i))}(this,this),this.check()}},{key:"conjugate",value:function(){return function(t,e){t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3]}(this,this),this.check()}},{key:"invert",value:function(){return function(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=r*r+n*n+i*i+o*o,s=a?1/a:0;t[0]=-r*s,t[1]=-n*s,t[2]=-i*s,t[3]=o*s}(this,this),this.check()}},{key:"lerp",value:function(t,e,r){return void 0===r?this.lerp(this,t,e):(ir(this,t,e,r),this.check())}},{key:"multiplyRight",value:function(t){return Ke(this,this,t),this.check()}},{key:"multiplyLeft",value:function(t){return Ke(this,t,this),this.check()}},{key:"normalize",value:function(){var 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()}},{key:"rotateX",value:function(t){return function(t,e,r){r*=.5;var n=e[0],i=e[1],o=e[2],a=e[3],s=Math.sin(r),u=Math.cos(r);t[0]=n*u+a*s,t[1]=i*u+o*s,t[2]=o*u-i*s,t[3]=a*u-n*s}(this,this,t),this.check()}},{key:"rotateY",value:function(t){return function(t,e,r){r*=.5;var n=e[0],i=e[1],o=e[2],a=e[3],s=Math.sin(r),u=Math.cos(r);t[0]=n*u-o*s,t[1]=i*u+a*s,t[2]=o*u+n*s,t[3]=a*u-i*s}(this,this,t),this.check()}},{key:"rotateZ",value:function(t){return function(t,e,r){r*=.5;var n=e[0],i=e[1],o=e[2],a=e[3],s=Math.sin(r),u=Math.cos(r);t[0]=n*u+i*s,t[1]=i*u-n*s,t[2]=o*u+a*s,t[3]=a*u-o*s}(this,this,t),this.check()}},{key:"scale",value:function(t){return rr(this,this,t),this.check()}},{key:"slerp",value:function(t,e,r){var n,i,o;switch(arguments.length){case 1:var a=t.start;n=void 0===a?lr:a,i=t.target,o=t.ratio;break;case 2:n=this,i=t,o=e;break;default:n=t,i=e,o=r}return qe(this,n,i,o),this.check()}},{key:"transformVector4",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Ve;return $(e,t,this),de(e,4)}},{key:"lengthSq",value:function(){return this.lengthSquared()}},{key:"setFromAxisAngle",value:function(t,e){return this.setAxisAngle(t,e)}},{key:"premultiply",value:function(t){return this.multiplyLeft(t)}},{key:"multiply",value:function(t){return this.multiplyRight(t)}}]),r}(le),hr=new Be,dr=new Be,pr=new Be,vr=new Be,yr=new Be,gr=new Be,mr=new Be,br=0,Ar=1,wr=2,Br=3,_r=4,xr=5,Cr=6,kr=7,Er=8,Or=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[0,0,0],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0,0,0,0,0,0,0];Ht()(this,t),zt(this,"center",void 0),zt(this,"halfAxes",void 0),this.center=(new Be).from(e),this.halfAxes=new Ue(r)}return Jt()(t,[{key:"halfSize",get:function(){var t=this.halfAxes.getColumn(0),e=this.halfAxes.getColumn(1),r=this.halfAxes.getColumn(2);return[new Be(t).len(),new Be(e).len(),new Be(r).len()]}},{key:"quaternion",get:function(){var t=this.halfAxes.getColumn(0),e=this.halfAxes.getColumn(1),r=this.halfAxes.getColumn(2),n=new Be(t).normalize(),i=new Be(e).normalize(),o=new Be(r).normalize();return(new fr).fromMatrix3(new Ue([].concat(Se()(n),Se()(i),Se()(o))))}},{key:"fromCenterHalfSizeQuaternion",value:function(t,e,r){var n=new fr(r),i=(new Ue).fromQuaternion(n);return i[0]=i[0]*e[0],i[1]=i[1]*e[0],i[2]=i[2]*e[0],i[3]=i[3]*e[1],i[4]=i[4]*e[1],i[5]=i[5]*e[1],i[6]=i[6]*e[2],i[7]=i[7]*e[2],i[8]=i[8]*e[2],this.center=(new Be).from(t),this.halfAxes=i,this}},{key:"clone",value:function(){return new t(this.center,this.halfAxes)}},{key:"equals",value:function(t){return this===t||Boolean(t)&&this.center.equals(t.center)&&this.halfAxes.equals(t.halfAxes)}},{key:"getBoundingSphere",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Oe,e=this.halfAxes,r=e.getColumn(0,pr),n=e.getColumn(1,vr),i=e.getColumn(2,yr),o=hr.copy(r).add(n).add(i);return t.center.copy(this.center),t.radius=o.magnitude(),t}},{key:"intersectPlane",value:function(t){var e=this.center,r=t.normal,n=this.halfAxes,i=r.x,o=r.y,a=r.z,s=Math.abs(i*n[br]+o*n[Ar]+a*n[wr])+Math.abs(i*n[Br]+o*n[_r]+a*n[xr])+Math.abs(i*n[Cr]+o*n[kr]+a*n[Er]),u=r.dot(e)+t.distance;return u<=-s?jt:u>=s?Nt:Gt}},{key:"distanceTo",value:function(t){return Math.sqrt(this.distanceSquaredTo(t))}},{key:"distanceSquaredTo",value:function(t){var e=dr.from(t).subtract(this.center),r=this.halfAxes,n=r.getColumn(0,pr),i=r.getColumn(1,vr),o=r.getColumn(2,yr),a=n.magnitude(),s=i.magnitude(),u=o.magnitude();n.normalize(),i.normalize(),o.normalize();var c,l=0;return(c=Math.abs(e.dot(n))-a)>0&&(l+=c*c),(c=Math.abs(e.dot(i))-s)>0&&(l+=c*c),(c=Math.abs(e.dot(o))-u)>0&&(l+=c*c),l}},{key:"computePlaneDistances",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[-0,-0],n=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY,o=this.center,a=this.halfAxes,s=a.getColumn(0,pr),u=a.getColumn(1,vr),c=a.getColumn(2,yr),l=gr.copy(s).add(u).add(c).add(o),f=mr.copy(l).subtract(t),h=e.dot(f);return n=Math.min(h,n),i=Math.max(h,i),l.copy(o).add(s).add(u).subtract(c),f.copy(l).subtract(t),h=e.dot(f),n=Math.min(h,n),i=Math.max(h,i),l.copy(o).add(s).subtract(u).add(c),f.copy(l).subtract(t),h=e.dot(f),n=Math.min(h,n),i=Math.max(h,i),l.copy(o).add(s).subtract(u).subtract(c),f.copy(l).subtract(t),h=e.dot(f),n=Math.min(h,n),i=Math.max(h,i),o.copy(l).subtract(s).add(u).add(c),f.copy(l).subtract(t),h=e.dot(f),n=Math.min(h,n),i=Math.max(h,i),o.copy(l).subtract(s).add(u).subtract(c),f.copy(l).subtract(t),h=e.dot(f),n=Math.min(h,n),i=Math.max(h,i),o.copy(l).subtract(s).subtract(u).add(c),f.copy(l).subtract(t),h=e.dot(f),n=Math.min(h,n),i=Math.max(h,i),o.copy(l).subtract(s).subtract(u).subtract(c),f.copy(l).subtract(t),h=e.dot(f),n=Math.min(h,n),i=Math.max(h,i),r[0]=n,r[1]=i,r}},{key:"transform",value:function(t){this.center.transformAsPoint(t);var e=this.halfAxes.getColumn(0,pr);e.transformAsPoint(t);var r=this.halfAxes.getColumn(1,vr);r.transformAsPoint(t);var n=this.halfAxes.getColumn(2,yr);return n.transformAsPoint(t),this.halfAxes=new Ue([].concat(Se()(e),Se()(r),Se()(n))),this}},{key:"getTransform",value:function(){throw new Error("not implemented")}}]),t}(),Tr=new Be,Sr=new Be,Mr=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[0,0,1],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;Ht()(this,t),zt(this,"normal",void 0),zt(this,"distance",void 0),this.normal=new Be,this.distance=-0,this.fromNormalDistance(e,r)}return Jt()(t,[{key:"fromNormalDistance",value:function(t,e){return re(Number.isFinite(e)),this.normal.from(t).normalize(),this.distance=e,this}},{key:"fromPointNormal",value:function(t,e){t=Tr.from(t),this.normal.from(e).normalize();var r=-this.normal.dot(t);return this.distance=r,this}},{key:"fromCoefficients",value:function(t,e,r,n){return this.normal.set(t,e,r),re(se(this.normal.len(),1)),this.distance=n,this}},{key:"clone",value:function(){return new t(this.normal,this.distance)}},{key:"equals",value:function(t){return se(this.distance,t.distance)&&se(this.normal,t.normal)}},{key:"getPointDistance",value:function(t){return this.normal.dot(t)+this.distance}},{key:"transform",value:function(t){var e=Sr.copy(this.normal).transformAsVector(t).normalize(),r=this.normal.scale(-this.distance).transform(t);return this.fromPointNormal(r,e)}},{key:"projectPointOntoPlane",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];t=Tr.from(t);var r=this.getPointDistance(t),n=Sr.copy(this.normal).scale(r);return t.subtract(n).to(e)}}]),t}();function Ir(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return Rr(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Rr(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function Rr(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var Pr,Fr=[new Be([1,0,0]),new Be([0,1,0]),new Be([0,0,1])],Dr=new Be,Lr=new Be,jr=(new Mr(new Be(1,0,0),0),function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];Ht()(this,t),zt(this,"planes",void 0),this.planes=e}return Jt()(t,[{key:"fromBoundingSphere",value:function(t){this.planes.length=2*Fr.length;var e,r=t.center,n=t.radius,i=0,o=Ir(Fr);try{for(o.s();!(e=o.n()).done;){var a=e.value,s=this.planes[i],u=this.planes[i+1];s||(s=this.planes[i]=new Mr),u||(u=this.planes[i+1]=new Mr);var c=Dr.copy(a).scale(-n).add(r);a.dot(c);s.fromPointNormal(c,a);var l=Dr.copy(a).scale(n).add(r),f=Lr.copy(a).negate();f.dot(l);u.fromPointNormal(l,f),i+=2}}catch(t){o.e(t)}finally{o.f()}return this}},{key:"computeVisibility",value:function(t){var e,r=Nt,n=Ir(this.planes);try{for(n.s();!(e=n.n()).done;){var i=e.value;switch(t.intersectPlane(i)){case jt:return jt;case Gt:r=Gt}}}catch(t){n.e(t)}finally{n.f()}return r}},{key:"computeVisibilityWithPlaneMask",value:function(e,r){if(re(Number.isFinite(r),"parentPlaneMask is required."),r===t.MASK_OUTSIDE||r===t.MASK_INSIDE)return r;for(var n=t.MASK_INSIDE,i=this.planes,o=0;o<this.planes.length;++o){var a=o<31?1<<o:0;if(!(o<31&&0==(r&a))){var s=i[o],u=e.intersectPlane(s);if(u===jt)return t.MASK_OUTSIDE;u===Gt&&(n|=a)}}return n}}]),t}());function Gr(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=ee()(t);if(e){var i=ee()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return $t()(this,r)}}zt(jr,"MASK_OUTSIDE",4294967295),zt(jr,"MASK_INSIDE",0),zt(jr,"MASK_INDETERMINATE",2147483647),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"}(Pr||(Pr={}));var Nr,Ur,Hr=45*Math.PI/180,Vr=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),Jr=function(t){Yt()(r,t);var e=Gr(r);function r(t){var n;return qt()(this,r),n=e.call(this,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0),1===arguments.length&&Array.isArray(t)?n.copy(t):n.identity(),n}return Qt()(r,[{key:"ELEMENTS",get:function(){return 16}},{key:"RANK",get:function(){return 4}},{key:"INDICES",get:function(){return Pr}},{key:"copy",value:function(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()}},{key:"set",value:function(t,e,r,n,i,o,a,s,u,c,l,f,h,d,p,v){return this[0]=t,this[1]=e,this[2]=r,this[3]=n,this[4]=i,this[5]=o,this[6]=a,this[7]=s,this[8]=u,this[9]=c,this[10]=l,this[11]=f,this[12]=h,this[13]=d,this[14]=p,this[15]=v,this.check()}},{key:"setRowMajor",value:function(t,e,r,n,i,o,a,s,u,c,l,f,h,d,p,v){return this[0]=t,this[1]=i,this[2]=u,this[3]=h,this[4]=e,this[5]=o,this[6]=c,this[7]=d,this[8]=r,this[9]=a,this[10]=l,this[11]=p,this[12]=n,this[13]=s,this[14]=f,this[15]=v,this.check()}},{key:"toRowMajor",value:function(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}},{key:"identity",value:function(){return this.copy(Vr)}},{key:"fromObject",value:function(t){return this.check()}},{key:"fromQuaternion",value:function(t){return function(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=r+r,s=n+n,u=i+i,c=r*a,l=n*a,f=n*s,h=i*a,d=i*s,p=i*u,v=o*a,y=o*s,g=o*u;t[0]=1-f-p,t[1]=l+g,t[2]=h-y,t[3]=0,t[4]=l-g,t[5]=1-c-p,t[6]=d+v,t[7]=0,t[8]=h+y,t[9]=d-v,t[10]=1-c-f,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1}(this,t),this.check()}},{key:"frustum",value:function(t){var e=t.left,r=t.right,n=t.bottom,i=t.top,o=t.near,a=void 0===o?.1:o,s=t.far,u=void 0===s?500:s;return u===1/0?function(t,e,r,n,i,o){var a=2*o/(r-e),s=2*o/(i-n),u=(r+e)/(r-e),c=(i+n)/(i-n),l=-2*o;t[0]=a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=s,t[6]=0,t[7]=0,t[8]=u,t[9]=c,t[10]=-1,t[11]=-1,t[12]=0,t[13]=0,t[14]=l,t[15]=0}(this,e,r,n,i,a):function(t,e,r,n,i,o,a){var s=1/(r-e),u=1/(i-n),c=1/(o-a);t[0]=2*o*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*o*u,t[6]=0,t[7]=0,t[8]=(r+e)*s,t[9]=(i+n)*u,t[10]=(a+o)*c,t[11]=-1,t[12]=0,t[13]=0,t[14]=a*o*2*c,t[15]=0}(this,e,r,n,i,a,u),this.check()}},{key:"lookAt",value:function(t){var e=t.eye,r=t.center,n=void 0===r?[0,0,0]:r,i=t.up;return function(t,e,r,n){var i,o,a,s,u,c,l,f,h,d,p=e[0],v=e[1],y=e[2],g=n[0],m=n[1],b=n[2],A=r[0],w=r[1],B=r[2];Math.abs(p-A)<1e-6&&Math.abs(v-w)<1e-6&&Math.abs(y-B)<1e-6?function(t){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):(l=p-A,f=v-w,h=y-B,i=m*(h*=d=1/Math.hypot(l,f,h))-b*(f*=d),o=b*(l*=d)-g*h,a=g*f-m*l,(d=Math.hypot(i,o,a))?(i*=d=1/d,o*=d,a*=d):(i=0,o=0,a=0),s=f*a-h*o,u=h*i-l*a,c=l*o-f*i,(d=Math.hypot(s,u,c))?(s*=d=1/d,u*=d,c*=d):(s=0,u=0,c=0),t[0]=i,t[1]=s,t[2]=l,t[3]=0,t[4]=o,t[5]=u,t[6]=f,t[7]=0,t[8]=a,t[9]=c,t[10]=h,t[11]=0,t[12]=-(i*p+o*v+a*y),t[13]=-(s*p+u*v+c*y),t[14]=-(l*p+f*v+h*y),t[15]=1)}(this,e,n,void 0===i?[0,1,0]:i),this.check()}},{key:"ortho",value:function(t){var e=t.left,r=t.right,n=t.bottom,i=t.top,o=t.near,a=void 0===o?.1:o,s=t.far;return lt(this,e,r,n,i,a,void 0===s?500:s),this.check()}},{key:"orthographic",value:function(t){var e=t.fovy,r=void 0===e?Hr:e,n=t.aspect,i=void 0===n?1:n,o=t.focalDistance,a=void 0===o?1:o,s=t.near,u=void 0===s?.1:s,c=t.far,l=void 0===c?500:c;zr(r);var f=r/2,h=a*Math.tan(f),d=h*i;return this.ortho({left:-d,right:d,bottom:-h,top:h,near:u,far:l})}},{key:"perspective",value:function(t){var e=t.fovy,r=void 0===e?45*Math.PI/180:e,n=t.aspect,i=void 0===n?1:n,o=t.near,a=void 0===o?.1:o,s=t.far,u=void 0===s?500:s;return zr(r),ct(this,r,i,a,u),this.check()}},{key:"determinant",value:function(){return e=(t=this)[0],r=t[1],n=t[2],i=t[3],o=t[4],a=t[5],s=t[6],u=t[7],c=t[8],l=t[9],f=t[10],h=t[11],d=t[12],p=t[13],v=t[14],y=t[15],(e*a-r*o)*(f*y-h*v)-(e*s-n*o)*(l*y-h*p)+(e*u-i*o)*(l*v-f*p)+(r*s-n*a)*(c*y-h*d)-(r*u-i*a)*(c*v-f*d)+(n*u-i*s)*(c*p-l*d);var t,e,r,n,i,o,a,s,u,c,l,f,h,d,p,v,y}},{key:"getScale",value:function(){var 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}},{key:"getTranslation",value:function(){var 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}},{key:"getRotation",value:function(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];var r=this.getScale(e),n=1/r[0],i=1/r[1],o=1/r[2];return t[0]=this[0]*n,t[1]=this[1]*i,t[2]=this[2]*o,t[3]=0,t[4]=this[4]*n,t[5]=this[5]*i,t[6]=this[6]*o,t[7]=0,t[8]=this[8]*n,t[9]=this[9]*i,t[10]=this[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}},{key:"getRotationMatrix3",value:function(t,e){t=t||[-0,-0,-0,-0,-0,-0,-0,-0,-0],e=e||[-0,-0,-0];var r=this.getScale(e),n=1/r[0],i=1/r[1],o=1/r[2];return t[0]=this[0]*n,t[1]=this[1]*i,t[2]=this[2]*o,t[3]=this[4]*n,t[4]=this[5]*i,t[5]=this[6]*o,t[6]=this[8]*n,t[7]=this[9]*i,t[8]=this[10]*o,t}},{key:"transpose",value:function(){return function(t,e){if(t===e){var r=e[1],n=e[2],i=e[3],o=e[6],a=e[7],s=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=r,t[6]=e[9],t[7]=e[13],t[8]=n,t[9]=o,t[11]=e[14],t[12]=i,t[13]=a,t[14]=s}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]}(this,this),this.check()}},{key:"invert",value:function(){return rt(this,this),this.check()}},{key:"multiplyLeft",value:function(t){return nt(this,t,this),this.check()}},{key:"multiplyRight",value:function(t){return nt(this,this,t),this.check()}},{key:"rotateX",value:function(t){return at(this,this,t),this.check()}},{key:"rotateY",value:function(t){return function(t,e,r){var n=Math.sin(r),i=Math.cos(r),o=e[0],a=e[1],s=e[2],u=e[3],c=e[8],l=e[9],f=e[10],h=e[11];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*i-c*n,t[1]=a*i-l*n,t[2]=s*i-f*n,t[3]=u*i-h*n,t[8]=o*n+c*i,t[9]=a*n+l*i,t[10]=s*n+f*i,t[11]=u*n+h*i}(this,this,t),this.check()}},{key:"rotateZ",value:function(t){return st(this,this,t),this.check()}},{key:"rotateXYZ",value:function(t){return this.rotateX(t[0]).rotateY(t[1]).rotateZ(t[2])}},{key:"rotateAxis",value:function(t,e){return function(t,e,r,n){var i,o,a,s,u,c,l,f,h,d,p,v,y,g,m,b,A,w,B,_,x,C,k,E,O=n[0],T=n[1],S=n[2],M=Math.hypot(O,T,S);M<1e-6||(O*=M=1/M,T*=M,S*=M,i=Math.sin(r),a=1-(o=Math.cos(r)),s=e[0],u=e[1],c=e[2],l=e[3],f=e[4],h=e[5],d=e[6],p=e[7],v=e[8],y=e[9],g=e[10],m=e[11],b=O*O*a+o,A=T*O*a+S*i,w=S*O*a-T*i,B=O*T*a-S*i,_=T*T*a+o,x=S*T*a+O*i,C=O*S*a+T*i,k=T*S*a-O*i,E=S*S*a+o,t[0]=s*b+f*A+v*w,t[1]=u*b+h*A+y*w,t[2]=c*b+d*A+g*w,t[3]=l*b+p*A+m*w,t[4]=s*B+f*_+v*x,t[5]=u*B+h*_+y*x,t[6]=c*B+d*_+g*x,t[7]=l*B+p*_+m*x,t[8]=s*C+f*k+v*E,t[9]=u*C+h*k+y*E,t[10]=c*C+d*k+g*E,t[11]=l*C+p*k+m*E,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]))}(this,this,t,e),this.check()}},{key:"scale",value:function(t){return ot(this,this,Array.isArray(t)?t:[t,t,t]),this.check()}},{key:"translate",value:function(t){return it(this,this,t),this.check()}},{key:"transform",value:function(t,e){return 4===t.length?(de(e=Z(e||[-0,-0,-0,-0],t,this),4),e):this.transformAsPoint(t,e)}},{key:"transformAsPoint",value:function(t,e){var r;switch(t.length){case 2:r=ht(e||[-0,-0],t,this);break;case 3:r=gt(e||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return de(r,t.length),r}},{key:"transformAsVector",value:function(t,e){var r;switch(t.length){case 2:r=ye(e||[-0,-0],t,this);break;case 3:r=ge(e||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return de(r,t.length),r}},{key:"transformPoint",value:function(t,e){return this.transformAsPoint(t,e)}},{key:"transformVector",value:function(t,e){return this.transformAsPoint(t,e)}},{key:"transformDirection",value:function(t,e){return this.transformAsVector(t,e)}},{key:"makeRotationX",value:function(t){return this.identity().rotateX(t)}},{key:"makeTranslation",value:function(t,e,r){return this.identity().translate([t,e,r])}}],[{key:"IDENTITY",get:function(){return function(){Ur||(Ur=new Jr,Object.freeze(Ur));return Ur}()}},{key:"ZERO",get:function(){return function(){Nr||(Nr=new Jr([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Object.freeze(Nr));return Nr}()}}]),r}(Ie);function zr(t){if(t>2*Math.PI)throw Error("expected radians")}new Be,new Be,new Be,new Be,new Be;new Be,new Be,new Be,new Be,new Be,new Be,new Be,new Be,new Be,new Be,new Be,new Be,Math.PI;var Kr=1e-15,qr=1e-20,Wr=(Math.PI,Math.PI,Math.PI,Math.PI,new Ue),Qr=new Ue,Xr=new Ue,Yr=new Ue,Zr=new Ue;function $r(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=qr,n=10,i=0,o=0,a=Qr,s=Xr;a.identity(),s.copy(t);for(var u=r*tn(s);o<n&&nn(s)>u;)on(s,Yr),Zr.copy(Yr).transpose(),s.multiplyRight(Yr),s.multiplyLeft(Zr),a.multiplyRight(Yr),++i>2&&(++o,i=0);return e.unitary=a.toTarget(e.unitary),e.diagonal=s.toTarget(e.diagonal),e}function tn(t){for(var e=0,r=0;r<9;++r){var n=t[r];e+=n*n}return Math.sqrt(e)}var en=[1,0,0],rn=[2,2,1];function nn(t){for(var e=0,r=0;r<3;++r){var n=t[Wr.getElementIndex(rn[r],en[r])];e+=2*n*n}return Math.sqrt(e)}function on(t,e){for(var r=Kr,n=0,i=1,o=0;o<3;++o){var a=Math.abs(t[Wr.getElementIndex(rn[o],en[o])]);a>n&&(i=o,n=a)}var s=en[i],u=rn[i],c=1,l=0;if(Math.abs(t[Wr.getElementIndex(u,s)])>r){var f,h=(t[Wr.getElementIndex(u,u)]-t[Wr.getElementIndex(s,s)])/2/t[Wr.getElementIndex(u,s)];l=(f=h<0?-1/(-h+Math.sqrt(1+h*h)):1/(h+Math.sqrt(1+h*h)))*(c=1/Math.sqrt(1+f*f))}return Ue.IDENTITY.to(e),e[Wr.getElementIndex(s,s)]=e[Wr.getElementIndex(u,u)]=c,e[Wr.getElementIndex(u,s)]=l,e[Wr.getElementIndex(s,u)]=-l,e}function an(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return sn(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return sn(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function sn(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var un=new Be,cn=new Be,ln=new Be,fn=new Be,hn=new Be,dn=new Ue,pn={diagonal:new Ue,unitary:new Ue};function vn(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return yn(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return yn(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function yn(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var gn=[[.5,.5],[0,0],[0,1],[1,0],[1,1]],mn=gn.concat([[0,.5],[.5,0],[1,.5],[.5,1]]),bn=mn.concat([[.25,.5],[.75,.5]]),An=function(){function t(e,r,n){p()(this,t),B()(this,"x",void 0),B()(this,"y",void 0),B()(this,"z",void 0),B()(this,"childVisible",void 0),B()(this,"selected",void 0),B()(this,"_children",void 0),this.x=e,this.y=r,this.z=n}return E()(t,[{key:"children",get:function(){if(!this._children){var e=2*this.x,r=2*this.y,n=this.z+1;this._children=[new t(e,r,n),new t(e,r+1,n),new t(e+1,r,n),new t(e+1,r+1,n)]}return this._children}},{key:"update",value:function(t){var e=t.viewport,r=t.cullingVolume,n=t.elevationBounds,i=t.minZ,o=t.maxZ,a=t.bounds,s=t.offset,u=t.project,c=this.getBoundingVolume(n,s,u);if(a&&!this.insideBounds(a))return!1;if(r.computeVisibility(c)<0)return!1;if(!this.childVisible){var l=this.z;if(l<o&&l>=i){var f=c.distanceTo(e.cameraPosition)*e.scale/e.height;l+=Math.floor(Math.log2(f))}if(l>=o)return this.selected=!0,!0}this.selected=!1,this.childVisible=!0;var h,d=vn(this.children);try{for(d.s();!(h=d.n()).done;){h.value.update(t)}}catch(t){d.e(t)}finally{d.f()}return!0}},{key:"getSelected",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];if(this.selected&&t.push(this),this._children){var e,r=vn(this._children);try{for(r.s();!(e=r.n()).done;){var n=e.value;n.getSelected(t)}}catch(t){r.e(t)}finally{r.f()}}return t}},{key:"insideBounds",value:function(t){var e=R()(t,4),r=e[0],n=e[1],i=e[2],o=e[3],a=512/Math.pow(2,this.z);return this.x*a<i&&this.y*a<o&&(this.x+1)*a>r&&(this.y+1)*a>n}},{key:"getBoundingVolume",value:function(t,e,r){if(r){var n,i=[],o=vn(this.z<1?bn:this.z<2?mn:gn);try{for(o.s();!(n=o.n()).done;){var a=n.value,s=En(this.x+a[0],this.y+a[1],this.z);s[2]=t[0],i.push(r(s)),t[0]!==t[1]&&(s[2]=t[1],i.push(r(s)))}}catch(t){o.e(t)}finally{o.f()}return function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Or;if(!t||0===t.length)return e.halfAxes=new Ue([0,0,0,0,0,0,0,0,0]),e.center=new Be,e;var r,n=t.length,i=new Be(0,0,0),o=an(t);try{for(o.s();!(r=o.n()).done;){var a=r.value;i.add(a)}}catch(t){o.e(t)}finally{o.f()}var s=1/n;i.multiplyByScalar(s);var u,c=0,l=0,f=0,h=0,d=0,p=0,v=an(t);try{for(v.s();!(u=v.n()).done;){var y=u.value,g=un.copy(y).subtract(i);c+=g.x*g.x,l+=g.x*g.y,f+=g.x*g.z,h+=g.y*g.y,d+=g.y*g.z,p+=g.z*g.z}}catch(t){v.e(t)}finally{v.f()}c*=s,l*=s,f*=s,h*=s,d*=s,p*=s;var m=dn;m[0]=c,m[1]=l,m[2]=f,m[3]=l,m[4]=h,m[5]=d,m[6]=f,m[7]=d,m[8]=p;var b,A=$r(m,pn),w=A.unitary,B=e.halfAxes.copy(w),_=B.getColumn(0,ln),x=B.getColumn(1,fn),C=B.getColumn(2,hn),k=-Number.MAX_VALUE,E=-Number.MAX_VALUE,O=-Number.MAX_VALUE,T=Number.MAX_VALUE,S=Number.MAX_VALUE,M=Number.MAX_VALUE,I=an(t);try{for(I.s();!(b=I.n()).done;){var R=b.value;un.copy(R),k=Math.max(un.dot(_),k),E=Math.max(un.dot(x),E),O=Math.max(un.dot(C),O),T=Math.min(un.dot(_),T),S=Math.min(un.dot(x),S),M=Math.min(un.dot(C),M)}}catch(t){I.e(t)}finally{I.f()}_=_.multiplyByScalar(.5*(T+k)),x=x.multiplyByScalar(.5*(S+E)),C=C.multiplyByScalar(.5*(M+O)),e.center.copy(_).add(x).add(C);var P=cn.set(k-T,E-S,O-M).multiplyByScalar(.5),F=new Ue([P[0],0,0,0,P[1],0,0,0,P[2]]);return e.halfAxes.multiplyRight(F),e}(i)}var u=512/Math.pow(2,this.z),c=this.x*u+512*e,l=512-(this.y+1)*u;return new Ce([c,l,t[0]],[c+u,l+u,t[1]])}}]),t}();var wn=[-1/0,-1/0,1/0,1/0],Bn={type:"url",value:null,validate:function(t,e){return e.optional&&null===t||"string"==typeof t||Array.isArray(t)&&t.every((function(t){return"string"==typeof t}))},equals:function(t,e){if(t===e)return!0;if(!Array.isArray(t)||!Array.isArray(e))return!1;var r=t.length;if(r!==e.length)return!1;for(var n=0;n<r;n++)if(t[n]!==e[n])return!1;return!0}};function _n(t,e){var r=[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.apply(Math,Lt()(r.map((function(t){return t[0]})))),Math.min.apply(Math,Lt()(r.map((function(t){return t[1]})))),Math.max.apply(Math,Lt()(r.map((function(t){return t[0]})))),Math.max.apply(Math,Lt()(r.map((function(t){return t[1]}))))]}function xn(t,e){if(!t||!t.length)return null;var r,n=e.index,i=e.id;Array.isArray(t)&&(t=t[(r=i,Math.abs(r.split("").reduce((function(t,e){return(t<<5)-t+e.charCodeAt(0)|0}),0))%t.length)]);for(var o=t,a=0,s=Object.keys(n);a<s.length;a++){var u=s[a],c=new RegExp("{".concat(u,"}"),"g");o=o.replace(c,String(n[u]))}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 Cn(t){var e=t.viewport,r=t.z,n=t.cullRect,i=n.x-e.x,o=n.y-e.y,a=n.width,s=n.height;if(!Array.isArray(r)){var u={targetZ:r||0},c=e.unproject([i,o],u),l=e.unproject([i+a,o],u),f=e.unproject([i,o+s],u),h=e.unproject([i+a,o+s],u);return[Math.min(c[0],l[0],f[0],h[0]),Math.min(c[1],l[1],f[1],h[1]),Math.max(c[0],l[0],f[0],h[0]),Math.max(c[1],l[1],f[1],h[1])]}var d=Cn({viewport:e,z:r[0],cullRect:n}),p=Cn({viewport:e,z:r[1],cullRect:n});return[Math.min(d[0],p[0]),Math.min(d[1],p[1]),Math.max(d[2],p[2]),Math.max(d[3],p[3])]}function kn(t,e){return 512*Math.pow(2,t)/e}function En(t,e,r){var n=kn(r,512),i=t/n*360-180,o=Math.PI-2*Math.PI*e/n;return[i,180/Math.PI*Math.atan(.5*(Math.exp(o)-Math.exp(-o)))]}function On(t,e,r,n){var i=kn(r,n);return[t/i*512,e/i*512]}function Tn(t,e,r,n){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:512;if(t.isGeospatial){var o=En(e,r,n),a=R()(o,2),s=a[0],u=a[1],c=En(e+1,r+1,n),l=R()(c,2),f=l[0],h=l[1];return{west:s,north:u,east:f,south:h}}var d=On(e,r,n,i),p=R()(d,2),v=p[0],y=p[1],g=On(e+1,r+1,n,i),m=R()(g,2),b=m[0],A=m[1];return{left:v,top:y,right:b,bottom:A}}function Sn(t,e,r,n,i){for(var o=function(t,e,r){return r?_n(t,r).map((function(t){return t*e/512})):t.map((function(t){return t*e/512}))}(function(t,e,r){var n;if(e&&2===e.length){var i=R()(e,2),o=i[0],a=i[1],s=t.getBounds({z:o}),u=t.getBounds({z:a});n=[Math.min(s[0],u[0]),Math.min(s[1],u[1]),Math.max(s[2],u[2]),Math.max(s[3],u[3])]}else n=t.getBounds();return t.isGeospatial?[Math.max(n[0],r[0]),Math.max(n[1],r[1]),Math.min(n[2],r[2]),Math.min(n[3],r[3])]:[Math.max(Math.min(n[0],r[2]),r[0]),Math.max(Math.min(n[1],r[3]),r[1]),Math.min(Math.max(n[2],r[0]),r[2]),Math.min(Math.max(n[3],r[1]),r[3])]}(t,null,n),kn(e,r),i),a=R()(o,4),s=a[0],u=a[1],c=a[2],l=a[3],f=[],h=Math.floor(s);h<c;h++)for(var d=Math.floor(u);d<l;d++)f.push({x:h,y:d,z:e});return f}function Mn(t){var e=t.viewport,r=t.maxZoom,n=t.minZoom,i=t.zRange,o=t.extent,a=t.tileSize,s=void 0===a?512:a,u=t.modelMatrix,c=t.modelMatrixInverse,l=t.zoomOffset,f=void 0===l?0:l,h=e.isGeospatial?Math.round(e.zoom+Math.log2(512/s))+f:Math.ceil(e.zoom)+f;if("number"==typeof n&&Number.isFinite(n)&&h<n){if(!o)return[];h=n}"number"==typeof r&&Number.isFinite(r)&&h>r&&(h=r);var d=o;return u&&c&&o&&!e.isGeospatial&&(d=_n(o,u)),e.isGeospatial?function(t,e,r,n){var i=t instanceof _._GlobeViewport&&t.resolution?t.projectPosition:null,o=Object.values(t.getFrustumPlanes()).map((function(t){var e=t.normal,r=t.distance;return new Mr(e.clone().negate(),r)})),a=new jr(o),s=t.distanceScales.unitsPerMeter[2],u=r&&r[0]*s||0,c=r&&r[1]*s||0,l=t instanceof _.WebMercatorViewport&&t.pitch<=60?e:0;if(n){var f=n,h=R()(f,4),d=h[0],p=h[1],v=h[2],y=kt([d,h[3]]),g=kt([v,p]);n=[y[0],512-y[1],g[0],512-g[1]]}var m=new An(0,0,0),b={viewport:t,project:i,cullingVolume:a,elevationBounds:[u,c],minZ:l,maxZ:e,bounds:n,offset:0};if(m.update(b),t instanceof _.WebMercatorViewport&&t.subViewports&&t.subViewports.length>1){for(b.offset=-1;m.update(b)&&!(--b.offset<-3););for(b.offset=1;m.update(b)&&!(++b.offset>3););}return m.getSelected()}(e,h,i,o):Sn(e,h,s,d||wn,c)}function In(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Rn(){var t;if("undefined"!=typeof window&&window.performance)t=window.performance.now();else if("undefined"!=typeof process&&process.hrtime){var e=process.hrtime();t=1e3*e[0]+e[1]/1e6}else t=Date.now();return t}var Pn=function(){function t(e,r){p()(this,t),In(this,"name",void 0),In(this,"type",void 0),In(this,"sampleSize",1),In(this,"time",void 0),In(this,"count",void 0),In(this,"samples",void 0),In(this,"lastTiming",void 0),In(this,"lastSampleTime",void 0),In(this,"lastSampleCount",void 0),In(this,"_count",0),In(this,"_time",0),In(this,"_samples",0),In(this,"_startTime",0),In(this,"_timerPending",!1),this.name=e,this.type=r,this.reset()}return E()(t,[{key:"setSampleSize",value:function(t){return this.sampleSize=t,this}},{key:"incrementCount",value:function(){return this.addCount(1),this}},{key:"decrementCount",value:function(){return this.subtractCount(1),this}},{key:"addCount",value:function(t){return this._count+=t,this._samples++,this._checkSampling(),this}},{key:"subtractCount",value:function(t){return this._count-=t,this._samples++,this._checkSampling(),this}},{key:"addTime",value:function(t){return this._time+=t,this.lastTiming=t,this._samples++,this._checkSampling(),this}},{key:"timeStart",value:function(){return this._startTime=Rn(),this._timerPending=!0,this}},{key:"timeEnd",value:function(){return this._timerPending?(this.addTime(Rn()-this._startTime),this._timerPending=!1,this._checkSampling(),this):this}},{key:"getSampleAverageCount",value:function(){return this.sampleSize>0?this.lastSampleCount/this.sampleSize:0}},{key:"getSampleAverageTime",value:function(){return this.sampleSize>0?this.lastSampleTime/this.sampleSize:0}},{key:"getSampleHz",value:function(){return this.lastSampleTime>0?this.sampleSize/(this.lastSampleTime/1e3):0}},{key:"getAverageCount",value:function(){return this.samples>0?this.count/this.samples:0}},{key:"getAverageTime",value:function(){return this.samples>0?this.time/this.samples:0}},{key:"getHz",value:function(){return this.time>0?this.samples/(this.time/1e3):0}},{key:"reset",value:function(){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}},{key:"_checkSampling",value:function(){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)}}]),t}(),Fn=function(){function t(e){p()(this,t),In(this,"id",void 0),In(this,"stats",{}),this.id=e.id,this.stats={},this._initializeStats(e.stats),Object.seal(this)}return E()(t,[{key:"get",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"count";return this._getOrCreate({name:t,type:e})}},{key:"size",get:function(){return Object.keys(this.stats).length}},{key:"reset",value:function(){for(var t in this.stats)this.stats[t].reset();return this}},{key:"forEach",value:function(t){for(var e in this.stats)t(this.stats[e])}},{key:"getTable",value:function(){var t={};return this.forEach((function(e){t[e.name]={time:e.time||0,count:e.count||0,average:e.getAverageTime()||0,hz:e.getHz()||0}})),t}},{key:"_initializeStats",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];e.forEach((function(e){return t._getOrCreate(e)}))}},{key:"_getOrCreate",value:function(t){if(!t||!t.name)return null;var e=t.name,r=t.type;return this.stats[e]||(this.stats[e]=t instanceof Pn?t:new Pn(e,r)),this.stats[e]}}]),t}();function Dn(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Ln(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Dn(Object(r),!0).forEach((function(e){B()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Dn(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var jn,Gn={id:"request-scheduler",throttleRequests:!0,maxRequests:6},Nn=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};p()(this,t),In(this,"props",void 0),In(this,"stats",void 0),In(this,"activeRequestCount",0),In(this,"requestQueue",[]),In(this,"requestMap",new Map),In(this,"deferredUpdate",null),this.props=Ln(Ln({},Gn),e),this.stats=new Fn({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")}return E()(t,[{key:"scheduleRequest",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){return 0};if(!this.props.throttleRequests)return Promise.resolve({done:function(){}});if(this.requestMap.has(t))return this.requestMap.get(t);var r={handle:t,priority:0,getPriority:e},n=new Promise((function(t){return r.resolve=t,r}));return this.requestQueue.push(r),this.requestMap.set(t,n),this._issueNewRequests(),n}},{key:"_issueRequest",value:function(t){var e=this,r=t.handle,n=t.resolve,i=!1,o=function(){i||(i=!0,e.requestMap.delete(r),e.activeRequestCount--,e._issueNewRequests())};return this.activeRequestCount++,n?n({done:o}):Promise.resolve({done:o})}},{key:"_issueNewRequests",value:function(){var t=this;this.deferredUpdate||(this.deferredUpdate=setTimeout((function(){return t._issueNewRequestsAsync()}),0))}},{key:"_issueNewRequestsAsync",value:function(){this.deferredUpdate=null;var t=Math.max(this.props.maxRequests-this.activeRequestCount,0);if(0!==t){this._updateAllRequests();for(var e=0;e<t;++e){var r=this.requestQueue.shift();r&&this._issueRequest(r)}}}},{key:"_updateAllRequests",value:function(){for(var t=this.requestQueue,e=0;e<t.length;++e){var r=t[e];this._updateRequest(r)||(t.splice(e,1),this.requestMap.delete(r.handle),e--)}t.sort((function(t,e){return t.priority-e.priority}))}},{key:"_updateRequest",value:function(t){return t.priority=t.getPriority(t.handle),!(t.priority<0)||(t.resolve(null),!1)}}]),t}();function Un(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return Hn(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Hn(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function Hn(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var Vn=(jn={},B()(jn,"best-available",(function(t){var e,r=Un(t);try{for(r.s();!(e=r.n()).done;){e.value.state=0}}catch(t){r.e(t)}finally{r.f()}var n,i=Un(t);try{for(i.s();!(n=i.n()).done;){var o=n.value;o.isSelected&&!zn(o)&&Kn(o)}}catch(t){i.e(t)}finally{i.f()}var a,s=Un(t);try{for(s.s();!(a=s.n()).done;){var u=a.value;u.isVisible=Boolean(2&u.state)}}catch(t){s.e(t)}finally{s.f()}})),B()(jn,"no-overlap",(function(t){var e,r=Un(t);try{for(r.s();!(e=r.n()).done;){e.value.state=0}}catch(t){r.e(t)}finally{r.f()}var n,i=Un(t);try{for(i.s();!(n=i.n()).done;){var o=n.value;o.isSelected&&zn(o)}}catch(t){i.e(t)}finally{i.f()}var a,s=Un(Array.from(t).sort((function(t,e){return t.zoom-e.zoom})));try{for(s.s();!(a=s.n()).done;){var u=a.value;if(u.isVisible=Boolean(2&u.state),u.children&&(u.isVisible||1&u.state)){var c,l=Un(u.children);try{for(l.s();!(c=l.n()).done;){c.value.state=1}}catch(t){l.e(t)}finally{l.f()}}else u.isSelected&&Kn(u)}}catch(t){s.e(t)}finally{s.f()}})),B()(jn,"never",(function(){})),jn),Jn=function(){function t(e){var r=this;p()(this,t),B()(this,"opts",void 0),B()(this,"_requestScheduler",void 0),B()(this,"_cache",void 0),B()(this,"_dirty",void 0),B()(this,"_tiles",void 0),B()(this,"_cacheByteSize",void 0),B()(this,"_viewport",void 0),B()(this,"_zRange",void 0),B()(this,"_selectedTiles",void 0),B()(this,"_frameNumber",void 0),B()(this,"_modelMatrix",void 0),B()(this,"_modelMatrixInverse",void 0),B()(this,"_maxZoom",void 0),B()(this,"_minZoom",void 0),B()(this,"onTileLoad",void 0),B()(this,"_getCullBounds",Object(_._memoize)(Cn)),this.opts=e,this.onTileLoad=function(t){r.opts.onTileLoad(t),r.opts.maxCacheByteSize&&(r._cacheByteSize+=t.byteLength,r._resizeCache())},this._requestScheduler=new Nn({maxRequests:e.maxRequests,throttleRequests:e.maxRequests>0}),this._cache=new Map,this._tiles=[],this._dirty=!1,this._cacheByteSize=0,this._viewport=null,this._selectedTiles=null,this._frameNumber=0,this._modelMatrix=new Jr,this._modelMatrixInverse=new Jr,this.setOptions(e)}return E()(t,[{key:"tiles",get:function(){return this._tiles}},{key:"selectedTiles",get:function(){return this._selectedTiles}},{key:"isLoaded",get:function(){return null!==this._selectedTiles&&this._selectedTiles.every((function(t){return t.isLoaded}))}},{key:"needsReload",get:function(){return null!==this._selectedTiles&&this._selectedTiles.some((function(t){return t.needsReload}))}},{key:"setOptions",value:function(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))}},{key:"finalize",value:function(){var t,e=Un(this._cache.values());try{for(e.s();!(t=e.n()).done;){var r=t.value;r.isLoading&&r.abort()}}catch(t){e.e(t)}finally{e.f()}this._cache.clear(),this._tiles=[],this._selectedTiles=null}},{key:"reloadAll",value:function(){var t,e=Un(this._cache.keys());try{for(e.s();!(t=e.n()).done;){var r=t.value,n=this._cache.get(r);this._selectedTiles&&this._selectedTiles.includes(n)?n.setNeedsReload():this._cache.delete(r)}}catch(t){e.e(t)}finally{e.f()}}},{key:"update",value:function(t){var e=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=r.zRange,i=r.modelMatrix,o=new Jr(i),a=!o.equals(this._modelMatrix);if(this._viewport&&t.equals(this._viewport)&&se(this._zRange,n)&&!a)this.needsReload&&(this._selectedTiles=this._selectedTiles.map((function(t){return e._getTile(t.index,!0)})));else{a&&(this._modelMatrixInverse=o.clone().invert(),this._modelMatrix=o),this._viewport=t,this._zRange=n;var s=this.getTileIndices({viewport:t,maxZoom:this._maxZoom,minZoom:this._minZoom,zRange:n,modelMatrix:this._modelMatrix,modelMatrixInverse:this._modelMatrixInverse});this._selectedTiles=s.map((function(t){return e._getTile(t,!0)})),this._dirty&&this._rebuildTree()}var u=this.updateTileStates();return this._pruneRequests(),this._dirty&&this._resizeCache(),u&&this._frameNumber++,this._frameNumber}},{key:"isTileVisible",value:function(t,e){if(!t.isVisible)return!1;if(e&&this._viewport){var r=Cn({viewport:this._viewport,z:this._zRange,cullRect:e}),n=R()(r,4),i=n[0],o=n[1],a=n[2],s=n[3],u=t.bbox;if("west"in u)return u.west<a&&u.east>i&&u.south<s&&u.north>o;var c=Math.min(u.top,u.bottom),l=Math.max(u.top,u.bottom);return u.left<a&&u.right>i&&c<s&&l>o}return!0}},{key:"getTileIndices",value:function(t){var e=t.viewport,r=t.maxZoom,n=t.minZoom,i=t.zRange,o=t.modelMatrix,a=t.modelMatrixInverse,s=this.opts;return Mn({viewport:e,maxZoom:r,minZoom:n,zRange:i,tileSize:s.tileSize,extent:s.extent,modelMatrix:o,modelMatrixInverse:a,zoomOffset:s.zoomOffset})}},{key:"getTileId",value:function(t){return"".concat(t.x,"-").concat(t.y,"-").concat(t.z)}},{key:"getTileZoom",value:function(t){return t.z}},{key:"getTileMetadata",value:function(t){var e=this.opts.tileSize;return{bbox:Tn(this._viewport,t.x,t.y,t.z,e)}}},{key:"getParentIndex",value:function(t){return{x:Math.floor(t.x/2),y:Math.floor(t.y/2),z:t.z-1}}},{key:"updateTileStates",value:function(){var t,e=this.opts.refinementStrategy||"best-available",r=new Array(this._cache.size),n=0,i=Un(this._cache.values());try{for(i.s();!(t=i.n()).done;){var o=t.value;r[n++]=o.isVisible,o.isSelected=!1,o.isVisible=!1}}catch(t){i.e(t)}finally{i.f()}var a,s=Un(this._selectedTiles);try{for(s.s();!(a=s.n()).done;){var u=a.value;u.isSelected=!0,u.isVisible=!0}}catch(t){s.e(t)}finally{s.f()}("function"==typeof e?e:Vn[e])(Array.from(this._cache.values())),n=0;var c,l=Un(this._cache.values());try{for(l.s();!(c=l.n()).done;){var f=c.value;if(r[n++]!==f.isVisible)return!0}}catch(t){l.e(t)}finally{l.f()}return!1}},{key:"_pruneRequests",value:function(){var t,e=this.opts.maxRequests,r=[],n=0,i=Un(this._cache.values());try{for(i.s();!(t=i.n()).done;){var o=t.value;o.isLoading&&(n++,o.isSelected||o.isVisible||r.push(o))}}catch(t){i.e(t)}finally{i.f()}for(;e>0&&n>e&&r.length>0;){r.shift().abort(),n--}}},{key:"_rebuildTree",value:function(){var t,e=this._cache,r=Un(e.values());try{for(r.s();!(t=r.n()).done;){var n=t.value;n.parent=null,n.children&&(n.children.length=0)}}catch(t){r.e(t)}finally{r.f()}var i,o=Un(e.values());try{for(o.s();!(i=o.n()).done;){var a=i.value,s=this._getNearestAncestor(a);a.parent=s,null!=s&&s.children&&s.children.push(a)}}catch(t){o.e(t)}finally{o.f()}}},{key:"_resizeCache",value:function(){var t=this._cache,e=this.opts,r=e.maxCacheSize||(e.maxCacheByteSize?1/0:5*this.selectedTiles.length),n=e.maxCacheByteSize||1/0;if(t.size>r||this._cacheByteSize>n){var i,o=Un(t);try{for(o.s();!(i=o.n()).done;){var a=R()(i.value,2),s=a[0],u=a[1];if(u.isVisible||(this._cacheByteSize-=e.maxCacheByteSize?u.byteLength:0,t.delete(s),this.opts.onTileUnload(u)),t.size<=r&&this._cacheByteSize<=n)break}}catch(t){o.e(t)}finally{o.f()}this._rebuildTree(),this._dirty=!0}this._dirty&&(this._tiles=Array.from(this._cache.values()).sort((function(t,e){return t.zoom-e.zoom})),this._dirty=!1)}},{key:"_getTile",value:function(t,e){var r=this.getTileId(t),n=this._cache.get(r),i=!1;return!n&&e?(n=new Ft(t),Object.assign(n,this.getTileMetadata(n.index)),Object.assign(n,{id:r,zoom:this.getTileZoom(n.index)}),i=!0,this._cache.set(r,n),this._dirty=!0):n&&n.needsReload&&(i=!0),n&&i&&n.loadData({getData:this.opts.getTileData,requestScheduler:this._requestScheduler,onLoad:this.onTileLoad,onError:this.opts.onTileError}),n}},{key:"_getNearestAncestor",value:function(t){for(var e=this._minZoom,r=void 0===e?0:e,n=t.index;this.getTileZoom(n)>r;){n=this.getParentIndex(n);var i=this._getTile(n);if(i)return i}return null}}]),t}();function zn(t){for(var e=t;e;){if(e.isLoaded||e.content)return e.state|=2,!0;e=e.parent}return!1}function Kn(t){var e,r=Un(t.children);try{for(r.s();!(e=r.n()).done;){var n=e.value;n.isLoaded||n.content?n.state|=2:Kn(n)}}catch(t){r.e(t)}finally{r.f()}}function qn(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Wn(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?qn(Object(r),!0).forEach((function(e){B()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):qn(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Qn(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=A()(t);if(e){var i=A()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return m()(this,r)}}var Xn={TilesetClass:Jn,data:{type:"data",value:[]},dataComparator:Bn.equals,renderSubLayers:{type:"function",value:function(t){return new _.GeoJsonLayer(t)},compare:!1},getTileData:{type:"function",optional:!0,value:null,compare:!1},onViewportLoad:{type:"function",optional:!0,value:null,compare:!1},onTileLoad:{type:"function",value:function(t){},compare:!1},onTileUnload:{type:"function",value:function(t){},compare:!1},onTileError:{type:"function",value:function(t){return console.error(t)},compare:!1},extent:{type:"array",optional:!0,value:null,compare:!0},tileSize:512,maxZoom:null,minZoom:0,maxCacheSize:null,maxCacheByteSize:null,refinementStrategy:"best-available",zRange:null,maxRequests:6,zoomOffset:0},Yn=function(t){y()(r,t);var e=Qn(r);function r(){return p()(this,r),e.apply(this,arguments)}return E()(r,[{key:"initializeState",value:function(){this.state={tileset:null,isLoaded:!1}}},{key:"finalizeState",value:function(){var t,e;null===(t=this.state)||void 0===t||null===(e=t.tileset)||void 0===e||e.finalize()}},{key:"isLoaded",get:function(){var t,e;return null===(t=this.state)||void 0===t?void 0:null===(e=t.tileset)||void 0===e?void 0:e.selectedTiles.every((function(t){return t.isLoaded&&t.layers&&t.layers.every((function(t){return t.isLoaded}))}))}},{key:"shouldUpdateState",value:function(t){return t.changeFlags.somethingChanged}},{key:"updateState",value:function(t){var e=t.changeFlags,r=this.state.tileset,n=e.propsOrDataChanged||e.updateTriggersChanged,i=e.dataChanged||e.updateTriggersChanged&&(e.updateTriggersChanged.all||e.updateTriggersChanged.getTileData);r?n&&(r.setOptions(this._getTilesetOptions()),i?r.reloadAll():this.state.tileset.tiles.forEach((function(t){t.layers=null}))):(r=new this.props.TilesetClass(this._getTilesetOptions()),this.setState({tileset:r})),this._updateTileset()}},{key:"_getTilesetOptions",value:function(){var t=this.props,e=t.tileSize,r=t.maxCacheSize,n=t.maxCacheByteSize,i=t.refinementStrategy,o=t.extent;return{maxCacheSize:r,maxCacheByteSize:n,maxZoom:t.maxZoom,minZoom:t.minZoom,tileSize:e,refinementStrategy:i,extent:o,maxRequests:t.maxRequests,zoomOffset:t.zoomOffset,getTileData:this.getTileData.bind(this),onTileLoad:this._onTileLoad.bind(this),onTileError:this._onTileError.bind(this),onTileUnload:this._onTileUnload.bind(this)}}},{key:"_updateTileset",value:function(){var t=this.state.tileset,e=this.props,r=e.zRange,n=e.modelMatrix,i=t.update(this.context.viewport,{zRange:r,modelMatrix:n}),o=t.isLoaded,a=this.state.isLoaded!==o,s=this.state.frameNumber!==i;o&&(a||s)&&this._onViewportLoad(),s&&this.setState({frameNumber:i}),this.state.isLoaded=o}},{key:"_onViewportLoad",value:function(){var t=this.state.tileset,e=this.props.onViewportLoad;e&&e(t.selectedTiles)}},{key:"_onTileLoad",value:function(t){this.props.onTileLoad(t),t.layers=null,this.setNeedsUpdate()}},{key:"_onTileError",value:function(t,e){this.props.onTileError(t),e.layers=null,this.setNeedsUpdate()}},{key:"_onTileUnload",value:function(t){this.props.onTileUnload(t)}},{key:"getTileData",value:function(t){var e=this.props,r=e.data,n=e.getTileData,i=e.fetch,o=t.signal;return t.url="string"==typeof r||Array.isArray(r)?xn(r,t):null,n?n(t):i&&t.url?i(t.url,{propName:"data",layer:this,signal:o}):null}},{key:"renderSubLayers",value:function(t){return this.props.renderSubLayers(t)}},{key:"getSubLayerPropsByTile",value:function(t){return null}},{key:"getPickingInfo",value:function(t){var e=t.info,r=t.sourceLayer;return e.tile=r.props.tile,e}},{key:"_updateAutoHighlight",value:function(t){t.sourceLayer&&t.sourceLayer.updateAutoHighlight(t)}},{key:"renderLayers",value:function(){var t=this;return this.state.tileset.tiles.map((function(e){var r=t.getSubLayerPropsByTile(e);if(e.isLoaded||e.content)if(e.layers)r&&e.layers[0]&&Object.keys(r).some((function(t){return e.layers[0].props[t]!==r[t]}))&&(e.layers=e.layers.map((function(t){return t.clone(r)})));else{var n=t.renderSubLayers(Wn(Wn({},t.props),{},{id:"".concat(t.id,"-").concat(e.id),data:e.content,_offset:0,tile:e}));e.layers=Object(_._flatten)(n,Boolean).map((function(t){return t.clone(Wn({tile:e},r))}))}else;return e.layers}))}},{key:"filterSubLayer",value:function(t){var e=t.layer,r=t.cullRect,n=e.props.tile;return this.state.tileset.isTileVisible(n,r)}}]),r}(_.CompositeLayer);B()(Yn,"defaultProps",Xn),B()(Yn,"layerName","TileLayer");var Zn=r(22),$n=r.n(Zn);function ti(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function ei(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ti(Object(r),!0).forEach((function(e){B()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ti(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function ri(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=A()(t);if(e){var i=A()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return m()(this,r)}}var ni=function(t){y()(r,t);var e=ri(r);function r(){return p()(this,r),e.apply(this,arguments)}return E()(r,[{key:"getShaders",value:function(){var t=$n()(A()(r.prototype),"getShaders",this).call(this);return t.inject={"vs:#decl":"uniform float trailLength;\nattribute float instanceTimestamps;\nattribute float instanceNextTimestamps;\nvarying 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;\nvarying 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}},{key:"initializeState",value:function(){$n()(A()(r.prototype),"initializeState",this).call(this),this.getAttributeManager().addInstanced({timestamps:{size:1,accessor:"getTimestamps",shaderAttributes:{instanceTimestamps:{vertexOffset:0},instanceNextTimestamps:{vertexOffset:1}}}})}},{key:"draw",value:function(t){var e=this.props,n=e.fadeTrail,i=e.trailLength,o=e.currentTime;t.uniforms=ei(ei({},t.uniforms),{},{fadeTrail:n,trailLength:i,currentTime:o}),$n()(A()(r.prototype),"draw",this).call(this,t)}}]),r}(_.PathLayer);B()(ni,"layerName","TripsLayer"),B()(ni,"defaultProps",{fadeTrail:!0,trailLength:{type:"number",value:120,min:0},currentTime:{type:"number",value:0,min:0},getTimestamps:{type:"accessor",value:function(t){return t.timestamps}}});var ii=r(35),oi=r(23),ai=r.n(oi),si=r(31),ui=r.n(si);function ci(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=A()(t);if(e){var i=A()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return m()(this,r)}}function li(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function fi(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?li(Object(r),!0).forEach((function(e){B()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):li(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function hi(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return di(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return di(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function di(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function pi(t,e){e=void 0===e?t[0][0]:e;var r,n=hi(t);try{for(n.s();!(r=n.n()).done;){var i=r.value,o=i[0]-e;o>180?i[0]-=360:o<-180&&(i[0]+=360)}}catch(t){n.e(t)}finally{n.f()}}function vi(t,e,r){var n=Object(ii.h3ToGeo)(t),i=R()(n,2),o=i[0],a=i[1],s=e.length;pi(e,a);for(var u=e[0]===e[s-1]?s-1:s,c=0;c<u;c++)e[c][0]=ae(a,e[c][0],r),e[c][1]=ae(o,e[c][1],r)}function yi(t,e,r){var n=t(e,r),i=Object(ii.h3ToGeo)(n),o=R()(i,2),a=o[0];return[o[1],a]}function gi(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=Object(ii.h3ToGeoBoundary)(t,!0);return 1!==e?vi(t,r,e):pi(r),r}var mi=fi(fi({},_.PolygonLayer.defaultProps),{},{highPrecision:"auto",coverage:{type:"number",min:0,max:1,value:1},centerHexagon:null,getHexagon:{type:"accessor",value:function(t){return t.hexagon}},extruded:!0}),bi=function(t){y()(r,t);var e=ci(r);function r(){var t;p()(this,r);for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return t=e.call.apply(e,[this].concat(i)),B()(ai()(t),"state",void 0),t}return E()(r,[{key:"initializeState",value:function(){r._checkH3Lib(),this.state={edgeLengthKM:0,resolution:-1}}},{key:"shouldUpdateState",value:function(t){var e=t.changeFlags;return this._shouldUseHighPrecision()?e.propsOrDataChanged:e.somethingChanged}},{key:"updateState",value:function(t){var e=t.props,r=t.changeFlags;if(!0!==e.highPrecision&&(r.dataChanged||r.updateTriggersChanged&&r.updateTriggersChanged.getHexagon)){var n=this._calculateH3DataProps();this.setState(n)}this._updateVertices(this.context.viewport)}},{key:"_calculateH3DataProps",value:function(){var t,e=-1,r=!1,n=!1,i=Object(_.createIterable)(this.props.data),o=i.iterable,a=i.objectInfo,s=hi(o);try{for(s.s();!(t=s.n()).done;){var u=t.value;a.index++;var c=this.props.getHexagon(u,a),l=Object(ii.h3GetResolution)(c);if(e<0){if(e=l,!this.props.highPrecision)break}else if(e!==l){n=!0;break}if(Object(ii.h3IsPentagon)(c)){r=!0;break}}}catch(t){s.e(t)}finally{s.f()}return{resolution:e,edgeLengthKM:e>=0?Object(ii.edgeLength)(e,"km"):0,hasMultipleRes:n,hasPentagon:r}}},{key:"_shouldUseHighPrecision",value:function(){if("auto"===this.props.highPrecision){var t=this.state,e=t.resolution,r=t.hasPentagon,n=t.hasMultipleRes,i=this.context.viewport;return Boolean(null==i?void 0:i.resolution)||n||r||e>=0&&e<=5}return this.props.highPrecision}},{key:"_updateVertices",value:function(t){if(!this._shouldUseHighPrecision()){var e=this.state,r=e.resolution,n=e.edgeLengthKM,i=e.centerHex;if(!(r<0)){var o=this.props.centerHexagon||Object(ii.geoToH3)(t.latitude,t.longitude,r);if(i!==o){if(i){var a=Object(ii.h3Distance)(i,o);if(a>=0&&a*n<10)return}var s=t.distanceScales.unitsPerMeter,u=gi(o),c=Object(ii.h3ToGeo)(o),l=R()(c,2),f=l[0],h=l[1],d=t.projectFlat([h,f]),p=R()(d,2),v=p[0],y=p[1];u=u.map((function(e){var r=t.projectFlat(e);return[(r[0]-v)/s[0],(r[1]-y)/s[1]]})),this.setState({centerHex:o,vertices:u})}}}}},{key:"renderLayers",value:function(){return this._shouldUseHighPrecision()?this._renderPolygonLayer():this._renderColumnLayer()}},{key:"_getForwardProps",value:function(){var t=this.props,e=t.elevationScale,r=t.material,n=t.coverage,i=t.extruded,o=t.wireframe,a=t.stroked,s=t.filled,u=t.lineWidthUnits,c=t.lineWidthScale,l=t.lineWidthMinPixels,f=t.lineWidthMaxPixels,h=t.getFillColor,d=t.getElevation,p=t.getLineColor,v=t.getLineWidth,y=t.transitions,g=t.updateTriggers;return{elevationScale:e,extruded:i,coverage:n,wireframe:o,stroked:a,filled:s,lineWidthUnits:u,lineWidthScale:c,lineWidthMinPixels:l,lineWidthMaxPixels:f,material:r,getElevation:d,getFillColor:h,getLineColor:p,getLineWidth:v,transitions:y,updateTriggers:{getFillColor:g.getFillColor,getElevation:g.getElevation,getLineColor:g.getLineColor,getLineWidth:g.getLineWidth}}}},{key:"_renderPolygonLayer",value:function(){var t=this.props,e=t.data,r=t.getHexagon,n=t.updateTriggers,i=t.coverage,o=this.getSubLayerClass("hexagon-cell-hifi",_.PolygonLayer),a=this._getForwardProps();return a.updateTriggers.getPolygon=function(t,e){return null==t?e:"object"===ui()(t)?fi(fi({},t),{},{coverage:e}):{getHexagon:t,coverage:e}}(n.getHexagon,i),new o(a,this.getSubLayerProps({id:"hexagon-cell-hifi",updateTriggers:a.updateTriggers}),{data:e,_normalize:!1,_windingOrder:"CCW",positionFormat:"XY",getPolygon:function(t,e){return function(t){var e,r=new Float64Array(2*t.length),n=0,i=hi(t);try{for(i.s();!(e=i.n()).done;){var o=e.value;r[n++]=o[0],r[n++]=o[1]}}catch(t){i.e(t)}finally{i.f()}return r}(gi(r(t,e),i))}})}},{key:"_renderColumnLayer",value:function(){var t=this.props,e=t.data,r=t.getHexagon,n=t.updateTriggers,i=this.getSubLayerClass("hexagon-cell",_.ColumnLayer),o=this._getForwardProps();return o.updateTriggers.getPosition=n.getHexagon,new i(o,this.getSubLayerProps({id:"hexagon-cell",flatShading:!0,updateTriggers:o.updateTriggers}),{data:e,diskResolution:6,radius:1,vertices:this.state.vertices,getPosition:yi.bind(null,r)})}}]),r}(_.CompositeLayer);function Ai(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return wi(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return wi(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function wi(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Bi(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=A()(t);if(e){var i=A()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return m()(this,r)}}B()(bi,"defaultProps",mi),B()(bi,"layerName","H3HexagonLayer"),B()(bi,"_checkH3Lib",(function(){}));var _i=function(t){y()(r,t);var e=Bi(r);function r(){return p()(this,r),e.apply(this,arguments)}return E()(r,[{key:"initializeState",value:function(){bi._checkH3Lib()}},{key:"updateState",value:function(t){var e=t.props,r=t.changeFlags;if(r.dataChanged||r.updateTriggersChanged&&r.updateTriggersChanged.getHexagons){var n,i=e.data,o=e.getHexagons,a=[],s=Object(_.createIterable)(i),u=s.iterable,c=s.objectInfo,l=Ai(u);try{for(l.s();!(n=l.n()).done;){var f=n.value;c.index++;var h,d=o(f,c),p=Ai(Object(ii.h3SetToMultiPolygon)(d,!0));try{for(p.s();!(h=p.n()).done;){var v=h.value;a.push(this.getSubLayerRow({polygon:v},f,c.index))}}catch(t){p.e(t)}finally{p.f()}}}catch(t){l.e(t)}finally{l.f()}this.setState({polygons:a})}}},{key:"indexToBounds",value:function(){return{data:this.state.polygons,getPolygon:function(t){return t.polygon}}}}]),r}(M);B()(_i,"layerName","H3ClusterLayer"),B()(_i,"defaultProps",{getHexagons:{type:"accessor",value:function(t){return t.hexagons}}});var xi=r(43);function Ci(){return!("object"===("undefined"==typeof process?"undefined":ui()(process))&&"[object process]"===String(process)&&!process.browser)||function(t){if("undefined"!=typeof window&&"object"===ui()(window.process)&&"renderer"===window.process.type)return!0;if("undefined"!=typeof process&&"object"===ui()(process.versions)&&Boolean(process.versions.electron))return!0;var e="object"===("undefined"==typeof navigator?"undefined":ui()(navigator))&&"string"==typeof navigator.userAgent&&navigator.userAgent,r=t||e;return!!(r&&r.indexOf("Electron")>=0)}()}Ci();function ki(t){try{var e=window[t],r="__storage_test__";return e.setItem(r,r),e.removeItem(r),e}catch(t){return null}}var Ei,Oi=function(){function t(e){p()(this,t);var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"sessionStorage";In(this,"storage",void 0),In(this,"id",void 0),In(this,"config",{}),this.storage=ki(n),this.id=e,this.config={},Object.assign(this.config,r),this._loadConfiguration()}return E()(t,[{key:"getConfiguration",value:function(){return this.config}},{key:"setConfiguration",value:function(t){return this.config={},this.updateConfiguration(t)}},{key:"updateConfiguration",value:function(t){if(Object.assign(this.config,t),this.storage){var e=JSON.stringify(this.config);this.storage.setItem(this.id,e)}return this}},{key:"_loadConfiguration",value:function(){var t={};if(this.storage){var e=this.storage.getItem(this.id);t=e?JSON.parse(e):{}}return Object.assign(this.config,t),this}}]),t}();function Ti(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:600,i=t.src.replace(/\(/g,"%28").replace(/\)/g,"%29");t.width>n&&(r=Math.min(r,n/t.width));var o=t.width*r,a=t.height*r,s=["font-size:1px;","padding:".concat(Math.floor(a/2),"px ").concat(Math.floor(o/2),"px;"),"line-height:".concat(a,"px;"),"background:url(".concat(i,");"),"background-size:".concat(o,"px ").concat(a,"px;"),"color:transparent;"].join("");return["".concat(e," %c+"),s]}function Si(t){return"string"==typeof t?Ei[t.toUpperCase()]||Ei.WHITE:t}function Mi(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return Ii(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ii(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function Ii(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Ri(t){var e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["constructor"],n=Object.getPrototypeOf(t),i=Object.getOwnPropertyNames(n),o=Mi(i);try{var a=function(){var n=e.value;"function"==typeof t[n]&&(r.find((function(t){return n===t}))||(t[n]=t[n].bind(t)))};for(o.s();!(e=o.n()).done;)a()}catch(t){o.e(t)}finally{o.f()}}function Pi(t,e){if(!t)throw new Error(e||"Assertion failed")}!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"}(Ei||(Ei={}));var Fi={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document,process:"object"===("undefined"==typeof process?"undefined":ui()(process))&&process},Di=(globalThis,Fi.window||Fi.self||Fi.global),Li=Fi.process||{};console;function ji(){var t,e,r;if(Ci&&"performance"in Di)t=null==Di?void 0:null===(e=Di.performance)||void 0===e?void 0:null===(r=e.now)||void 0===r?void 0:r.call(e);else if("hrtime"in Li){var n,i=null==Li?void 0:null===(n=Li.hrtime)||void 0===n?void 0:n.call(Li);t=1e3*i[0]+i[1]/1e6}else t=Date.now();return t}var Gi={debug:Ci&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},Ni={enabled:!0,level:0};function Ui(){}var Hi={},Vi={once:!0},Ji=function(){function t(){p()(this,t);var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{id:""},r=e.id;In(this,"id",void 0),In(this,"VERSION","8.8.15"),In(this,"_startTs",ji()),In(this,"_deltaTs",ji()),In(this,"_storage",void 0),In(this,"userData",{}),In(this,"LOG_THROTTLE_TIMEOUT",0),this.id=r,this._storage=new Oi("__probe-".concat(this.id,"__"),Ni),this.userData={},this.timeStamp("".concat(this.id," started")),Ri(this),Object.seal(this)}return E()(t,[{key:"level",get:function(){return this.getLevel()},set:function(t){this.setLevel(t)}},{key:"isEnabled",value:function(){return this._storage.config.enabled}},{key:"getLevel",value:function(){return this._storage.config.level}},{key:"getTotal",value:function(){return Number((ji()-this._startTs).toPrecision(10))}},{key:"getDelta",value:function(){return Number((ji()-this._deltaTs).toPrecision(10))}},{key:"priority",get:function(){return this.level},set:function(t){this.level=t}},{key:"getPriority",value:function(){return this.level}},{key:"enable",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this._storage.updateConfiguration({enabled:t}),this}},{key:"setLevel",value:function(t){return this._storage.updateConfiguration({level:t}),this}},{key:"get",value:function(t){return this._storage.config[t]}},{key:"set",value:function(t,e){this._storage.updateConfiguration(B()({},t,e))}},{key:"settings",value:function(){console.table?console.table(this._storage.config):console.log(this._storage.config)}},{key:"assert",value:function(t,e){Pi(t,e)}},{key:"warn",value:function(t){return this._getLogFunction(0,t,Gi.warn,arguments,Vi)}},{key:"error",value:function(t){return this._getLogFunction(0,t,Gi.error,arguments)}},{key:"deprecated",value:function(t,e){return this.warn("`".concat(t,"` is deprecated and will be removed in a later version. Use `").concat(e,"` instead"))}},{key:"removed",value:function(t,e){return this.error("`".concat(t,"` has been removed. Use `").concat(e,"` instead"))}},{key:"probe",value:function(t,e){return this._getLogFunction(t,e,Gi.log,arguments,{time:!0,once:!0})}},{key:"log",value:function(t,e){return this._getLogFunction(t,e,Gi.debug,arguments)}},{key:"info",value:function(t,e){return this._getLogFunction(t,e,console.info,arguments)}},{key:"once",value:function(t,e){for(var r=arguments.length,n=new Array(r>2?r-2:0),i=2;i<r;i++)n[i-2]=arguments[i];return this._getLogFunction(t,e,Gi.debug||Gi.info,arguments,Vi)}},{key:"table",value:function(t,e,r){return e?this._getLogFunction(t,e,console.table||Ui,r&&[r],{tag:qi(e)}):Ui}},{key:"image",value:function(t){var e=t.logLevel,n=t.priority,i=t.image,o=t.message,a=void 0===o?"":o,s=t.scale,u=void 0===s?1:s;return this._shouldLog(e||n)?Ci?function(t){var e=t.image,r=t.message,n=void 0===r?"":r,i=t.scale,o=void 0===i?1:i;if("string"==typeof e){var a=new Image;return a.onload=function(){var t,e=Ti(a,n,o);(t=console).log.apply(t,Lt()(e))},a.src=e,Ui}var s=e.nodeName||"";if("img"===s.toLowerCase()){var u;return(u=console).log.apply(u,Lt()(Ti(e,n,o))),Ui}if("canvas"===s.toLowerCase()){var c=new Image;return c.onload=function(){var t;return(t=console).log.apply(t,Lt()(Ti(c,n,o)))},c.src=e.toDataURL(),Ui}return Ui}({image:i,message:a,scale:u}):function(t){var e=t.image,n=(t.message,t.scale),i=void 0===n?1:n,o=null;try{o=r(116)}catch(t){}if(o)return function(){return o(e,{fit:"box",width:"".concat(Math.round(80*i),"%")}).then((function(t){return console.log(t)}))};return Ui}({image:i,message:a,scale:u}):Ui}},{key:"time",value:function(t,e){return this._getLogFunction(t,e,console.time?console.time:console.info)}},{key:"timeEnd",value:function(t,e){return this._getLogFunction(t,e,console.timeEnd?console.timeEnd:console.info)}},{key:"timeStamp",value:function(t,e){return this._getLogFunction(t,e,console.timeStamp||Ui)}},{key:"group",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{collapsed:!1},n=Ki({logLevel:t,message:e,opts:r}),i=r.collapsed;return n.method=(i?console.groupCollapsed:console.group)||console.info,this._getLogFunction(n)}},{key:"groupCollapsed",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.group(t,e,Object.assign({},r,{collapsed:!0}))}},{key:"groupEnd",value:function(t){return this._getLogFunction(t,"",console.groupEnd||Ui)}},{key:"withGroup",value:function(t,e,r){this.group(t,e)();try{r()}finally{this.groupEnd(t)()}}},{key:"trace",value:function(){console.trace&&console.trace()}},{key:"_shouldLog",value:function(t){return this.isEnabled()&&this.getLevel()>=zi(t)}},{key:"_getLogFunction",value:function(t,e,r,n,i){if(this._shouldLog(t)){var o;i=Ki({logLevel:t,message:e,args:n,opts:i}),Pi(r=r||i.method),i.total=this.getTotal(),i.delta=this.getDelta(),this._deltaTs=ji();var a=i.tag||i.message;if(i.once){if(Hi[a])return Ui;Hi[a]=ji()}return e=function(t,e,r){if("string"==typeof e){var n=r.time?function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8,r=Math.max(e-t.length,0);return"".concat(" ".repeat(r)).concat(t)}((s=r.total)<10?"".concat(s.toFixed(2),"ms"):s<100?"".concat(s.toFixed(1),"ms"):s<1e3?"".concat(s.toFixed(0),"ms"):"".concat((s/1e3).toFixed(2),"s")):"";e=r.time?"".concat(t,": ").concat(n," ").concat(e):"".concat(t,": ").concat(e),i=e,o=r.color,a=r.background,Ci||"string"!=typeof i||(o&&(o=Si(o),i="[".concat(o,"m").concat(i,"")),a&&(o=Si(a),i="[".concat(a+10,"m").concat(i,""))),e=i}var i,o,a;var s;return e}(this.id,i.message,i),(o=r).bind.apply(o,[console,e].concat(Lt()(i.args)))}return Ui}}]),t}();function zi(t){if(!t)return 0;var e;switch(ui()(t)){case"number":e=t;break;case"object":e=t.logLevel||t.priority||0;break;default:return 0}return Pi(Number.isFinite(e)&&e>=0),e}function Ki(t){var e=t.logLevel,r=t.message;t.logLevel=zi(e);for(var n=t.args?Array.from(t.args):[];n.length&&n.shift()!==r;);switch(ui()(e)){case"string":case"function":void 0!==r&&n.unshift(r),t.message=e;break;case"object":Object.assign(t,e)}"function"==typeof t.message&&(t.message=t.message());var i=ui()(t.message);return Pi("string"===i||"object"===i),Object.assign(t,{args:n},t.opts)}function qi(t){for(var e in t)for(var r in t[e])return r||"untitled";return"empty"}In(Ji,"VERSION","8.8.15");var Wi=new Ji({id:"luma.gl"});function Qi(t,e){if(!t)throw new Error(e||"luma.gl: assertion failed.")}function Xi(t){return"undefined"!=typeof WebGLRenderingContext&&t instanceof WebGLRenderingContext||("undefined"!=typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext||Boolean(t&&Number.isFinite(t._version)))}function Yi(t){return"undefined"!=typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext||Boolean(t&&2===t._version)}function Zi(t){return Qi(Xi(t),"Invalid WebGLRenderingContext"),t}function $i(t){return Qi(Yi(t),"Requires WebGL2"),t}var to={};function eo(t,e){var r;to[t]=!0,void 0!==e&&(r=e,globalThis.console&&globalThis.console.error&&globalThis.console.error(r))}var ro=function t(e){var r=e.gl;this.ext=e,this.isAlive=!0,this.hasBeenBound=!1,this.elementArrayBuffer=null,this.attribs=new Array(e.maxVertexAttribs);for(var n=0;n<this.attribs.length;n++){var i=new t.VertexAttrib(r);this.attribs[n]=i}this.maxAttrib=0};(ro.VertexAttrib=function(t){this.enabled=!1,this.buffer=null,this.size=4,this.type=5126,this.normalized=!1,this.stride=16,this.offset=0,this.cached="",this.recache()}).prototype.recache=function(){this.cached=[this.size,this.type,this.normalized,this.stride,this.offset].join(":")};var no,io=function(t){var e=this;this.gl=t,function(t){var e=t.getError;t.getError=function(){var r;do{0!==(r=e.apply(t))&&(to[r]=!0)}while(0!==r);for(r in to)if(to[r])return delete to[r],parseInt(r,10);return 0}}(t);var r=this.original={getParameter:t.getParameter,enableVertexAttribArray:t.enableVertexAttribArray,disableVertexAttribArray:t.disableVertexAttribArray,bindBuffer:t.bindBuffer,getVertexAttrib:t.getVertexAttrib,vertexAttribPointer:t.vertexAttribPointer};t.getParameter=function(t){return t===e.VERTEX_ARRAY_BINDING_OES?e.currentVertexArrayObject===e.defaultVertexArrayObject?null:e.currentVertexArrayObject:r.getParameter.apply(this,arguments)},t.enableVertexAttribArray=function(t){var n=e.currentVertexArrayObject;n.maxAttrib=Math.max(n.maxAttrib,t);var i=n.attribs[t];return i.enabled=!0,r.enableVertexAttribArray.apply(this,arguments)},t.disableVertexAttribArray=function(t){var n=e.currentVertexArrayObject;n.maxAttrib=Math.max(n.maxAttrib,t);var i=n.attribs[t];return i.enabled=!1,r.disableVertexAttribArray.apply(this,arguments)},t.bindBuffer=function(t,n){switch(t){case 34962:e.currentArrayBuffer=n;break;case 34963:e.currentVertexArrayObject.elementArrayBuffer=n}return r.bindBuffer.apply(this,arguments)},t.getVertexAttrib=function(t,n){var i=e.currentVertexArrayObject,o=i.attribs[t];switch(n){case 34975:return o.buffer;case 34338:return o.enabled;case 34339:return o.size;case 34340:return o.stride;case 34341:return o.type;case 34922:return o.normalized;default:return r.getVertexAttrib.apply(this,arguments)}},t.vertexAttribPointer=function(t,n,i,o,a,s){var u=e.currentVertexArrayObject;u.maxAttrib=Math.max(u.maxAttrib,t);var c=u.attribs[t];return c.buffer=e.currentArrayBuffer,c.size=n,c.type=i,c.normalized=o,c.stride=a,c.offset=s,c.recache(),r.vertexAttribPointer.apply(this,arguments)},t.instrumentExtension&&t.instrumentExtension(this,"OES_vertex_array_object"),t.canvas&&t.canvas.addEventListener("webglcontextrestored",(function(){var t;t="OESVertexArrayObject emulation library context restored",globalThis.console&&globalThis.console.log&&globalThis.console.log(t),e.reset_()}),!0),this.reset_()};io.prototype.VERTEX_ARRAY_BINDING_OES=34229,io.prototype.reset_=function(){if(void 0!==this.vertexArrayObjects)for(var t=0;t<this.vertexArrayObjects.length;++t)this.vertexArrayObjects.isAlive=!1;var e=this.gl;this.maxVertexAttribs=e.getParameter(34921),this.defaultVertexArrayObject=new ro(this),this.currentVertexArrayObject=null,this.currentArrayBuffer=null,this.vertexArrayObjects=[this.defaultVertexArrayObject],this.bindVertexArrayOES(null)},io.prototype.createVertexArrayOES=function(){var t=new ro(this);return this.vertexArrayObjects.push(t),t},io.prototype.deleteVertexArrayOES=function(t){t.isAlive=!1,this.vertexArrayObjects.splice(this.vertexArrayObjects.indexOf(t),1),this.currentVertexArrayObject===t&&this.bindVertexArrayOES(null)},io.prototype.isVertexArrayOES=function(t){return!!(t&&t instanceof ro&&t.hasBeenBound&&t.ext===this)},io.prototype.bindVertexArrayOES=function(t){var e=this.gl;if(!t||t.isAlive){var r=this.original,n=this.currentVertexArrayObject;this.currentVertexArrayObject=t||this.defaultVertexArrayObject,this.currentVertexArrayObject.hasBeenBound=!0;var i=this.currentVertexArrayObject;if(n!==i){n&&i.elementArrayBuffer===n.elementArrayBuffer||r.bindBuffer.call(e,34963,i.elementArrayBuffer);for(var o=this.currentArrayBuffer,a=Math.max(n?n.maxAttrib:0,i.maxAttrib),s=0;s<=a;s++){var u=i.attribs[s],c=n?n.attribs[s]:null;if(n&&u.enabled===c.enabled||(u.enabled?r.enableVertexAttribArray.call(e,s):r.disableVertexAttribArray.call(e,s)),u.enabled){var l=!1;n&&u.buffer===c.buffer||(o!==u.buffer&&(r.bindBuffer.call(e,34962,u.buffer),o=u.buffer),l=!0),(l||u.cached!==c.cached)&&r.vertexAttribPointer.call(e,s,u.size,u.type,u.normalized,u.stride,u.offset)}}this.currentArrayBuffer!==o&&r.bindBuffer.call(e,34962,this.currentArrayBuffer)}}else eo(1282,"bindVertexArrayOES: attempt to bind deleted arrayObject")};var oo,ao=function(t){return Yi(t)?void 0:0},so=(no={},B()(no,3074,(function(t){return Yi(t)?void 0:36064})),B()(no,35723,(function(t){return Yi(t)?void 0:4352})),B()(no,35977,ao),B()(no,32937,ao),B()(no,36795,(function(t,e){var r=Yi(t)?t.getExtension("EXT_disjoint_timer_query_webgl2"):t.getExtension("EXT_disjoint_timer_query");return r&&r.GPU_DISJOINT_EXT?e(r.GPU_DISJOINT_EXT):0})),B()(no,37445,(function(t,e){var r=t.getExtension("WEBGL_debug_renderer_info");return e(r&&r.UNMASKED_VENDOR_WEBGL||7936)})),B()(no,37446,(function(t,e){var r=t.getExtension("WEBGL_debug_renderer_info");return e(r&&r.UNMASKED_RENDERER_WEBGL||7937)})),B()(no,34047,(function(t,e){var r=t.luma.extensions.EXT_texture_filter_anisotropic;return r?e(r.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1})),B()(no,32883,ao),B()(no,35071,ao),B()(no,37447,ao),B()(no,36063,(function(t,e){if(!Yi(t)){var r=t.getExtension("WEBGL_draw_buffers");return r?e(r.MAX_COLOR_ATTACHMENTS_WEBGL):0}})),B()(no,35379,ao),B()(no,35374,ao),B()(no,35377,ao),B()(no,34852,(function(t){if(!Yi(t)){var e=t.getExtension("WEBGL_draw_buffers");return e?e.MAX_DRAW_BUFFERS_WEBGL:0}})),B()(no,36203,(function(t){return t.getExtension("OES_element_index")?2147483647:65535})),B()(no,33001,(function(t){return t.getExtension("OES_element_index")?16777216:65535})),B()(no,33e3,(function(t){return 16777216})),B()(no,37157,ao),B()(no,35373,ao),B()(no,35657,ao),B()(no,36183,ao),B()(no,37137,ao),B()(no,34045,ao),B()(no,35978,ao),B()(no,35979,ao),B()(no,35968,ao),B()(no,35376,ao),B()(no,35375,ao),B()(no,35659,ao),B()(no,37154,ao),B()(no,35371,ao),B()(no,35658,ao),B()(no,35076,ao),B()(no,35077,ao),B()(no,35380,ao),no);var uo,co,lo,fo=(oo={},B()(oo,"OES_vertex_array_object",{meta:{suffix:"OES"},createVertexArray:function(){Qi(!1,"VertexArray requires WebGL2 or OES_vertex_array_object extension")},deleteVertexArray:function(){},bindVertexArray:function(){},isVertexArray:function(){return!1}}),B()(oo,"ANGLE_instanced_arrays",{meta:{suffix:"ANGLE"},vertexAttribDivisor:function(t,e){Qi(0===e,"WebGL instanced rendering not supported")},drawElementsInstanced:function(){},drawArraysInstanced:function(){}}),B()(oo,"WEBGL_draw_buffers",{meta:{suffix:"WEBGL"},drawBuffers:function(){Qi(!1)}}),B()(oo,"EXT_disjoint_timer_query",{meta:{suffix:"EXT"},createQuery:function(){Qi(!1)},deleteQuery:function(){Qi(!1)},beginQuery:function(){Qi(!1)},endQuery:function(){},getQuery:function(t,e){return this.getQueryObject(t,e)},getQueryParameter:function(t,e){return this.getQueryObject(t,e)},getQueryObject:function(){}}),oo),ho={readBuffer:function(t,e,r){Yi(t)&&e(r)},getVertexAttrib:function(t,e,r,n){var i,o=function(t,e){return{webgl2:Yi(t),ext:t.getExtension(e)}}(t,"ANGLE_instanced_arrays"),a=o.webgl2,s=o.ext;switch(n){case 35069:i=!!a&&void 0;break;case 35070:i=a||s?void 0:0}return void 0!==i?i:e(r,n)},getProgramParameter:function(t,e,r,n){if(!Yi(t))switch(n){case 35967:return 35981;case 35971:case 35382:return 0}return e(r,n)},getInternalformatParameter:function(t,e,r,n,i){if(!Yi(t))switch(i){case 32937:return new Int32Array([0])}return t.getInternalformatParameter(r,n,i)},getTexParameter:function(t,e,r,n){switch(n){case 34046:var i=t.luma.extensions.EXT_texture_filter_anisotropic;n=i&&i.TEXTURE_MAX_ANISOTROPY_EXT||34046}return e(r,n)},getParameter:function(t,e,r){var n=so[r],i="function"==typeof n?n(t,e,r):n;return void 0!==i?i:e(r)},hint:function(t,e,r,n){return e(r,n)}};function po(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return vo(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return vo(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function vo(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function yo(t,e){var r=e.extension,n=e.target,i=e.target2,o=fo[r];Qi(o);for(var a=o.meta,s=(void 0===a?{}:a).suffix,u=void 0===s?"":s,c=t.getExtension(r),l=function(){var e=h[f],r="".concat(e).concat(u),a=null;"meta"===e||"function"==typeof t[e]||(c&&"function"==typeof c[r]?a=function(){return c[r].apply(c,arguments)}:"function"==typeof o[e]&&(a=o[e].bind(n))),a&&(n[e]=a,i[e]=a)},f=0,h=Object.keys(o);f<h.length;f++)l()}globalThis.polyfillContext=function(t){t.luma=t.luma||{};var e=t.luma;return e.polyfilled||(!function(t){if("function"!=typeof t.createVertexArray){var e=t.getSupportedExtensions;t.getSupportedExtensions=function(){var t=e.call(this)||[];return t.indexOf("OES_vertex_array_object")<0&&t.push("OES_vertex_array_object"),t};var r=t.getExtension;t.getExtension=function(e){var n=r.call(this,e);return n||("OES_vertex_array_object"!==e?null:(t.__OESVertexArrayObject||(this.__OESVertexArrayObject=new io(this)),this.__OESVertexArrayObject))}}}(t),function(t){t.luma.extensions={};var e,r=po(t.getSupportedExtensions()||[]);try{for(r.s();!(e=r.n()).done;){var n=e.value;t.luma[n]=t.getExtension(n)}}catch(t){r.e(t)}finally{r.f()}}(t),function(t,e){var r,n=po(Object.getOwnPropertyNames(e));try{for(n.s();!(r=n.n()).done;){var i=r.value;"overrides"!==i&&yo(t,{extension:i,target:t.luma,target2:t})}}catch(t){n.e(t)}finally{n.f()}}(t,fo),function(t,e){var r=e.target,n=e.target2;Object.keys(ho).forEach((function(e){if("function"==typeof ho[e]){var i=t[e]?t[e].bind(t):function(){},o=ho[e].bind(null,t,i);r[e]=o,n[e]=o}}))}(t,{target:e,target2:t}),e.polyfilled=!0),t};var go=(uo={},B()(uo,3042,!1),B()(uo,32773,new Float32Array([0,0,0,0])),B()(uo,32777,32774),B()(uo,34877,32774),B()(uo,32969,1),B()(uo,32968,0),B()(uo,32971,1),B()(uo,32970,0),B()(uo,3106,new Float32Array([0,0,0,0])),B()(uo,3107,[!0,!0,!0,!0]),B()(uo,2884,!1),B()(uo,2885,1029),B()(uo,2929,!1),B()(uo,2931,1),B()(uo,2932,513),B()(uo,2928,new Float32Array([0,1])),B()(uo,2930,!0),B()(uo,3024,!0),B()(uo,36006,null),B()(uo,2886,2305),B()(uo,33170,4352),B()(uo,2849,1),B()(uo,32823,!1),B()(uo,32824,0),B()(uo,10752,0),B()(uo,32938,1),B()(uo,32939,!1),B()(uo,3089,!1),B()(uo,3088,new Int32Array([0,0,1024,1024])),B()(uo,2960,!1),B()(uo,2961,0),B()(uo,2968,4294967295),B()(uo,36005,4294967295),B()(uo,2962,519),B()(uo,2967,0),B()(uo,2963,4294967295),B()(uo,34816,519),B()(uo,36003,0),B()(uo,36004,4294967295),B()(uo,2964,7680),B()(uo,2965,7680),B()(uo,2966,7680),B()(uo,34817,7680),B()(uo,34818,7680),B()(uo,34819,7680),B()(uo,2978,[0,0,1024,1024]),B()(uo,3333,4),B()(uo,3317,4),B()(uo,37440,!1),B()(uo,37441,!1),B()(uo,37443,37444),B()(uo,35723,4352),B()(uo,36010,null),B()(uo,35977,!1),B()(uo,3330,0),B()(uo,3332,0),B()(uo,3331,0),B()(uo,3314,0),B()(uo,32878,0),B()(uo,3316,0),B()(uo,3315,0),B()(uo,32877,0),uo),mo=function(t,e,r){return e?t.enable(r):t.disable(r)},bo=function(t,e,r){return t.hint(r,e)},Ao=function(t,e,r){return t.pixelStorei(r,e)};function wo(t){return Array.isArray(t)||ArrayBuffer.isView(t)}var Bo=(co={},B()(co,3042,mo),B()(co,32773,(function(t,e){return t.blendColor.apply(t,Lt()(e))})),B()(co,32777,"blendEquation"),B()(co,34877,"blendEquation"),B()(co,32969,"blendFunc"),B()(co,32968,"blendFunc"),B()(co,32971,"blendFunc"),B()(co,32970,"blendFunc"),B()(co,3106,(function(t,e){return t.clearColor.apply(t,Lt()(e))})),B()(co,3107,(function(t,e){return t.colorMask.apply(t,Lt()(e))})),B()(co,2884,mo),B()(co,2885,(function(t,e){return t.cullFace(e)})),B()(co,2929,mo),B()(co,2931,(function(t,e){return t.clearDepth(e)})),B()(co,2932,(function(t,e){return t.depthFunc(e)})),B()(co,2928,(function(t,e){return t.depthRange.apply(t,Lt()(e))})),B()(co,2930,(function(t,e){return t.depthMask(e)})),B()(co,3024,mo),B()(co,35723,bo),B()(co,36006,(function(t,e){var r=Yi(t)?36009:36160;return t.bindFramebuffer(r,e)})),B()(co,2886,(function(t,e){return t.frontFace(e)})),B()(co,33170,bo),B()(co,2849,(function(t,e){return t.lineWidth(e)})),B()(co,32823,mo),B()(co,32824,"polygonOffset"),B()(co,10752,"polygonOffset"),B()(co,35977,mo),B()(co,32938,"sampleCoverage"),B()(co,32939,"sampleCoverage"),B()(co,3089,mo),B()(co,3088,(function(t,e){return t.scissor.apply(t,Lt()(e))})),B()(co,2960,mo),B()(co,2961,(function(t,e){return t.clearStencil(e)})),B()(co,2968,(function(t,e){return t.stencilMaskSeparate(1028,e)})),B()(co,36005,(function(t,e){return t.stencilMaskSeparate(1029,e)})),B()(co,2962,"stencilFuncFront"),B()(co,2967,"stencilFuncFront"),B()(co,2963,"stencilFuncFront"),B()(co,34816,"stencilFuncBack"),B()(co,36003,"stencilFuncBack"),B()(co,36004,"stencilFuncBack"),B()(co,2964,"stencilOpFront"),B()(co,2965,"stencilOpFront"),B()(co,2966,"stencilOpFront"),B()(co,34817,"stencilOpBack"),B()(co,34818,"stencilOpBack"),B()(co,34819,"stencilOpBack"),B()(co,2978,(function(t,e){return t.viewport.apply(t,Lt()(e))})),B()(co,3333,Ao),B()(co,3317,Ao),B()(co,37440,Ao),B()(co,37441,Ao),B()(co,37443,Ao),B()(co,3330,Ao),B()(co,3332,Ao),B()(co,3331,Ao),B()(co,36010,(function(t,e){return t.bindFramebuffer(36008,e)})),B()(co,3314,Ao),B()(co,32878,Ao),B()(co,3316,Ao),B()(co,3315,Ao),B()(co,32877,Ao),B()(co,"framebuffer",(function(t,e){var r=e&&"handle"in e?e.handle:e;return t.bindFramebuffer(36160,r)})),B()(co,"blend",(function(t,e){return e?t.enable(3042):t.disable(3042)})),B()(co,"blendColor",(function(t,e){return t.blendColor.apply(t,Lt()(e))})),B()(co,"blendEquation",(function(t,e){e=wo(e)?e:[e,e],t.blendEquationSeparate.apply(t,Lt()(e))})),B()(co,"blendFunc",(function(t,e){e=wo(e)&&2===e.length?[].concat(Lt()(e),Lt()(e)):e,t.blendFuncSeparate.apply(t,Lt()(e))})),B()(co,"clearColor",(function(t,e){return t.clearColor.apply(t,Lt()(e))})),B()(co,"clearDepth",(function(t,e){return t.clearDepth(e)})),B()(co,"clearStencil",(function(t,e){return t.clearStencil(e)})),B()(co,"colorMask",(function(t,e){return t.colorMask.apply(t,Lt()(e))})),B()(co,"cull",(function(t,e){return e?t.enable(2884):t.disable(2884)})),B()(co,"cullFace",(function(t,e){return t.cullFace(e)})),B()(co,"depthTest",(function(t,e){return e?t.enable(2929):t.disable(2929)})),B()(co,"depthFunc",(function(t,e){return t.depthFunc(e)})),B()(co,"depthMask",(function(t,e){return t.depthMask(e)})),B()(co,"depthRange",(function(t,e){return t.depthRange.apply(t,Lt()(e))})),B()(co,"dither",(function(t,e){return e?t.enable(3024):t.disable(3024)})),B()(co,"derivativeHint",(function(t,e){t.hint(35723,e)})),B()(co,"frontFace",(function(t,e){return t.frontFace(e)})),B()(co,"mipmapHint",(function(t,e){return t.hint(33170,e)})),B()(co,"lineWidth",(function(t,e){return t.lineWidth(e)})),B()(co,"polygonOffsetFill",(function(t,e){return e?t.enable(32823):t.disable(32823)})),B()(co,"polygonOffset",(function(t,e){return t.polygonOffset.apply(t,Lt()(e))})),B()(co,"sampleCoverage",(function(t,e){return t.sampleCoverage.apply(t,Lt()(e))})),B()(co,"scissorTest",(function(t,e){return e?t.enable(3089):t.disable(3089)})),B()(co,"scissor",(function(t,e){return t.scissor.apply(t,Lt()(e))})),B()(co,"stencilTest",(function(t,e){return e?t.enable(2960):t.disable(2960)})),B()(co,"stencilMask",(function(t,e){var r=e=wo(e)?e:[e,e],n=R()(r,2),i=n[0],o=n[1];t.stencilMaskSeparate(1028,i),t.stencilMaskSeparate(1029,o)})),B()(co,"stencilFunc",(function(t,e){var r=e=wo(e)&&3===e.length?[].concat(Lt()(e),Lt()(e)):e,n=R()(r,6),i=n[0],o=n[1],a=n[2],s=n[3],u=n[4],c=n[5];t.stencilFuncSeparate(1028,i,o,a),t.stencilFuncSeparate(1029,s,u,c)})),B()(co,"stencilOp",(function(t,e){var r=e=wo(e)&&3===e.length?[].concat(Lt()(e),Lt()(e)):e,n=R()(r,6),i=n[0],o=n[1],a=n[2],s=n[3],u=n[4],c=n[5];t.stencilOpSeparate(1028,i,o,a),t.stencilOpSeparate(1029,s,u,c)})),B()(co,"viewport",(function(t,e){return t.viewport.apply(t,Lt()(e))})),co);function _o(t,e,r){return void 0!==e[t]?e[t]:r[t]}var xo={blendEquation:function(t,e,r){return t.blendEquationSeparate(_o(32777,e,r),_o(34877,e,r))},blendFunc:function(t,e,r){return t.blendFuncSeparate(_o(32969,e,r),_o(32968,e,r),_o(32971,e,r),_o(32970,e,r))},polygonOffset:function(t,e,r){return t.polygonOffset(_o(32824,e,r),_o(10752,e,r))},sampleCoverage:function(t,e,r){return t.sampleCoverage(_o(32938,e,r),_o(32939,e,r))},stencilFuncFront:function(t,e,r){return t.stencilFuncSeparate(1028,_o(2962,e,r),_o(2967,e,r),_o(2963,e,r))},stencilFuncBack:function(t,e,r){return t.stencilFuncSeparate(1029,_o(34816,e,r),_o(36003,e,r),_o(36004,e,r))},stencilOpFront:function(t,e,r){return t.stencilOpSeparate(1028,_o(2964,e,r),_o(2965,e,r),_o(2966,e,r))},stencilOpBack:function(t,e,r){return t.stencilOpSeparate(1029,_o(34817,e,r),_o(34818,e,r),_o(34819,e,r))}},Co={enable:function(t,e){return t(B()({},e,!0))},disable:function(t,e){return t(B()({},e,!1))},pixelStorei:function(t,e,r){return t(B()({},e,r))},hint:function(t,e,r){return t(B()({},e,r))},bindFramebuffer:function(t,e,r){var n;switch(e){case 36160:return t((n={},B()(n,36006,r),B()(n,36010,r),n));case 36009:return t(B()({},36006,r));case 36008:return t(B()({},36010,r));default:return null}},blendColor:function(t,e,r,n,i){return t(B()({},32773,new Float32Array([e,r,n,i])))},blendEquation:function(t,e){var r;return t((r={},B()(r,32777,e),B()(r,34877,e),r))},blendEquationSeparate:function(t,e,r){var n;return t((n={},B()(n,32777,e),B()(n,34877,r),n))},blendFunc:function(t,e,r){var n;return t((n={},B()(n,32969,e),B()(n,32968,r),B()(n,32971,e),B()(n,32970,r),n))},blendFuncSeparate:function(t,e,r,n,i){var o;return t((o={},B()(o,32969,e),B()(o,32968,r),B()(o,32971,n),B()(o,32970,i),o))},clearColor:function(t,e,r,n,i){return t(B()({},3106,new Float32Array([e,r,n,i])))},clearDepth:function(t,e){return t(B()({},2931,e))},clearStencil:function(t,e){return t(B()({},2961,e))},colorMask:function(t,e,r,n,i){return t(B()({},3107,[e,r,n,i]))},cullFace:function(t,e){return t(B()({},2885,e))},depthFunc:function(t,e){return t(B()({},2932,e))},depthRange:function(t,e,r){return t(B()({},2928,new Float32Array([e,r])))},depthMask:function(t,e){return t(B()({},2930,e))},frontFace:function(t,e){return t(B()({},2886,e))},lineWidth:function(t,e){return t(B()({},2849,e))},polygonOffset:function(t,e,r){var n;return t((n={},B()(n,32824,e),B()(n,10752,r),n))},sampleCoverage:function(t,e,r){var n;return t((n={},B()(n,32938,e),B()(n,32939,r),n))},scissor:function(t,e,r,n,i){return t(B()({},3088,new Int32Array([e,r,n,i])))},stencilMask:function(t,e){var r;return t((r={},B()(r,2968,e),B()(r,36005,e),r))},stencilMaskSeparate:function(t,e,r){return t(B()({},1028===e?2968:36005,r))},stencilFunc:function(t,e,r,n){var i;return t((i={},B()(i,2962,e),B()(i,2967,r),B()(i,2963,n),B()(i,34816,e),B()(i,36003,r),B()(i,36004,n),i))},stencilFuncSeparate:function(t,e,r,n,i){var o;return t((o={},B()(o,1028===e?2962:34816,r),B()(o,1028===e?2967:36003,n),B()(o,1028===e?2963:36004,i),o))},stencilOp:function(t,e,r,n){var i;return t((i={},B()(i,2964,e),B()(i,2965,r),B()(i,2966,n),B()(i,34817,e),B()(i,34818,r),B()(i,34819,n),i))},stencilOpSeparate:function(t,e,r,n,i){var o;return t((o={},B()(o,1028===e?2964:34817,r),B()(o,1028===e?2965:34818,n),B()(o,1028===e?2966:34819,i),o))},viewport:function(t,e,r,n,i){return t(B()({},2978,[e,r,n,i]))}},ko=function(t,e){return t.isEnabled(e)},Eo=(lo={},B()(lo,3042,ko),B()(lo,2884,ko),B()(lo,2929,ko),B()(lo,3024,ko),B()(lo,32823,ko),B()(lo,32926,ko),B()(lo,32928,ko),B()(lo,3089,ko),B()(lo,2960,ko),B()(lo,35977,ko),lo);function Oo(t){for(var e in t)return!1;return!0}function To(t,e){if(t===e)return!0;var r=Array.isArray(t)||ArrayBuffer.isView(t),n=Array.isArray(e)||ArrayBuffer.isView(e);if(r&&n&&t.length===e.length){for(var i=0;i<t.length;++i)if(t[i]!==e[i])return!1;return!0}return!1}function So(t,e){var r=t[e].bind(t);t[e]=function(){var e=arguments.length<=0?void 0:arguments[0];return e in t.state.cache&&t.state.enable?t.state.cache[e]:r.apply(void 0,arguments)},Object.defineProperty(t[e],"name",{value:"".concat(e,"-from-cache"),configurable:!1})}function Mo(t,e,r){var n=t[e].bind(t);t[e]=function(){for(var e=arguments.length,i=new Array(e),o=0;o<e;o++)i[o]=arguments[o];var a=r.apply(void 0,[t.state._updateCache].concat(i)),s=a.valueChanged,u=a.oldValue;return s&&n.apply(void 0,i),u},Object.defineProperty(t[e],"name",{value:"".concat(e,"-to-cache"),configurable:!1})}function Io(t){var e=t.useProgram.bind(t);t.useProgram=function(r){t.state.program!==r&&(e(r),t.state.program=r)}}var Ro=function(){function t(e){p()(this,t);var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=r.copyState,i=void 0!==n&&n,o=r.log,a=void 0===o?function(){}:o;this.gl=e,this.program=null,this.stateStack=[],this.enable=!0,this.cache=i?Go(e):Object.assign({},go),this.log=a,this._updateCache=this._updateCache.bind(this),Object.seal(this)}return E()(t,[{key:"push",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.stateStack.push({})}},{key:"pop",value:function(){Qi(this.stateStack.length>0);var t=this.stateStack[this.stateStack.length-1];jo(this.gl,t),this.stateStack.pop()}},{key:"_updateCache",value:function(t){var e,r=!1,n=this.stateStack.length>0&&this.stateStack[this.stateStack.length-1];for(var i in t){Qi(void 0!==i);var o=t[i],a=this.cache[i];To(o,a)||(r=!0,e=a,!n||i in n||(n[i]=a),this.cache[i]=o)}return{valueChanged:r,oldValue:e}}}]),t}();function Po(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.enable,n=void 0===r||r,i=e.copyState;if(Qi(void 0!==i),!t.state){var o=globalThis.polyfillContext;for(var a in o&&o(t),t.state=new Ro(t,{copyState:i}),Io(t),Co){var s=Co[a];Mo(t,a,s)}So(t,"getParameter"),So(t,"isEnabled")}return t.state.enable=n,t}function Fo(t){Qi(t.state),t.state.pop()}function Do(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return Lo(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Lo(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function Lo(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function jo(t,e){if(Qi(Xi(t),"setParameters requires a WebGL context"),!Oo(e)){var r={};for(var n in e){var i=Number(n),o=Bo[n];o&&("string"==typeof o?r[o]=!0:o(t,e[n],i))}var a=t.state&&t.state.cache;if(a)for(var s in r){(0,xo[s])(t,e,a)}}}function Go(t,e){if("number"==typeof(e=e||go)){var r=e,n=Eo[r];return n?n(t,r):t.getParameter(r)}var i,o={},a=Do(Array.isArray(e)?e:Object.keys(e));try{for(a.s();!(i=a.n()).done;){var s=i.value,u=Eo[s];o[s]=u?u(t,Number(s)):t.getParameter(Number(s))}}catch(t){a.e(t)}finally{a.f()}return o}function No(t,e,r){if(Oo(e))return r(t);var n,i=e.nocatch,o=void 0===i||i;if(function(t){t.state||Po(t,{copyState:!1}),t.state.push()}(t),jo(t,e),o)n=r(t),Fo(t);else try{n=r(t)}finally{Fo(t)}return n}var Uo=Ci();var Ho=function(){function t(){p()(this,t),this.stats=new Map}return E()(t,[{key:"get",value:function(t){return this.stats.has(t)||this.stats.set(t,new Fn({id:t})),this.stats.get(t)}}]),t}(),Vo=new Ho;if(globalThis.luma&&"8.5.16"!==globalThis.luma.VERSION)throw new Error("luma.gl - multiple VERSIONs detected: ".concat(globalThis.luma.VERSION," vs ").concat("8.5.16"));globalThis.luma||(Ci()&&Wi.log(1,"luma.gl ".concat("8.5.16"," - ").concat("set luma.log.level=1 (or higher) to trace rendering"))(),globalThis.luma=globalThis.luma||{VERSION:"8.5.16",version:"8.5.16",log:Wi,stats:Vo,globals:{modules:{},nodeIO:{}}});globalThis.luma;function Jo(t,e){if(!t)throw new Error(e||"luma.gl: assertion failed.")}function zo(t,e){if("string"!=typeof e)return e;var r=Number(e);if(!isNaN(r))return r;var n=t[e=e.replace(/^.*\./,"")];return Jo(void 0!==n,"Accessing undefined constant GL.".concat(e)),n}function Ko(t,e){for(var r in e=Number(e),t)if(t[r]===e)return"GL.".concat(r);return String(e)}var qo={};function Wo(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"id";qo[t]=qo[t]||1;var e=qo[t]++;return"".concat(t,"-").concat(e)}function Qo(t){return Jo("number"==typeof t,"Input must be a number"),t&&0==(t&t-1)}function Xo(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return Yo(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Yo(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function Yo(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var Zo="Resource subclass must define virtual methods",$o=function(t){function e(t){p()(this,e);var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Zi(t);var n=r.id,i=r.userData,o=void 0===i?{}:i;this.gl=t,this.gl2=t,this.id=n||Wo(this[Symbol.toStringTag]),this.userData=o,this._bound=!1,this._handle=r.handle,void 0===this._handle&&(this._handle=this._createHandle()),this.byteLength=0,this._initStats(),this._addStats()}return E()(e,[{key:t,get:function(){return"Resource"}},{key:"toString",value:function(){return"".concat(this[Symbol.toStringTag]||this.constructor.name,"(").concat(this.id,")")}},{key:"handle",get:function(){return this._handle}},{key:"delete",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.deleteChildren,r=void 0!==e&&e,n=this._handle&&this._deleteHandle(this._handle);return this._handle&&this._removeStats(),this._handle=null,n&&r&&n.filter(Boolean).forEach((function(t){return t.delete()})),this}},{key:"bind",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.handle;return"function"!=typeof e?(this._bindHandle(e),this):(this._bound?t=e():(this._bindHandle(this.handle),this._bound=!0,t=e(),this._bound=!1,this._bindHandle(null)),t)}},{key:"unbind",value:function(){this.bind(null)}},{key:"getParameter",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Jo(t=zo(this.gl,t));var r=this.constructor.PARAMETERS||{},n=r[t];if(n){var i=Yi(this.gl),o=(!("webgl2"in n)||i)&&(!("extension"in n)||this.gl.getExtension(n.extension));if(!o){var a=n.webgl1,s="webgl2"in n?n.webgl2:n.webgl1,u=i?s:a;return u}}return this._getParameter(t,e)}},{key:"getParameters",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=e.parameters,n=e.keys,i=this.constructor.PARAMETERS||{},o=Yi(this.gl),a={},s=r||Object.keys(i),u=Xo(s);try{for(u.s();!(t=u.n()).done;){var c=t.value,l=i[c],f=l&&(!("webgl2"in l)||o)&&(!("extension"in l)||this.gl.getExtension(l.extension));if(f){var h=n?Ko(this.gl,c):c;a[h]=this.getParameter(c,e),n&&"GLenum"===l.type&&(a[h]=Ko(this.gl,a[h]))}}}catch(t){u.e(t)}finally{u.f()}return a}},{key:"setParameter",value:function(t,e){Jo(t=zo(this.gl,t));var r=(this.constructor.PARAMETERS||{})[t];if(r){var n=Yi(this.gl);if(!((!("webgl2"in r)||n)&&(!("extension"in r)||this.gl.getExtension(r.extension))))throw new Error("Parameter not available on this platform");"GLenum"===r.type&&(e=zo(e))}return this._setParameter(t,e),this}},{key:"setParameters",value:function(t){for(var e in t)this.setParameter(e,t[e]);return this}},{key:"stubRemovedMethods",value:function(t,e,r){return function(t,e,r,n){var i="See luma.gl ".concat(r," Upgrade Guide at https://luma.gl/docs/upgrade-guide"),o=Object.getPrototypeOf(t);n.forEach((function(t){o.methodName||(o[t]=function(){throw Wi.removed("Calling removed method ".concat(e,".").concat(t,": "),i)(),new Error(t)})}))}(this,t,e,r)}},{key:"initialize",value:function(t){}},{key:"_createHandle",value:function(){throw new Error(Zo)}},{key:"_deleteHandle",value:function(){throw new Error(Zo)}},{key:"_bindHandle",value:function(t){throw new Error(Zo)}},{key:"_getOptsFromHandle",value:function(){throw new Error(Zo)}},{key:"_getParameter",value:function(t,e){throw new Error(Zo)}},{key:"_setParameter",value:function(t,e){throw new Error(Zo)}},{key:"_context",value:function(){return this.gl.luma=this.gl.luma||{},this.gl.luma}},{key:"_initStats",value:function(){this.gl.stats=this.gl.stats||new Ho}},{key:"_addStats",value:function(){var t=this[Symbol.toStringTag],e=Vo.get("Resource Counts");e.get("Resources Created").incrementCount(),e.get("".concat(t,"s Created")).incrementCount(),e.get("".concat(t,"s Active")).incrementCount()}},{key:"_removeStats",value:function(){var t=this[Symbol.toStringTag];Vo.get("Resource Counts").get("".concat(t,"s Active")).decrementCount()}},{key:"_trackAllocatedMemory",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this[Symbol.toStringTag];this._doTrackAllocatedMemory(t,e),this._doTrackAllocatedMemory(t,e,this.gl.stats.get("Memory Usage"))}},{key:"_doTrackAllocatedMemory",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this[Symbol.toStringTag],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Vo.get("Memory Usage");r.get("GPU Memory").addCount(t),r.get("".concat(e," Memory")).addCount(t),this.byteLength=t}},{key:"_trackDeallocatedMemory",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this[Symbol.toStringTag];this._doTrackDeallocatedMemory(t),this._doTrackDeallocatedMemory(t,this.gl.stats.get("Memory Usage"))}},{key:"_doTrackDeallocatedMemory",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this[Symbol.toStringTag],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Vo.get("Memory Usage");e.get("GPU Memory").subtractCount(this.byteLength),e.get("".concat(t," Memory")).subtractCount(this.byteLength),this.byteLength=0}}]),e}(Symbol.toStringTag),ta=r(74),ea=r.n(ta);function ra(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("Failed to deduce GL constant from typed array")}}function na(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.clamped,n=void 0===r||r;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")}}function ia(t){var e=t.data,r=t.width,n=t.height,i=t.bytesPerPixel,o=void 0===i?4:i,a=t.temp,s=r*o;a=a||new Uint8Array(s);for(var u=0;u<n/2;++u){var c=u*s,l=(n-u-1)*s;a.set(e.subarray(c,c+s)),e.copyWithin(c,l,l+s),e.set(a,l)}}function oa(t){for(var e=t.data,r=t.width,n=t.height,i=Math.round(r/2),o=Math.round(n/2),a=new Uint8Array(i*o*4),s=0;s<o;s++)for(var u=0;u<i;u++)for(var c=0;c<4;c++)a[4*(s*i+u)+c]=e[4*(2*s*r+2*u)+c];return{data:a,width:i,height:o}}function aa(t,e,r){var n=r.removedProps,i=void 0===n?{}:n,o=r.deprecatedProps,a=void 0===o?{}:o,s=r.replacedProps,u=void 0===s?{}:s;for(var c in i)if(c in e){var l=i[c]?"".concat(t,".").concat(i[c]):"N/A";Wi.removed("".concat(t,".").concat(c),l)()}for(var f in a)if(f in e){var h=a[f];Wi.deprecated("".concat(t,".").concat(f),"".concat(t,".").concat(h))()}var d=null;for(var p in u)if(p in e){var v=u[p];Wi.deprecated("".concat(t,".").concat(p),"".concat(t,".").concat(v))(),(d=d||Object.assign({},e))[v]=e[p],delete d[p]}return d||e}var sa={offset:0,stride:0,type:5126,size:1,divisor:0,normalized:!1,integer:!1},ua={deprecatedProps:{instanced:"divisor",isInstanced:"divisor"}},ca=function(){function t(){var e=this;p()(this,t);for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];n.forEach((function(t){return e._assign(t)})),Object.freeze(this)}return E()(t,[{key:"toString",value:function(){return JSON.stringify(this)}},{key:"BYTES_PER_ELEMENT",get:function(){return t.getBytesPerElement(this)}},{key:"BYTES_PER_VERTEX",get:function(){return t.getBytesPerVertex(this)}},{key:"_assign",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return void 0!==(t=aa("Accessor",t,ua)).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.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),this}}],[{key:"getBytesPerElement",value:function(t){return na(t.type||5126).BYTES_PER_ELEMENT}},{key:"getBytesPerVertex",value:function(t){return Jo(t.size),na(t.type||5126).BYTES_PER_ELEMENT*t.size}},{key:"resolve",value:function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return ea()(t,[sa].concat(r))}}]),t}();function la(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=A()(t);if(e){var i=A()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return m()(this,r)}}var fa,ha,da,pa={offset:"accessor.offset",stride:"accessor.stride",type:"accessor.type",size:"accessor.size",divisor:"accessor.divisor",normalized:"accessor.normalized",integer:"accessor.integer",instanced:"accessor.divisor",isInstanced:"accessor.divisor"},va={removedProps:{},replacedProps:{bytes:"byteLength"},deprecatedProps:pa},ya={removedProps:pa},ga=function(t,e){y()(n,t);var r=la(n);function n(t){var e;p()(this,n);var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(e=r.call(this,t,i)).stubRemovedMethods("Buffer","v6.0",["layout","setLayout","getIndexedParameter"]),e.target=i.target||(e.gl.webgl2?36662:34962),e.initialize(i),Object.seal(ai()(e)),e}return E()(n,[{key:e,get:function(){return"Buffer"}},{key:"getElementCount",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.accessor;return Math.round(this.byteLength/ca.getBytesPerElement(t))}},{key:"getVertexCount",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.accessor;return Math.round(this.byteLength/ca.getBytesPerVertex(t))}},{key:"initialize",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return ArrayBuffer.isView(t)&&(t={data:t}),Number.isFinite(t)&&(t={byteLength:t}),t=aa("Buffer",t,va),this.usage=t.usage||35044,this.debugData=null,this.setAccessor(Object.assign({},t,t.accessor)),t.data?this._setData(t.data,t.offset,t.byteLength):this._setByteLength(t.byteLength||0),this}},{key:"setProps",value:function(t){return"accessor"in(t=aa("Buffer",t,ya))&&this.setAccessor(t.accessor),this}},{key:"setAccessor",value:function(t){return delete(t=Object.assign({},t)).buffer,this.accessor=new ca(t),this}},{key:"reallocate",value:function(t){return t>this.byteLength?(this._setByteLength(t),!0):(this.bytesUsed=t,!1)}},{key:"setData",value:function(t){return this.initialize(t)}},{key:"subData",value:function(t){ArrayBuffer.isView(t)&&(t={data:t});var e=t,r=e.data,n=e.offset,i=void 0===n?0:n,o=e.srcOffset,a=void 0===o?0:o,s=t.byteLength||t.length;Jo(r);var u=this.gl.webgl2?36663:this.target;return this.gl.bindBuffer(u,this.handle),0!==a||void 0!==s?($i(this.gl),this.gl.bufferSubData(this.target,i,r,a,s)):this.gl.bufferSubData(u,i,r),this.gl.bindBuffer(u,null),this.debugData=null,this._inferType(r),this}},{key:"copyData",value:function(t){var e=t.sourceBuffer,r=t.readOffset,n=void 0===r?0:r,i=t.writeOffset,o=void 0===i?0:i,a=t.size,s=this.gl;return $i(s),s.bindBuffer(36662,e.handle),s.bindBuffer(36663,this.handle),s.copyBufferSubData(36662,36663,n,o,a),s.bindBuffer(36662,null),s.bindBuffer(36663,null),this.debugData=null,this}},{key:"getData",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.dstData,r=void 0===e?null:e,n=t.srcByteOffset,i=void 0===n?0:n,o=t.dstOffset,a=void 0===o?0:o,s=t.length,u=void 0===s?0:s;$i(this.gl);var c,l,f=na(this.accessor.type||5126,{clamped:!1}),h=this._getAvailableElementCount(i),d=a;r?c=(l=r.length)-d:l=d+(c=Math.min(h,u||h));var p=Math.min(h,c);return Jo((u=u||p)<=p),r=r||new f(l),this.gl.bindBuffer(36662,this.handle),this.gl.getBufferSubData(36662,i,r,a,u),this.gl.bindBuffer(36662,null),r}},{key:"bind",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.target,r=void 0===e?this.target:e,n=t.index,i=void 0===n?this.accessor&&this.accessor.index:n,o=t.offset,a=void 0===o?0:o,s=t.size;return 35345===r||35982===r?void 0!==s?this.gl.bindBufferRange(r,i,this.handle,a,s):(Jo(0===a),this.gl.bindBufferBase(r,i,this.handle)):this.gl.bindBuffer(r,this.handle),this}},{key:"unbind",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.target,r=void 0===e?this.target:e,n=t.index,i=void 0===n?this.accessor&&this.accessor.index:n,o=35345===r||35982===r;return o?this.gl.bindBufferBase(r,i,null):this.gl.bindBuffer(r,null),this}},{key:"getDebugData",value:function(){return this.debugData?{data:this.debugData,changed:!1}:(this.debugData=this.getData({length:Math.min(10,this.byteLength)}),{data:this.debugData,changed:!0})}},{key:"invalidateDebugData",value:function(){this.debugData=null}},{key:"_setData",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.byteLength+e;Jo(ArrayBuffer.isView(t)),this._trackDeallocatedMemory();var n=this._getTarget();this.gl.bindBuffer(n,this.handle),this.gl.bufferData(n,r,this.usage),this.gl.bufferSubData(n,e,t),this.gl.bindBuffer(n,null),this.debugData=t.slice(0,10),this.bytesUsed=r,this._trackAllocatedMemory(r);var i=ra(t);return Jo(i),this.setAccessor(new ca(this.accessor,{type:i})),this}},{key:"_setByteLength",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.usage;Jo(t>=0),this._trackDeallocatedMemory();var r=t;0===t&&(r=new Float32Array(0));var n=this._getTarget();return this.gl.bindBuffer(n,this.handle),this.gl.bufferData(n,r,e),this.gl.bindBuffer(n,null),this.usage=e,this.debugData=null,this.bytesUsed=t,this._trackAllocatedMemory(t),this}},{key:"_getTarget",value:function(){return this.gl.webgl2?36663:this.target}},{key:"_getAvailableElementCount",value:function(t){var e=t/na(this.accessor.type||5126,{clamped:!1}).BYTES_PER_ELEMENT;return this.getElementCount()-e}},{key:"_inferType",value:function(t){this.accessor.type||this.setAccessor(new ca(this.accessor,{type:ra(t)}))}},{key:"_createHandle",value:function(){return this.gl.createBuffer()}},{key:"_deleteHandle",value:function(){this.gl.deleteBuffer(this.handle),this._trackDeallocatedMemory()}},{key:"_getParameter",value:function(t){this.gl.bindBuffer(this.target,this.handle);var e=this.gl.getBufferParameter(this.target,t);return this.gl.bindBuffer(this.target,null),e}},{key:"type",get:function(){return Wi.deprecated("Buffer.type","Buffer.accessor.type")(),this.accessor.type}},{key:"bytes",get:function(){return Wi.deprecated("Buffer.bytes","Buffer.byteLength")(),this.byteLength}},{key:"setByteLength",value:function(t){return Wi.deprecated("setByteLength","reallocate")(),this.reallocate(t)}},{key:"updateAccessor",value:function(t){return Wi.deprecated("updateAccessor(...)","setAccessor(new Accessor(buffer.accessor, ...)")(),this.accessor=new ca(this.accessor,t),this}}]),n}($o,Symbol.toStringTag),ma=(fa={},B()(fa,6407,{dataFormat:6407,types:[5121,33635]}),B()(fa,6408,{dataFormat:6408,types:[5121,32819,32820]}),B()(fa,6406,{dataFormat:6406,types:[5121]}),B()(fa,6409,{dataFormat:6409,types:[5121]}),B()(fa,6410,{dataFormat:6410,types:[5121]}),B()(fa,33326,{dataFormat:6403,types:[5126],gl2:!0}),B()(fa,33328,{dataFormat:33319,types:[5126],gl2:!0}),B()(fa,34837,{dataFormat:6407,types:[5126],gl2:!0}),B()(fa,34836,{dataFormat:6408,types:[5126],gl2:!0}),fa),ba=(ha={},B()(ha,6403,1),B()(ha,36244,1),B()(ha,33319,2),B()(ha,33320,2),B()(ha,6407,3),B()(ha,36248,3),B()(ha,6408,4),B()(ha,36249,4),B()(ha,6402,1),B()(ha,34041,1),B()(ha,6406,1),B()(ha,6409,1),B()(ha,6410,2),ha),Aa=(da={},B()(da,5126,4),B()(da,5125,4),B()(da,5124,4),B()(da,5123,2),B()(da,5122,2),B()(da,5131,2),B()(da,5120,1),B()(da,5121,1),da);function wa(t,e){var r=ma[e];if(!r)return!1;if(void 0===r.gl1&&void 0===r.gl2)return!0;var n=Yi(t)&&r.gl2||r.gl1;return"string"==typeof n?t.getExtension(n):n}function Ba(t,e){var r=ma[e];switch(r&&r.types[0]){case 5126:return t.getExtension("OES_texture_float_linear");case 5131:return t.getExtension("OES_texture_half_float_linear");default:return!0}}function _a(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return xa(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return xa(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function xa(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Ca(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=A()(t);if(e){var i=A()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return m()(this,r)}}var ka=[9729,9728],Ea=globalThis.WebGLBuffer||function(){},Oa=function(t,e){y()(n,t);var r=Ca(n);function n(t,e){var i;p()(this,n);var o=e.id,a=void 0===o?Wo("texture"):o,s=e.handle,u=e.target;return(i=r.call(this,t,{id:a,handle:s})).target=u,i.textureUnit=void 0,i.loaded=!1,i.width=void 0,i.height=void 0,i.depth=void 0,i.format=void 0,i.type=void 0,i.dataFormat=void 0,i.border=void 0,i.textureUnit=void 0,i.mipmaps=void 0,i}return E()(n,[{key:e,get:function(){return"Texture"}},{key:"toString",value:function(){return"Texture(".concat(this.id,",").concat(this.width,"x").concat(this.height,")")}},{key:"initialize",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=e.data;if(r instanceof Promise)return r.then((function(r){return t.initialize(Object.assign({},e,{pixels:r,data:r}))})),this;var n="undefined"!=typeof HTMLVideoElement&&r instanceof HTMLVideoElement;if(n&&r.readyState<HTMLVideoElement.HAVE_METADATA)return this._video=null,r.addEventListener("loadeddata",(function(){return t.initialize(e)})),this;var i=e.pixels,o=void 0===i?null:i,a=e.format,s=void 0===a?6408:a,u=e.border,c=void 0===u?0:u,l=e.recreate,f=void 0!==l&&l,h=e.parameters,d=void 0===h?{}:h,p=e.pixelStore,v=void 0===p?{}:p,y=e.textureUnit,g=void 0===y?void 0:y;r||(r=o);var m=e.width,b=e.height,A=e.dataFormat,w=e.type,B=e.compressed,_=void 0!==B&&B,x=e.mipmaps,C=void 0===x||x,k=e.depth,E=void 0===k?0:k,O=this._deduceParameters({format:s,type:w,dataFormat:A,compressed:_,data:r,width:m,height:b});return m=O.width,b=O.height,_=O.compressed,A=O.dataFormat,w=O.type,this.width=m,this.height=b,this.depth=E,this.format=s,this.type=w,this.dataFormat=A,this.border=c,this.textureUnit=g,Number.isFinite(this.textureUnit)&&(this.gl.activeTexture(33984+this.textureUnit),this.gl.bindTexture(this.target,this.handle)),C&&this._isNPOT()&&(Wi.warn("texture: ".concat(this," is Non-Power-Of-Two, disabling mipmaping"))(),C=!1,this._updateForNPOT(d)),this.mipmaps=C,this.setImageData({data:r,width:m,height:b,depth:E,format:s,type:w,dataFormat:A,border:c,mipmaps:C,parameters:v,compressed:_}),C&&this.generateMipmap(),this.setParameters(d),f&&(this.data=r),n&&(this._video={video:r,parameters:d,lastTime:r.readyState>=HTMLVideoElement.HAVE_CURRENT_DATA?r.currentTime:-1}),this}},{key:"update",value:function(){if(this._video){var t=this._video,e=t.video,r=t.parameters;if(t.lastTime===e.currentTime||e.readyState<HTMLVideoElement.HAVE_CURRENT_DATA)return;this.setSubImageData({data:e,parameters:r}),this.mipmaps&&this.generateMipmap(),this._video.lastTime=e.currentTime}}},{key:"resize",value:function(t){var e=t.height,r=t.width,n=t.mipmaps,i=void 0!==n&&n;return r!==this.width||e!==this.height?this.initialize({width:r,height:e,format:this.format,type:this.type,dataFormat:this.dataFormat,border:this.border,mipmaps:i}):this}},{key:"generateMipmap",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._isNPOT()?(Wi.warn("texture: ".concat(this," is Non-Power-Of-Two, disabling mipmaping"))(),this):(this.mipmaps=!0,this.gl.bindTexture(this.target,this.handle),No(this.gl,e,(function(){t.gl.generateMipmap(t.target)})),this.gl.bindTexture(this.target,null),this)}},{key:"setImageData",value:function(t){this._trackDeallocatedMemory("Texture");var e=t.target,r=void 0===e?this.target:e,n=t.pixels,i=void 0===n?null:n,o=t.level,a=void 0===o?0:o,s=t.format,u=void 0===s?this.format:s,c=t.border,l=void 0===c?this.border:c,f=t.offset,h=void 0===f?0:f,d=t.parameters,p=void 0===d?{}:d,v=t.data,y=void 0===v?null:v,g=t.type,m=void 0===g?this.type:g,b=t.width,A=void 0===b?this.width:b,w=t.height,B=void 0===w?this.height:w,_=t.dataFormat,x=void 0===_?this.dataFormat:_,C=t.compressed,k=void 0!==C&&C;y||(y=i);var E=this._deduceParameters({format:u,type:m,dataFormat:x,compressed:k,data:y,width:A,height:B});m=E.type,x=E.dataFormat,k=E.compressed,A=E.width,B=E.height;var O=this.gl;O.bindTexture(this.target,this.handle);var T,S,M=this._getDataType({data:y,compressed:k});y=M.data,T=M.dataType;var I=0;if(No(this.gl,p,(function(){switch(T){case"null":O.texImage2D(r,a,u,A,B,l,x,m,y);break;case"typed-array":O.texImage2D(r,a,u,A,B,l,x,m,y,h);break;case"buffer":(S=$i(O)).bindBuffer(35052,y.handle||y),S.texImage2D(r,a,u,A,B,l,x,m,h),S.bindBuffer(35052,null);break;case"browser-object":Yi(O)?O.texImage2D(r,a,u,A,B,l,x,m,y):O.texImage2D(r,a,u,x,m,y);break;case"compressed":var t,e=_a(y.entries());try{for(e.s();!(t=e.n()).done;){var n=R()(t.value,2),i=n[0],o=n[1];O.compressedTexImage2D(r,i,o.format,o.width,o.height,l,o.data),I+=o.levelSize}}catch(t){e.e(t)}finally{e.f()}break;default:Jo(!1,"Unknown image data type")}})),"compressed"===T)this._trackAllocatedMemory(I,"Texture");else if(y&&y.byteLength)this._trackAllocatedMemory(y.byteLength,"Texture");else{var P=ba[this.dataFormat]||4,F=Aa[this.type]||1;this._trackAllocatedMemory(this.width*this.height*P*F,"Texture")}return this.loaded=!0,this}},{key:"setSubImageData",value:function(t){var e=this,r=t.target,n=void 0===r?this.target:r,i=t.pixels,o=void 0===i?null:i,a=t.data,s=void 0===a?null:a,u=t.x,c=void 0===u?0:u,l=t.y,f=void 0===l?0:l,h=t.width,d=void 0===h?this.width:h,p=t.height,v=void 0===p?this.height:p,y=t.level,g=void 0===y?0:y,m=t.format,b=void 0===m?this.format:m,A=t.type,w=void 0===A?this.type:A,B=t.dataFormat,_=void 0===B?this.dataFormat:B,x=t.compressed,C=void 0!==x&&x,k=t.offset,E=void 0===k?0:k,O=t.border,T=(void 0===O&&this.border,t.parameters),S=void 0===T?{}:T,M=this._deduceParameters({format:b,type:w,dataFormat:_,compressed:C,data:s,width:d,height:v});if(w=M.type,_=M.dataFormat,C=M.compressed,d=M.width,v=M.height,Jo(0===this.depth,"texSubImage not supported for 3D textures"),s||(s=o),s&&s.data){var I=s;s=I.data,d=I.shape[0],v=I.shape[1]}s instanceof ga&&(s=s.handle),this.gl.bindTexture(this.target,this.handle),No(this.gl,S,(function(){if(C)e.gl.compressedTexSubImage2D(n,g,c,f,d,v,b,s);else if(null===s)e.gl.texSubImage2D(n,g,c,f,d,v,_,w,null);else if(ArrayBuffer.isView(s))e.gl.texSubImage2D(n,g,c,f,d,v,_,w,s,E);else if(s instanceof Ea){var t=$i(e.gl);t.bindBuffer(35052,s),t.texSubImage2D(n,g,c,f,d,v,_,w,E),t.bindBuffer(35052,null)}else if(Yi(e.gl)){$i(e.gl).texSubImage2D(n,g,c,f,d,v,_,w,s)}else e.gl.texSubImage2D(n,g,c,f,_,w,s)})),this.gl.bindTexture(this.target,null)}},{key:"copyFramebuffer",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return Wi.error("Texture.copyFramebuffer({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null}},{key:"getActiveUnit",value:function(){return this.gl.getParameter(34016)-33984}},{key:"bind",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.textureUnit,e=this.gl;return void 0!==t&&(this.textureUnit=t,e.activeTexture(33984+t)),e.bindTexture(this.target,this.handle),t}},{key:"unbind",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.textureUnit,e=this.gl;return void 0!==t&&(this.textureUnit=t,e.activeTexture(33984+t)),e.bindTexture(this.target,null),t}},{key:"_getDataType",value:function(t){var e=t.data,r=t.compressed;return void 0!==r&&r?{data:e,dataType:"compressed"}:null===e?{data:e,dataType:"null"}:ArrayBuffer.isView(e)?{data:e,dataType:"typed-array"}:e instanceof ga?{data:e.handle,dataType:"buffer"}:e instanceof Ea?{data:e,dataType:"buffer"}:{data:e,dataType:"browser-object"}}},{key:"_deduceParameters",value:function(t){var e=t.format,r=t.data,n=t.width,i=t.height,o=t.dataFormat,a=t.type,s=t.compressed,u=ma[e];o=o||u&&u.dataFormat,a=a||u&&u.types[0],s=s||u&&u.compressed;var c=this._deduceImageSize(r,n,i);return{dataFormat:o,type:a,compressed:s,width:n=c.width,height:i=c.height,format:e,data:r}}},{key:"_deduceImageSize",value:function(t,e,r){var n;return Jo(n="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?{width:t.width,height:t.height}:"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:r}:{width:e>=0?e:1,height:r>=0?r:1},"Could not deduced texture size"),Jo(void 0===e||n.width===e,"Deduced texture width does not match supplied width"),Jo(void 0===r||n.height===r,"Deduced texture height does not match supplied height"),n}},{key:"_createHandle",value:function(){return this.gl.createTexture()}},{key:"_deleteHandle",value:function(){this.gl.deleteTexture(this.handle),this._trackDeallocatedMemory("Texture")}},{key:"_getParameter",value:function(t){switch(t){case 4096:return this.width;case 4097:return this.height;default:this.gl.bindTexture(this.target,this.handle);var e=this.gl.getTexParameter(this.target,t);return this.gl.bindTexture(this.target,null),e}}},{key:"_setParameter",value:function(t,e){switch(this.gl.bindTexture(this.target,this.handle),e=this._getNPOTParam(t,e),t){case 33082:case 33083:this.gl.texParameterf(this.handle,t,e);break;case 4096:case 4097:Jo(!1);break;default:this.gl.texParameteri(this.target,t,e)}return this.gl.bindTexture(this.target,null),this}},{key:"_isNPOT",value:function(){return!Yi(this.gl)&&(!(!this.width||!this.height)&&(!Qo(this.width)||!Qo(this.height)))}},{key:"_updateForNPOT",value:function(t){void 0===t[this.gl.TEXTURE_MIN_FILTER]&&(t[this.gl.TEXTURE_MIN_FILTER]=this.gl.LINEAR),void 0===t[this.gl.TEXTURE_WRAP_S]&&(t[this.gl.TEXTURE_WRAP_S]=this.gl.CLAMP_TO_EDGE),void 0===t[this.gl.TEXTURE_WRAP_T]&&(t[this.gl.TEXTURE_WRAP_T]=this.gl.CLAMP_TO_EDGE)}},{key:"_getNPOTParam",value:function(t,e){if(this._isNPOT())switch(t){case 10241:-1===ka.indexOf(e)&&(e=9729);break;case 10242:case 10243:33071!==e&&(e=33071)}return e}}],[{key:"isSupported",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.format,n=e.linearFiltering,i=!0;return r&&(i=(i=i&&wa(t,r))&&(!n||Ba(t,r))),i}}]),n}($o,Symbol.toStringTag),Ta="";function Sa(t,e){return Jo("string"==typeof t),t=Ta+t,new Promise((function(r,n){try{var i=new Image;i.onload=function(){return r(i)},i.onerror=function(){return n(new Error("Could not load image ".concat(t,".")))},i.crossOrigin=e&&e.crossOrigin||"anonymous",i.src=t}catch(t){n(t)}}))}function Ma(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=A()(t);if(e){var i=A()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return m()(this,r)}}var Ia,Ra=function(t,e){y()(n,t);var r=Ma(n);function n(t){var e;p()(this,n);var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Zi(t),(i instanceof Promise||"string"==typeof i)&&(i={data:i}),"string"==typeof i.data&&(i=Object.assign({},i,{data:Sa(i.data)})),(e=r.call(this,t,Object.assign({},i,{target:3553}))).initialize(i),Object.seal(ai()(e)),e}return E()(n,[{key:e,get:function(){return"Texture2D"}}],[{key:"isSupported",value:function(t,e){return Oa.isSupported(t,e)}}]),n}(Oa,Symbol.toStringTag),Pa="EXT_color_buffer_float",Fa=(Ia={},B()(Ia,33189,{bpp:2}),B()(Ia,33190,{gl2:!0,bpp:3}),B()(Ia,36012,{gl2:!0,bpp:4}),B()(Ia,36168,{bpp:1}),B()(Ia,34041,{bpp:4}),B()(Ia,35056,{gl2:!0,bpp:4}),B()(Ia,36013,{gl2:!0,bpp:5}),B()(Ia,32854,{bpp:2}),B()(Ia,36194,{bpp:2}),B()(Ia,32855,{bpp:2}),B()(Ia,33321,{gl2:!0,bpp:1}),B()(Ia,33330,{gl2:!0,bpp:1}),B()(Ia,33329,{gl2:!0,bpp:1}),B()(Ia,33332,{gl2:!0,bpp:2}),B()(Ia,33331,{gl2:!0,bpp:2}),B()(Ia,33334,{gl2:!0,bpp:4}),B()(Ia,33333,{gl2:!0,bpp:4}),B()(Ia,33323,{gl2:!0,bpp:2}),B()(Ia,33336,{gl2:!0,bpp:2}),B()(Ia,33335,{gl2:!0,bpp:2}),B()(Ia,33338,{gl2:!0,bpp:4}),B()(Ia,33337,{gl2:!0,bpp:4}),B()(Ia,33340,{gl2:!0,bpp:8}),B()(Ia,33339,{gl2:!0,bpp:8}),B()(Ia,32849,{gl2:!0,bpp:3}),B()(Ia,32856,{gl2:!0,bpp:4}),B()(Ia,32857,{gl2:!0,bpp:4}),B()(Ia,36220,{gl2:!0,bpp:4}),B()(Ia,36238,{gl2:!0,bpp:4}),B()(Ia,36975,{gl2:!0,bpp:4}),B()(Ia,36214,{gl2:!0,bpp:8}),B()(Ia,36232,{gl2:!0,bpp:8}),B()(Ia,36226,{gl2:!0,bpp:16}),B()(Ia,36208,{gl2:!0,bpp:16}),B()(Ia,33325,{gl2:Pa,bpp:2}),B()(Ia,33327,{gl2:Pa,bpp:4}),B()(Ia,34842,{gl2:Pa,bpp:8}),B()(Ia,33326,{gl2:Pa,bpp:4}),B()(Ia,33328,{gl2:Pa,bpp:8}),B()(Ia,34836,{gl2:Pa,bpp:16}),B()(Ia,35898,{gl2:Pa,bpp:4}),Ia);function Da(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=A()(t);if(e){var i=A()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return m()(this,r)}}function La(t,e,r){var n=r[e];if(!n)return!1;var i=Yi(t)&&n.gl2||n.gl1;return"string"==typeof i?t.getExtension(i):i}var ja=function(t,e){y()(n,t);var r=Da(n);function n(t){var e;p()(this,n);var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(e=r.call(this,t,i)).initialize(i),Object.seal(ai()(e)),e}return E()(n,[{key:e,get:function(){return"Renderbuffer"}},{key:"initialize",value:function(t){var e=t.format,r=t.width,n=void 0===r?1:r,i=t.height,o=void 0===i?1:i,a=t.samples,s=void 0===a?0:a;return Jo(e,"Needs format"),this._trackDeallocatedMemory(),this.gl.bindRenderbuffer(36161,this.handle),0!==s&&Yi(this.gl)?this.gl.renderbufferStorageMultisample(36161,s,e,n,o):this.gl.renderbufferStorage(36161,e,n,o),this.format=e,this.width=n,this.height=o,this.samples=s,this._trackAllocatedMemory(this.width*this.height*(this.samples||1)*Fa[this.format].bpp),this}},{key:"resize",value:function(t){var e=t.width,r=t.height;return e!==this.width||r!==this.height?this.initialize({width:e,height:r,format:this.format,samples:this.samples}):this}},{key:"_createHandle",value:function(){return this.gl.createRenderbuffer()}},{key:"_deleteHandle",value:function(){this.gl.deleteRenderbuffer(this.handle),this._trackDeallocatedMemory()}},{key:"_bindHandle",value:function(t){this.gl.bindRenderbuffer(36161,t)}},{key:"_syncHandle",value:function(t){this.format=this.getParameter(36164),this.width=this.getParameter(36162),this.height=this.getParameter(36163),this.samples=this.getParameter(36011)}},{key:"_getParameter",value:function(t){return this.gl.bindRenderbuffer(36161,this.handle),this.gl.getRenderbufferParameter(36161,t)}}],[{key:"isSupported",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{format:null},r=e.format;return!r||La(t,r,Fa)}},{key:"getSamplesForFormat",value:function(t,e){var r=e.format;return t.getInternalformatParameter(36161,r,32937)}}]),n}($o,Symbol.toStringTag);function Ga(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.framebuffer,n=void 0===r?null:r,i=e.color,o=void 0===i?null:i,a=e.depth,s=void 0===a?null:a,u=e.stencil,c=void 0===u?null:u,l={};n&&(l.framebuffer=n);var f=0;o&&(f|=16384,!0!==o&&(l.clearColor=o)),s&&(f|=256,!0!==s&&(l.clearDepth=s)),c&&(f|=1024,!0!==s&&(l.clearStencil=s)),Jo(0!==f,"clear: bad arguments"),No(t,l,(function(){t.clear(f)}))}function Na(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.framebuffer,n=void 0===r?null:r,i=e.buffer,o=void 0===i?6144:i,a=e.drawBuffer,s=void 0===a?0:a,u=e.value,c=void 0===u?[0,0,0,0]:u;$i(t),No(t,{framebuffer:n},(function(){switch(o){case 6144:switch(c.constructor){case Int32Array:t.clearBufferiv(o,s,c);break;case Uint32Array:t.clearBufferuiv(o,s,c);break;case Float32Array:default:t.clearBufferfv(o,s,c)}break;case 6145:t.clearBufferfv(6145,0,[c]);break;case 6146:t.clearBufferiv(6146,0,[c]);break;case 34041:var e=R()(c,2),r=e[0],n=e[1];t.clearBufferfi(34041,0,r,n);break;default:Jo(!1,"clear: bad arguments")}}))}function Ua(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 Jo(!1),0}}function Ha(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=A()(t);if(e){var i=A()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return m()(this,r)}}var Va=[34069,34070,34071,34072,34073,34074],Ja=function(t,e){y()(i,t);var r,n=Ha(i);function i(t){var e;p()(this,i);var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Zi(t),(e=n.call(this,t,Object.assign({},r,{target:34067}))).initialize(r),Object.seal(ai()(e)),e}return E()(i,[{key:e,get:function(){return"TextureCube"}},{key:"initialize",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=e.mipmaps,n=void 0===r||r,i=e.parameters,o=void 0===i?{}:i;return this.opts=e,this.setCubeMapImageData(e).then((function(){t.loaded=!0,n&&t.generateMipmap(e),t.setParameters(o)})),this}},{key:"subImage",value:function(t){var e=t.face,r=t.data,n=t.x,i=void 0===n?0:n,o=t.y,a=void 0===o?0:o,s=t.mipmapLevel,u=void 0===s?0:s;return this._subImage({target:e,data:r,x:i,y:a,mipmapLevel:u})}},{key:"setCubeMapImageData",value:(r=It()(Pt.a.mark((function t(e){var r,n,i,o,a,s,u,c,l,f,h,d,p,v=this;return Pt.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.width,n=e.height,i=e.pixels,o=e.data,a=e.border,s=void 0===a?0:a,u=e.format,c=void 0===u?6408:u,l=e.type,f=void 0===l?5121:l,h=this.gl,d=i||o,t.next=5,Promise.all(Va.map((function(t){var e=d[t];return Promise.all(Array.isArray(e)?e:[e])})));case 5:p=t.sent,this.bind(),Va.forEach((function(t,e){p[e].length>1&&!1!==v.opts.mipmaps&&Wi.warn("".concat(v.id," has mipmap and multiple LODs."))(),p[e].forEach((function(e,i){r&&n?h.texImage2D(t,i,c,r,n,s,c,f,e):h.texImage2D(t,i,c,c,f,e)}))})),this.unbind();case 9:case"end":return t.stop()}}),t,this)}))),function(t){return r.apply(this,arguments)})},{key:"setImageDataForFace",value:function(t){var e=this,r=t.face,n=t.width,i=t.height,o=t.pixels,a=t.data,s=t.border,u=void 0===s?0:s,c=t.format,l=void 0===c?6408:c,f=t.type,h=void 0===f?5121:f,d=this.gl,p=o||a;return this.bind(),p instanceof Promise?p.then((function(n){return e.setImageDataForFace(Object.assign({},t,{face:r,data:n,pixels:n}))})):this.width||this.height?d.texImage2D(r,0,l,n,i,u,l,h,p):d.texImage2D(r,0,l,l,h,p),this}}]),i}(Oa,Symbol.toStringTag);function za(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=A()(t);if(e){var i=A()(this).constructor;Reflect.construct(n,arguments,i)}else n.apply(this,arguments);return m()(this,r)}}Ja.FACES=Va;Symbol.toStringTag;function Ka(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.sourceX,n=void 0===r?0:r,i=e.sourceY,o=void 0===i?0:i,a=e.sourceFormat,s=void 0===a?6408:a,u=e.sourceAttachment,c=void 0===u?36064:u,l=e.target,f=void 0===l?null:l,h=e.sourceWidth,d=e.sourceHeight,p=e.sourceType,v=Wa(t),y=v.framebuffer,g=v.deleteFramebuffer;Jo(y);var m=y.gl,b=y.handle,A=y.attachments;h=h||y.width,d=d||y.height,36064===c&&null===b&&(c=1028),Jo(A[c]),f=Qa(f,p=p||A[c].type,s,h,d),p=p||ra(f);var w=m.bindFramebuffer(36160,b);return m.readPixels(n,o,h,d,s,p,f),m.bindFramebuffer(36160,w||null),g&&y.delete(),f}function qa(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.sourceAttachment,n=void 0===r?36064:r,i=e.targetMaxHeight,o=void 0===i?Number.MAX_SAFE_INTEGER:i,a=Ka(t,{sourceAttachment:n}),s=t.width,u=t.height;u>o;){var c=oa({data:a,width:s,height:u});a=c.data,s=c.width,u=c.height}ia({data:a,width:s,height:u});var l=document.createElement("canvas");l.width=s,l.height=u;var f=l.getContext("2d"),h=f.createImageData(s,u);return h.data.set(a),f.putImageData(h,0,0),l.toDataURL()}function Wa(t){return t instanceof $a?{framebuffer:t,deleteFramebuffer:!1}:{framebuffer:(e=t,n=e.gl,i=e.width,o=e.height,a=e.id,new $a(n,Object.assign({},r,{id:"framebuffer-for-".concat(a),width:i,height:o,attachments:B()({},36064,e)}))),deleteFramebuffer:!0};var e,r,n,i,o,a}function Qa(t,e,r,n,i){return t||new(na(e=e||5121,{clamped:!1}))(n*i*Ua(r))}function Xa(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return Ya(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ya(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function Ya(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Za(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=A()(t);if(e){var i=A()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return m()(this,r)}}var $a=function(t,e){y()(n,t);var r=Za(n);function n(t){var e;p()(this,n);var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(e=r.call(this,t,i)).width=null,e.height=null,e.attachments={},e.readBuffer=36064,e.drawBuffers=[36064],e.ownResources=[],e.initialize(i),Object.seal(ai()(e)),e}return E()(n,[{key:e,get:function(){return"Framebuffer"}},{key:"MAX_COLOR_ATTACHMENTS",get:function(){var t=$i(this.gl);return t.getParameter(t.MAX_COLOR_ATTACHMENTS)}},{key:"MAX_DRAW_BUFFERS",get:function(){var t=$i(this.gl);return t.getParameter(t.MAX_DRAW_BUFFERS)}},{key:"color",get:function(){return this.attachments[36064]||null}},{key:"texture",get:function(){return this.attachments[36064]||null}},{key:"depth",get:function(){return this.attachments[36096]||this.attachments[33306]||null}},{key:"stencil",get:function(){return this.attachments[36128]||this.attachments[33306]||null}},{key:"initialize",value:function(t){var e=t.width,r=void 0===e?1:e,n=t.height,i=void 0===n?1:n,o=t.attachments,a=void 0===o?null:o,s=t.color,u=void 0===s||s,c=t.depth,l=void 0===c||c,f=t.stencil,h=void 0!==f&&f,d=t.check,p=void 0===d||d,v=t.readBuffer,y=void 0===v?void 0:v,g=t.drawBuffers,m=void 0===g?void 0:g;if(Jo(r>=0&&i>=0,"Width and height need to be integers"),this.width=r,this.height=i,a)for(var b in a){var A=a[b];(Array.isArray(A)?A[0]:A).resize({width:r,height:i})}else a=this._createDefaultAttachments(u,l,h,r,i);this.update({clearAttachments:!0,attachments:a,readBuffer:y,drawBuffers:m}),a&&p&&this.checkStatus()}},{key:"delete",value:function(){var t,e=Xa(this.ownResources);try{for(e.s();!(t=e.n()).done;){t.value.delete()}}catch(t){e.e(t)}finally{e.f()}return $n()(A()(n.prototype),"delete",this).call(this),this}},{key:"update",value:function(t){var e=t.attachments,r=void 0===e?{}:e,n=t.readBuffer,i=t.drawBuffers,o=t.clearAttachments,a=void 0!==o&&o,s=t.resizeAttachments,u=void 0===s||s;this.attach(r,{clearAttachments:a,resizeAttachments:u});var c=this.gl,l=c.bindFramebuffer(36160,this.handle);return n&&this._setReadBuffer(n),i&&this._setDrawBuffers(i),c.bindFramebuffer(36160,l||null),this}},{key:"resize",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.width,r=t.height;if(null===this.handle)return Jo(void 0===e&&void 0===r),this.width=this.gl.drawingBufferWidth,this.height=this.gl.drawingBufferHeight,this;for(var n in void 0===e&&(e=this.gl.drawingBufferWidth),void 0===r&&(r=this.gl.drawingBufferHeight),e!==this.width&&r!==this.height&&Wi.log(2,"Resizing framebuffer ".concat(this.id," to ").concat(e,"x").concat(r))(),this.attachments)this.attachments[n].resize({width:e,height:r});return this.width=e,this.height=r,this}},{key:"attach",value:function(t){var e=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=r.clearAttachments,i=void 0!==n&&n,o=r.resizeAttachments,a=void 0===o||o,s={};i&&Object.keys(this.attachments).forEach((function(t){s[t]=null})),Object.assign(s,t);var u=this.gl.bindFramebuffer(36160,this.handle);for(var c in s){Jo(void 0!==c,"Misspelled framebuffer binding point?");var l=Number(c),f=s[l],h=f;if(h)if(h instanceof ja)this._attachRenderbuffer({attachment:l,renderbuffer:h});else if(Array.isArray(f)){var d=R()(f,3),p=d[0],v=d[1],y=void 0===v?0:v,g=d[2],m=void 0===g?0:g;h=p,this._attachTexture({attachment:l,texture:p,layer:y,level:m})}else this._attachTexture({attachment:l,texture:h,layer:0,level:0});else this._unattach(l);a&&h&&h.resize({width:this.width,height:this.height})}this.gl.bindFramebuffer(36160,u||null),Object.assign(this.attachments,t),Object.keys(this.attachments).filter((function(t){return!e.attachments[t]})).forEach((function(t){delete e.attachments[t]}))}},{key:"checkStatus",value:function(){this.gl;var t=this.getStatus();if(36053!==t)throw new Error(function(t){return($a.STATUS||{})[t]||"Framebuffer error ".concat(t)}(t));return this}},{key:"getStatus",value:function(){var t=this.gl,e=t.bindFramebuffer(36160,this.handle),r=t.checkFramebufferStatus(36160);return t.bindFramebuffer(36160,e||null),r}},{key:"clear",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=e.color,n=e.depth,i=e.stencil,o=e.drawBuffers,a=void 0===o?[]:o,s=this.gl.bindFramebuffer(36160,this.handle);return(r||n||i)&&Ga(this.gl,{color:r,depth:n,stencil:i}),a.forEach((function(e,r){Na(t.gl,{drawBuffer:r,value:e})})),this.gl.bindFramebuffer(36160,s||null),this}},{key:"readPixels",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return Wi.error("Framebuffer.readPixels() is no logner supported, use readPixelsToArray(framebuffer)")(),null}},{key:"readPixelsToBuffer",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return Wi.error("Framebuffer.readPixelsToBuffer()is no logner supported, use readPixelsToBuffer(framebuffer)")(),null}},{key:"copyToDataUrl",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return Wi.error("Framebuffer.copyToDataUrl() is no logner supported, use copyToDataUrl(framebuffer)")(),null}},{key:"copyToImage",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return Wi.error("Framebuffer.copyToImage() is no logner supported, use copyToImage(framebuffer)")(),null}},{key:"copyToTexture",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return Wi.error("Framebuffer.copyToTexture({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null}},{key:"blit",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return Wi.error("Framebuffer.blit({...}) is no logner supported, use blit(source, target, opts)")(),null}},{key:"invalidate",value:function(t){var e=t.attachments,r=void 0===e?[]:e,n=t.x,i=void 0===n?0:n,o=t.y,a=void 0===o?0:o,s=t.width,u=t.height,c=$i(this.gl),l=c.bindFramebuffer(36008,this.handle);return 0===i&&0===a&&void 0===s&&void 0===u?c.invalidateFramebuffer(36008,r):c.invalidateFramebuffer(36008,r,i,a,s,u),c.bindFramebuffer(36008,l),this}},{key:"getAttachmentParameter",value:function(t,e,r){var n=this._getAttachmentParameterFallback(e);return null===n&&(this.gl.bindFramebuffer(36160,this.handle),n=this.gl.getFramebufferAttachmentParameter(36160,t,e),this.gl.bindFramebuffer(36160,null)),r&&n>1e3&&(n=Ko(this.gl,n)),n}},{key:"getAttachmentParameters",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:36064,r=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.constructor.ATTACHMENT_PARAMETERS||[],i={},o=Xa(n);try{for(o.s();!(t=o.n()).done;){var a=t.value,s=r?Ko(this.gl,a):a;i[s]=this.getAttachmentParameter(e,a,r)}}catch(t){o.e(t)}finally{o.f()}return i}},{key:"getParameters",value:function(){for(var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=Object.keys(this.attachments),r={},n=0,i=e;n<i.length;n++){var o=i[n],a=Number(o),s=t?Ko(this.gl,a):a;r[s]=this.getAttachmentParameters(a,t)}return r}},{key:"show",value:function(){return"undefined"!=typeof window&&window.open(qa(this),"luma-debug-texture"),this}},{key:"log",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(t>Wi.level||"undefined"==typeof window)return this;e=e||"Framebuffer ".concat(this.id);var r=qa(this,{targetMaxHeight:100});return Wi.image({logLevel:t,message:e,image:r},e)(),this}},{key:"bind",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.target,r=void 0===e?36160:e;return this.gl.bindFramebuffer(r,this.handle),this}},{key:"unbind",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.target,r=void 0===e?36160:e;return this.gl.bindFramebuffer(r,null),this}},{key:"_createDefaultAttachments",value:function(t,e,r,n,i){var o,a=null;t&&((a=a||{})[36064]=new Ra(this.gl,{id:"".concat(this.id,"-color0"),pixels:null,format:6408,type:5121,width:n,height:i,mipmaps:!1,parameters:(o={},B()(o,10241,9729),B()(o,10240,9729),B()(o,10242,33071),B()(o,10243,33071),o)}),this.ownResources.push(a[36064]));return e&&r?((a=a||{})[33306]=new ja(this.gl,{id:"".concat(this.id,"-depth-stencil"),format:35056,width:n,height:111}),this.ownResources.push(a[33306])):e?((a=a||{})[36096]=new ja(this.gl,{id:"".concat(this.id,"-depth"),format:33189,width:n,height:i}),this.ownResources.push(a[36096])):r&&Jo(!1),a}},{key:"_unattach",value:function(t){var e=this.attachments[t];e&&(e instanceof ja?this.gl.framebufferRenderbuffer(36160,t,36161,null):this.gl.framebufferTexture2D(36160,t,3553,null,0),delete this.attachments[t])}},{key:"_attachRenderbuffer",value:function(t){var e=t.attachment,r=void 0===e?36064:e,n=t.renderbuffer;this.gl.framebufferRenderbuffer(36160,r,36161,n.handle),this.attachments[r]=n}},{key:"_attachTexture",value:function(t){var e=t.attachment,r=void 0===e?36064:e,n=t.texture,i=t.layer,o=t.level,a=this.gl;switch(a.bindTexture(n.target,n.handle),n.target){case 35866:case 32879:$i(a).framebufferTextureLayer(36160,r,n.target,o,i);break;case 34067:var s=function(t){return t<34069?t+34069:t}(i);a.framebufferTexture2D(36160,r,s,n.handle,o);break;case 3553:a.framebufferTexture2D(36160,r,3553,n.handle,o);break;default:Jo(!1,"Illegal texture type")}a.bindTexture(n.target,null),this.attachments[r]=n}},{key:"_setReadBuffer",value:function(t){var e,r=Yi(e=this.gl)?e:null;r?r.readBuffer(t):Jo(36064===t||1029===t,"Multiple render targets not supported"),this.readBuffer=t}},{key:"_setDrawBuffers",value:function(t){var e=this.gl,r=$i(e);if(r)r.drawBuffers(t);else{var n=e.getExtension("WEBGL_draw_buffers");n?n.drawBuffersWEBGL(t):Jo(1===t.length&&(36064===t[0]||1029===t[0]),"Multiple render targets not supported")}this.drawBuffers=t}},{key:"_getAttachmentParameterFallback",value:function(t){var e=function(t){for(var e in t.luma=t.luma||{},t.luma.caps=t.luma.caps||{},_s)void 0===t.luma.caps[e]&&(t.luma.caps[e]=Es(t,e));return t.luma.caps}(this.gl);switch(t){case 36052:return e.WEBGL2?null:0;case 33298:case 33299:case 33300:case 33301:case 33302:case 33303:return e.WEBGL2?null:8;case 33297:return e.WEBGL2?null:5125;case 33296:return e.WEBGL2||e.EXT_sRGB?null:9729;default:return null}}},{key:"_createHandle",value:function(){return this.gl.createFramebuffer()}},{key:"_deleteHandle",value:function(){this.gl.deleteFramebuffer(this.handle)}},{key:"_bindHandle",value:function(t){return this.gl.bindFramebuffer(36160,t)}}],[{key:"isSupported",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.colorBufferFloat,n=e.colorBufferHalfFloat,i=!0;return r&&(i=Boolean(t.getExtension("EXT_color_buffer_float")||t.getExtension("WEBGL_color_buffer_float")||t.getExtension("OES_texture_float"))),n&&(i=i&&Boolean(t.getExtension("EXT_color_buffer_float")||t.getExtension("EXT_color_buffer_half_float"))),i}},{key:"getDefaultFramebuffer",value:function(t){return t.luma=t.luma||{},t.luma.defaultFramebuffer=t.luma.defaultFramebuffer||new n(t,{id:"default-framebuffer",handle:null,attachments:{}}),t.luma.defaultFramebuffer}}]),n}($o,Symbol.toStringTag);var ts;$a.ATTACHMENT_PARAMETERS=[36049,36048,33296,33298,33299,33300,33301,33302,33303];var es="WEBGL2",rs="VERTEX_ARRAY_OBJECT",ns="TIMER_QUERY",is="INSTANCED_RENDERING",os="MULTIPLE_RENDER_TARGETS",as="ELEMENT_INDEX_UINT32",ss="BLEND_EQUATION_MINMAX",us="FLOAT_BLEND",cs="COLOR_ENCODING_SRGB",ls="TEXTURE_DEPTH",fs="TEXTURE_FLOAT",hs="TEXTURE_HALF_FLOAT",ds="TEXTURE_FILTER_LINEAR_FLOAT",ps="TEXTURE_FILTER_LINEAR_HALF_FLOAT",vs="TEXTURE_FILTER_ANISOTROPIC",ys="COLOR_ATTACHMENT_RGBA32F",gs="COLOR_ATTACHMENT_FLOAT",ms="COLOR_ATTACHMENT_HALF_FLOAT",bs="GLSL_FRAG_DATA",As="GLSL_FRAG_DEPTH",ws="GLSL_DERIVATIVES",Bs="GLSL_TEXTURE_LOD";var _s=(ts={},B()(ts,es,[!1,!0]),B()(ts,rs,["OES_vertex_array_object",!0]),B()(ts,ns,["EXT_disjoint_timer_query","EXT_disjoint_timer_query_webgl2"]),B()(ts,is,["ANGLE_instanced_arrays",!0]),B()(ts,os,["WEBGL_draw_buffers",!0]),B()(ts,as,["OES_element_index_uint",!0]),B()(ts,ss,["EXT_blend_minmax",!0]),B()(ts,us,["EXT_float_blend"]),B()(ts,cs,["EXT_sRGB",!0]),B()(ts,ls,["WEBGL_depth_texture",!0]),B()(ts,fs,["OES_texture_float",!0]),B()(ts,hs,["OES_texture_half_float",!0]),B()(ts,ds,["OES_texture_float_linear"]),B()(ts,ps,["OES_texture_half_float_linear"]),B()(ts,vs,["EXT_texture_filter_anisotropic"]),B()(ts,ys,[function(t){var e=new Ra(t,{format:6408,type:5126,dataFormat:6408}),r=new $a(t,{id:"test-framebuffer",check:!1,attachments:B()({},36064,e)}),n=r.getStatus();return e.delete(),r.delete(),36053===n},"EXT_color_buffer_float"]),B()(ts,gs,[!1,"EXT_color_buffer_float"]),B()(ts,ms,["EXT_color_buffer_half_float"]),B()(ts,bs,["WEBGL_draw_buffers",!0]),B()(ts,As,["EXT_frag_depth",!0]),B()(ts,ws,["OES_standard_derivatives",!0]),B()(ts,Bs,["EXT_shader_texture_lod",!0]),ts);function xs(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return Cs(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Cs(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function Cs(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function ks(t,e){return function(t,e){return(e=Array.isArray(e)?e:[e]).every((function(e){return Es(t,e)}))}(t,e)}function Es(t,e){return t.luma=t.luma||{},t.luma.caps=t.luma.caps||{},void 0===t.luma.caps[e]&&(t.luma.caps[e]=function(t,e){var r,n=_s[e];Jo(n,e);var i=Yi(t)&&n[1]||n[0];if("function"==typeof i)r=i(t);else if(Array.isArray(i)){r=!0;var o,a=xs(i);try{for(a.s();!(o=a.n()).done;){var s=o.value;r=r&&Boolean(t.getExtension(s))}}catch(t){a.e(t)}finally{a.f()}}else"string"==typeof i?r=Boolean(t.getExtension(i)):"boolean"==typeof i?r=i:Jo(!1);return r}(t,e)),t.luma.caps[e]||Wi.log(2,"Feature: ".concat(e," not supported"))(),t.luma.caps[e]}function Os(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Ts(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Os(Object(r),!0).forEach((function(e){B()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Os(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var Ss=function(){function t(e,r){p()(this,t);var n=r.attributes,i=r.material,o=r.pbrDebug,a=r.imageBasedLightingEnvironment,s=r.lights,u=r.useTangents;this.gl=e,this.defines={MANUAL_SRGB:1,SRGB_FAST_APPROXIMATION:1},ks(e,Bs)&&(this.defines.USE_TEX_LOD=1),this.uniforms={u_Camera:[0,0,0],u_MetallicRoughnessValues:[1,1]},this.parameters={},this.generatedTextures=[],a&&(this.uniforms.u_DiffuseEnvSampler=a.getDiffuseEnvSampler(),this.uniforms.u_SpecularEnvSampler=a.getSpecularEnvSampler(),this.uniforms.u_brdfLUT=a.getBrdfTexture(),this.uniforms.u_ScaleIBLAmbient=[1,1]),o&&(this.uniforms.u_ScaleDiffBaseMR=[0,0,0,0],this.uniforms.u_ScaleFGDSpec=[0,0,0,0]),this.defineIfPresent(n.NORMAL,"HAS_NORMALS"),this.defineIfPresent(n.TANGENT&&u,"HAS_TANGENTS"),this.defineIfPresent(n.TEXCOORD_0,"HAS_UV"),this.defineIfPresent(a,"USE_IBL"),this.defineIfPresent(s,"USE_LIGHTS"),this.defineIfPresent(o,"PBR_DEBUG"),i&&this.parseMaterial(i)}return E()(t,[{key:"defineIfPresent",value:function(t,e){t&&(this.defines[e]=1)}},{key:"parseTexture",value:function(t,e){var r,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=t.texture&&t.texture.sampler&&t.texture.sampler.parameters||{},o=t.texture.source.image,a={};o.compressed?(r=o,a=B()({},this.gl.TEXTURE_MIN_FILTER,o.data.length>1?this.gl.LINEAR_MIPMAP_NEAREST:this.gl.LINEAR)):r={data:o};var s=new Ra(this.gl,Ts({id:t.name||t.id,parameters:Ts(Ts({},i),a),pixelStore:B()({},this.gl.UNPACK_FLIP_Y_WEBGL,!1)},r));this.uniforms[e]=s,this.defineIfPresent(n,n),this.generatedTextures.push(s)}},{key:"parsePbrMetallicRoughness",value:function(t){t.baseColorTexture&&this.parseTexture(t.baseColorTexture,"u_BaseColorSampler","HAS_BASECOLORMAP"),this.uniforms.u_BaseColorFactor=t.baseColorFactor||[1,1,1,1],t.metallicRoughnessTexture&&this.parseTexture(t.metallicRoughnessTexture,"u_MetallicRoughnessSampler","HAS_METALROUGHNESSMAP");var e=t.metallicFactor,r=void 0===e?1:e,n=t.roughnessFactor,i=void 0===n?1:n;this.uniforms.u_MetallicRoughnessValues=[r,i]}},{key:"parseMaterial",value:function(t){if(this.uniforms.pbr_uUnlit=Boolean(t.unlit),t.pbrMetallicRoughness&&this.parsePbrMetallicRoughness(t.pbrMetallicRoughness),t.normalTexture){this.parseTexture(t.normalTexture,"u_NormalSampler","HAS_NORMALMAP");var e=t.normalTexture.scale,r=void 0===e?1:e;this.uniforms.u_NormalScale=r}if(t.occlusionTexture){this.parseTexture(t.occlusionTexture,"u_OcclusionSampler","HAS_OCCLUSIONMAP");var n=t.occlusionTexture.strength,i=void 0===n?1:n;this.uniforms.u_OcclusionStrength=i}if(t.emissiveTexture&&(this.parseTexture(t.emissiveTexture,"u_EmissiveSampler","HAS_EMISSIVEMAP"),this.uniforms.u_EmissiveFactor=t.emissiveFactor||[0,0,0]),"MASK"===t.alphaMode){var o=t.alphaCutoff,a=void 0===o?.5:o;this.defines.ALPHA_CUTOFF=1,this.uniforms.u_AlphaCutoff=a}else"BLEND"===t.alphaMode&&(Wi.warn("BLEND alphaMode might not work well because it requires mesh sorting")(),Object.assign(this.parameters,{blend:!0,blendEquation:this.gl.FUNC_ADD,blendFunc:[this.gl.SRC_ALPHA,this.gl.ONE_MINUS_SRC_ALPHA,this.gl.ONE,this.gl.ONE_MINUS_SRC_ALPHA]}))}},{key:"delete",value:function(){this.generatedTextures.forEach((function(t){return t.delete()}))}}]),t}();function Ms(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Is(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Ms(Object(r),!0).forEach((function(e){B()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ms(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Rs(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=A()(t);if(e){var i=A()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return m()(this,r)}}var Ps=function(t){y()(r,t);var e=Rs(r);function r(){return p()(this,r),e.apply(this,arguments)}return E()(r,[{key:"getShaders",value:function(){var t=$n()(A()(r.prototype),"getShaders",this).call(this);return t.modules.push(xi.pbr),Is(Is({},t),{},{vs:"#version 300 es\n#define SHADER_NAME simple-mesh-layer-vs\n\n// Scale the model\nuniform float sizeScale;\nuniform bool composeModelMatrix;\nuniform bool pickFeatureIds;\n\n// Primitive attributes\nin vec3 positions;\nin vec3 normals;\nin vec3 colors;\nin vec2 texCoords;\nin vec4 uvRegions;\nin vec3 featureIdsPickingColors;\n\n// Instance attributes\nin vec4 instanceColors;\nin vec3 instancePickingColors;\nin mat3 instanceModelMatrix;\n\n// Outputs to fragment shader\nout vec2 vTexCoord;\nout vec3 cameraPosition;\nout vec3 normals_commonspace;\nout vec4 position_commonspace;\nout vec4 vColor;\n\nvec2 applyUVRegion(vec2 uv) {\n #ifdef HAS_UV_REGIONS\n // https://github.com/Esri/i3s-spec/blob/master/docs/1.7/geometryUVRegion.cmn.md\n return fract(uv) * (uvRegions.zw - uvRegions.xy) + uvRegions.xy;\n #else\n return uv;\n #endif\n}\n\nvoid main(void) {\n vec2 uv = applyUVRegion(texCoords);\n geometry.uv = uv;\n\n if (pickFeatureIds) {\n geometry.pickingColor = featureIdsPickingColors;\n } else {\n geometry.pickingColor = instancePickingColors;\n }\n\n vTexCoord = uv;\n cameraPosition = project_uCameraPosition;\n vColor = vec4(colors * instanceColors.rgb, instanceColors.a);\n\n vec3 pos = (instanceModelMatrix * positions) * sizeScale;\n vec3 projectedPosition = project_position(positions);\n position_commonspace = vec4(projectedPosition, 1.0);\n gl_Position = project_common_position_to_clipspace(position_commonspace);\n\n geometry.position = position_commonspace;\n normals_commonspace = project_normal(instanceModelMatrix * normals);\n geometry.normal = normals_commonspace;\n\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n #ifdef MODULE_PBR\n // set PBR data\n pbr_vPosition = geometry.position.xyz;\n #ifdef HAS_NORMALS\n pbr_vNormal = geometry.normal;\n #endif\n\n #ifdef HAS_UV\n pbr_vUV = uv;\n #else\n pbr_vUV = vec2(0., 0.);\n #endif\n geometry.uv = pbr_vUV;\n #endif\n\n DECKGL_FILTER_COLOR(vColor, geometry);\n}\n",fs:"#version 300 es\n#define SHADER_NAME simple-mesh-layer-fs\n\nprecision highp float;\n\nuniform bool hasTexture;\nuniform sampler2D sampler;\nuniform bool flatShading;\nuniform float opacity;\n\nin vec2 vTexCoord;\nin vec3 cameraPosition;\nin vec3 normals_commonspace;\nin vec4 position_commonspace;\nin vec4 vColor;\n\nout vec4 fragColor;\n\nvoid main(void) {\n \n#ifdef MODULE_PBR\n\n fragColor = vColor * pbr_filterColor(vec4(0));\n geometry.uv = pbr_vUV;\n fragColor.a *= opacity;\n\n#else\n\n geometry.uv = vTexCoord;\n\n vec3 normal;\n if (flatShading) {\n\n// NOTE(Tarek): This is necessary because\n// headless.gl reports the extension as\n// available but does not support it in\n// the shader.\n#ifdef DERIVATIVES_AVAILABLE\n normal = normalize(cross(dFdx(position_commonspace.xyz), dFdy(position_commonspace.xyz)));\n#else\n normal = vec3(0.0, 0.0, 1.0);\n#endif\n } else {\n normal = normals_commonspace;\n }\n\n vec4 color = hasTexture ? texture(sampler, vTexCoord) : vColor;\n vec3 lightColor = lighting_getLightColor(color.rgb, cameraPosition, position_commonspace.xyz, normal);\n fragColor = vec4(lightColor, color.a * opacity);\n\n#endif\n\n DECKGL_FILTER_COLOR(fragColor, geometry);\n}\n"})}},{key:"initializeState",value:function(){var t=this.props.featureIds;$n()(A()(r.prototype),"initializeState",this).call(this);var e=this.getAttributeManager();t&&e.add({featureIdsPickingColors:{type:5121,size:3,noAlloc:!0,update:this.calculateFeatureIdsPickingColors}})}},{key:"updateState",value:function(t){$n()(A()(r.prototype),"updateState",this).call(this,t);var e=t.props,n=t.oldProps;e.pbrMaterial!==n.pbrMaterial&&this.updatePbrMaterialUniforms(e.pbrMaterial)}},{key:"draw",value:function(t){var e=this.props.featureIds;this.state.model&&(this.state.model.setUniforms({u_Camera:this.state.model.getUniforms().project_uCameraPosition,pickFeatureIds:Boolean(e)}),$n()(A()(r.prototype),"draw",this).call(this,t))}},{key:"getModel",value:function(t){var e=this.props,r=e.id,n=e.pbrMaterial,i=this.parseMaterial(n,t);this.setState({materialParser:i});var o,a=this.getShaders();return(o=t.attributes).COLOR_0||o.colors||(o.colors={constant:!0,value:new Float32Array([1,1,1])}),new xi.Model(this.context.gl,Is(Is({},this.getShaders()),{},{id:r,geometry:t,defines:Is(Is(Is({},a.defines),null==i?void 0:i.defines),{},{HAS_UV_REGIONS:t.attributes.uvRegions}),parameters:null==i?void 0:i.parameters,isInstanced:!0}))}},{key:"updatePbrMaterialUniforms",value:function(t){var e=this.state.model;if(e){var r=this.props.mesh,n=this.parseMaterial(t,r);this.setState({materialParser:n}),e.setUniforms(n.uniforms)}}},{key:"parseMaterial",value:function(t,e){var r,n=Boolean(t.pbrMetallicRoughness&&t.pbrMetallicRoughness.baseColorTexture);return null===(r=this.state.materialParser)||void 0===r||r.delete(),new Ss(this.context.gl,{attributes:{NORMAL:e.attributes.normals,TEXCOORD_0:e.attributes.texCoords},material:Is({unlit:n},t),pbrDebug:!1,imageBasedLightingEnvironment:null,lights:!0,useTangents:!1})}},{key:"calculateFeatureIdsPickingColors",value:function(t){for(var e=this.props.featureIds,r=new Uint8ClampedArray(e.length*t.size),n=[],i=0;i<e.length;i++)this.encodePickingColor(e[i],n),r[3*i]=n[0],r[3*i+1]=n[1],r[3*i+2]=n[2];t.value=r}},{key:"finalizeState",value:function(t){var e;$n()(A()(r.prototype),"finalizeState",this).call(this,t),null===(e=this.state.materialParser)||void 0===e||e.delete(),this.setState({materialParser:null})}}]),r}(_.SimpleMeshLayer);B()(Ps,"layerName","MeshLayer"),B()(Ps,"defaultProps",{pbrMaterial:{type:"object",value:null},featureIds:{type:"array",value:null,optional:!0}});var Fs=r(3),Ds=r.n(Fs),Ls=r(1),js=r.n(Ls),Gs=r(9),Ns=r.n(Gs),Us=function(t){return"boolean"==typeof t},Hs=function(t){return"function"==typeof t},Vs=function(t){return null!==t&&"object"===Ns()(t)},Js=function(t){return Vs(t)&&t.constructor==={}.constructor},zs=function(t){return t&&"function"==typeof t[Symbol.iterator]},Ks=function(t){return t&&"function"==typeof t[Symbol.asyncIterator]},qs=function(t){return"undefined"!=typeof Response&&t instanceof Response||t&&t.arrayBuffer&&t.text&&t.json},Ws=function(t){return"undefined"!=typeof Blob&&t instanceof Blob},Qs=function(t){return function(t){return"undefined"!=typeof ReadableStream&&t instanceof ReadableStream||Vs(t)&&Hs(t.tee)&&Hs(t.cancel)&&Hs(t.getReader)}(t)||function(t){return Vs(t)&&Hs(t.read)&&Hs(t.pipe)&&Us(t.readable)}(t)},Xs=r(8),Ys=r.n(Xs);function Zs(t,e){if(!t)throw new Error(e||"loader assertion failed.")}function $s(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function tu(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?$s(Object(r),!0).forEach((function(e){Ys()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):$s(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function eu(t){var e;return!!t&&(Array.isArray(t)&&(t=t[0]),Array.isArray(null===(e=t)||void 0===e?void 0:e.extensions))}function ru(t){var e,r,n;return Zs(t,"null loader"),Zs(eu(t),"invalid loader"),Array.isArray(t)&&(n=t[1],t=tu(tu({},t=t[0]),{},{options:tu(tu({},t.options),n)})),(null!==(e=t)&&void 0!==e&&e.parseTextSync||null!==(r=t)&&void 0!==r&&r.parseText)&&(t.text=!0),t.text||(t.binary=!0),t}var nu="",iu={};function ou(t){for(var e in iu)if(t.startsWith(e)){var r=iu[e];t=t.replace(e,r)}return t.startsWith("http://")||t.startsWith("https://")||(t="".concat(nu).concat(t)),t}var au=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,su=/^([-\w.]+\/[-\w.+]+)/;function uu(t){var e=su.exec(t);return e?e[1]:t}function cu(t){var e=au.exec(t);return e?e[1]:""}var lu=/\?.*/;function fu(t){if(qs(t)){var e=du(t.url||"");return{url:e,type:uu(t.headers.get("content-type")||"")||cu(e)}}return Ws(t)?{url:du(t.name||""),type:t.type||""}:"string"==typeof t?{url:du(t),type:cu(t)}:{url:"",type:""}}function hu(t){return qs(t)?t.headers["content-length"]||-1:Ws(t)?t.size:"string"==typeof t?t.length:t instanceof ArrayBuffer?t.byteLength:ArrayBuffer.isView(t)?t.byteLength:-1}function du(t){return t.replace(lu,"")}function pu(t){return vu.apply(this,arguments)}function vu(){return(vu=Ds()(js.a.mark((function t(e){var r,n,i,o,a,s,u;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!qs(e)){t.next=2;break}return t.abrupt("return",e);case 2:return r={},(n=hu(e))>=0&&(r["content-length"]=String(n)),i=fu(e),o=i.url,(a=i.type)&&(r["content-type"]=a),t.next=9,Au(e);case 9:return(s=t.sent)&&(r["x-first-bytes"]=s),"string"==typeof e&&(e=(new TextEncoder).encode(e)),u=new Response(e,{headers:r}),Object.defineProperty(u,"url",{value:o}),t.abrupt("return",u);case 15:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function yu(t){return gu.apply(this,arguments)}function gu(){return(gu=Ds()(js.a.mark((function t(e){var r;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e.ok){t.next=5;break}return t.next=3,mu(e);case 3:throw r=t.sent,new Error(r);case 5:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function mu(t){return bu.apply(this,arguments)}function bu(){return(bu=Ds()(js.a.mark((function t(e){var r,n,i;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r="Failed to fetch resource ".concat(e.url," (").concat(e.status,"): "),t.prev=1,n=e.headers.get("Content-Type"),i=e.statusText,!n.includes("application/json")){t.next=11;break}return t.t0=i,t.t1=" ",t.next=9,e.text();case 9:t.t2=t.sent,i=t.t0+=t.t1.concat.call(t.t1,t.t2);case 11:r=(r+=i).length>60?"".concat(r.slice(0,60),"..."):r,t.next=17;break;case 15:t.prev=15,t.t3=t.catch(1);case 17:return t.abrupt("return",r);case 18:case"end":return t.stop()}}),t,null,[[1,15]])})))).apply(this,arguments)}function Au(t){return wu.apply(this,arguments)}function wu(){return(wu=Ds()(js.a.mark((function t(e){var r,n,i,o;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=5,"string"!=typeof e){t.next=3;break}return t.abrupt("return","data:,".concat(e.slice(0,r)));case 3:if(!(e instanceof Blob)){t.next=8;break}return n=e.slice(0,5),t.next=7,new Promise((function(t){var e=new FileReader;e.onload=function(e){var r;return t(null==e?void 0:null===(r=e.target)||void 0===r?void 0:r.result)},e.readAsDataURL(n)}));case 7:return t.abrupt("return",t.sent);case 8:if(!(e instanceof ArrayBuffer)){t.next=12;break}return i=e.slice(0,r),o=Bu(i),t.abrupt("return","data:base64,".concat(o));case 12:return t.abrupt("return",null);case 13:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Bu(t){for(var e="",r=new Uint8Array(t),n=0;n<r.byteLength;n++)e+=String.fromCharCode(r[n]);return btoa(e)}function _u(t,e){return xu.apply(this,arguments)}function xu(){return(xu=Ds()(js.a.mark((function t(e,r){var n;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("string"!=typeof e){t.next=7;break}return e=ou(e),n=r,null!=r&&r.fetch&&"function"!=typeof(null==r?void 0:r.fetch)&&(n=r.fetch),t.next=6,fetch(e,n);case 6:return t.abrupt("return",t.sent);case 7:return t.next=9,pu(e);case 9:return t.abrupt("return",t.sent);case 10:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var Cu=r(2),ku=r.n(Cu),Eu=r(4),Ou=r.n(Eu);function Tu(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Su=r(13),Mu=r.n(Su);function Iu(){return!("object"===("undefined"==typeof process?"undefined":Ns()(process))&&"[object process]"===String(process)&&!process.browser)||function(t){if("undefined"!=typeof window&&"object"===Ns()(window.process)&&"renderer"===window.process.type)return!0;if("undefined"!=typeof process&&"object"===Ns()(process.versions)&&Boolean(process.versions.electron))return!0;var e="object"===("undefined"==typeof navigator?"undefined":Ns()(navigator))&&"string"==typeof navigator.userAgent&&navigator.userAgent,r=t||e;return!!(r&&r.indexOf("Electron")>=0)}()}var Ru=Iu();function Pu(t){try{var e=window[t],r="__storage_test__";return e.setItem(r,r),e.removeItem(r),e}catch(t){return null}}var Fu=function(){function t(e,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"sessionStorage";ku()(this,t),this.storage=Pu(n),this.id=e,this.config={},Object.assign(this.config,r),this._loadConfiguration()}return Ou()(t,[{key:"getConfiguration",value:function(){return this.config}},{key:"setConfiguration",value:function(t){return this.config={},this.updateConfiguration(t)}},{key:"updateConfiguration",value:function(t){if(Object.assign(this.config,t),this.storage){var e=JSON.stringify(this.config);this.storage.setItem(this.id,e)}return this}},{key:"_loadConfiguration",value:function(){var t={};if(this.storage){var e=this.storage.getItem(this.id);t=e?JSON.parse(e):{}}return Object.assign(this.config,t),this}}]),t}();function Du(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:600,i=t.src.replace(/\(/g,"%28").replace(/\)/g,"%29");t.width>n&&(r=Math.min(r,n/t.width));var o=t.width*r,a=t.height*r,s=["font-size:1px;","padding:".concat(Math.floor(a/2),"px ").concat(Math.floor(o/2),"px;"),"line-height:".concat(a,"px;"),"background:url(".concat(i,");"),"background-size:".concat(o,"px ").concat(a,"px;"),"color:transparent;"].join("");return["".concat(e," %c+"),s]}var Lu={BLACK:30,RED:31,GREEN:32,YELLOW:33,BLUE:34,MAGENTA:35,CYAN:36,WHITE:37,BRIGHT_BLACK:90,BRIGHT_RED:91,BRIGHT_GREEN:92,BRIGHT_YELLOW:93,BRIGHT_BLUE:94,BRIGHT_MAGENTA:95,BRIGHT_CYAN:96,BRIGHT_WHITE:97};function ju(t){return"string"==typeof t?Lu[t.toUpperCase()]||Lu.WHITE:t}function Gu(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return Nu(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Nu(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function Nu(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Uu(t){var e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["constructor"],n=Object.getPrototypeOf(t),i=Object.getOwnPropertyNames(n),o=Gu(i);try{var a=function(){var n=e.value;"function"==typeof t[n]&&(r.find((function(t){return n===t}))||(t[n]=t[n].bind(t)))};for(o.s();!(e=o.n()).done;)a()}catch(t){o.e(t)}finally{o.f()}}function Hu(t,e){if(!t)throw new Error(e||"Assertion failed")}var Vu={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document,process:"object"===("undefined"==typeof process?"undefined":Ns()(process))&&process},Ju=Vu.window||Vu.self||Vu.global,zu=Vu.process||{};console;function Ku(){var t;if(Ru&&Ju.performance)t=Ju.performance.now();else if(zu.hrtime){var e=zu.hrtime();t=1e3*e[0]+e[1]/1e6}else t=Date.now();return t}var qu={debug:Ru&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},Wu={enabled:!0,level:0};function Qu(){}var Xu={},Yu={once:!0};function Zu(t){for(var e in t)for(var r in t[e])return r||"untitled";return"empty"}var $u=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{id:""},r=e.id;ku()(this,t),this.id=r,this.VERSION="8.8.15",this._startTs=Ku(),this._deltaTs=Ku(),this.LOG_THROTTLE_TIMEOUT=0,this._storage=new Fu("__probe-".concat(this.id,"__"),Wu),this.userData={},this.timeStamp("".concat(this.id," started")),Uu(this),Object.seal(this)}return Ou()(t,[{key:"level",get:function(){return this.getLevel()},set:function(t){this.setLevel(t)}},{key:"isEnabled",value:function(){return this._storage.config.enabled}},{key:"getLevel",value:function(){return this._storage.config.level}},{key:"getTotal",value:function(){return Number((Ku()-this._startTs).toPrecision(10))}},{key:"getDelta",value:function(){return Number((Ku()-this._deltaTs).toPrecision(10))}},{key:"priority",get:function(){return this.level},set:function(t){this.level=t}},{key:"getPriority",value:function(){return this.level}},{key:"enable",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this._storage.updateConfiguration({enabled:t}),this}},{key:"setLevel",value:function(t){return this._storage.updateConfiguration({level:t}),this}},{key:"assert",value:function(t,e){Hu(t,e)}},{key:"warn",value:function(t){return this._getLogFunction(0,t,qu.warn,arguments,Yu)}},{key:"error",value:function(t){return this._getLogFunction(0,t,qu.error,arguments)}},{key:"deprecated",value:function(t,e){return this.warn("`".concat(t,"` is deprecated and will be removed in a later version. Use `").concat(e,"` instead"))}},{key:"removed",value:function(t,e){return this.error("`".concat(t,"` has been removed. Use `").concat(e,"` instead"))}},{key:"probe",value:function(t,e){return this._getLogFunction(t,e,qu.log,arguments,{time:!0,once:!0})}},{key:"log",value:function(t,e){return this._getLogFunction(t,e,qu.debug,arguments)}},{key:"info",value:function(t,e){return this._getLogFunction(t,e,console.info,arguments)}},{key:"once",value:function(t,e){return this._getLogFunction(t,e,qu.debug||qu.info,arguments,Yu)}},{key:"table",value:function(t,e,r){return e?this._getLogFunction(t,e,console.table||Qu,r&&[r],{tag:Zu(e)}):Qu}},{key:"image",value:function(t){var e=t.logLevel,n=t.priority,i=t.image,o=t.message,a=void 0===o?"":o,s=t.scale,u=void 0===s?1:s;return this._shouldLog(e||n)?Ru?function(t){var e=t.image,r=t.message,n=void 0===r?"":r,i=t.scale,o=void 0===i?1:i;if("string"==typeof e){var a=new Image;return a.onload=function(){var t,e=Du(a,n,o);(t=console).log.apply(t,Mu()(e))},a.src=e,Qu}var s=e.nodeName||"";if("img"===s.toLowerCase()){var u;return(u=console).log.apply(u,Mu()(Du(e,n,o))),Qu}if("canvas"===s.toLowerCase()){var c=new Image;return c.onload=function(){var t;return(t=console).log.apply(t,Mu()(Du(c,n,o)))},c.src=e.toDataURL(),Qu}return Qu}({image:i,message:a,scale:u}):function(t){var e=t.image,n=(t.message,t.scale),i=void 0===n?1:n,o=null;try{o=r(112)}catch(t){}if(o)return function(){return o(e,{fit:"box",width:"".concat(Math.round(80*i),"%")}).then((function(t){return console.log(t)}))};return Qu}({image:i,message:a,scale:u}):Qu}},{key:"settings",value:function(){console.table?console.table(this._storage.config):console.log(this._storage.config)}},{key:"get",value:function(t){return this._storage.config[t]}},{key:"set",value:function(t,e){this._storage.updateConfiguration(Ys()({},t,e))}},{key:"time",value:function(t,e){return this._getLogFunction(t,e,console.time?console.time:console.info)}},{key:"timeEnd",value:function(t,e){return this._getLogFunction(t,e,console.timeEnd?console.timeEnd:console.info)}},{key:"timeStamp",value:function(t,e){return this._getLogFunction(t,e,console.timeStamp||Qu)}},{key:"group",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{collapsed:!1},n=r=ec({logLevel:t,message:e,opts:r}),i=n.collapsed;return r.method=(i?console.groupCollapsed:console.group)||console.info,this._getLogFunction(r)}},{key:"groupCollapsed",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.group(t,e,Object.assign({},r,{collapsed:!0}))}},{key:"groupEnd",value:function(t){return this._getLogFunction(t,"",console.groupEnd||Qu)}},{key:"withGroup",value:function(t,e,r){this.group(t,e)();try{r()}finally{this.groupEnd(t)()}}},{key:"trace",value:function(){console.trace&&console.trace()}},{key:"_shouldLog",value:function(t){return this.isEnabled()&&this.getLevel()>=tc(t)}},{key:"_getLogFunction",value:function(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],i=arguments.length>4?arguments[4]:void 0;if(this._shouldLog(t)){var o;i=ec({logLevel:t,message:e,args:n,opts:i}),Hu(r=r||i.method),i.total=this.getTotal(),i.delta=this.getDelta(),this._deltaTs=Ku();var a=i.tag||i.message;if(i.once){if(Xu[a])return Qu;Xu[a]=Ku()}return e=rc(this.id,i.message,i),(o=r).bind.apply(o,[console,e].concat(Mu()(i.args)))}return Qu}}]),t}();function tc(t){if(!t)return 0;var e;switch(Ns()(t)){case"number":e=t;break;case"object":e=t.logLevel||t.priority||0;break;default:return 0}return Hu(Number.isFinite(e)&&e>=0),e}function ec(t){var e=t.logLevel,r=t.message;t.logLevel=tc(e);for(var n=t.args?Array.from(t.args):[];n.length&&n.shift()!==r;);switch(t.args=n,Ns()(e)){case"string":case"function":void 0!==r&&n.unshift(r),t.message=e;break;case"object":Object.assign(t,e)}"function"==typeof t.message&&(t.message=t.message());var i=Ns()(t.message);return Hu("string"===i||"object"===i),Object.assign(t,t.opts)}function rc(t,e,r){if("string"==typeof e){var n=r.time?function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8,r=Math.max(e-t.length,0);return"".concat(" ".repeat(r)).concat(t)}((s=r.total)<10?"".concat(s.toFixed(2),"ms"):s<100?"".concat(s.toFixed(1),"ms"):s<1e3?"".concat(s.toFixed(0),"ms"):"".concat((s/1e3).toFixed(2),"s")):"";e=r.time?"".concat(t,": ").concat(n," ").concat(e):"".concat(t,": ").concat(e),i=e,o=r.color,a=r.background,Ru||"string"!=typeof i||(o&&(o=ju(o),i="[".concat(o,"m").concat(i,"")),a&&(o=ju(a),i="[".concat(a+10,"m").concat(i,""))),e=i}var i,o,a,s;return e}$u.VERSION="8.8.15";var nc=new $u({id:"loaders.gl"}),ic=function(){function t(){ku()(this,t)}return Ou()(t,[{key:"log",value:function(){return function(){}}},{key:"info",value:function(){return function(){}}},{key:"warn",value:function(){return function(){}}},{key:"error",value:function(){return function(){}}}]),t}(),oc=function(){function t(){ku()(this,t),Tu(this,"console",void 0),this.console=console}return Ou()(t,[{key:"log",value:function(){for(var t,e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return(t=this.console.log).bind.apply(t,[this.console].concat(r))}},{key:"info",value:function(){for(var t,e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return(t=this.console.info).bind.apply(t,[this.console].concat(r))}},{key:"warn",value:function(){for(var t,e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return(t=this.console.warn).bind.apply(t,[this.console].concat(r))}},{key:"error",value:function(){for(var t,e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return(t=this.console.error).bind.apply(t,[this.console].concat(r))}}]),t}(),ac=("undefined"!=typeof self&&self,"undefined"!=typeof window&&window,"undefined"!=typeof global&&global,"undefined"!=typeof document&&document,Boolean("object"!==("undefined"==typeof process?"undefined":Ns()(process))||"[object process]"!==String(process)||process.browser)),sc="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version),uc=(sc&&parseFloat(sc[1]),{fetch:null,mimeType:void 0,nothrow:!1,log:new oc,CDN:"https://unpkg.com/@loaders.gl",worker:!0,maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:ac,_nodeWorkers:!1,_workerType:"",limit:0,_limitMB:0,batchSize:"auto",batchDebounceMs:0,metadata:!1,transforms:[]}),cc={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 lc(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return fc(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return fc(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function fc(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function hc(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function dc(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?hc(Object(r),!0).forEach((function(e){Ys()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):hc(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function pc(){globalThis.loaders=globalThis.loaders||{};var t=globalThis.loaders;return t._state=t._state||{},t._state}var vc=function(){var t=pc();return t.globalOptions=t.globalOptions||dc({},uc),t.globalOptions};function yc(t,e,r,n){return r=r||[],function(t,e){mc(t,null,uc,cc,e);var r,n=lc(e);try{for(n.s();!(r=n.n()).done;){var i=r.value,o=t&&t[i.id]||{},a=i.options&&i.options[i.id]||{},s=i.deprecatedOptions&&i.deprecatedOptions[i.id]||{};mc(o,i.id,a,s,e)}}catch(t){n.e(t)}finally{n.f()}}(t,r=Array.isArray(r)?r:[r]),Ac(e,t,n)}function gc(t,e){var r=vc(),n=t||r;return"function"==typeof n.fetch?n.fetch:Vs(n.fetch)?function(t){return _u(t,n)}:null!=e&&e.fetch?null==e?void 0:e.fetch:_u}function mc(t,e,r,n,i){var o=e||"Top level",a=e?"".concat(e,"."):"";for(var s in t){var u=!e&&Vs(t[s]);if(!(s in r||"baseUri"===s&&!e||"workerUrl"===s&&e))if(s in n)nc.warn("".concat(o," loader option '").concat(a).concat(s,"' no longer supported, use '").concat(n[s],"'"))();else if(!u){var c=bc(s,i);nc.warn("".concat(o," loader option '").concat(a).concat(s,"' not recognized. ").concat(c))()}}}function bc(t,e){var r,n=t.toLowerCase(),i="",o=lc(e);try{for(o.s();!(r=o.n()).done;){var a=r.value;for(var s in a.options){if(t===s)return"Did you mean '".concat(a.id,".").concat(s,"'?");var u=s.toLowerCase();(n.startsWith(u)||u.startsWith(n))&&(i=i||"Did you mean '".concat(a.id,".").concat(s,"'?"))}}}catch(t){o.e(t)}finally{o.f()}return i}function Ac(t,e,r){var n=dc({},t.options||{});return function(t,e){!e||"baseUri"in t||(t.baseUri=e)}(n,r),null===n.log&&(n.log=new ic),wc(n,vc()),wc(n,e),n}function wc(t,e){for(var r in e)if(r in e){var n=e[r];Js(n)&&Js(t[r])?t[r]=dc(dc({},t[r]),e[r]):t[r]=e[r]}}function Bc(t,e){if(!t)throw new Error(e||"loaders.gl assertion failed.")}function _c(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"3.3.0-alpha.5";Bc(t,"no worker provided");var r=t.version;return!(!e||!r)}var xc={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},Cc=xc.global||xc.self||xc.window||{},kc="object"!==("undefined"==typeof process?"undefined":Ns()(process))||"[object process]"!==String(process)||process.browser,Ec="function"==typeof importScripts,Oc="undefined"!=typeof window&&void 0!==window.orientation,Tc="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version),Sc=(Tc&&parseFloat(Tc[1]),function t(){ku()(this,t)}),Mc=new Map;function Ic(t){Bc(t.source&&!t.url||!t.source&&t.url);var e=Mc.get(t.source||t.url);return e||(t.url&&(e=function(t){if(!t.startsWith("http"))return t;return Rc((e=t,"try {\n importScripts('".concat(e,"');\n} catch (error) {\n console.error(error);\n throw error;\n}")));var e}(t.url),Mc.set(t.url,e)),t.source&&(e=Rc(t.source),Mc.set(t.source,e))),Bc(e),e}function Rc(t){var e=new Blob([t],{type:"application/javascript"});return URL.createObjectURL(e)}function Pc(t){return!!t&&(t instanceof ArrayBuffer||("undefined"!=typeof MessagePort&&t instanceof MessagePort||("undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas)))}var Fc=function(){},Dc=function(){function t(e){ku()(this,t),Tu(this,"name",void 0),Tu(this,"source",void 0),Tu(this,"url",void 0),Tu(this,"terminated",!1),Tu(this,"worker",void 0),Tu(this,"onMessage",void 0),Tu(this,"onError",void 0),Tu(this,"_loadableURL","");var r=e.name,n=e.source,i=e.url;Bc(n||i),this.name=r,this.source=n,this.url=i,this.onMessage=Fc,this.onError=function(t){return console.log(t)},this.worker=kc?this._createBrowserWorker():this._createNodeWorker()}return Ou()(t,[{key:"destroy",value:function(){this.onMessage=Fc,this.onError=Fc,this.worker.terminate(),this.terminated=!0}},{key:"isRunning",get:function(){return Boolean(this.onMessage)}},{key:"postMessage",value:function(t,e){e=e||function t(e){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2?arguments[2]:void 0,i=n||new Set;if(e){if(Pc(e))i.add(e);else if(Pc(e.buffer))i.add(e.buffer);else if(ArrayBuffer.isView(e));else if(r&&"object"===Ns()(e))for(var o in e)t(e[o],r,i)}else;return void 0===n?Array.from(i):[]}(t),this.worker.postMessage(t,e)}},{key:"_getErrorFromErrorEvent",value:function(t){var e="Failed to load ";return e+="worker ".concat(this.name," from ").concat(this.url,". "),t.message&&(e+="".concat(t.message," in ")),t.lineno&&(e+=":".concat(t.lineno,":").concat(t.colno)),new Error(e)}},{key:"_createBrowserWorker",value:function(){var t=this;this._loadableURL=Ic({source:this.source,url:this.url});var e=new Worker(this._loadableURL,{name:this.name});return e.onmessage=function(e){e.data?t.onMessage(e.data):t.onError(new Error("No data received"))},e.onerror=function(e){t.onError(t._getErrorFromErrorEvent(e)),t.terminated=!0},e.onmessageerror=function(t){return console.error(t)},e}},{key:"_createNodeWorker",value:function(){var t,e=this;if(this.url){var r=this.url.includes(":/")||this.url.startsWith("/")?this.url:"./".concat(this.url);t=new Sc(r,{eval:!1})}else{if(!this.source)throw new Error("no worker");t=new Sc(this.source,{eval:!0})}return t.on("message",(function(t){e.onMessage(t)})),t.on("error",(function(t){e.onError(t)})),t.on("exit",(function(t){})),t}}],[{key:"isSupported",value:function(){return"undefined"!=typeof Worker&&kc||!kc}}]),t}(),Lc=function(){function t(e,r){var n=this;ku()(this,t),Tu(this,"name",void 0),Tu(this,"workerThread",void 0),Tu(this,"isRunning",!0),Tu(this,"result",void 0),Tu(this,"_resolve",(function(){})),Tu(this,"_reject",(function(){})),this.name=e,this.workerThread=r,this.result=new Promise((function(t,e){n._resolve=t,n._reject=e}))}return Ou()(t,[{key:"postMessage",value:function(t,e){this.workerThread.postMessage({source:"loaders.gl",type:t,payload:e})}},{key:"done",value:function(t){Bc(this.isRunning),this.isRunning=!1,this._resolve(t)}},{key:"error",value:function(t){Bc(this.isRunning),this.isRunning=!1,this._reject(t)}}]),t}();function jc(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Gc(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?jc(Object(r),!0).forEach((function(e){Ys()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):jc(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var Nc=function(){function t(e){ku()(this,t),Tu(this,"name","unnamed"),Tu(this,"source",void 0),Tu(this,"url",void 0),Tu(this,"maxConcurrency",1),Tu(this,"maxMobileConcurrency",1),Tu(this,"onDebug",(function(){})),Tu(this,"reuseWorkers",!0),Tu(this,"props",{}),Tu(this,"jobQueue",[]),Tu(this,"idleQueue",[]),Tu(this,"count",0),Tu(this,"isDestroyed",!1),this.source=e.source,this.url=e.url,this.setProps(e)}var e,r;return Ou()(t,[{key:"destroy",value:function(){this.idleQueue.forEach((function(t){return t.destroy()})),this.isDestroyed=!0}},{key:"setProps",value:function(t){this.props=Gc(Gc({},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)}},{key:"startJob",value:(r=Ds()(js.a.mark((function t(e){var r,n,i,o=this,a=arguments;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=a.length>1&&void 0!==a[1]?a[1]:function(t,e,r){return t.done(r)},n=a.length>2&&void 0!==a[2]?a[2]:function(t,e){return t.error(e)},i=new Promise((function(t){return o.jobQueue.push({name:e,onMessage:r,onError:n,onStart:t}),o})),this._startQueuedJob(),t.next=6,i;case 6:return t.abrupt("return",t.sent);case 7:case"end":return t.stop()}}),t,this)}))),function(t){return r.apply(this,arguments)})},{key:"_startQueuedJob",value:(e=Ds()(js.a.mark((function t(){var e,r,n;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.jobQueue.length){t.next=2;break}return t.abrupt("return");case 2:if(e=this._getAvailableWorker()){t.next=5;break}return t.abrupt("return");case 5:if(!(r=this.jobQueue.shift())){t.next=18;break}return this.onDebug({message:"Starting job",name:r.name,workerThread:e,backlog:this.jobQueue.length}),n=new Lc(r.name,e),e.onMessage=function(t){return r.onMessage(n,t.type,t.payload)},e.onError=function(t){return r.onError(n,t)},r.onStart(n),t.prev=12,t.next=15,n.result;case 15:return t.prev=15,this.returnWorkerToQueue(e),t.finish(15);case 18:case"end":return t.stop()}}),t,this,[[12,,15,18]])}))),function(){return e.apply(this,arguments)})},{key:"returnWorkerToQueue",value:function(t){this.isDestroyed||!this.reuseWorkers||this.count>this._getMaxConcurrency()?(t.destroy(),this.count--):this.idleQueue.push(t),this.isDestroyed||this._startQueuedJob()}},{key:"_getAvailableWorker",value:function(){if(this.idleQueue.length>0)return this.idleQueue.shift()||null;if(this.count<this._getMaxConcurrency()){this.count++;var t="".concat(this.name.toLowerCase()," (#").concat(this.count," of ").concat(this.maxConcurrency,")");return new Dc({name:t,source:this.source,url:this.url})}return null}},{key:"_getMaxConcurrency",value:function(){return Oc?this.maxMobileConcurrency:this.maxConcurrency}}],[{key:"isSupported",value:function(){return Dc.isSupported()}}]),t}();function Uc(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return Hc(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Hc(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function Hc(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Vc(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Jc(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Vc(Object(r),!0).forEach((function(e){Ys()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Vc(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var zc={maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:!0,onDebug:function(){}},Kc=function(){function t(e){ku()(this,t),Tu(this,"props",void 0),Tu(this,"workerPools",new Map),this.props=Jc({},zc),this.setProps(e),this.workerPools=new Map}return Ou()(t,[{key:"destroy",value:function(){var t,e=Uc(this.workerPools.values());try{for(e.s();!(t=e.n()).done;){t.value.destroy()}}catch(t){e.e(t)}finally{e.f()}this.workerPools=new Map}},{key:"setProps",value:function(t){this.props=Jc(Jc({},this.props),t);var e,r=Uc(this.workerPools.values());try{for(r.s();!(e=r.n()).done;){e.value.setProps(this._getWorkerPoolProps())}}catch(t){r.e(t)}finally{r.f()}}},{key:"getWorkerPool",value:function(t){var e=t.name,r=t.source,n=t.url,i=this.workerPools.get(e);return i||((i=new Nc({name:e,source:r,url:n})).setProps(this._getWorkerPoolProps()),this.workerPools.set(e,i)),i}},{key:"_getWorkerPoolProps",value:function(){return{maxConcurrency:this.props.maxConcurrency,maxMobileConcurrency:this.props.maxMobileConcurrency,reuseWorkers:this.props.reuseWorkers,onDebug:this.props.onDebug}}}],[{key:"isSupported",value:function(){return Dc.isSupported()}},{key:"getWorkerFarm",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t._workerFarm=t._workerFarm||new t({}),t._workerFarm.setProps(e),t._workerFarm}}]),t}();Tu(Kc,"_workerFarm",void 0);function qc(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e[t.id]||{},n="".concat(t.id,"-worker.js"),i=r.workerUrl;if(i||"compression"!==t.id||(i=e.workerUrl),"test"===e._workerType&&(i="modules/".concat(t.module,"/dist/").concat(n)),!i){var o=t.version;"latest"===o&&(o="beta");var a=o?"@".concat(o):"";i="https://unpkg.com/@loaders.gl/".concat(t.module).concat(a,"/dist/").concat(n)}return Bc(i),i}function Wc(t,e){return!!Kc.isSupported()&&(!!(kc||null!=e&&e._nodeWorkers)&&(t.worker&&(null==e?void 0:e.worker)))}function Qc(t,e,r,n,i){return Xc.apply(this,arguments)}function Xc(){return(Xc=Ds()(js.a.mark((function t(e,r,n,i,o){var a,s,u,c,l,f;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a=e.id,s=qc(e,n),u=Kc.getWorkerFarm(n),c=u.getWorkerPool({name:a,url:s}),n=JSON.parse(JSON.stringify(n)),i=JSON.parse(JSON.stringify(i||{})),t.next=8,c.startJob("process-on-worker",Yc.bind(null,o));case 8:return(l=t.sent).postMessage("process",{input:r,options:n,context:i}),t.next=12,l.result;case 12:return f=t.sent,t.next=15,f.result;case 15:return t.abrupt("return",t.sent);case 16:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Yc(t,e,r,n){return Zc.apply(this,arguments)}function Zc(){return(Zc=Ds()(js.a.mark((function t(e,r,n,i){var o,a,s,u,c;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:t.t0=n,t.next="done"===t.t0?3:"error"===t.t0?5:"process"===t.t0?7:20;break;case 3:return r.done(i),t.abrupt("break",21);case 5:return r.error(new Error(i.error)),t.abrupt("break",21);case 7:return o=i.id,a=i.input,s=i.options,t.prev=8,t.next=11,e(a,s);case 11:u=t.sent,r.postMessage("done",{id:o,result:u}),t.next=19;break;case 15:t.prev=15,t.t1=t.catch(8),c=t.t1 instanceof Error?t.t1.message:"unknown error",r.postMessage("error",{id:o,error:c});case 19:return t.abrupt("break",21);case 20:console.warn("parse-with-worker unknown message ".concat(n));case 21:case"end":return t.stop()}}),t,null,[[8,15]])})))).apply(this,arguments)}var $c=r(45),tl=r.n($c);r(53);function el(t){return t&&"object"===Ns()(t)&&t.isBuffer}function rl(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return nl(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return nl(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function nl(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function il(t){if(el(t))return el(e=t)?new Uint8Array(e.buffer,e.byteOffset,e.length).slice().buffer:e;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){var r=t;return(new TextEncoder).encode(r).buffer}if(t&&"object"===Ns()(t)&&t._toArrayBuffer)return t._toArrayBuffer();throw new Error("toArrayBuffer")}function ol(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];var n,i=e.map((function(t){return t instanceof ArrayBuffer?new Uint8Array(t):t})),o=i.reduce((function(t,e){return t+e.byteLength}),0),a=new Uint8Array(o),s=0,u=rl(i);try{for(u.s();!(n=u.n()).done;){var c=n.value;a.set(c,s),s+=c.byteLength}}catch(t){u.e(t)}finally{u.f()}return a.buffer}function al(t,e,r){var n=void 0!==r?new Uint8Array(t).subarray(e,e+r):new Uint8Array(t).subarray(e);return new Uint8Array(n).buffer}function sl(t){return ul.apply(this,arguments)}function ul(){return(ul=Ds()(js.a.mark((function t(e){var r,n,i,o,a,s,u;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=[],n=!1,i=!1,t.prev=3,a=tl()(e);case 5:return t.next=7,a.next();case 7:if(!(n=!(s=t.sent).done)){t.next=13;break}u=s.value,r.push(u);case 10:n=!1,t.next=5;break;case 13:t.next=19;break;case 15:t.prev=15,t.t0=t.catch(3),i=!0,o=t.t0;case 19:if(t.prev=19,t.prev=20,!n||null==a.return){t.next=24;break}return t.next=24,a.return();case 24:if(t.prev=24,!i){t.next=27;break}throw o;case 27:return t.finish(24);case 28:return t.finish(19);case 29:return t.abrupt("return",ol.apply(void 0,r));case 30:case"end":return t.stop()}}),t,null,[[3,15,19,29],[20,,24,28]])})))).apply(this,arguments)}var cl=js.a.mark(ll);function ll(t,e){var r,n,i,o,a;return js.a.wrap((function(s){for(;;)switch(s.prev=s.next){case 0:r=(null==e?void 0:e.chunkSize)||262144,n=0,i=new TextEncoder;case 3:if(!(n<t.length)){s.next=11;break}return o=Math.min(t.length-n,r),a=t.slice(n,n+o),n+=o,s.next=9,i.encode(a);case 9:s.next=3;break;case 11:case"end":return s.stop()}}),cl)}var fl=js.a.mark(hl);function hl(t){var e,r,n,i,o,a,s,u=arguments;return js.a.wrap((function(c){for(;;)switch(c.prev=c.next){case 0:e=u.length>1&&void 0!==u[1]?u[1]:{},r=e.chunkSize,n=void 0===r?262144:r,i=0;case 3:if(!(i<t.byteLength)){c.next=14;break}return o=Math.min(t.byteLength-i,n),a=new ArrayBuffer(o),s=new Uint8Array(t,i,o),new Uint8Array(a).set(s),i+=o,c.next=12,a;case 12:c.next=3;break;case 14:case"end":return c.stop()}}),fl)}var dl=r(41),pl=r.n(dl),vl=r(44),yl=r.n(vl);function gl(){return(gl=yl()(js.a.mark((function t(e,r){var n,i,o,a;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=(null==r?void 0:r.chunkSize)||1048576,i=0;case 2:if(!(i<e.size)){t.next=12;break}return o=i+n,t.next=6,pl()(e.slice(i,o).arrayBuffer());case 6:return a=t.sent,i=o,t.next=10,a;case 10:t.next=2;break;case 12:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function ml(t,e){return ac?function(t,e){return bl.apply(this,arguments)}(t,e):function(t,e){return Al.apply(this,arguments)}(t,e)}function bl(){return(bl=yl()(js.a.mark((function t(e,r){var n,i,o,a,s,u;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=e.getReader(),t.prev=1;case 2:return o=i||n.read(),null!=r&&r._streamReadAhead&&(i=n.read()),t.next=7,pl()(o);case 7:if(a=t.sent,s=a.done,u=a.value,!s){t.next=12;break}return t.abrupt("return");case 12:return t.next=14,il(u);case 14:t.next=2;break;case 16:t.next=21;break;case 18:t.prev=18,t.t0=t.catch(1),n.releaseLock();case 21:case"end":return t.stop()}}),t,null,[[1,18]])})))).apply(this,arguments)}function Al(){return(Al=yl()(js.a.mark((function t(e,r){var n,i,o,a,s,u;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=!1,i=!1,t.prev=2,a=tl()(e);case 4:return t.next=6,pl()(a.next());case 6:if(!(n=!(s=t.sent).done)){t.next=13;break}return u=s.value,t.next=10,il(u);case 10:n=!1,t.next=4;break;case 13:t.next=19;break;case 15:t.prev=15,t.t0=t.catch(2),i=!0,o=t.t0;case 19:if(t.prev=19,t.prev=20,!n||null==a.return){t.next=24;break}return t.next=24,pl()(a.return());case 24:if(t.prev=24,!i){t.next=27;break}throw o;case 27:return t.finish(24);case 28:return t.finish(19);case 29:case"end":return t.stop()}}),t,null,[[2,15,19,29],[20,,24,28]])})))).apply(this,arguments)}function wl(t,e){if("string"==typeof t)return ll(t,e);if(t instanceof ArrayBuffer)return hl(t,e);if(Ws(t))return function(t,e){return gl.apply(this,arguments)}(t,e);if(Qs(t))return ml(t,e);if(qs(t))return ml(t.body,e);throw new Error("makeIterator")}var Bl="Cannot convert supplied data type";function _l(t,e,r){if(e.text&&"string"==typeof t)return t;var n;if((n=t)&&"object"===Ns()(n)&&n.isBuffer&&(t=t.buffer),t instanceof ArrayBuffer){var i=t;return e.text&&!e.binary?new TextDecoder("utf8").decode(i):i}if(ArrayBuffer.isView(t)){if(e.text&&!e.binary)return new TextDecoder("utf8").decode(t);var o=t.buffer,a=t.byteLength||t.length;return 0===t.byteOffset&&a===o.byteLength||(o=o.slice(t.byteOffset,t.byteOffset+a)),o}throw new Error(Bl)}function xl(t,e,r){return Cl.apply(this,arguments)}function Cl(){return(Cl=Ds()(js.a.mark((function t(e,r,n){var i,o;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i=e instanceof ArrayBuffer||ArrayBuffer.isView(e),"string"!=typeof e&&!i){t.next=3;break}return t.abrupt("return",_l(e,r));case 3:if(!Ws(e)){t.next=7;break}return t.next=6,pu(e);case 6:e=t.sent;case 7:if(!qs(e)){t.next=21;break}return o=e,t.next=11,yu(o);case 11:if(!r.binary){t.next=17;break}return t.next=14,o.arrayBuffer();case 14:t.t0=t.sent,t.next=20;break;case 17:return t.next=19,o.text();case 19:t.t0=t.sent;case 20:return t.abrupt("return",t.t0);case 21:if(Qs(e)&&(e=wl(e,n)),!zs(e)&&!Ks(e)){t.next=24;break}return t.abrupt("return",sl(e));case 24:throw new Error(Bl);case 25:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function kl(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function El(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?kl(Object(r),!0).forEach((function(e){Ys()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):kl(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Ol(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(r)return r;var n=El({fetch:gc(e,t)},t);return Array.isArray(n.loaders)||(n.loaders=null),n}function Tl(t,e){if(!e&&t&&!Array.isArray(t))return t;var r;if(t&&(r=Array.isArray(t)?t:[t]),e&&e.loaders){var n=Array.isArray(e.loaders)?e.loaders:[e.loaders];r=r?[].concat(Mu()(r),Mu()(n)):n}return r&&r.length?r:null}function Sl(t){var e=t&&t.lastIndexOf("/");return e>=0?t.substr(e+1):""}function Ml(t){var e=t&&t.lastIndexOf("/");return e>=0?t.substr(0,e):""}function Il(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];var n="/";return(e=e.map((function(t,r){return r&&(t=t.replace(new RegExp("^".concat(n)),"")),r!==e.length-1&&(t=t.replace(new RegExp("".concat(n,"$")),"")),t}))).join(n)}r(50),r(64);function Rl(){return!("object"===("undefined"==typeof process?"undefined":Ns()(process))&&"[object process]"===String(process)&&!process.browser)||function(t){if("undefined"!=typeof window&&"object"===Ns()(window.process)&&"renderer"===window.process.type)return!0;if("undefined"!=typeof process&&"object"===Ns()(process.versions)&&Boolean(process.versions.electron))return!0;var e="object"===("undefined"==typeof navigator?"undefined":Ns()(navigator))&&"string"==typeof navigator.userAgent&&navigator.userAgent,r=t||e;return!!(r&&r.indexOf("Electron")>=0)}()}Rl();function Pl(t){try{var e=window[t],r="__storage_test__";return e.setItem(r,r),e.removeItem(r),e}catch(t){return null}}var Fl,Dl=function(){function t(e){ku()(this,t);var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"sessionStorage";Tu(this,"storage",void 0),Tu(this,"id",void 0),Tu(this,"config",{}),this.storage=Pl(n),this.id=e,this.config={},Object.assign(this.config,r),this._loadConfiguration()}return Ou()(t,[{key:"getConfiguration",value:function(){return this.config}},{key:"setConfiguration",value:function(t){return this.config={},this.updateConfiguration(t)}},{key:"updateConfiguration",value:function(t){if(Object.assign(this.config,t),this.storage){var e=JSON.stringify(this.config);this.storage.setItem(this.id,e)}return this}},{key:"_loadConfiguration",value:function(){var t={};if(this.storage){var e=this.storage.getItem(this.id);t=e?JSON.parse(e):{}}return Object.assign(this.config,t),this}}]),t}();function Ll(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:600,i=t.src.replace(/\(/g,"%28").replace(/\)/g,"%29");t.width>n&&(r=Math.min(r,n/t.width));var o=t.width*r,a=t.height*r,s=["font-size:1px;","padding:".concat(Math.floor(a/2),"px ").concat(Math.floor(o/2),"px;"),"line-height:".concat(a,"px;"),"background:url(".concat(i,");"),"background-size:".concat(o,"px ").concat(a,"px;"),"color:transparent;"].join("");return["".concat(e," %c+"),s]}function jl(t){return"string"==typeof t?Fl[t.toUpperCase()]||Fl.WHITE:t}function Gl(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return Nl(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Nl(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function Nl(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Ul(t){var e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["constructor"],n=Object.getPrototypeOf(t),i=Object.getOwnPropertyNames(n),o=Gl(i);try{var a=function(){var n=e.value;"function"==typeof t[n]&&(r.find((function(t){return n===t}))||(t[n]=t[n].bind(t)))};for(o.s();!(e=o.n()).done;)a()}catch(t){o.e(t)}finally{o.f()}}function Hl(t,e){if(!t)throw new Error(e||"Assertion failed")}!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"}(Fl||(Fl={}));var Vl={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document,process:"object"===("undefined"==typeof process?"undefined":Ns()(process))&&process},Jl=(globalThis,Vl.window||Vl.self||Vl.global),zl=Vl.process||{};console;function Kl(){var t,e,r;if(Rl&&"performance"in Jl)t=null==Jl?void 0:null===(e=Jl.performance)||void 0===e?void 0:null===(r=e.now)||void 0===r?void 0:r.call(e);else if("hrtime"in zl){var n,i=null==zl?void 0:null===(n=zl.hrtime)||void 0===n?void 0:n.call(zl);t=1e3*i[0]+i[1]/1e6}else t=Date.now();return t}var ql={debug:Rl&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},Wl={enabled:!0,level:0};function Ql(){}var Xl={},Yl={once:!0},Zl=function(){function t(){ku()(this,t);var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{id:""},r=e.id;Tu(this,"id",void 0),Tu(this,"VERSION","8.8.15"),Tu(this,"_startTs",Kl()),Tu(this,"_deltaTs",Kl()),Tu(this,"_storage",void 0),Tu(this,"userData",{}),Tu(this,"LOG_THROTTLE_TIMEOUT",0),this.id=r,this._storage=new Dl("__probe-".concat(this.id,"__"),Wl),this.userData={},this.timeStamp("".concat(this.id," started")),Ul(this),Object.seal(this)}return Ou()(t,[{key:"level",get:function(){return this.getLevel()},set:function(t){this.setLevel(t)}},{key:"isEnabled",value:function(){return this._storage.config.enabled}},{key:"getLevel",value:function(){return this._storage.config.level}},{key:"getTotal",value:function(){return Number((Kl()-this._startTs).toPrecision(10))}},{key:"getDelta",value:function(){return Number((Kl()-this._deltaTs).toPrecision(10))}},{key:"priority",get:function(){return this.level},set:function(t){this.level=t}},{key:"getPriority",value:function(){return this.level}},{key:"enable",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this._storage.updateConfiguration({enabled:t}),this}},{key:"setLevel",value:function(t){return this._storage.updateConfiguration({level:t}),this}},{key:"get",value:function(t){return this._storage.config[t]}},{key:"set",value:function(t,e){this._storage.updateConfiguration(Ys()({},t,e))}},{key:"settings",value:function(){console.table?console.table(this._storage.config):console.log(this._storage.config)}},{key:"assert",value:function(t,e){Hl(t,e)}},{key:"warn",value:function(t){return this._getLogFunction(0,t,ql.warn,arguments,Yl)}},{key:"error",value:function(t){return this._getLogFunction(0,t,ql.error,arguments)}},{key:"deprecated",value:function(t,e){return this.warn("`".concat(t,"` is deprecated and will be removed in a later version. Use `").concat(e,"` instead"))}},{key:"removed",value:function(t,e){return this.error("`".concat(t,"` has been removed. Use `").concat(e,"` instead"))}},{key:"probe",value:function(t,e){return this._getLogFunction(t,e,ql.log,arguments,{time:!0,once:!0})}},{key:"log",value:function(t,e){return this._getLogFunction(t,e,ql.debug,arguments)}},{key:"info",value:function(t,e){return this._getLogFunction(t,e,console.info,arguments)}},{key:"once",value:function(t,e){for(var r=arguments.length,n=new Array(r>2?r-2:0),i=2;i<r;i++)n[i-2]=arguments[i];return this._getLogFunction(t,e,ql.debug||ql.info,arguments,Yl)}},{key:"table",value:function(t,e,r){return e?this._getLogFunction(t,e,console.table||Ql,r&&[r],{tag:ef(e)}):Ql}},{key:"image",value:function(t){var e=t.logLevel,n=t.priority,i=t.image,o=t.message,a=void 0===o?"":o,s=t.scale,u=void 0===s?1:s;return this._shouldLog(e||n)?Rl?function(t){var e=t.image,r=t.message,n=void 0===r?"":r,i=t.scale,o=void 0===i?1:i;if("string"==typeof e){var a=new Image;return a.onload=function(){var t,e=Ll(a,n,o);(t=console).log.apply(t,Mu()(e))},a.src=e,Ql}var s=e.nodeName||"";if("img"===s.toLowerCase()){var u;return(u=console).log.apply(u,Mu()(Ll(e,n,o))),Ql}if("canvas"===s.toLowerCase()){var c=new Image;return c.onload=function(){var t;return(t=console).log.apply(t,Mu()(Ll(c,n,o)))},c.src=e.toDataURL(),Ql}return Ql}({image:i,message:a,scale:u}):function(t){var e=t.image,n=(t.message,t.scale),i=void 0===n?1:n,o=null;try{o=r(113)}catch(t){}if(o)return function(){return o(e,{fit:"box",width:"".concat(Math.round(80*i),"%")}).then((function(t){return console.log(t)}))};return Ql}({image:i,message:a,scale:u}):Ql}},{key:"time",value:function(t,e){return this._getLogFunction(t,e,console.time?console.time:console.info)}},{key:"timeEnd",value:function(t,e){return this._getLogFunction(t,e,console.timeEnd?console.timeEnd:console.info)}},{key:"timeStamp",value:function(t,e){return this._getLogFunction(t,e,console.timeStamp||Ql)}},{key:"group",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{collapsed:!1},n=tf({logLevel:t,message:e,opts:r}),i=r.collapsed;return n.method=(i?console.groupCollapsed:console.group)||console.info,this._getLogFunction(n)}},{key:"groupCollapsed",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.group(t,e,Object.assign({},r,{collapsed:!0}))}},{key:"groupEnd",value:function(t){return this._getLogFunction(t,"",console.groupEnd||Ql)}},{key:"withGroup",value:function(t,e,r){this.group(t,e)();try{r()}finally{this.groupEnd(t)()}}},{key:"trace",value:function(){console.trace&&console.trace()}},{key:"_shouldLog",value:function(t){return this.isEnabled()&&this.getLevel()>=$l(t)}},{key:"_getLogFunction",value:function(t,e,r,n,i){if(this._shouldLog(t)){var o;i=tf({logLevel:t,message:e,args:n,opts:i}),Hl(r=r||i.method),i.total=this.getTotal(),i.delta=this.getDelta(),this._deltaTs=Kl();var a=i.tag||i.message;if(i.once){if(Xl[a])return Ql;Xl[a]=Kl()}return e=function(t,e,r){if("string"==typeof e){var n=r.time?function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8,r=Math.max(e-t.length,0);return"".concat(" ".repeat(r)).concat(t)}((s=r.total)<10?"".concat(s.toFixed(2),"ms"):s<100?"".concat(s.toFixed(1),"ms"):s<1e3?"".concat(s.toFixed(0),"ms"):"".concat((s/1e3).toFixed(2),"s")):"";e=r.time?"".concat(t,": ").concat(n," ").concat(e):"".concat(t,": ").concat(e),i=e,o=r.color,a=r.background,Rl||"string"!=typeof i||(o&&(o=jl(o),i="[".concat(o,"m").concat(i,"")),a&&(o=jl(a),i="[".concat(a+10,"m").concat(i,""))),e=i}var i,o,a;var s;return e}(this.id,i.message,i),(o=r).bind.apply(o,[console,e].concat(Mu()(i.args)))}return Ql}}]),t}();function $l(t){if(!t)return 0;var e;switch(Ns()(t)){case"number":e=t;break;case"object":e=t.logLevel||t.priority||0;break;default:return 0}return Hl(Number.isFinite(e)&&e>=0),e}function tf(t){var e=t.logLevel,r=t.message;t.logLevel=$l(e);for(var n=t.args?Array.from(t.args):[];n.length&&n.shift()!==r;);switch(Ns()(e)){case"string":case"function":void 0!==r&&n.unshift(r),t.message=e;break;case"object":Object.assign(t,e)}"function"==typeof t.message&&(t.message=t.message());var i=Ns()(t.message);return Hl("string"===i||"object"===i),Object.assign(t,{args:n},t.opts)}function ef(t){for(var e in t)for(var r in t[e])return r||"untitled";return"empty"}Tu(Zl,"VERSION","8.8.15");var rf=new Zl({id:"loaders.gl"});var nf=function(){var t=pc();return t.loaderRegistry=t.loaderRegistry||[],t.loaderRegistry};function of(){return nf()}function af(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function sf(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?af(Object(r),!0).forEach((function(e){Ys()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):af(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function uf(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return cf(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return cf(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function cf(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var lf=/\.([^.]+)$/;function ff(t){return hf.apply(this,arguments)}function hf(){return(hf=Ds()(js.a.mark((function t(e){var r,n,i,o,a=arguments;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=a.length>1&&void 0!==a[1]?a[1]:[],n=a.length>2?a[2]:void 0,i=a.length>3?a[3]:void 0,vf(e)){t.next=5;break}return t.abrupt("return",null);case 5:if(!(o=df(e,r,sf(sf({},n),{},{nothrow:!0}),i))){t.next=8;break}return t.abrupt("return",o);case 8:if(!Ws(e)){t.next=13;break}return t.next=11,e.slice(0,10).arrayBuffer();case 11:e=t.sent,o=df(e,r,n,i);case 13:if(o||null!=n&&n.nothrow){t.next=15;break}throw new Error(yf(e));case 15:return t.abrupt("return",o);case 16:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function df(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0;if(!vf(t))return null;if(e&&!Array.isArray(e))return ru(e);var i,o=[];(e&&(o=o.concat(e)),null!=r&&r.ignoreRegisteredLoaders)||(i=o).push.apply(i,Mu()(of()));gf(o);var a=pf(t,o,r,n);if(!(a||null!=r&&r.nothrow))throw new Error(yf(t));return a}function pf(t,e,r,n){var i,o=fu(t),a=o.url,s=o.type,u=a||(null==n?void 0:n.url),c=null,l="";(null!=r&&r.mimeType&&(c=mf(e,null==r?void 0:r.mimeType),l="match forced by supplied MIME type ".concat(null==r?void 0:r.mimeType)),c=c||function(t,e){var r=e&&lf.exec(e),n=r&&r[1];return n?function(t,e){e=e.toLowerCase();var r,n=uf(t);try{for(n.s();!(r=n.n()).done;){var i,o=r.value,a=uf(o.extensions);try{for(a.s();!(i=a.n()).done;){if(i.value.toLowerCase()===e)return o}}catch(t){a.e(t)}finally{a.f()}}}catch(t){n.e(t)}finally{n.f()}return null}(t,n):null}(e,u),l=l||(c?"matched url ".concat(u):""),c=c||mf(e,s),l=l||(c?"matched MIME type ".concat(s):""),c=c||function(t,e){if(!e)return null;var r,n=uf(t);try{for(n.s();!(r=n.n()).done;){var i=r.value;if("string"==typeof e){if(bf(e,i))return i}else if(ArrayBuffer.isView(e)){if(Af(e.buffer,e.byteOffset,i))return i}else if(e instanceof ArrayBuffer){if(Af(e,0,i))return i}}}catch(t){n.e(t)}finally{n.f()}return null}(e,t),l=l||(c?"matched initial data ".concat(wf(t)):""),c=c||mf(e,null==r?void 0:r.fallbackMimeType),l=l||(c?"matched fallback MIME type ".concat(s):""))&&rf.log(1,"selectLoader selected ".concat(null===(i=c)||void 0===i?void 0:i.name,": ").concat(l,"."));return c}function vf(t){return!(t instanceof Response&&204===t.status)}function yf(t){var e=fu(t),r=e.url,i=e.type,o="No valid loader found (";o+=r?"".concat(n.filename(r),", "):"no url provided, ",o+="MIME type: ".concat(i?'"'.concat(i,'"'):"not provided",", ");var a=t?wf(t):"";return o+=a?' first bytes: "'.concat(a,'"'):"first bytes: not available",o+=")"}function gf(t){var e,r=uf(t);try{for(r.s();!(e=r.n()).done;){ru(e.value)}}catch(t){r.e(t)}finally{r.f()}}function mf(t,e){var r,n=uf(t);try{for(n.s();!(r=n.n()).done;){var i=r.value;if(i.mimeTypes&&i.mimeTypes.includes(e))return i;if(e==="application/x.".concat(i.id))return i}}catch(t){n.e(t)}finally{n.f()}return null}function bf(t,e){return e.testText?e.testText(t):(Array.isArray(e.tests)?e.tests:[e.tests]).some((function(e){return t.startsWith(e)}))}function Af(t,e,r){return(Array.isArray(r.tests)?r.tests:[r.tests]).some((function(n){return function(t,e,r,n){if(n instanceof ArrayBuffer)return function(t,e,r){if(r=r||t.byteLength,t.byteLength<r||e.byteLength<r)return!1;for(var n=new Uint8Array(t),i=new Uint8Array(e),o=0;o<n.length;++o)if(n[o]!==i[o])return!1;return!0}(n,t,n.byteLength);switch(Ns()(n)){case"function":return n(t,r);case"string":var i=Bf(t,e,n.length);return n===i;default:return!1}}(t,e,r,n)}))}function wf(t){var 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 Bf(t.buffer,t.byteOffset,e);if(t instanceof ArrayBuffer){var r=0;return Bf(t,r,e)}return""}function Bf(t,e,r){if(t.byteLength<e+r)return"";for(var n=new DataView(t),i="",o=0;o<r;o++)i+=String.fromCharCode(n.getUint8(e+o));return i}function _f(t,e,r,n){return xf.apply(this,arguments)}function xf(){return(xf=Ds()(js.a.mark((function t(e,r,n,i){var o,a,s,u;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return Bc(!i||"object"===Ns()(i)),!r||Array.isArray(r)||eu(r)||(i=void 0,n=r,r=void 0),t.next=4,e;case 4:return e=t.sent,n=n||{},o=fu(e),a=o.url,s=Tl(r,i),t.next=11,ff(e,s,n);case 11:if(u=t.sent){t.next=14;break}return t.abrupt("return",null);case 14:return n=yc(n,u,s,a),i=Ol({url:a,parse:_f,loaders:s},n,i),t.next=18,Cf(u,e,n,i);case 18:return t.abrupt("return",t.sent);case 19:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Cf(t,e,r,n){return kf.apply(this,arguments)}function kf(){return(kf=Ds()(js.a.mark((function t(e,r,n,i){var o,a,s,u,c,l,f,h;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return _c(e),qs(r)&&(a=(o=r).ok,s=o.redirected,u=o.status,c=o.statusText,l=o.type,f=o.url,h=Object.fromEntries(o.headers.entries()),i.response={headers:h,ok:a,redirected:s,status:u,statusText:c,type:l,url:f}),t.next=4,xl(r,e,n);case 4:if(r=t.sent,!e.parseTextSync||"string"!=typeof r){t.next=8;break}return n.dataType="text",t.abrupt("return",e.parseTextSync(r,n,i,e));case 8:if(!Wc(e,n)){t.next=12;break}return t.next=11,Qc(e,r,n,i,_f);case 11:return t.abrupt("return",t.sent);case 12:if(!e.parseText||"string"!=typeof r){t.next=16;break}return t.next=15,e.parseText(r,n,i,e);case 15:return t.abrupt("return",t.sent);case 16:if(!e.parse){t.next=20;break}return t.next=19,e.parse(r,n,i,e);case 19:return t.abrupt("return",t.sent);case 20:throw Bc(!e.parseSync),new Error("".concat(e.id," loader - no parser found and worker is disabled"));case 22:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Ef(t,e,r,n){return Of.apply(this,arguments)}function Of(){return(Of=Ds()(js.a.mark((function t(e,r,n,i){var o,a;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(Array.isArray(r)||eu(r)||(void 0,n=r,r=void 0),o=gc(n),a=e,"string"!=typeof e){t.next=7;break}return t.next=6,o(e);case 6:a=t.sent;case 7:if(!Ws(e)){t.next=11;break}return t.next=10,o(e);case 10:a=t.sent;case 11:return t.next=13,_f(a,r,n);case 13:return t.abrupt("return",t.sent);case 14:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var Tf=r(19),Sf=r.n(Tf),Mf=r(11),If=r.n(Mf),Rf=r(21),Pf=r.n(Rf),Ff=r(17),Df=r.n(Ff);r(72);function Lf(t,e){if(!t)throw new Error("math.gl assertion ".concat(e))}var jf=1/Math.PI*180,Gf=1/180*Math.PI,Nf={};function Uf(t){return Math.round(t/Nf.EPSILON)*Nf.EPSILON}function Hf(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.precision,n=void 0===r?Nf.precision||4:r;return t=Uf(t),"".concat(parseFloat(t.toPrecision(n)))}function Vf(t){return Array.isArray(t)||ArrayBuffer.isView(t)&&!(t instanceof DataView)}function Jf(t,e,r){if(Vf(t)){r=r||((i=t).clone?i.clone():new Array(i.length));for(var n=0;n<r.length&&n<t.length;++n)r[n]=e(t[n],n,r);return r}var i;return e(t)}function zf(t){return function(t,e){return Jf(t,(function(t){return t*Gf}),e)}(t)}function Kf(t){return qf(t)}function qf(t,e){return Jf(t,(function(t){return t*jf}),e)}function Wf(t,e,r){return Jf(t,(function(t){return Math.max(e,Math.min(r,t))}))}function Qf(t,e,r){var n=Nf.EPSILON;r&&(Nf.EPSILON=r);try{if(t===e)return!0;if(Vf(t)&&Vf(e)){if(t.length!==e.length)return!1;for(var i=0;i<t.length;++i)if(!Qf(t[i],e[i]))return!1;return!0}return t&&t.equals?t.equals(e):e&&e.equals?e.equals(t):!(!Number.isFinite(t)||!Number.isFinite(e))&&Math.abs(t-e)<=Nf.EPSILON*Math.max(1,Math.abs(t),Math.abs(e))}finally{Nf.EPSILON=n}}function Xf(t,e){if(t.length!==e)return!1;for(var r=0;r<t.length;++r)if(!Number.isFinite(t[r]))return!1;return!0}function Yf(t){if(!Number.isFinite(t))throw new Error("Invalid number ".concat(t));return t}function Zf(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(Nf.debug&&!Xf(t,e))throw new Error("math.gl: ".concat(r," some fields set to invalid numbers'"));return t}Nf.EPSILON=1e-12,Nf.debug=!1,Nf.precision=4,Nf.printTypes=!1,Nf.printDegrees=!1,Nf.printRowMajor=!0;var $f={};function th(t,e){$f[t]||($f[t]=!0,console.warn("".concat(t," has been removed in version ").concat(e,", see upgrade guide for more information")))}function eh(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Df()(t);if(e){var i=Df()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Pf()(this,r)}}var rh=function(t){If()(r,t);var e=eh(r);function r(){return ku()(this,r),e.apply(this,arguments)}return Ou()(r,[{key:"ELEMENTS",get:function(){return Lf(!1),0}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"from",value:function(t){return Array.isArray(t)?this.copy(t):this.fromObject(t)}},{key:"fromArray",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=0;r<this.ELEMENTS;++r)this[r]=t[r+e];return this.check()}},{key:"to",value:function(t){return t===this?this:Vf(t)?this.toArray(t):this.toObject(t)}},{key:"toTarget",value:function(t){return t?this.to(t):this}},{key:"toArray",value:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=0;r<this.ELEMENTS;++r)t[e+r]=this[r];return t}},{key:"toFloat32Array",value:function(){return new Float32Array(this)}},{key:"toString",value:function(){return this.formatString(Nf)}},{key:"formatString",value:function(t){for(var e="",r=0;r<this.ELEMENTS;++r)e+=(r>0?", ":"")+Hf(this[r],t);return"".concat(t.printTypes?this.constructor.name:"","[").concat(e,"]")}},{key:"equals",value:function(t){if(!t||this.length!==t.length)return!1;for(var e=0;e<this.ELEMENTS;++e)if(!Qf(this[e],t[e]))return!1;return!0}},{key:"exactEquals",value:function(t){if(!t||this.length!==t.length)return!1;for(var e=0;e<this.ELEMENTS;++e)if(this[e]!==t[e])return!1;return!0}},{key:"negate",value:function(){for(var t=0;t<this.ELEMENTS;++t)this[t]=-this[t];return this.check()}},{key:"lerp",value:function(t,e,r){void 0===r&&(r=e,e=t,t=this);for(var n=0;n<this.ELEMENTS;++n){var i=t[n];this[n]=i+r*(e[n]-i)}return this.check()}},{key:"min",value:function(t){for(var e=0;e<this.ELEMENTS;++e)this[e]=Math.min(t[e],this[e]);return this.check()}},{key:"max",value:function(t){for(var e=0;e<this.ELEMENTS;++e)this[e]=Math.max(t[e],this[e]);return this.check()}},{key:"clamp",value:function(t,e){for(var r=0;r<this.ELEMENTS;++r)this[r]=Math.min(Math.max(this[r],t[r]),e[r]);return this.check()}},{key:"add",value:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];for(var n=0,i=e;n<i.length;n++)for(var o=i[n],a=0;a<this.ELEMENTS;++a)this[a]+=o[a];return this.check()}},{key:"subtract",value:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];for(var n=0,i=e;n<i.length;n++)for(var o=i[n],a=0;a<this.ELEMENTS;++a)this[a]-=o[a];return this.check()}},{key:"scale",value:function(t){if(Array.isArray(t))return this.multiply(t);for(var e=0;e<this.ELEMENTS;++e)this[e]*=t;return this.check()}},{key:"sub",value:function(t){return this.subtract(t)}},{key:"setScalar",value:function(t){for(var e=0;e<this.ELEMENTS;++e)this[e]=t;return this.check()}},{key:"addScalar",value:function(t){for(var e=0;e<this.ELEMENTS;++e)this[e]+=t;return this.check()}},{key:"subScalar",value:function(t){return this.addScalar(-t)}},{key:"multiplyScalar",value:function(t){for(var e=0;e<this.ELEMENTS;++e)this[e]*=t;return this.check()}},{key:"divideScalar",value:function(t){return this.scale(1/t)}},{key:"clampScalar",value:function(t,e){for(var r=0;r<this.ELEMENTS;++r)this[r]=Math.min(Math.max(this[r],t),e);return this.check()}},{key:"multiplyByScalar",value:function(t){return this.scale(t)}},{key:"elements",get:function(){return this}},{key:"check",value:function(){if(Nf.debug&&!this.validate())throw new Error("math.gl: ".concat(this.constructor.name," some fields set to invalid numbers'"));return this}},{key:"validate",value:function(){for(var t=this.length===this.ELEMENTS,e=0;e<this.ELEMENTS;++e)t=t&&Number.isFinite(this[e]);return t}}]),r}(function(t){function e(){var e=Reflect.construct(t,Array.from(arguments));return Object.setPrototypeOf(e,Object.getPrototypeOf(this)),e}return e.prototype=Object.create(t.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t,e}(Array));function nh(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Df()(t);if(e){var i=Df()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Pf()(this,r)}}var ih=function(t){If()(r,t);var e=nh(r);function r(){return ku()(this,r),e.apply(this,arguments)}return Ou()(r,[{key:"ELEMENTS",get:function(){return Lf(!1),0}},{key:"RANK",get:function(){return Lf(!1),0}},{key:"toString",value:function(){var t="[";if(Nf.printRowMajor){t+="row-major:";for(var e=0;e<this.RANK;++e)for(var r=0;r<this.RANK;++r)t+=" ".concat(this[r*this.RANK+e])}else{t+="column-major:";for(var n=0;n<this.ELEMENTS;++n)t+=" ".concat(this[n])}return t+="]"}},{key:"getElementIndex",value:function(t,e){return e*this.RANK+t}},{key:"getElement",value:function(t,e){return this[e*this.RANK+t]}},{key:"setElement",value:function(t,e,r){return this[e*this.RANK+t]=Yf(r),this}},{key:"getColumn",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Array(this.RANK).fill(-0),r=t*this.RANK,n=0;n<this.RANK;++n)e[n]=this[r+n];return e}},{key:"setColumn",value:function(t,e){for(var r=t*this.RANK,n=0;n<this.RANK;++n)this[r+n]=e[n];return this}}]),r}(rh);function oh(t,e,r){var n=e[0],i=e[1],o=r[3]*n+r[7]*i||1;return t[0]=(r[0]*n+r[4]*i)/o,t[1]=(r[1]*n+r[5]*i)/o,t}function ah(t,e,r){var n=e[0],i=e[1],o=e[2],a=r[3]*n+r[7]*i+r[11]*o||1;return t[0]=(r[0]*n+r[4]*i+r[8]*o)/a,t[1]=(r[1]*n+r[5]*i+r[9]*o)/a,t[2]=(r[2]*n+r[6]*i+r[10]*o)/a,t}var sh="undefined"!=typeof Float32Array?Float32Array:Array;Math.random;Math.PI;function uh(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=e[6],l=e[7],f=e[8],h=e[9],d=e[10],p=e[11],v=e[12],y=e[13],g=e[14],m=e[15],b=r[0],A=r[1],w=r[2],B=r[3];return t[0]=b*n+A*s+w*f+B*v,t[1]=b*i+A*u+w*h+B*y,t[2]=b*o+A*c+w*d+B*g,t[3]=b*a+A*l+w*p+B*m,b=r[4],A=r[5],w=r[6],B=r[7],t[4]=b*n+A*s+w*f+B*v,t[5]=b*i+A*u+w*h+B*y,t[6]=b*o+A*c+w*d+B*g,t[7]=b*a+A*l+w*p+B*m,b=r[8],A=r[9],w=r[10],B=r[11],t[8]=b*n+A*s+w*f+B*v,t[9]=b*i+A*u+w*h+B*y,t[10]=b*o+A*c+w*d+B*g,t[11]=b*a+A*l+w*p+B*m,b=r[12],A=r[13],w=r[14],B=r[15],t[12]=b*n+A*s+w*f+B*v,t[13]=b*i+A*u+w*h+B*y,t[14]=b*o+A*c+w*d+B*g,t[15]=b*a+A*l+w*p+B*m,t}function ch(t,e,r){var n=r[0],i=r[1],o=r[2];return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,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 lh(t,e){var r=e[0],n=e[1],i=e[2],o=e[4],a=e[5],s=e[6],u=e[8],c=e[9],l=e[10];return t[0]=Math.hypot(r,n,i),t[1]=Math.hypot(o,a,s),t[2]=Math.hypot(u,c,l),t}function fh(t,e,r,n,i){var o,a=1/Math.tan(e/2);return t[0]=a/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,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!=i&&i!==1/0?(o=1/(n-i),t[10]=(i+n)*o,t[14]=2*i*n*o):(t[10]=-1,t[14]=-2*n),t}function hh(t,e,r,n){var i,o,a,s,u,c,l,f,h,d,p=e[0],v=e[1],y=e[2],g=n[0],m=n[1],b=n[2],A=r[0],w=r[1],B=r[2];return Math.abs(p-A)<1e-6&&Math.abs(v-w)<1e-6&&Math.abs(y-B)<1e-6?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):(l=p-A,f=v-w,h=y-B,i=m*(h*=d=1/Math.hypot(l,f,h))-b*(f*=d),o=b*(l*=d)-g*h,a=g*f-m*l,(d=Math.hypot(i,o,a))?(i*=d=1/d,o*=d,a*=d):(i=0,o=0,a=0),s=f*a-h*o,u=h*i-l*a,c=l*o-f*i,(d=Math.hypot(s,u,c))?(s*=d=1/d,u*=d,c*=d):(s=0,u=0,c=0),t[0]=i,t[1]=s,t[2]=l,t[3]=0,t[4]=o,t[5]=u,t[6]=f,t[7]=0,t[8]=a,t[9]=c,t[10]=h,t[11]=0,t[12]=-(i*p+o*v+a*y),t[13]=-(s*p+u*v+c*y),t[14]=-(l*p+f*v+h*y),t[15]=1,t)}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});function dh(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[3]*i+r[6],t[1]=r[1]*n+r[4]*i+r[7],t}function ph(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[4]*i+r[12],t[1]=r[1]*n+r[5]*i+r[13],t}!function(){var t=function(){var t=new sh(2);return sh!=Float32Array&&(t[0]=0,t[1]=0),t}()}();function vh(){var t=new sh(3);return sh!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function yh(t){var e=t[0],r=t[1],n=t[2];return Math.hypot(e,r,n)}function gh(t,e,r){var n=new sh(3);return n[0]=t,n[1]=e,n[2]=r,n}function mh(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function bh(t,e,r){var n=e[0],i=e[1],o=e[2],a=r[0],s=r[1],u=r[2];return t[0]=i*u-o*s,t[1]=o*a-n*u,t[2]=n*s-i*a,t}function Ah(t,e,r){var n=e[0],i=e[1],o=e[2],a=r[3]*n+r[7]*i+r[11]*o+r[15];return a=a||1,t[0]=(r[0]*n+r[4]*i+r[8]*o+r[12])/a,t[1]=(r[1]*n+r[5]*i+r[9]*o+r[13])/a,t[2]=(r[2]*n+r[6]*i+r[10]*o+r[14])/a,t}function wh(t,e,r){var n=e[0],i=e[1],o=e[2];return t[0]=n*r[0]+i*r[3]+o*r[6],t[1]=n*r[1]+i*r[4]+o*r[7],t[2]=n*r[2]+i*r[5]+o*r[8],t}var Bh=yh;!function(){var t=vh()}();function _h(t){var e=t[0],r=t[1],n=t[2],i=t[3];return Math.hypot(e,r,n,i)}function xh(t){var e=t[0],r=t[1],n=t[2],i=t[3];return e*e+r*r+n*n+i*i}function Ch(t,e,r){var n=e[0],i=e[1],o=e[2],a=r[0],s=r[1],u=r[2],c=r[3],l=c*n+s*o-u*i,f=c*i+u*n-a*o,h=c*o+a*i-s*n,d=-a*n-s*i-u*o;return t[0]=l*c+d*-a+f*-u-h*-s,t[1]=f*c+d*-s+h*-a-l*-u,t[2]=h*c+d*-u+l*-s-f*-a,t[3]=e[3],t}!function(){var t=function(){var t=new sh(4);return sh!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}()}();function kh(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Df()(t);if(e){var i=Df()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Pf()(this,r)}}var Eh=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),Oh=Object.freeze([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Th=Object.freeze({COL0ROW0:0,COL0ROW1:1,COL0ROW2:2,COL0ROW3:3,COL1ROW0:4,COL1ROW1:5,COL1ROW2:6,COL1ROW3:7,COL2ROW0:8,COL2ROW1:9,COL2ROW2:10,COL2ROW3:11,COL3ROW0:12,COL3ROW1:13,COL3ROW2:14,COL3ROW3:15}),Sh={},Mh=function(t){If()(r,t);var e=kh(r);function r(t){var n;return ku()(this,r),n=e.call(this,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0),1===arguments.length&&Array.isArray(t)?n.copy(t):n.identity(),n}return Ou()(r,[{key:"INDICES",get:function(){return Th}},{key:"ELEMENTS",get:function(){return 16}},{key:"RANK",get:function(){return 4}},{key:"copy",value:function(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()}},{key:"set",value:function(t,e,r,n,i,o,a,s,u,c,l,f,h,d,p,v){return this[0]=t,this[1]=e,this[2]=r,this[3]=n,this[4]=i,this[5]=o,this[6]=a,this[7]=s,this[8]=u,this[9]=c,this[10]=l,this[11]=f,this[12]=h,this[13]=d,this[14]=p,this[15]=v,this.check()}},{key:"setRowMajor",value:function(t,e,r,n,i,o,a,s,u,c,l,f,h,d,p,v){return this[0]=t,this[1]=i,this[2]=u,this[3]=h,this[4]=e,this[5]=o,this[6]=c,this[7]=d,this[8]=r,this[9]=a,this[10]=l,this[11]=p,this[12]=n,this[13]=s,this[14]=f,this[15]=v,this.check()}},{key:"toRowMajor",value:function(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}},{key:"identity",value:function(){return this.copy(Eh)}},{key:"fromQuaternion",value:function(t){return function(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=r+r,s=n+n,u=i+i,c=r*a,l=n*a,f=n*s,h=i*a,d=i*s,p=i*u,v=o*a,y=o*s,g=o*u;t[0]=1-f-p,t[1]=l+g,t[2]=h-y,t[3]=0,t[4]=l-g,t[5]=1-c-p,t[6]=d+v,t[7]=0,t[8]=h+y,t[9]=d-v,t[10]=1-c-f,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1}(this,t),this.check()}},{key:"frustum",value:function(t){var e=t.left,n=t.right,i=t.bottom,o=t.top,a=t.near,s=t.far;return s===1/0?r._computeInfinitePerspectiveOffCenter(this,e,n,i,o,a):function(t,e,r,n,i,o,a){var s=1/(r-e),u=1/(i-n),c=1/(o-a);t[0]=2*o*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*o*u,t[6]=0,t[7]=0,t[8]=(r+e)*s,t[9]=(i+n)*u,t[10]=(a+o)*c,t[11]=-1,t[12]=0,t[13]=0,t[14]=a*o*2*c,t[15]=0}(this,e,n,i,o,a,s),this.check()}},{key:"lookAt",value:function(t,e,r){if(1===arguments.length){var n=t;t=n.eye,e=n.center,r=n.up}return hh(this,t,e=e||[0,0,0],r=r||[0,1,0]),this.check()}},{key:"ortho",value:function(t){var e=t.left,r=t.right,n=t.bottom,i=t.top,o=t.near,a=void 0===o?.1:o,s=t.far;return function(t,e,r,n,i,o,a){var s=1/(e-r),u=1/(n-i),c=1/(o-a);t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(e+r)*s,t[13]=(i+n)*u,t[14]=(a+o)*c,t[15]=1}(this,e,r,n,i,a,void 0===s?500:s),this.check()}},{key:"orthographic",value:function(t){var e=t.fovy,n=void 0===e?45*Math.PI/180:e,i=t.aspect,o=void 0===i?1:i,a=t.focalDistance,s=void 0===a?1:a,u=t.near,c=void 0===u?.1:u,l=t.far,f=void 0===l?500:l;if(n>2*Math.PI)throw Error("radians");var h=n/2,d=s*Math.tan(h),p=d*o;return(new r).ortho({left:-p,right:p,bottom:-d,top:d,near:c,far:f})}},{key:"perspective",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.fovy,r=void 0===e?void 0:e,n=t.fov,i=void 0===n?45*Math.PI/180:n,o=t.aspect,a=void 0===o?1:o,s=t.near,u=void 0===s?.1:s,c=t.far,l=void 0===c?500:c;if((r=r||i)>2*Math.PI)throw Error("radians");return fh(this,r,a,u,l),this.check()}},{key:"determinant",value:function(){return e=(t=this)[0],r=t[1],n=t[2],i=t[3],o=t[4],a=t[5],s=t[6],u=t[7],c=t[8],l=t[9],f=t[10],h=t[11],d=t[12],p=t[13],v=t[14],y=t[15],(e*a-r*o)*(f*y-h*v)-(e*s-n*o)*(l*y-h*p)+(e*u-i*o)*(l*v-f*p)+(r*s-n*a)*(c*y-h*d)-(r*u-i*a)*(c*v-f*d)+(n*u-i*s)*(c*p-l*d);var t,e,r,n,i,o,a,s,u,c,l,f,h,d,p,v,y}},{key:"getScale",value:function(){var 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}},{key:"getTranslation",value:function(){var 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}},{key:"getRotation",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=this.getScale(e||[-0,-0,-0]),n=1/r[0],i=1/r[1],o=1/r[2];return t[0]=this[0]*n,t[1]=this[1]*i,t[2]=this[2]*o,t[3]=0,t[4]=this[4]*n,t[5]=this[5]*i,t[6]=this[6]*o,t[7]=0,t[8]=this[8]*n,t[9]=this[9]*i,t[10]=this[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}},{key:"getRotationMatrix3",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[-0,-0,-0,-0,-0,-0,-0,-0,-0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=this.getScale(e||[-0,-0,-0]),n=1/r[0],i=1/r[1],o=1/r[2];return t[0]=this[0]*n,t[1]=this[1]*i,t[2]=this[2]*o,t[3]=this[4]*n,t[4]=this[5]*i,t[5]=this[6]*o,t[6]=this[8]*n,t[7]=this[9]*i,t[8]=this[10]*o,t}},{key:"transpose",value:function(){return function(t,e){if(t===e){var r=e[1],n=e[2],i=e[3],o=e[6],a=e[7],s=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=r,t[6]=e[9],t[7]=e[13],t[8]=n,t[9]=o,t[11]=e[14],t[12]=i,t[13]=a,t[14]=s}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]}(this,this),this.check()}},{key:"invert",value:function(){return function(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],c=e[7],l=e[8],f=e[9],h=e[10],d=e[11],p=e[12],v=e[13],y=e[14],g=e[15],m=r*s-n*a,b=r*u-i*a,A=r*c-o*a,w=n*u-i*s,B=n*c-o*s,_=i*c-o*u,x=l*v-f*p,C=l*y-h*p,k=l*g-d*p,E=f*y-h*v,O=f*g-d*v,T=h*g-d*y,S=m*T-b*O+A*E+w*k-B*C+_*x;S&&(S=1/S,t[0]=(s*T-u*O+c*E)*S,t[1]=(i*O-n*T-o*E)*S,t[2]=(v*_-y*B+g*w)*S,t[3]=(h*B-f*_-d*w)*S,t[4]=(u*k-a*T-c*C)*S,t[5]=(r*T-i*k+o*C)*S,t[6]=(y*A-p*_-g*b)*S,t[7]=(l*_-h*A+d*b)*S,t[8]=(a*O-s*k+c*x)*S,t[9]=(n*k-r*O-o*x)*S,t[10]=(p*B-v*A+g*m)*S,t[11]=(f*A-l*B-d*m)*S,t[12]=(s*C-a*E-u*x)*S,t[13]=(r*E-n*C+i*x)*S,t[14]=(v*b-p*w-y*m)*S,t[15]=(l*w-f*b+h*m)*S)}(this,this),this.check()}},{key:"multiplyLeft",value:function(t){return uh(this,t,this),this.check()}},{key:"multiplyRight",value:function(t){return uh(this,this,t),this.check()}},{key:"rotateX",value:function(t){return function(t,e,r){var n=Math.sin(r),i=Math.cos(r),o=e[4],a=e[5],s=e[6],u=e[7],c=e[8],l=e[9],f=e[10],h=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*i+c*n,t[5]=a*i+l*n,t[6]=s*i+f*n,t[7]=u*i+h*n,t[8]=c*i-o*n,t[9]=l*i-a*n,t[10]=f*i-s*n,t[11]=h*i-u*n}(this,this,t),this.check()}},{key:"rotateY",value:function(t){return function(t,e,r){var n=Math.sin(r),i=Math.cos(r),o=e[0],a=e[1],s=e[2],u=e[3],c=e[8],l=e[9],f=e[10],h=e[11];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*i-c*n,t[1]=a*i-l*n,t[2]=s*i-f*n,t[3]=u*i-h*n,t[8]=o*n+c*i,t[9]=a*n+l*i,t[10]=s*n+f*i,t[11]=u*n+h*i}(this,this,t),this.check()}},{key:"rotateZ",value:function(t){return function(t,e,r){var n=Math.sin(r),i=Math.cos(r),o=e[0],a=e[1],s=e[2],u=e[3],c=e[4],l=e[5],f=e[6],h=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*i+c*n,t[1]=a*i+l*n,t[2]=s*i+f*n,t[3]=u*i+h*n,t[4]=c*i-o*n,t[5]=l*i-a*n,t[6]=f*i-s*n,t[7]=h*i-u*n}(this,this,t),this.check()}},{key:"rotateXYZ",value:function(t){var e=Sf()(t,3),r=e[0],n=e[1],i=e[2];return this.rotateX(r).rotateY(n).rotateZ(i)}},{key:"rotateAxis",value:function(t,e){return function(t,e,r,n){var i,o,a,s,u,c,l,f,h,d,p,v,y,g,m,b,A,w,B,_,x,C,k,E,O=n[0],T=n[1],S=n[2],M=Math.hypot(O,T,S);M<1e-6||(O*=M=1/M,T*=M,S*=M,i=Math.sin(r),a=1-(o=Math.cos(r)),s=e[0],u=e[1],c=e[2],l=e[3],f=e[4],h=e[5],d=e[6],p=e[7],v=e[8],y=e[9],g=e[10],m=e[11],b=O*O*a+o,A=T*O*a+S*i,w=S*O*a-T*i,B=O*T*a-S*i,_=T*T*a+o,x=S*T*a+O*i,C=O*S*a+T*i,k=T*S*a-O*i,E=S*S*a+o,t[0]=s*b+f*A+v*w,t[1]=u*b+h*A+y*w,t[2]=c*b+d*A+g*w,t[3]=l*b+p*A+m*w,t[4]=s*B+f*_+v*x,t[5]=u*B+h*_+y*x,t[6]=c*B+d*_+g*x,t[7]=l*B+p*_+m*x,t[8]=s*C+f*k+v*E,t[9]=u*C+h*k+y*E,t[10]=c*C+d*k+g*E,t[11]=l*C+p*k+m*E,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]))}(this,this,t,e),this.check()}},{key:"scale",value:function(t){return Array.isArray(t)?ch(this,this,t):ch(this,this,[t,t,t]),this.check()}},{key:"translate",value:function(t){return function(t,e,r){var n,i,o,a,s,u,c,l,f,h,d,p,v=r[0],y=r[1],g=r[2];e===t?(t[12]=e[0]*v+e[4]*y+e[8]*g+e[12],t[13]=e[1]*v+e[5]*y+e[9]*g+e[13],t[14]=e[2]*v+e[6]*y+e[10]*g+e[14],t[15]=e[3]*v+e[7]*y+e[11]*g+e[15]):(n=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=e[6],l=e[7],f=e[8],h=e[9],d=e[10],p=e[11],t[0]=n,t[1]=i,t[2]=o,t[3]=a,t[4]=s,t[5]=u,t[6]=c,t[7]=l,t[8]=f,t[9]=h,t[10]=d,t[11]=p,t[12]=n*v+s*y+f*g+e[12],t[13]=i*v+u*y+h*g+e[13],t[14]=o*v+c*y+d*g+e[14],t[15]=a*v+l*y+p*g+e[15])}(this,this,t),this.check()}},{key:"transform",value:function(t,e){return 4===t.length?(Zf(e=function(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*o+r[12]*a,t[1]=r[1]*n+r[5]*i+r[9]*o+r[13]*a,t[2]=r[2]*n+r[6]*i+r[10]*o+r[14]*a,t[3]=r[3]*n+r[7]*i+r[11]*o+r[15]*a,t}(e||[-0,-0,-0,-0],t,this),4),e):this.transformAsPoint(t,e)}},{key:"transformAsPoint",value:function(t,e){switch(t.length){case 2:e=ph(e||[-0,-0],t,this);break;case 3:e=Ah(e||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return Zf(e,t.length),e}},{key:"transformAsVector",value:function(t,e){switch(t.length){case 2:e=oh(e||[-0,-0],t,this);break;case 3:e=ah(e||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return Zf(e,t.length),e}},{key:"makeRotationX",value:function(t){return this.identity().rotateX(t)}},{key:"makeTranslation",value:function(t,e,r){return this.identity().translate([t,e,r])}},{key:"transformPoint",value:function(t,e){return th("Matrix4.transformPoint","3.0"),this.transformAsPoint(t,e)}},{key:"transformVector",value:function(t,e){return th("Matrix4.transformVector","3.0"),this.transformAsPoint(t,e)}},{key:"transformDirection",value:function(t,e){return th("Matrix4.transformDirection","3.0"),this.transformAsVector(t,e)}}],[{key:"IDENTITY",get:function(){return Sh.IDENTITY=Sh.IDENTITY||Object.freeze(new r(Eh)),Sh.IDENTITY}},{key:"ZERO",get:function(){return Sh.ZERO=Sh.ZERO||Object.freeze(new r(Oh)),Sh.ZERO}},{key:"_computeInfinitePerspectiveOffCenter",value:function(t,e,r,n,i,o){var a=2*o/(r-e),s=2*o/(i-n),u=(r+e)/(r-e),c=(i+n)/(i-n),l=-2*o;return t[0]=a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=s,t[6]=0,t[7]=0,t[8]=u,t[9]=c,t[10]=-1,t[11]=-1,t[12]=0,t[13]=0,t[14]=l,t[15]=0,t}}]),r}(ih);function Ih(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Df()(t);if(e){var i=Df()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Pf()(this,r)}}var Rh=function(t){If()(r,t);var e=Ih(r);function r(){return ku()(this,r),e.apply(this,arguments)}return Ou()(r,[{key:"ELEMENTS",get:function(){return Lf(!1),0}},{key:"copy",value:function(t){return Lf(!1),this}},{key:"x",get:function(){return this[0]},set:function(t){this[0]=Yf(t)}},{key:"y",get:function(){return this[1]},set:function(t){this[1]=Yf(t)}},{key:"len",value:function(){return Math.sqrt(this.lengthSquared())}},{key:"magnitude",value:function(){return this.len()}},{key:"lengthSquared",value:function(){for(var t=0,e=0;e<this.ELEMENTS;++e)t+=this[e]*this[e];return t}},{key:"magnitudeSquared",value:function(){return this.lengthSquared()}},{key:"distance",value:function(t){return Math.sqrt(this.distanceSquared(t))}},{key:"distanceSquared",value:function(t){for(var e=0,r=0;r<this.ELEMENTS;++r){var n=this[r]-t[r];e+=n*n}return Yf(e)}},{key:"dot",value:function(t){for(var e=0,r=0;r<this.ELEMENTS;++r)e+=this[r]*t[r];return Yf(e)}},{key:"normalize",value:function(){var t=this.magnitude();if(0!==t)for(var e=0;e<this.ELEMENTS;++e)this[e]/=t;return this.check()}},{key:"multiply",value:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];for(var n=0,i=e;n<i.length;n++)for(var o=i[n],a=0;a<this.ELEMENTS;++a)this[a]*=o[a];return this.check()}},{key:"divide",value:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];for(var n=0,i=e;n<i.length;n++)for(var o=i[n],a=0;a<this.ELEMENTS;++a)this[a]/=o[a];return this.check()}},{key:"lengthSq",value:function(){return this.lengthSquared()}},{key:"distanceTo",value:function(t){return this.distance(t)}},{key:"distanceToSquared",value:function(t){return this.distanceSquared(t)}},{key:"getComponent",value:function(t){return Lf(t>=0&&t<this.ELEMENTS,"index is out of range"),Yf(this[t])}},{key:"setComponent",value:function(t,e){return Lf(t>=0&&t<this.ELEMENTS,"index is out of range"),this[t]=e,this.check()}},{key:"addVectors",value:function(t,e){return this.copy(t).add(e)}},{key:"subVectors",value:function(t,e){return this.copy(t).subtract(e)}},{key:"multiplyVectors",value:function(t,e){return this.copy(t).multiply(e)}},{key:"addScaledVector",value:function(t,e){return this.add(new this.constructor(t).multiplyScalar(e))}}]),r}(rh);function Ph(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Df()(t);if(e){var i=Df()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Pf()(this,r)}}var Fh=[0,0,0],Dh={},Lh=function(t){If()(r,t);var e=Ph(r);function r(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return ku()(this,r),t=e.call(this,-0,-0,-0),1===arguments.length&&Vf(n)?t.copy(n):(Nf.debug&&(Yf(n),Yf(i),Yf(o)),t[0]=n,t[1]=i,t[2]=o),t}return Ou()(r,[{key:"set",value:function(t,e,r){return this[0]=t,this[1]=e,this[2]=r,this.check()}},{key:"copy",value:function(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this.check()}},{key:"fromObject",value:function(t){return Nf.debug&&(Yf(t.x),Yf(t.y),Yf(t.z)),this[0]=t.x,this[1]=t.y,this[2]=t.z,this.check()}},{key:"toObject",value:function(t){return t.x=this[0],t.y=this[1],t.z=this[2],t}},{key:"ELEMENTS",get:function(){return 3}},{key:"z",get:function(){return this[2]},set:function(t){this[2]=Yf(t)}},{key:"angle",value:function(t){return r=t,n=(e=this)[0],i=e[1],o=e[2],a=r[0],s=r[1],u=r[2],c=Math.sqrt(n*n+i*i+o*o)*Math.sqrt(a*a+s*s+u*u),l=c&&mh(e,r)/c,Math.acos(Math.min(Math.max(l,-1),1));var e,r,n,i,o,a,s,u,c,l}},{key:"cross",value:function(t){return bh(this,this,t),this.check()}},{key:"rotateX",value:function(t){var e=t.radians,r=t.origin;return function(t,e,r,n){var i=[],o=[];i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],o[0]=i[0],o[1]=i[1]*Math.cos(n)-i[2]*Math.sin(n),o[2]=i[1]*Math.sin(n)+i[2]*Math.cos(n),t[0]=o[0]+r[0],t[1]=o[1]+r[1],t[2]=o[2]+r[2]}(this,this,void 0===r?Fh:r,e),this.check()}},{key:"rotateY",value:function(t){var e=t.radians,r=t.origin;return function(t,e,r,n){var i=[],o=[];i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],o[0]=i[2]*Math.sin(n)+i[0]*Math.cos(n),o[1]=i[1],o[2]=i[2]*Math.cos(n)-i[0]*Math.sin(n),t[0]=o[0]+r[0],t[1]=o[1]+r[1],t[2]=o[2]+r[2]}(this,this,void 0===r?Fh:r,e),this.check()}},{key:"rotateZ",value:function(t){var e=t.radians,r=t.origin;return function(t,e,r,n){var i=[],o=[];i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],o[0]=i[0]*Math.cos(n)-i[1]*Math.sin(n),o[1]=i[0]*Math.sin(n)+i[1]*Math.cos(n),o[2]=i[2],t[0]=o[0]+r[0],t[1]=o[1]+r[1],t[2]=o[2]+r[2]}(this,this,void 0===r?Fh:r,e),this.check()}},{key:"transform",value:function(t){return this.transformAsPoint(t)}},{key:"transformAsPoint",value:function(t){return Ah(this,this,t),this.check()}},{key:"transformAsVector",value:function(t){return ah(this,this,t),this.check()}},{key:"transformByMatrix3",value:function(t){return wh(this,this,t),this.check()}},{key:"transformByMatrix2",value:function(t){return function(t,e,r){var n=e[0],i=e[1];t[0]=r[0]*n+r[2]*i,t[1]=r[1]*n+r[3]*i,t[2]=e[2]}(this,this,t),this.check()}},{key:"transformByQuaternion",value:function(t){return function(t,e,r){var n=r[0],i=r[1],o=r[2],a=r[3],s=e[0],u=e[1],c=e[2],l=i*c-o*u,f=o*s-n*c,h=n*u-i*s,d=i*h-o*f,p=o*l-n*h,v=n*f-i*l,y=2*a;l*=y,f*=y,h*=y,d*=2,p*=2,v*=2,t[0]=s+l+d,t[1]=u+f+p,t[2]=c+h+v}(this,this,t),this.check()}}],[{key:"ZERO",get:function(){return Dh.ZERO=Dh.ZERO||Object.freeze(new r(0,0,0,0))}}]),r}(Rh),jh=.1,Gh=1e-12,Nh=1e-15,Uh=(Math.PI,Math.PI,Math.PI,Math.PI,Math.max(6378137,6378137,6356752.314245179),function(t){return t}),Hh=new Lh;function Vh(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Uh;return Vf(t)?(e[0]=r(t[0]),e[1]=r(t[1]),e[2]=t[2]):"longitude"in t?(e[0]=r(t.longitude),e[1]=r(t.latitude),e[2]=t.height):(e[0]=r(t.x),e[1]=r(t.y),e[2]=t.z),e}function Jh(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Hh;return Vh(t,e,Nf._cartographicRadians?Uh:zf)}function zh(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Uh;return Vf(e)?(e[0]=r(t[0]),e[1]=r(t[1]),e[2]=t[2]):"longitude"in e?(e.longitude=r(t[0]),e.latitude=r(t[1]),e.height=t[2]):(e.x=r(t[0]),e.y=r(t[1]),e.z=t[2]),e}function Kh(t,e){return zh(t,e,Nf._cartographicRadians?Uh:Kf)}var qh=new Lh,Wh=new Lh,Qh=new Lh;var Xh=new Lh,Yh={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"}},Zh={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},$h={east:new Lh,north:new Lh,up:new Lh,west:new Lh,south:new Lh,down:new Lh},td=new Lh,ed=new Lh,rd=new Lh;function nd(t,e,r,n,i,o){var a,s,u,c=Yh[e]&&Yh[e][r];Lf(c&&(!n||n===c));var l=Xh.copy(i);if(Qf(l.x,0,1e-14)&&Qf(l.y,0,1e-14)){var f=Math.sign(l.z);a=td.fromArray(Zh[e]),"east"!==e&&"west"!==e&&a.scale(f),s=ed.fromArray(Zh[r]),"east"!==r&&"west"!==r&&s.scale(f),u=rd.fromArray(Zh[n]),"east"!==n&&"west"!==n&&u.scale(f)}else{var h=$h.up,d=$h.east,p=$h.north;d.set(-l.y,l.x,0).normalize(),t.geodeticSurfaceNormal(l,h),p.copy(h).cross(d);var v=$h.west,y=$h.south;$h.down.copy(h).scale(-1),v.copy(d).scale(-1),y.copy(p).scale(-1),a=$h[e],s=$h[r],u=$h[n]}return o[0]=a.x,o[1]=a.y,o[2]=a.z,o[3]=0,o[4]=s.x,o[5]=s.y,o[6]=s.z,o[7]=0,o[8]=u.x,o[9]=u.y,o[10]=u.z,o[11]=0,o[12]=l.x,o[13]=l.y,o[14]=l.z,o[15]=1,o}var id,od=new Lh,ad=new Lh,sd=new Lh,ud=new Lh,cd=new Lh,ld=new Lh,fd=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;ku()(this,t),Lf(e>=0),Lf(r>=0),Lf(n>=0),this.radii=new Lh(e,r,n),this.radiiSquared=new Lh(e*e,r*r,n*n),this.radiiToTheFourth=new Lh(e*e*e*e,r*r*r*r,n*n*n*n),this.oneOverRadii=new Lh(0===e?0:1/e,0===r?0:1/r,0===n?0:1/n),this.oneOverRadiiSquared=new Lh(0===e?0:1/(e*e),0===r?0:1/(r*r),0===n?0:1/(n*n)),this.minimumRadius=Math.min(e,r,n),this.maximumRadius=Math.max(e,r,n),this.centerToleranceSquared=jh,0!==this.radiiSquared.z&&(this.squaredXOverSquaredZ=this.radiiSquared.x/this.radiiSquared.z),Object.freeze(this)}return Ou()(t,[{key:"equals",value:function(t){return this===t||Boolean(t&&this.radii.equals(t.radii))}},{key:"toString",value:function(){return this.radii.toString()}},{key:"cartographicToCartesian",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0],r=ad,n=sd,i=Sf()(t,3),o=i[2];this.geodeticSurfaceNormalCartographic(t,r),n.copy(this.radiiSquared).scale(r);var a=Math.sqrt(r.dot(n));return n.scale(1/a),r.scale(o),n.add(r),n.to(e)}},{key:"cartesianToCartographic",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];ld.from(t);var r=this.scaleToGeodeticSurface(ld,ud);if(r){var n=this.geodeticSurfaceNormal(r,ad),i=cd;i.copy(ld).subtract(r);var o=Math.atan2(n.y,n.x),a=Math.asin(n.z),s=Math.sign(mh(i,ld))*yh(i);return Kh([o,a,s],e)}}},{key:"eastNorthUpToFixedFrame",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Mh;return nd(this,"east","north","up",t,e)}},{key:"localFrameToFixedFrame",value:function(t,e,r,n){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:new Mh;return nd(this,t,e,r,n,i)}},{key:"geocentricSurfaceNormal",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];return od.from(t).normalize().to(e)}},{key:"geodeticSurfaceNormalCartographic",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0],r=Jh(t),n=r[0],i=r[1],o=Math.cos(i);return od.set(o*Math.cos(n),o*Math.sin(n),Math.sin(i)).normalize(),od.to(e)}},{key:"geodeticSurfaceNormal",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];return od.from(t).scale(this.oneOverRadiiSquared).normalize().to(e)}},{key:"scaleToGeodeticSurface",value:function(t,e){return function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Lh,n=e.oneOverRadii,i=e.oneOverRadiiSquared,o=e.centerToleranceSquared;qh.from(t);var a=t.x,s=t.y,u=t.z,c=n.x,l=n.y,f=n.z,h=a*a*c*c,d=s*s*l*l,p=u*u*f*f,v=h+d+p,y=Math.sqrt(1/v);if(Number.isFinite(y)){var g=Wh;if(g.copy(t).scale(y),v<o)return g.to(r);var m=i.x,b=i.y,A=i.z,w=Qh;w.set(g.x*m*2,g.y*b*2,g.z*A*2);var B,_,x,C,k=(1-y)*t.len()/(.5*w.len()),E=0;do{var O=(B=1/(1+(k-=E)*m))*B,T=(_=1/(1+k*b))*_,S=(x=1/(1+k*A))*x,M=O*B,I=T*_,R=S*x,P=h*M*m+d*I*b+p*R*A,F=-2*P;E=(C=h*O+d*T+p*S-1)/F}while(Math.abs(C)>Gh);return qh.scale([B,_,x]).to(r)}}(t,this,e)}},{key:"scaleToGeocentricSurface",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];ud.from(t);var r=ud.x,n=ud.y,i=ud.z,o=this.oneOverRadiiSquared,a=1/Math.sqrt(r*r*o.x+n*n*o.y+i*i*o.z);return ud.multiplyScalar(a).to(e)}},{key:"transformPositionToScaledSpace",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];return ud.from(t).scale(this.oneOverRadii).to(e)}},{key:"transformPositionFromScaledSpace",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];return ud.from(t).scale(this.radii).to(e)}},{key:"getSurfaceNormalIntersectionWithZAxis",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[0,0,0];Lf(Qf(this.radii.x,this.radii.y,Nh)),Lf(this.radii.z>0),ud.from(t);var n=ud.z*(1-this.squaredXOverSquaredZ);if(!(Math.abs(n)>=this.radii.z-e))return ud.set(0,0,n).to(r)}}],[{key:"WGS84",get:function(){return id=id||new t(6378137,6378137,6356752.314245179)}}]),t}();function hd(){var t;if("undefined"!=typeof window&&window.performance)t=window.performance.now();else if("undefined"!=typeof process&&process.hrtime){var e=process.hrtime();t=1e3*e[0]+e[1]/1e6}else t=Date.now();return t}var dd=function(){function t(e,r){ku()(this,t),Tu(this,"name",void 0),Tu(this,"type",void 0),Tu(this,"sampleSize",1),Tu(this,"time",void 0),Tu(this,"count",void 0),Tu(this,"samples",void 0),Tu(this,"lastTiming",void 0),Tu(this,"lastSampleTime",void 0),Tu(this,"lastSampleCount",void 0),Tu(this,"_count",0),Tu(this,"_time",0),Tu(this,"_samples",0),Tu(this,"_startTime",0),Tu(this,"_timerPending",!1),this.name=e,this.type=r,this.reset()}return Ou()(t,[{key:"setSampleSize",value:function(t){return this.sampleSize=t,this}},{key:"incrementCount",value:function(){return this.addCount(1),this}},{key:"decrementCount",value:function(){return this.subtractCount(1),this}},{key:"addCount",value:function(t){return this._count+=t,this._samples++,this._checkSampling(),this}},{key:"subtractCount",value:function(t){return this._count-=t,this._samples++,this._checkSampling(),this}},{key:"addTime",value:function(t){return this._time+=t,this.lastTiming=t,this._samples++,this._checkSampling(),this}},{key:"timeStart",value:function(){return this._startTime=hd(),this._timerPending=!0,this}},{key:"timeEnd",value:function(){return this._timerPending?(this.addTime(hd()-this._startTime),this._timerPending=!1,this._checkSampling(),this):this}},{key:"getSampleAverageCount",value:function(){return this.sampleSize>0?this.lastSampleCount/this.sampleSize:0}},{key:"getSampleAverageTime",value:function(){return this.sampleSize>0?this.lastSampleTime/this.sampleSize:0}},{key:"getSampleHz",value:function(){return this.lastSampleTime>0?this.sampleSize/(this.lastSampleTime/1e3):0}},{key:"getAverageCount",value:function(){return this.samples>0?this.count/this.samples:0}},{key:"getAverageTime",value:function(){return this.samples>0?this.time/this.samples:0}},{key:"getHz",value:function(){return this.time>0?this.samples/(this.time/1e3):0}},{key:"reset",value:function(){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}},{key:"_checkSampling",value:function(){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)}}]),t}(),pd=function(){function t(e){ku()(this,t),Tu(this,"id",void 0),Tu(this,"stats",{}),this.id=e.id,this.stats={},this._initializeStats(e.stats),Object.seal(this)}return Ou()(t,[{key:"get",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"count";return this._getOrCreate({name:t,type:e})}},{key:"size",get:function(){return Object.keys(this.stats).length}},{key:"reset",value:function(){for(var t in this.stats)this.stats[t].reset();return this}},{key:"forEach",value:function(t){for(var e in this.stats)t(this.stats[e])}},{key:"getTable",value:function(){var t={};return this.forEach((function(e){t[e.name]={time:e.time||0,count:e.count||0,average:e.getAverageTime()||0,hz:e.getHz()||0}})),t}},{key:"_initializeStats",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];e.forEach((function(e){return t._getOrCreate(e)}))}},{key:"_getOrCreate",value:function(t){if(!t||!t.name)return null;var e=t.name,r=t.type;return this.stats[e]||(this.stats[e]=t instanceof dd?t:new dd(e,r)),this.stats[e]}}]),t}();function vd(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function yd(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?vd(Object(r),!0).forEach((function(e){Ys()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):vd(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var gd={id:"request-scheduler",throttleRequests:!0,maxRequests:6},md=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};ku()(this,t),Tu(this,"props",void 0),Tu(this,"stats",void 0),Tu(this,"activeRequestCount",0),Tu(this,"requestQueue",[]),Tu(this,"requestMap",new Map),Tu(this,"deferredUpdate",null),this.props=yd(yd({},gd),e),this.stats=new pd({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")}return Ou()(t,[{key:"scheduleRequest",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){return 0};if(!this.props.throttleRequests)return Promise.resolve({done:function(){}});if(this.requestMap.has(t))return this.requestMap.get(t);var r={handle:t,priority:0,getPriority:e},n=new Promise((function(t){return r.resolve=t,r}));return this.requestQueue.push(r),this.requestMap.set(t,n),this._issueNewRequests(),n}},{key:"_issueRequest",value:function(t){var e=this,r=t.handle,n=t.resolve,i=!1,o=function(){i||(i=!0,e.requestMap.delete(r),e.activeRequestCount--,e._issueNewRequests())};return this.activeRequestCount++,n?n({done:o}):Promise.resolve({done:o})}},{key:"_issueNewRequests",value:function(){var t=this;this.deferredUpdate||(this.deferredUpdate=setTimeout((function(){return t._issueNewRequestsAsync()}),0))}},{key:"_issueNewRequestsAsync",value:function(){this.deferredUpdate=null;var t=Math.max(this.props.maxRequests-this.activeRequestCount,0);if(0!==t){this._updateAllRequests();for(var e=0;e<t;++e){var r=this.requestQueue.shift();r&&this._issueRequest(r)}}}},{key:"_updateAllRequests",value:function(){for(var t=this.requestQueue,e=0;e<t.length;++e){var r=t[e];this._updateRequest(r)||(t.splice(e,1),this.requestMap.delete(r.handle),e--)}t.sort((function(t,e){return t.priority-e.priority}))}},{key:"_updateRequest",value:function(t){return t.priority=t.getPriority(t.handle),!(t.priority<0)||(t.resolve(null),!1)}}]),t}(),bd=function t(e,r,n){ku()(this,t),Tu(this,"item",void 0),Tu(this,"previous",void 0),Tu(this,"next",void 0),this.item=e,this.previous=r,this.next=n},Ad=function(){function t(){ku()(this,t),Tu(this,"head",null),Tu(this,"tail",null),Tu(this,"_length",0)}return Ou()(t,[{key:"length",get:function(){return this._length}},{key:"add",value:function(t){var e=new bd(t,this.tail,null);return this.tail?(this.tail.next=e,this.tail=e):(this.head=e,this.tail=e),++this._length,e}},{key:"remove",value:function(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)}},{key:"splice",value:function(t,e){t!==e&&(this.remove(e),this._insert(t,e))}},{key:"_insert",value:function(t,e){var r=t.next;t.next=e,this.tail===t?this.tail=e:r.previous=e,e.next=r,e.previous=t,++this._length}}]),t}();function wd(t){return null!=t}var Bd=function(){function t(){ku()(this,t),Tu(this,"_list",void 0),Tu(this,"_sentinel",void 0),Tu(this,"_trimTiles",void 0),this._list=new Ad,this._sentinel=this._list.add("sentinel"),this._trimTiles=!1}return Ou()(t,[{key:"reset",value:function(){this._list.splice(this._list.tail,this._sentinel)}},{key:"touch",value:function(t){var e=t._cacheNode;wd(e)&&this._list.splice(this._sentinel,e)}},{key:"add",value:function(t,e,r){wd(e._cacheNode)||(e._cacheNode=this._list.add(e),r&&r(t,e))}},{key:"unloadTile",value:function(t,e,r){var n=e._cacheNode;wd(n)&&(this._list.remove(n),e._cacheNode=void 0,r&&r(t,e))}},{key:"unloadTiles",value:function(t,e){var r=this._trimTiles;this._trimTiles=!1;for(var n=this._list,i=1024*t.maximumMemoryUsage*1024,o=this._sentinel,a=n.head;a!==o&&(t.gpuMemoryUsageInBytes>i||r);){var s=a.item;a=a.next,this.unloadTile(t,s,e)}}},{key:"trim",value:function(){this._trimTiles=!0}}]),t}();var _d=Object.freeze({OUTSIDE:-1,INTERSECTING:0,INSIDE:1}),xd=(new Lh,new Lh,new Lh),Cd=new Lh,kd=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[0,0,0],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;ku()(this,t),this.radius=-0,this.center=new Lh,this.fromCenterRadius(e,r)}return Ou()(t,[{key:"fromCenterRadius",value:function(t,e){return this.center.from(t),this.radius=e,this}},{key:"fromCornerPoints",value:function(t,e){return e=xd.from(e),this.center=(new Lh).from(t).add(e).scale(.5),this.radius=this.center.distance(e),this}},{key:"equals",value:function(t){return this===t||Boolean(t)&&this.center.equals(t.center)&&this.radius===t.radius}},{key:"clone",value:function(){return new t(this.center,this.radius)}},{key:"union",value:function(t){var e=this.center,r=this.radius,n=t.center,i=t.radius,o=xd.copy(n).subtract(e),a=o.magnitude();if(r>=a+i)return this.clone();if(i>=a+r)return t.clone();var s=.5*(r+a+i);return Cd.copy(o).scale((-r+s)/a).add(e),this.center.copy(Cd),this.radius=s,this}},{key:"expand",value:function(t){var e=(t=xd.from(t)).subtract(this.center).magnitude();return e>this.radius&&(this.radius=e),this}},{key:"transform",value:function(t){this.center.transform(t);var e=lh(xd,t);return this.radius=Math.max(e[0],Math.max(e[1],e[2]))*this.radius,this}},{key:"distanceSquaredTo",value:function(t){return(t=xd.from(t)).subtract(this.center).lengthSquared()-this.radius*this.radius}},{key:"distanceTo",value:function(t){return Math.sqrt(this.distanceSquaredTo(t))}},{key:"intersectPlane",value:function(t){var e=this.center,r=this.radius,n=t.normal.dot(e)+t.distance;return n<-r?_d.OUTSIDE:n<r?_d.INTERSECTING:_d.INSIDE}}]),t}();function Ed(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=e[6],l=e[7],f=e[8],h=r[0],d=r[1],p=r[2],v=r[3],y=r[4],g=r[5],m=r[6],b=r[7],A=r[8];return t[0]=h*n+d*a+p*c,t[1]=h*i+d*s+p*l,t[2]=h*o+d*u+p*f,t[3]=v*n+y*a+g*c,t[4]=v*i+y*s+g*l,t[5]=v*o+y*u+g*f,t[6]=m*n+b*a+A*c,t[7]=m*i+b*s+A*l,t[8]=m*o+b*u+A*f,t}function Od(t,e,r){var n=r[0],i=r[1];return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=i*e[3],t[4]=i*e[4],t[5]=i*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function Td(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Df()(t);if(e){var i=Df()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Pf()(this,r)}}var Sd=Object.freeze([1,0,0,0,1,0,0,0,1]),Md=Object.freeze([0,0,0,0,0,0,0,0,0]),Id=Object.freeze({COL0ROW0:0,COL0ROW1:1,COL0ROW2:2,COL1ROW0:3,COL1ROW1:4,COL1ROW2:5,COL2ROW0:6,COL2ROW1:7,COL2ROW2:8}),Rd={},Pd=function(t){If()(r,t);var e=Td(r);function r(t){var n;return ku()(this,r),n=e.call(this,-0,-0,-0,-0,-0,-0,-0,-0,-0),1===arguments.length&&Array.isArray(t)?n.copy(t):n.identity(),n}return Ou()(r,[{key:"ELEMENTS",get:function(){return 9}},{key:"RANK",get:function(){return 3}},{key:"INDICES",get:function(){return Id}},{key:"copy",value:function(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()}},{key:"set",value:function(t,e,r,n,i,o,a,s,u){return this[0]=t,this[1]=e,this[2]=r,this[3]=n,this[4]=i,this[5]=o,this[6]=a,this[7]=s,this[8]=u,this.check()}},{key:"setRowMajor",value:function(t,e,r,n,i,o,a,s,u){return this[0]=t,this[1]=n,this[2]=a,this[3]=e,this[4]=i,this[5]=s,this[6]=r,this[7]=o,this[8]=u,this.check()}},{key:"determinant",value:function(){return e=(t=this)[0],r=t[1],n=t[2],i=t[3],o=t[4],a=t[5],s=t[6],u=t[7],c=t[8],e*(c*o-a*u)+r*(-c*i+a*s)+n*(u*i-o*s);var t,e,r,n,i,o,a,s,u,c}},{key:"identity",value:function(){return this.copy(Sd)}},{key:"fromQuaternion",value:function(t){return function(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=r+r,s=n+n,u=i+i,c=r*a,l=n*a,f=n*s,h=i*a,d=i*s,p=i*u,v=o*a,y=o*s,g=o*u;t[0]=1-f-p,t[3]=l-g,t[6]=h+y,t[1]=l+g,t[4]=1-c-p,t[7]=d-v,t[2]=h-y,t[5]=d+v,t[8]=1-c-f}(this,t),this.check()}},{key:"transpose",value:function(){return function(t,e){if(t===e){var r=e[1],n=e[2],i=e[5];t[1]=e[3],t[2]=e[6],t[3]=r,t[5]=e[7],t[6]=n,t[7]=i}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]}(this,this),this.check()}},{key:"invert",value:function(){return function(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],c=e[7],l=e[8],f=l*a-s*c,h=-l*o+s*u,d=c*o-a*u,p=r*f+n*h+i*d;p&&(p=1/p,t[0]=f*p,t[1]=(-l*n+i*c)*p,t[2]=(s*n-i*a)*p,t[3]=h*p,t[4]=(l*r-i*u)*p,t[5]=(-s*r+i*o)*p,t[6]=d*p,t[7]=(-c*r+n*u)*p,t[8]=(a*r-n*o)*p)}(this,this),this.check()}},{key:"multiplyLeft",value:function(t){return Ed(this,t,this),this.check()}},{key:"multiplyRight",value:function(t){return Ed(this,this,t),this.check()}},{key:"rotate",value:function(t){return function(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=e[6],l=e[7],f=e[8],h=Math.sin(r),d=Math.cos(r);t[0]=d*n+h*a,t[1]=d*i+h*s,t[2]=d*o+h*u,t[3]=d*a-h*n,t[4]=d*s-h*i,t[5]=d*u-h*o,t[6]=c,t[7]=l,t[8]=f}(this,this,t),this.check()}},{key:"scale",value:function(t){return Array.isArray(t)?Od(this,this,t):Od(this,this,[t,t,t]),this.check()}},{key:"translate",value:function(t){return function(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=e[6],l=e[7],f=e[8],h=r[0],d=r[1];t[0]=n,t[1]=i,t[2]=o,t[3]=a,t[4]=s,t[5]=u,t[6]=h*n+d*a+c,t[7]=h*i+d*s+l,t[8]=h*o+d*u+f}(this,this,t),this.check()}},{key:"transform",value:function(t,e){switch(t.length){case 2:e=dh(e||[-0,-0],t,this);break;case 3:e=wh(e||[-0,-0,-0],t,this);break;case 4:e=function(t,e,r){var n=e[0],i=e[1],o=e[2];return t[0]=r[0]*n+r[3]*i+r[6]*o,t[1]=r[1]*n+r[4]*i+r[7]*o,t[2]=r[2]*n+r[5]*i+r[8]*o,t[3]=e[3],t}(e||[-0,-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return Zf(e,t.length),e}},{key:"transformVector",value:function(t,e){return th("Matrix3.transformVector"),this.transform(t,e)}},{key:"transformVector2",value:function(t,e){return th("Matrix3.transformVector"),this.transform(t,e)}},{key:"transformVector3",value:function(t,e){return th("Matrix3.transformVector"),this.transform(t,e)}}],[{key:"IDENTITY",get:function(){return Rd.IDENTITY=Rd.IDENTITY||Object.freeze(new r(Sd)),Rd.IDENTITY}},{key:"ZERO",get:function(){return Rd.ZERO=Rd.ZERO||Object.freeze(new r(Md)),Rd.ZERO}}]),r}(ih);function Fd(){var t=new sh(4);return sh!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function Dd(t,e,r){r*=.5;var n=Math.sin(r);return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=Math.cos(r),t}function Ld(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=r[0],u=r[1],c=r[2],l=r[3];return t[0]=n*l+a*s+i*c-o*u,t[1]=i*l+a*u+o*s-n*c,t[2]=o*l+a*c+n*u-i*s,t[3]=a*l-n*s-i*u-o*c,t}function jd(t,e,r,n){var i,o,a,s,u,c=e[0],l=e[1],f=e[2],h=e[3],d=r[0],p=r[1],v=r[2],y=r[3];return(o=c*d+l*p+f*v+h*y)<0&&(o=-o,d=-d,p=-p,v=-v,y=-y),1-o>1e-6?(i=Math.acos(o),a=Math.sin(i),s=Math.sin((1-n)*i)/a,u=Math.sin(n*i)/a):(s=1-n,u=n),t[0]=s*c+u*d,t[1]=s*l+u*p,t[2]=s*f+u*v,t[3]=s*h+u*y,t}function Gd(t,e){var r,n=e[0]+e[4]+e[8];if(n>0)r=Math.sqrt(n+1),t[3]=.5*r,r=.5/r,t[0]=(e[5]-e[7])*r,t[1]=(e[6]-e[2])*r,t[2]=(e[1]-e[3])*r;else{var i=0;e[4]>e[0]&&(i=1),e[8]>e[3*i+i]&&(i=2);var o=(i+1)%3,a=(i+2)%3;r=Math.sqrt(e[3*i+i]-e[3*o+o]-e[3*a+a]+1),t[i]=.5*r,r=.5/r,t[3]=(e[3*o+a]-e[3*a+o])*r,t[o]=(e[3*o+i]+e[3*i+o])*r,t[a]=(e[3*a+i]+e[3*i+a])*r}return t}var Nd=function(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t},Ud=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t},Hd=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]},Vd=function(t,e,r,n){var i=e[0],o=e[1],a=e[2],s=e[3];return t[0]=i+n*(r[0]-i),t[1]=o+n*(r[1]-o),t[2]=a+n*(r[2]-a),t[3]=s+n*(r[3]-s),t},Jd=_h,zd=xh,Kd=function(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=r*r+n*n+i*i+o*o;return a>0&&(a=1/Math.sqrt(a)),t[0]=r*a,t[1]=n*a,t[2]=i*a,t[3]=o*a,t},qd=function(){var t=vh(),e=gh(1,0,0),r=gh(0,1,0);return function(n,i,o){var a=mh(i,o);return a<-.999999?(bh(t,e,i),Bh(t)<1e-6&&bh(t,r,i),function(t,e){var r=e[0],n=e[1],i=e[2],o=r*r+n*n+i*i;o>0&&(o=1/Math.sqrt(o)),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o}(t,t),Dd(n,t,Math.PI),n):a>.999999?(n[0]=0,n[1]=0,n[2]=0,n[3]=1,n):(bh(t,i,o),n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=1+a,Kd(n,n))}}();(function(){var t=Fd(),e=Fd()})(),function(){var t=function(){var t=new sh(9);return sh!=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 Wd(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Df()(t);if(e){var i=Df()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Pf()(this,r)}}var Qd=[0,0,0,1],Xd=function(t){If()(r,t);var e=Wd(r);function r(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;return ku()(this,r),t=e.call(this,-0,-0,-0,-0),Array.isArray(n)&&1===arguments.length?t.copy(n):t.set(n,i,o,a),t}return Ou()(r,[{key:"copy",value:function(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this.check()}},{key:"set",value:function(t,e,r,n){return this[0]=t,this[1]=e,this[2]=r,this[3]=n,this.check()}},{key:"fromMatrix3",value:function(t){return Gd(this,t),this.check()}},{key:"identity",value:function(){return function(t){t[0]=0,t[1]=0,t[2]=0,t[3]=1}(this),this.check()}},{key:"fromAxisRotation",value:function(t,e){return Dd(this,t,e),this.check()}},{key:"setAxisAngle",value:function(t,e){return this.fromAxisRotation(t,e)}},{key:"ELEMENTS",get:function(){return 4}},{key:"x",get:function(){return this[0]},set:function(t){this[0]=Yf(t)}},{key:"y",get:function(){return this[1]},set:function(t){this[1]=Yf(t)}},{key:"z",get:function(){return this[2]},set:function(t){this[2]=Yf(t)}},{key:"w",get:function(){return this[3]},set:function(t){this[3]=Yf(t)}},{key:"len",value:function(){return Jd(this)}},{key:"lengthSquared",value:function(){return zd(this)}},{key:"dot",value:function(t,e){if(void 0!==e)throw new Error("Quaternion.dot only takes one argument");return Hd(this,t)}},{key:"rotationTo",value:function(t,e){return qd(this,t,e),this.check()}},{key:"add",value:function(t,e){if(void 0!==e)throw new Error("Quaternion.add only takes one argument");return Nd(this,this,t),this.check()}},{key:"calculateW",value:function(){return function(t,e){var r=e[0],n=e[1],i=e[2];t[0]=r,t[1]=n,t[2]=i,t[3]=Math.sqrt(Math.abs(1-r*r-n*n-i*i))}(this,this),this.check()}},{key:"conjugate",value:function(){return function(t,e){t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3]}(this,this),this.check()}},{key:"invert",value:function(){return function(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=r*r+n*n+i*i+o*o,s=a?1/a:0;t[0]=-r*s,t[1]=-n*s,t[2]=-i*s,t[3]=o*s}(this,this),this.check()}},{key:"lerp",value:function(t,e,r){return Vd(this,t,e,r),this.check()}},{key:"multiplyRight",value:function(t,e){return Lf(!e),Ld(this,this,t),this.check()}},{key:"multiplyLeft",value:function(t,e){return Lf(!e),Ld(this,t,this),this.check()}},{key:"normalize",value:function(){var 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()}},{key:"rotateX",value:function(t){return function(t,e,r){r*=.5;var n=e[0],i=e[1],o=e[2],a=e[3],s=Math.sin(r),u=Math.cos(r);t[0]=n*u+a*s,t[1]=i*u+o*s,t[2]=o*u-i*s,t[3]=a*u-n*s}(this,this,t),this.check()}},{key:"rotateY",value:function(t){return function(t,e,r){r*=.5;var n=e[0],i=e[1],o=e[2],a=e[3],s=Math.sin(r),u=Math.cos(r);t[0]=n*u-o*s,t[1]=i*u+a*s,t[2]=o*u+n*s,t[3]=a*u-i*s}(this,this,t),this.check()}},{key:"rotateZ",value:function(t){return function(t,e,r){r*=.5;var n=e[0],i=e[1],o=e[2],a=e[3],s=Math.sin(r),u=Math.cos(r);t[0]=n*u+i*s,t[1]=i*u-n*s,t[2]=o*u+a*s,t[3]=a*u-o*s}(this,this,t),this.check()}},{key:"scale",value:function(t){return Ud(this,this,t),this.check()}},{key:"slerp",value:function(t,e,r){switch(arguments.length){case 1:var n=arguments[0],i=n.start;t=void 0===i?Qd:i,e=n.target,r=n.ratio;break;case 2:var o=Array.prototype.slice.call(arguments);e=o[0],r=o[1],t=this}return jd(this,t,e,r),this.check()}},{key:"transformVector4",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;return Ch(e,t,this),Zf(e,4)}},{key:"lengthSq",value:function(){return this.lengthSquared()}},{key:"setFromAxisAngle",value:function(t,e){return this.setAxisAngle(t,e)}},{key:"premultiply",value:function(t,e){return this.multiplyLeft(t,e)}},{key:"multiply",value:function(t,e){return this.multiplyRight(t,e)}}]),r}(rh),Yd=new Lh,Zd=new Lh,$d=new Lh,tp=new Lh,ep=new Lh,rp=new Lh,np=new Lh,ip=0,op=1,ap=2,sp=3,up=4,cp=5,lp=6,fp=7,hp=8,dp=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[0,0,0],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0,0,0,0,0,0,0];ku()(this,t),this.center=(new Lh).from(e),this.halfAxes=new Pd(r)}return Ou()(t,[{key:"halfSize",get:function(){var t=this.halfAxes.getColumn(0),e=this.halfAxes.getColumn(1),r=this.halfAxes.getColumn(2);return[new Lh(t).len(),new Lh(e).len(),new Lh(r).len()]}},{key:"quaternion",get:function(){var t=this.halfAxes.getColumn(0),e=this.halfAxes.getColumn(1),r=this.halfAxes.getColumn(2),n=new Lh(t).normalize(),i=new Lh(e).normalize(),o=new Lh(r).normalize();return(new Xd).fromMatrix3(new Pd([].concat(Mu()(n),Mu()(i),Mu()(o))))}},{key:"fromCenterHalfSizeQuaternion",value:function(t,e,r){var n=new Xd(r),i=(new Pd).fromQuaternion(n);return i[0]=i[0]*e[0],i[1]=i[1]*e[0],i[2]=i[2]*e[0],i[3]=i[3]*e[1],i[4]=i[4]*e[1],i[5]=i[5]*e[1],i[6]=i[6]*e[2],i[7]=i[7]*e[2],i[8]=i[8]*e[2],this.center=(new Lh).from(t),this.halfAxes=i,this}},{key:"clone",value:function(){return new t(this.center,this.halfAxes)}},{key:"equals",value:function(t){return this===t||Boolean(t)&&this.center.equals(t.center)&&this.halfAxes.equals(t.halfAxes)}},{key:"getBoundingSphere",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new kd,e=this.halfAxes,r=e.getColumn(0,$d),n=e.getColumn(1,tp),i=e.getColumn(2,ep),o=Yd.copy(r).add(n).add(i);return t.center.copy(this.center),t.radius=o.magnitude(),t}},{key:"intersectPlane",value:function(t){var e=this.center,r=t.normal,n=this.halfAxes,i=r.x,o=r.y,a=r.z,s=Math.abs(i*n[ip]+o*n[op]+a*n[ap])+Math.abs(i*n[sp]+o*n[up]+a*n[cp])+Math.abs(i*n[lp]+o*n[fp]+a*n[hp]),u=r.dot(e)+t.distance;return u<=-s?_d.OUTSIDE:u>=s?_d.INSIDE:_d.INTERSECTING}},{key:"distanceTo",value:function(t){return Math.sqrt(this.distanceSquaredTo(t))}},{key:"distanceSquaredTo",value:function(t){var e=Zd.from(t).subtract(this.center),r=this.halfAxes,n=r.getColumn(0,$d),i=r.getColumn(1,tp),o=r.getColumn(2,ep),a=n.magnitude(),s=i.magnitude(),u=o.magnitude();n.normalize(),i.normalize(),o.normalize();var c,l=0;return(c=Math.abs(e.dot(n))-a)>0&&(l+=c*c),(c=Math.abs(e.dot(i))-s)>0&&(l+=c*c),(c=Math.abs(e.dot(o))-u)>0&&(l+=c*c),l}},{key:"computePlaneDistances",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[-0,-0],n=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY,o=this.center,a=this.halfAxes,s=a.getColumn(0,$d),u=a.getColumn(1,tp),c=a.getColumn(2,ep),l=rp.copy(s).add(u).add(c).add(o),f=np.copy(l).subtract(t),h=e.dot(f);return n=Math.min(h,n),i=Math.max(h,i),l.copy(o).add(s).add(u).subtract(c),f.copy(l).subtract(t),h=e.dot(f),n=Math.min(h,n),i=Math.max(h,i),l.copy(o).add(s).subtract(u).add(c),f.copy(l).subtract(t),h=e.dot(f),n=Math.min(h,n),i=Math.max(h,i),l.copy(o).add(s).subtract(u).subtract(c),f.copy(l).subtract(t),h=e.dot(f),n=Math.min(h,n),i=Math.max(h,i),o.copy(l).subtract(s).add(u).add(c),f.copy(l).subtract(t),h=e.dot(f),n=Math.min(h,n),i=Math.max(h,i),o.copy(l).subtract(s).add(u).subtract(c),f.copy(l).subtract(t),h=e.dot(f),n=Math.min(h,n),i=Math.max(h,i),o.copy(l).subtract(s).subtract(u).add(c),f.copy(l).subtract(t),h=e.dot(f),n=Math.min(h,n),i=Math.max(h,i),o.copy(l).subtract(s).subtract(u).subtract(c),f.copy(l).subtract(t),h=e.dot(f),n=Math.min(h,n),i=Math.max(h,i),r[0]=n,r[1]=i,r}},{key:"transform",value:function(t){this.center.transformAsPoint(t);var e=this.halfAxes.getColumn(0,$d);e.transformAsPoint(t);var r=this.halfAxes.getColumn(1,tp);r.transformAsPoint(t);var n=this.halfAxes.getColumn(2,ep);return n.transformAsPoint(t),this.halfAxes=new Pd([].concat(Mu()(e),Mu()(r),Mu()(n))),this}},{key:"getTransform",value:function(){throw new Error("not implemented")}}]),t}(),pp=new Lh,vp=new Lh,yp=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[0,0,1],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;ku()(this,t),this.normal=new Lh,this.distance=-0,this.fromNormalDistance(e,r)}return Ou()(t,[{key:"fromNormalDistance",value:function(t,e){return Lf(Number.isFinite(e)),this.normal.from(t).normalize(),this.distance=e,this}},{key:"fromPointNormal",value:function(t,e){t=pp.from(t),this.normal.from(e).normalize();var r=-this.normal.dot(t);return this.distance=r,this}},{key:"fromCoefficients",value:function(t,e,r,n){return this.normal.set(t,e,r),Lf(Qf(this.normal.len(),1)),this.distance=n,this}},{key:"clone",value:function(e){return new t(this.normal,this.distance)}},{key:"equals",value:function(t){return Qf(this.distance,t.distance)&&Qf(this.normal,t.normal)}},{key:"getPointDistance",value:function(t){return this.normal.dot(t)+this.distance}},{key:"transform",value:function(t){var e=vp.copy(this.normal).transformAsVector(t).normalize(),r=this.normal.scale(-this.distance).transform(t);return this.fromPointNormal(r,e)}},{key:"projectPointOntoPlane",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];t=pp.from(t);var r=this.getPointDistance(t),n=vp.copy(this.normal).scale(r);return t.subtract(n).to(e)}}]),t}();function gp(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return mp(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return mp(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function mp(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var bp=[new Lh([1,0,0]),new Lh([0,1,0]),new Lh([0,0,1])],Ap=new Lh,wp=new Lh,Bp=(new yp(new Lh(1,0,0),0),function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];ku()(this,t),this.planes=e,Lf(this.planes.every((function(t){return t instanceof yp})))}return Ou()(t,[{key:"fromBoundingSphere",value:function(t){this.planes.length=2*bp.length;var e,r=t.center,n=t.radius,i=0,o=gp(bp);try{for(o.s();!(e=o.n()).done;){var a=e.value,s=this.planes[i],u=this.planes[i+1];s||(s=this.planes[i]=new yp),u||(u=this.planes[i+1]=new yp);var c=Ap.copy(a).scale(-n).add(r);a.dot(c);s.fromPointNormal(c,a);var l=Ap.copy(a).scale(n).add(r),f=wp.copy(a).negate();f.dot(l);u.fromPointNormal(l,f),i+=2}}catch(t){o.e(t)}finally{o.f()}return this}},{key:"computeVisibility",value:function(t){Lf(t);var e,r=_d.INSIDE,n=gp(this.planes);try{for(n.s();!(e=n.n()).done;){var i=e.value;switch(t.intersectPlane(i)){case _d.OUTSIDE:return _d.OUTSIDE;case _d.INTERSECTING:r=_d.INTERSECTING}}}catch(t){n.e(t)}finally{n.f()}return r}},{key:"computeVisibilityWithPlaneMask",value:function(e,r){if(Lf(e,"boundingVolume is required."),Lf(Number.isFinite(r),"parentPlaneMask is required."),r===t.MASK_OUTSIDE||r===t.MASK_INSIDE)return r;for(var n=t.MASK_INSIDE,i=this.planes,o=0;o<this.planes.length;++o){var a=o<31?1<<o:0;if(!(o<31&&0==(r&a))){var s=i[o],u=e.intersectPlane(s);if(u===_d.OUTSIDE)return t.MASK_OUTSIDE;u===_d.INTERSECTING&&(n|=a)}}return n}}],[{key:"MASK_OUTSIDE",get:function(){return 4294967295}},{key:"MASK_INSIDE",get:function(){return 0}},{key:"MASK_INDETERMINATE",get:function(){return 2147483647}}]),t}());new Lh,new Lh,new Lh,new Lh,new Lh;new Lh,new Lh,new Lh,new Lh,new Lh,new Lh,new Lh,new Lh,new Lh,new Lh,new Lh,new Lh,Math.PI;new Pd,new Pd,new Pd,new Pd,new Pd;new Lh,new Lh,new Lh,new Lh,new Lh,new Pd,new Pd,new Pd;function _p(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return xp(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return xp(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function xp(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var Cp=new Lh,kp=new Lh,Ep=new Bp([new yp,new yp,new yp,new yp,new yp,new yp]);function Op(t,e){var r=t.cameraDirection,n=t.cameraUp,i=t.height,o=t.distanceScales.metersPerUnit,a=Sp(t,t.center),s=fd.WGS84.eastNorthUpToFixedFrame(a),u=t.unprojectPosition(t.cameraPosition),c=fd.WGS84.cartographicToCartesian(u,new Lh),l=new Lh(s.transformAsVector(new Lh(r).scale(o))).normalize(),f=new Lh(s.transformAsVector(new Lh(n).scale(o))).normalize();return function(t){var e=t.getFrustumPlanes(),r=Tp(e.near,t.cameraPosition),n=Sp(t,r),i=Sp(t,t.cameraPosition,kp),o=0;for(var a in Ep.planes[o++].fromPointNormal(n,Cp.copy(n).subtract(i)),e)if("near"!==a){var s=Tp(e[a],r,kp),u=Sp(t,s,kp);Ep.planes[o++].fromPointNormal(u,Cp.copy(n).subtract(u))}}(t),{camera:{position:c,direction:l,up:f},viewport:t,topDownViewport:new(0,t.constructor)({longitude:t.longitude,latitude:t.latitude,height:i,width:t.width,bearing:t.bearing,zoom:t.zoom,pitch:0}),height:i,cullingVolume:Ep,frameNumber:e,sseDenominator:1.15}}function Tp(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Lh,n=t.normal.dot(e);return r.copy(t.normal).scale(t.distance-n).add(e),r}function Sp(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Lh,n=t.unprojectPosition(e);return fd.WGS84.cartographicToCartesian(n,r)}var Mp=new Lh;function Ip(t,e){if(t instanceof dp){var r=function(t){t.getColumn(0,Mp);var e=t.getColumn(1),r=t.getColumn(2);return Mp.add(e).add(r).len()}(t.halfAxes);return Math.log2(6356752.314245179/(r+e[2]))}if(t instanceof kd){var n=t.radius;return Math.log2(6356752.314245179/(n+e[2]))}if(t.width&&t.height){var i=t.width,o=t.height;return(Math.log2(6378137/i)+Math.log2(6378137/o))/2}return 1}function Rp(t,e,r){var n=fd.WGS84.cartographicToCartesian([t.xmax,t.ymax,t.zmax],new Lh),i=Math.sqrt(Math.pow(n[0]-r[0],2)+Math.pow(n[1]-r[1],2)+Math.pow(n[2]-r[2],2));return Math.log2(6356752.314245179/(i+e[2]))}var Pp=0,Fp=1,Dp=3,Lp=4,jp=5,Gp=1,Np=2,Up="empty",Hp="scenegraph",Vp="pointcloud",Jp="mesh",zp="I3S",Kp="TILES3D",qp="geometricError",Wp=1;function Qp(t){return null!=t}var Xp=new Lh,Yp=new Lh,Zp=new Lh;function $p(t,e,r){if(Zs(t,"3D Tile: boundingVolume must be defined"),t.box)return function(t,e,r){var n=new Lh(t[0],t[1],t[2]);e.transform(n,n);var i=[];if(10===t.length){var o=t.slice(3,6),a=new Xd;a.fromArray(t,6);var s=new Lh([1,0,0]),u=new Lh([0,1,0]),c=new Lh([0,0,1]);s.transformByQuaternion(a),s.scale(o[0]),u.transformByQuaternion(a),u.scale(o[1]),c.transformByQuaternion(a),c.scale(o[2]),i=[].concat(Mu()(s.toArray()),Mu()(u.toArray()),Mu()(c.toArray()))}else i=[].concat(Mu()(t.slice(3,6)),Mu()(t.slice(6,9)),Mu()(t.slice(9,12)));var l=e.transformAsVector(i.slice(0,3)),f=e.transformAsVector(i.slice(3,6)),h=e.transformAsVector(i.slice(6,9)),d=new Pd([l[0],l[1],l[2],f[0],f[1],f[2],h[0],h[1],h[2]]);if(Qp(r))return r.center=n,r.halfAxes=d,r;return new dp(n,d)}(t.box,e,r);if(t.region){var n=Sf()(t.region,6),i=n[0],o=n[1],a=n[2],s=n[3],u=n[4],c=n[5],l=fd.WGS84.cartographicToCartesian([qf(i),qf(s),u],Yp),f=fd.WGS84.cartographicToCartesian([qf(a),qf(o),c],Zp),h=(new Lh).addVectors(l,f).multiplyScalar(.5),d=(new Lh).subVectors(l,f).len()/2;return tv([h[0],h[1],h[2],d],new Mh)}if(t.sphere)return tv(t.sphere,e,r);throw new Error("3D Tile: boundingVolume must contain a sphere, region, or box")}function tv(t,e,r){var n=new Lh(t[0],t[1],t[2]);e.transform(n,n);var i=e.getScale(Xp),o=Math.max(Math.max(i[0],i[1]),i[2]),a=t[3]*o;return Qp(r)?(r.center=n,r.radius=a,r):new kd(n,a)}new Lh,new Lh,new Mh,new Lh,new Lh,new Lh;function ev(t,e){if(t.dynamicScreenSpaceError&&t.dynamicScreenSpaceErrorComputedDensity){var r=t.dynamicScreenSpaceErrorComputedDensity,n=t.dynamicScreenSpaceErrorFactor;return function(t,e){var r=t*e;return 1-Math.exp(-r*r)}(e,r)*n}return 0}var rv=new Lh,nv=new Lh,iv=new Lh,ov=new Lh,av=new Lh,sv=new Mh,uv=new Mh;function cv(t,e){var r=e.topDownViewport,n=t.header.mbs[1],i=t.header.mbs[0],o=t.header.mbs[2],a=t.header.mbs[3],s=Mu()(t.boundingVolume.center),u=r.unprojectPosition(r.cameraPosition);fd.WGS84.cartographicToCartesian(u,rv),nv.copy(rv).subtract(s).normalize(),fd.WGS84.eastNorthUpToFixedFrame(s,sv),uv.copy(sv).invert(),iv.copy(rv).transform(uv);var c=Math.sqrt(iv[0]*iv[0]+iv[1]*iv[1]),l=c*c/iv[2];ov.copy([iv[0],iv[1],l]);var f=ov.transform(sv).subtract(s).normalize(),h=nv.cross(f).normalize().scale(a).add(s),d=fd.WGS84.cartesianToCartographic(h),p=r.project([i,n,o]),v=r.project(d);return av.copy(p).subtract(v).magnitude()}var lv=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;ku()(this,t),Tu(this,"_map",new Map),Tu(this,"_array",void 0),Tu(this,"_length",void 0),this._array=new Array(e),this._length=e}return Ou()(t,[{key:"length",get:function(){return this._length},set:function(t){this._length=t,t>this._array.length&&(this._array.length=t)}},{key:"values",get:function(){return this._array}},{key:"get",value:function(t){return Zs(t<this._array.length),this._array[t]}},{key:"set",value:function(t,e){Zs(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)}},{key:"delete",value:function(t){var e=this._map.get(t);e>=0&&(this._array.splice(e,1),this._map.delete(t),this.length--)}},{key:"peek",value:function(){return this._array[this._length-1]}},{key:"push",value:function(t){if(!this._map.has(t)){var e=this.length++;this._array[e]=t,this._map.set(t,e)}}},{key:"pop",value:function(){var t=this._array[--this.length];return this._map.delete(t),t}},{key:"reserve",value:function(t){Zs(t>=0),t>this._array.length&&(this._array.length=t)}},{key:"resize",value:function(t){Zs(t>=0),this.length=t}},{key:"trim",value:function(t){null==t&&(t=this.length),this._array.length=t}},{key:"reset",value:function(){this._array=[],this._map=new Map,this._length=0}},{key:"find",value:function(t){return this._map.has(t)}}]),t}();function fv(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return hv(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return hv(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function hv(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function dv(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function pv(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?dv(Object(r),!0).forEach((function(e){Ys()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):dv(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var vv={loadSiblings:!1,skipLevelOfDetail:!1,maximumScreenSpaceError:2,updateTransforms:!0,onTraversalEnd:function(){},viewportTraversersMap:{},basePath:""},yv=function(){function t(e){ku()(this,t),Tu(this,"options",void 0),Tu(this,"root",void 0),Tu(this,"requestedTiles",void 0),Tu(this,"selectedTiles",void 0),Tu(this,"emptyTiles",void 0),Tu(this,"lastUpdate",(new Date).getTime()),Tu(this,"updateDebounceTime",1e3),Tu(this,"_traversalStack",void 0),Tu(this,"_emptyTraversalStack",void 0),Tu(this,"_frameNumber",void 0),this.options=pv(pv({},vv),e),this._traversalStack=new lv,this._emptyTraversalStack=new lv,this._frameNumber=null,this.root=null,this.selectedTiles={},this.requestedTiles={},this.emptyTiles={}}return Ou()(t,[{key:"traversalFinished",value:function(t){return!0}},{key:"traverse",value:function(t,e,r){this.root=t,this.options=pv(pv({},this.options),r),this.reset(),this.updateTile(t,e),this._frameNumber=e.frameNumber,this.executeTraversal(t,e)}},{key:"reset",value:function(){this.requestedTiles={},this.selectedTiles={},this.emptyTiles={},this._traversalStack.reset(),this._emptyTraversalStack.reset()}},{key:"executeTraversal",value:function(t,e){var r=this._traversalStack;for(t._selectionDepth=1,r.push(t);r.length>0;){var n=r.pop(),i=!1;this.canTraverse(n,e)&&(this.updateChildTiles(n,e),i=this.updateAndPushChildren(n,e,r,n.hasRenderContent?n._selectionDepth+1:n._selectionDepth));var o=n.parent,a=Boolean(!o||o._shouldRefine),s=!i;n.hasRenderContent?n.refine===Gp?(this.loadTile(n,e),this.selectTile(n,e)):n.refine===Np&&(this.loadTile(n,e),s&&this.selectTile(n,e)):(this.emptyTiles[n.id]=n,this.loadTile(n,e),s&&this.selectTile(n,e)),this.touchTile(n,e),n._shouldRefine=i&&a}var u=(new Date).getTime();(this.traversalFinished(e)||u-this.lastUpdate>this.updateDebounceTime)&&(this.lastUpdate=u,this.options.onTraversalEnd(e))}},{key:"updateChildTiles",value:function(t,e){var r,n=fv(t.children);try{for(n.s();!(r=n.n()).done;){var i=r.value;this.updateTile(i,e)}}catch(t){n.e(t)}finally{n.f()}return!0}},{key:"updateAndPushChildren",value:function(t,e,r,n){var i=this.options,o=i.loadSiblings,a=i.skipLevelOfDetail,s=t.children;s.sort(this.compareDistanceToCamera.bind(this));var u,c=t.refine===Np&&t.hasRenderContent&&!a,l=!1,f=!0,h=fv(s);try{for(h.s();!(u=h.n()).done;){var d=u.value;if(d._selectionDepth=n,d.isVisibleAndInRequestVolume?(r.find(d)&&r.delete(d),r.push(d),l=!0):(c||o)&&(this.loadTile(d,e),this.touchTile(d,e)),c){var p=void 0;if(p=!!d._inRequestVolume&&(d.hasRenderContent?d.contentAvailable:this.executeEmptyTraversal(d,e)),!(f=f&&p))return!1}}}catch(t){h.e(t)}finally{h.f()}return l||(f=!1),f}},{key:"updateTile",value:function(t,e){this.updateTileVisibility(t,e)}},{key:"selectTile",value:function(t,e){this.shouldSelectTile(t)&&(t._selectedFrame=e.frameNumber,this.selectedTiles[t.id]=t)}},{key:"loadTile",value:function(t,e){this.shouldLoadTile(t)&&(t._requestedFrame=e.frameNumber,t._priority=t._getPriority(),this.requestedTiles[t.id]=t)}},{key:"touchTile",value:function(t,e){t.tileset._cache.touch(t),t._touchedFrame=e.frameNumber}},{key:"canTraverse",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return!!t.hasChildren&&(t.hasTilesetContent?!t.contentExpired:!(!n&&!t.isVisibleAndInRequestVolume)&&this.shouldRefine(t,e,r))}},{key:"shouldLoadTile",value:function(t){return t.hasUnloadedContent||t.contentExpired}},{key:"shouldSelectTile",value:function(t){return t.contentAvailable&&!this.options.skipLevelOfDetail}},{key:"shouldRefine",value:function(t,e,r){var n=t._screenSpaceError;return r&&(n=t.getScreenSpaceError(e,!0)),n>this.options.maximumScreenSpaceError}},{key:"updateTileVisibility",value:function(t,e){var r=[];if(this.options.viewportTraversersMap)for(var n in this.options.viewportTraversersMap){this.options.viewportTraversersMap[n]===e.viewport.id&&r.push(n)}else r.push(e.viewport.id);t.updateVisibility(e,r)}},{key:"compareDistanceToCamera",value:function(t,e){return t._distanceToCamera-e._distanceToCamera}},{key:"anyChildrenVisible",value:function(t,e){var r,n=!1,i=fv(t.children);try{for(i.s();!(r=i.n()).done;){var o=r.value;o.updateVisibility(e),n=n||o.isVisibleAndInRequestVolume}}catch(t){i.e(t)}finally{i.f()}return n}},{key:"executeEmptyTraversal",value:function(t,e){var r=!0,n=this._emptyTraversalStack;for(n.push(t);n.length>0&&r;){var i=n.pop();if(this.updateTile(i,e),i.isVisibleAndInRequestVolume||this.loadTile(i,e),this.touchTile(i,e),!i.hasRenderContent&&this.canTraverse(i,e,!1,!0)){var o,a=fv(i.children);try{for(a.s();!(o=a.n()).done;){var s=o.value;n.find(s)&&n.delete(s),n.push(s)}}catch(t){a.e(t)}finally{a.f()}}else i.contentAvailable||(r=!1)}return r}}]),t}();function gv(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function mv(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?gv(Object(r),!0).forEach((function(e){Ys()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):gv(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var bv=new Lh;var Av=function(){function t(e,r,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";ku()(this,t),Tu(this,"tileset",void 0),Tu(this,"header",void 0),Tu(this,"id",void 0),Tu(this,"url",void 0),Tu(this,"parent",void 0),Tu(this,"refine",void 0),Tu(this,"type",void 0),Tu(this,"contentUrl",void 0),Tu(this,"lodMetricType",void 0),Tu(this,"lodMetricValue",void 0),Tu(this,"boundingVolume",void 0),Tu(this,"content",void 0),Tu(this,"contentState",void 0),Tu(this,"gpuMemoryUsageInBytes",void 0),Tu(this,"children",void 0),Tu(this,"depth",void 0),Tu(this,"viewportIds",void 0),Tu(this,"transform",void 0),Tu(this,"extensions",void 0),Tu(this,"implicitTiling",void 0),Tu(this,"userData",void 0),Tu(this,"computedTransform",void 0),Tu(this,"hasEmptyContent",void 0),Tu(this,"hasTilesetContent",void 0),Tu(this,"traverser",void 0),Tu(this,"_cacheNode",void 0),Tu(this,"_frameNumber",void 0),Tu(this,"_lodJudge",void 0),Tu(this,"_expireDate",void 0),Tu(this,"_expiredContent",void 0),Tu(this,"_shouldRefine",void 0),Tu(this,"_distanceToCamera",void 0),Tu(this,"_centerZDepth",void 0),Tu(this,"_screenSpaceError",void 0),Tu(this,"_visibilityPlaneMask",void 0),Tu(this,"_visible",void 0),Tu(this,"_inRequestVolume",void 0),Tu(this,"_stackLength",void 0),Tu(this,"_selectionDepth",void 0),Tu(this,"_touchedFrame",void 0),Tu(this,"_visitedFrame",void 0),Tu(this,"_selectedFrame",void 0),Tu(this,"_requestedFrame",void 0),Tu(this,"_priority",void 0),Tu(this,"_contentBoundingVolume",void 0),Tu(this,"_viewerRequestVolume",void 0),Tu(this,"_initialTransform",void 0),this.header=r,this.tileset=e,this.id=i||r.id,this.url=r.url,this.parent=n,this.refine=this._getRefine(r.refine),this.type=r.type,this.contentUrl=r.contentUrl,this.lodMetricType="geometricError",this.lodMetricValue=0,this.boundingVolume=null,this.content=null,this.contentState=Pp,this.gpuMemoryUsageInBytes=0,this.children=[],this.hasEmptyContent=!1,this.hasTilesetContent=!1,this.depth=0,this.viewportIds=[],this.userData={},this.extensions=null,this._priority=0,this._touchedFrame=0,this._visitedFrame=0,this._selectedFrame=0,this._requestedFrame=0,this._screenSpaceError=0,this._cacheNode=null,this._frameNumber=null,this._cacheNode=null,this.traverser=new yv({}),this._shouldRefine=!1,this._distanceToCamera=0,this._centerZDepth=0,this._visible=void 0,this._inRequestVolume=!1,this._stackLength=0,this._selectionDepth=0,this._initialTransform=new Mh,this.transform=new Mh,this._initializeLodMetric(r),this._initializeTransforms(r),this._initializeBoundingVolumes(r),this._initializeContent(r),this._initializeRenderingState(r),this._lodJudge=null,this._expireDate=null,this._expiredContent=null,this.implicitTiling=null,Object.seal(this)}var e;return Ou()(t,[{key:"destroy",value:function(){this.header=null}},{key:"isDestroyed",value:function(){return null===this.header}},{key:"selected",get:function(){return this._selectedFrame===this.tileset._frameNumber}},{key:"isVisible",get:function(){return this._visible}},{key:"isVisibleAndInRequestVolume",get:function(){return this._visible&&this._inRequestVolume}},{key:"hasRenderContent",get:function(){return!this.hasEmptyContent&&!this.hasTilesetContent}},{key:"hasChildren",get:function(){return this.children.length>0||this.header.children&&this.header.children.length>0}},{key:"contentReady",get:function(){return this.contentState===Dp||this.hasEmptyContent}},{key:"contentAvailable",get:function(){return Boolean(this.contentReady&&this.hasRenderContent||this._expiredContent&&!this.contentFailed)}},{key:"hasUnloadedContent",get:function(){return this.hasRenderContent&&this.contentUnloaded}},{key:"contentUnloaded",get:function(){return this.contentState===Pp}},{key:"contentExpired",get:function(){return this.contentState===Lp}},{key:"contentFailed",get:function(){return this.contentState===jp}},{key:"distanceToCamera",get:function(){return this._distanceToCamera}},{key:"screenSpaceError",get:function(){return this._screenSpaceError}},{key:"getScreenSpaceError",value:function(t,e){switch(this.tileset.type){case zp:return cv(this,t);case Kp:return function(t,e,r){var n=t.tileset,i=t.parent&&t.parent.lodMetricValue||t.lodMetricValue,o=r?i:t.lodMetricValue;if(0===o)return 0;var a=Math.max(t._distanceToCamera,1e-7),s=e.height,u=e.sseDenominator,c=o*s*(n.options.viewDistanceScale||1)/(a*u);return c-=ev(n,a)}(this,t,e);default:throw new Error("Unsupported tileset type")}}},{key:"unselect",value:function(){this._selectedFrame=0}},{key:"_getPriority",value:function(){var t=this.tileset._traverser,e=t.options.skipLevelOfDetail,r=this.refine===Gp||e;if(r&&!this.isVisible&&void 0!==this._visible)return-1;if(this.tileset._frameNumber-this._touchedFrame>=1)return-1;if(this.contentState===Pp)return-1;var n=this.parent,i=n&&(!r||0===this._screenSpaceError||n.hasTilesetContent)?n._screenSpaceError:this._screenSpaceError,o=t.root?t.root._screenSpaceError:0;return Math.max(o-i,0)}},{key:"loadContent",value:(e=Ds()(js.a.mark((function t(){var e,r,n,i;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.hasEmptyContent){t.next=2;break}return t.abrupt("return",!1);case 2:if(!this.content){t.next=4;break}return t.abrupt("return",!0);case 4:return this.contentExpired&&(this._expireDate=null),this.contentState=Fp,t.next=9,this.tileset._requestScheduler.scheduleRequest(this.id,this._getPriority.bind(this));case 9:if(e=t.sent){t.next=13;break}return this.contentState=Pp,t.abrupt("return",!1);case 13:return t.prev=13,r=this.tileset.getTileUrl(this.contentUrl),n=this.tileset.loader,i=mv(mv({},this.tileset.loadOptions),{},Ys()({},n.id,mv(mv({},this.tileset.loadOptions[n.id]),{},{isTileset:"json"===this.type},this._getLoaderSpecificOptions(n.id)))),t.next=19,Ef(r,n,i);case 19:if(this.content=t.sent,!this.tileset.options.contentLoader){t.next=23;break}return t.next=23,this.tileset.options.contentLoader(this);case 23:return this._isTileset()&&this.tileset._initializeTileHeaders(this.content,this),this.contentState=Dp,this._onContentLoaded(),t.abrupt("return",!0);case 29:throw t.prev=29,t.t0=t.catch(13),this.contentState=jp,t.t0;case 33:return t.prev=33,e.done(),t.finish(33);case 36:case"end":return t.stop()}}),t,this,[[13,29,33,36]])}))),function(){return e.apply(this,arguments)})},{key:"unloadContent",value:function(){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=Pp,!0}},{key:"updateVisibility",value:function(t,e){if(this._frameNumber!==t.frameNumber){var r=this.parent,n=r?r._visibilityPlaneMask:Bp.MASK_INDETERMINATE;if(this.tileset._traverser.options.updateTransforms){var i=r?r.computedTransform:this.tileset.modelMatrix;this._updateTransform(i)}this._distanceToCamera=this.distanceToTile(t),this._screenSpaceError=this.getScreenSpaceError(t,!1),this._visibilityPlaneMask=this.visibility(t,n),this._visible=this._visibilityPlaneMask!==Bp.MASK_OUTSIDE,this._inRequestVolume=this.insideViewerRequestVolume(t),this._frameNumber=t.frameNumber,this.viewportIds=e}}},{key:"visibility",value:function(t,e){var r=t.cullingVolume,n=this.boundingVolume;return r.computeVisibilityWithPlaneMask(n,e)}},{key:"contentVisibility",value:function(){return!0}},{key:"distanceToTile",value:function(t){var e=this.boundingVolume;return Math.sqrt(Math.max(e.distanceSquaredTo(t.camera.position),0))}},{key:"cameraSpaceZDepth",value:function(t){var e=t.camera,r=this.boundingVolume;return bv.subVectors(r.center,e.position),e.direction.dot(bv)}},{key:"insideViewerRequestVolume",value:function(t){var e=this._viewerRequestVolume;return!e||e.distanceSquaredTo(t.camera.position)<=0}},{key:"updateExpiration",value:function(){if(null!=this._expireDate&&this.contentReady&&!this.hasEmptyContent){var t=Date.now();Date.lessThan(this._expireDate,t)&&(this.contentState=Lp,this._expiredContent=this.content)}}},{key:"extras",get:function(){return this.header.extras}},{key:"_initializeLodMetric",value:function(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"))}},{key:"_initializeTransforms",value:function(t){this.transform=t.transform?new Mh(t.transform):new Mh;var e=this.parent,r=this.tileset,n=e&&e.computedTransform?e.computedTransform.clone():r.modelMatrix.clone();this.computedTransform=new Mh(n).multiplyRight(this.transform);var i=e&&e._initialTransform?e._initialTransform.clone():new Mh;this._initialTransform=new Mh(i).multiplyRight(this.transform)}},{key:"_initializeBoundingVolumes",value:function(t){this._contentBoundingVolume=null,this._viewerRequestVolume=null,this._updateBoundingVolume(t)}},{key:"_initializeContent",value:function(t){this.content={_tileset:this.tileset,_tile:this},this.hasEmptyContent=!0,this.contentState=Pp,this.hasTilesetContent=!1,t.contentUrl&&(this.content=null,this.hasEmptyContent=!1)}},{key:"_initializeRenderingState",value:function(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=Bp.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}},{key:"_getRefine",value:function(t){return t||this.parent&&this.parent.refine||Np}},{key:"_isTileset",value:function(){return-1!==this.contentUrl.indexOf(".json")}},{key:"_onContentLoaded",value:function(){switch(this.content&&this.content.type){case"vctr":case"geom":this.tileset._traverser.disableSkipLevelOfDetail=!0}this._isTileset()&&(this.hasTilesetContent=!0)}},{key:"_updateBoundingVolume",value:function(t){this.boundingVolume=$p(t.boundingVolume,this.computedTransform,this.boundingVolume);var e=t.content;e&&(e.boundingVolume&&(this._contentBoundingVolume=$p(e.boundingVolume,this.computedTransform,this._contentBoundingVolume)),t.viewerRequestVolume&&(this._viewerRequestVolume=$p(t.viewerRequestVolume,this.computedTransform,this._viewerRequestVolume)))}},{key:"_updateTransform",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Mh,e=t.clone().multiplyRight(this.transform),r=!e.equals(this.computedTransform);r&&(this.computedTransform=e,this._updateBoundingVolume(this.header))}},{key:"_getLoaderSpecificOptions",value:function(t){switch(t){case"i3s":return mv(mv({},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});case"3d-tiles":case"cesium-ion":default:return{assetGltfUpAxis:(e=this.tileset.tileset).asset&&e.asset.gltfUpAxis||"Y"}}var e}}]),t}(),wv=r(73),Bv=r.n(wv);function _v(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Df()(t);if(e){var i=Df()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Pf()(this,r)}}var xv=function(t){If()(r,t);var e=_v(r);function r(){return ku()(this,r),e.apply(this,arguments)}return Ou()(r,[{key:"compareDistanceToCamera",value:function(t,e){return 0===e._distanceToCamera&&0===t._distanceToCamera?e._centerZDepth-t._centerZDepth:e._distanceToCamera-t._distanceToCamera}},{key:"updateTileVisibility",value:function(t,e){if(Bv()(Df()(r.prototype),"updateTileVisibility",this).call(this,t,e),t.isVisibleAndInRequestVolume){var n=t.children.length>0;if(t.hasTilesetContent&&n){var i=t.children[0];return this.updateTileVisibility(i,e),void(t._visible=i._visible)}if(this.meetsScreenSpaceErrorEarly(t,e))t._visible=!1;else{var o=t.refine===Np,a=t._optimChildrenWithinParent===Wp;o&&a&&n&&!this.anyChildrenVisible(t,e)&&(t._visible=!1)}}}},{key:"meetsScreenSpaceErrorEarly",value:function(t,e){var r=t.parent;return!(!r||r.hasTilesetContent||r.refine!==Gp)&&!this.shouldRefine(t,e,!0)}}]),r}(yv),Cv=r(29),kv=r.n(Cv),Ev=function(){function t(){ku()(this,t),Tu(this,"frameNumberMap",new Map)}return Ou()(t,[{key:"register",value:function(t,e){var r=this.frameNumberMap.get(t)||new Map,n=r.get(e)||0;r.set(e,n+1),this.frameNumberMap.set(t,r)}},{key:"deregister",value:function(t,e){var r=this.frameNumberMap.get(t);if(r){var n=r.get(e)||1;r.set(e,n-1)}}},{key:"isZero",value:function(t,e){var r;return 0===((null===(r=this.frameNumberMap.get(t))||void 0===r?void 0:r.get(e))||0)}}]),t}(),Ov="REQUESTED",Tv="COMPLETED",Sv="ERROR",Mv=function(){function t(){ku()(this,t),Tu(this,"_statusMap",void 0),Tu(this,"pendingTilesRegister",new Ev),this._statusMap={}}return Ou()(t,[{key:"add",value:function(t,e,r,n){var i=this;if(!this._statusMap[e]){var o=n.frameNumber,a=n.viewport.id;this._statusMap[e]={request:t,callback:r,key:e,frameState:n,status:Ov},this.pendingTilesRegister.register(a,o),t().then((function(t){i._statusMap[e].status=Tv;var r=i._statusMap[e].frameState,o=r.frameNumber,a=r.viewport.id;i.pendingTilesRegister.deregister(a,o),i._statusMap[e].callback(t,n)})).catch((function(t){i._statusMap[e].status=Sv;var n=i._statusMap[e].frameState,o=n.frameNumber,a=n.viewport.id;i.pendingTilesRegister.deregister(a,o),r(t)}))}}},{key:"update",value:function(t,e){if(this._statusMap[t]){var r=this._statusMap[t].frameState,n=r.frameNumber,i=r.viewport.id;this.pendingTilesRegister.deregister(i,n);var o=e.frameNumber,a=e.viewport.id;this.pendingTilesRegister.register(a,o),this._statusMap[t].frameState=e}}},{key:"find",value:function(t){return this._statusMap[t]}},{key:"hasPendingTiles",value:function(t,e){return!this.pendingTilesRegister.isZero(t,e)}}]),t}();function Iv(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Rv(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Iv(Object(r),!0).forEach((function(e){Ys()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Iv(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Pv(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return Fv(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Fv(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function Fv(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Dv(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Df()(t);if(e){var i=Df()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Pf()(this,r)}}var Lv=function(t){If()(n,t);var e,r=Dv(n);function n(t){var e;return ku()(this,n),e=r.call(this,t),Tu(kv()(e),"_tileManager",void 0),e._tileManager=new Mv,e}return Ou()(n,[{key:"traversalFinished",value:function(t){return!this._tileManager.hasPendingTiles(t.viewport.id,this._frameNumber||0)}},{key:"shouldRefine",value:function(t,e){return t._lodJudge=function(t,e){if(0===t.lodMetricValue||isNaN(t.lodMetricValue))return"DIG";var r=2*cv(t,e);return r<2?"OUT":!t.header.children||r<=t.lodMetricValue?"DRAW":t.header.children?"DIG":"OUT"}(t,e),"DIG"===t._lodJudge}},{key:"updateChildTiles",value:function(t,e){var r,n=this,i=t.header.children||[],o=t.children,a=t.tileset,s=Pv(i);try{var u=function(){var i=r.value,s="".concat(i.id,"-").concat(e.viewport.id),u=o&&o.find((function(t){return t.id===s}));if(u)u&&n.updateTile(u,e);else{var c=function(){return n._loadTile(i.id,a)};n._tileManager.find(s)?n._tileManager.update(s,e):(a.tileset.nodePages&&(c=function(){return a.tileset.nodePagesTile.formTileFromNodePages(i.id)}),n._tileManager.add(c,s,(function(e){return n._onTileLoad(e,t,s)}),e))}};for(s.s();!(r=s.n()).done;)u()}catch(t){s.e(t)}finally{s.f()}return!1}},{key:"_loadTile",value:(e=Ds()(js.a.mark((function t(e,r){var n,i,o;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=r.loader,i=r.getTileUrl("".concat(r.url,"/nodes/").concat(e)),o=Rv(Rv({},r.loadOptions),{},{i3s:Rv(Rv({},r.loadOptions.i3s),{},{isTileHeader:!0})}),t.next=5,Ef(i,n,o);case 5:return t.abrupt("return",t.sent);case 6:case"end":return t.stop()}}),t)}))),function(t,r){return e.apply(this,arguments)})},{key:"_onTileLoad",value:function(t,e,r){var n=new Av(e.tileset,t,e,r);e.children.push(n);var i=this._tileManager.find(n.id).frameState;this.updateTile(n,i),this._frameNumber===i.frameNumber&&(this.traversalFinished(i)||(new Date).getTime()-this.lastUpdate>this.updateDebounceTime)&&this.executeTraversal(n,i)}}]),n}(yv);function jv(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return Gv(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Gv(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function Gv(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Nv(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Uv(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Nv(Object(r),!0).forEach((function(e){Ys()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Nv(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var Hv={description:"",ellipsoid:fd.WGS84,modelMatrix:new Mh,throttleRequests:!0,maxRequests:64,maximumMemoryUsage:32,maximumTilesSelected:0,debounceTime:0,onTileLoad:function(){},onTileUnload:function(){},onTileError:function(){},onTraversalComplete:function(t){return t},contentLoader:void 0,viewDistanceScale:1,maximumScreenSpaceError:8,loadTiles:!0,updateTransforms:!0,viewportTraversersMap:null,loadOptions:{fetch:{}},attributions:[],basePath:"",i3s:{}},Vv="Tiles In Tileset(s)",Jv=function(){function t(e,r){ku()(this,t),Tu(this,"options",void 0),Tu(this,"loadOptions",void 0),Tu(this,"type",void 0),Tu(this,"tileset",void 0),Tu(this,"loader",void 0),Tu(this,"url",void 0),Tu(this,"basePath",void 0),Tu(this,"modelMatrix",void 0),Tu(this,"ellipsoid",void 0),Tu(this,"lodMetricType",void 0),Tu(this,"lodMetricValue",void 0),Tu(this,"refine",void 0),Tu(this,"root",void 0),Tu(this,"roots",void 0),Tu(this,"asset",void 0),Tu(this,"description",void 0),Tu(this,"properties",void 0),Tu(this,"extras",void 0),Tu(this,"attributions",void 0),Tu(this,"credits",void 0),Tu(this,"stats",void 0),Tu(this,"traverseCounter",void 0),Tu(this,"geometricError",void 0),Tu(this,"selectedTiles",void 0),Tu(this,"updatePromise",null),Tu(this,"tilesetInitializationPromise",void 0),Tu(this,"cartographicCenter",void 0),Tu(this,"cartesianCenter",void 0),Tu(this,"zoom",void 0),Tu(this,"boundingVolume",void 0),Tu(this,"gpuMemoryUsageInBytes",void 0),Tu(this,"dynamicScreenSpaceErrorComputedDensity",void 0),Tu(this,"_traverser",void 0),Tu(this,"_cache",void 0),Tu(this,"_requestScheduler",void 0),Tu(this,"_frameNumber",void 0),Tu(this,"_queryParamsString",void 0),Tu(this,"_queryParams",void 0),Tu(this,"_extensionsUsed",void 0),Tu(this,"_tiles",void 0),Tu(this,"_pendingCount",void 0),Tu(this,"lastUpdatedVieports",void 0),Tu(this,"_requestedTiles",void 0),Tu(this,"_emptyTiles",void 0),Tu(this,"frameStateData",void 0),Tu(this,"maximumMemoryUsage",void 0),Zs(e),this.options=Uv(Uv({},Hv),r),this.tileset=e,this.loader=e.loader,this.type=e.type,this.url=e.url,this.basePath=e.basePath||n.dirname(this.url),this.modelMatrix=this.options.modelMatrix,this.ellipsoid=this.options.ellipsoid,this.lodMetricType=e.lodMetricType,this.lodMetricValue=e.lodMetricValue,this.refine=e.root.refine,this.loadOptions=this.options.loadOptions||{},this.root=null,this.roots={},this.cartographicCenter=null,this.cartesianCenter=null,this.zoom=1,this.boundingVolume=null,this.traverseCounter=0,this.geometricError=0,this._traverser=this._initializeTraverser(),this._cache=new Bd,this._requestScheduler=new md({throttleRequests:this.options.throttleRequests,maxRequests:this.options.maxRequests}),this._frameNumber=0,this._pendingCount=0,this._tiles={},this.selectedTiles=[],this._emptyTiles=[],this._requestedTiles=[],this.frameStateData={},this.lastUpdatedVieports=null,this._queryParams={},this._queryParamsString="",this.maximumMemoryUsage=this.options.maximumMemoryUsage||32,this.gpuMemoryUsageInBytes=0,this.stats=new pd({id:this.url}),this._initializeStats(),this._extensionsUsed=void 0,this.dynamicScreenSpaceErrorComputedDensity=0,this.extras=null,this.asset={},this.credits={},this.description=this.options.description||"",this.tilesetInitializationPromise=this._initializeTileSet(e)}var e,r,i;return Ou()(t,[{key:"destroy",value:function(){this._destroy()}},{key:"isLoaded",value:function(){return 0===this._pendingCount&&0!==this._frameNumber&&0===this._requestedTiles.length}},{key:"tiles",get:function(){return Object.values(this._tiles)}},{key:"frameNumber",get:function(){return this._frameNumber}},{key:"queryParams",get:function(){return this._queryParamsString||(this._queryParamsString=function(t){for(var e=[],r=0,n=Object.keys(t);r<n.length;r++){var i=n[r];e.push("".concat(i,"=").concat(t[i]))}switch(e.length){case 0:return"";case 1:return"?".concat(e[0]);default:return"?".concat(e.join("&"))}}(this._queryParams)),this._queryParamsString}},{key:"setProps",value:function(t){this.options=Uv(Uv({},this.options),t)}},{key:"setOptions",value:function(t){this.options=Uv(Uv({},this.options),t)}},{key:"getTileUrl",value:function(t){return t.startsWith("data:")?t:"".concat(t).concat(this.queryParams)}},{key:"hasExtension",value:function(t){return Boolean(this._extensionsUsed&&this._extensionsUsed.indexOf(t)>-1)}},{key:"update",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this.tilesetInitializationPromise.then((function(){!e&&t.lastUpdatedVieports?e=t.lastUpdatedVieports:t.lastUpdatedVieports=e,e&&t.doUpdate(e)}))}},{key:"selectTiles",value:(i=Ds()(js.a.mark((function t(){var e,r=this,n=arguments;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=n.length>0&&void 0!==n[0]?n[0]:null,t.next=3,this.tilesetInitializationPromise;case 3:return e&&(this.lastUpdatedVieports=e),this.updatePromise||(this.updatePromise=new Promise((function(t){setTimeout((function(){r.lastUpdatedVieports&&r.doUpdate(r.lastUpdatedVieports),t(r._frameNumber),r.updatePromise=null}),r.options.debounceTime)}))),t.abrupt("return",this.updatePromise);case 6:case"end":return t.stop()}}),t,this)}))),function(){return i.apply(this,arguments)})},{key:"doUpdate",value:function(t){if((!("loadTiles"in this.options)||this.options.loadTiles)&&!(this.traverseCounter>0)){var e=t instanceof Array?t:[t];this._cache.reset(),this._frameNumber++,this.traverseCounter=e.length;var r,n=[],i=jv(e);try{for(i.s();!(r=i.n()).done;){var o=r.value.id;this._needTraverse(o)?n.push(o):this.traverseCounter--}}catch(t){i.e(t)}finally{i.f()}var a,s=jv(e);try{for(s.s();!(a=s.n()).done;){var u=a.value,c=u.id;if(this.roots[c]||(this.roots[c]=this._initializeTileHeaders(this.tileset,null)),n.includes(c)){var l=Op(u,this._frameNumber);this._traverser.traverse(this.roots[c],l,this.options)}}}catch(t){s.e(t)}finally{s.f()}}}},{key:"_needTraverse",value:function(t){var e=t;return this.options.viewportTraversersMap&&(e=this.options.viewportTraversersMap[t]),e===t}},{key:"_onTraversalEnd",value:function(t){var e=t.viewport.id;this.frameStateData[e]||(this.frameStateData[e]={selectedTiles:[],_requestedTiles:[],_emptyTiles:[]});var r=this.frameStateData[e],n=function(t,e,r){if(0===r||t.length<=r)return[t,[]];var n,i=[],o=e.viewport,a=o.longitude,s=o.latitude,u=_p(t.entries());try{for(u.s();!(n=u.n()).done;){var c=Sf()(n.value,2),l=c[0],f=c[1],h=Sf()(f.header.mbs,2),d=h[0],p=h[1],v=Math.abs(a-d),y=Math.abs(s-p),g=Math.sqrt(y*y+v*v);i.push([l,g])}}catch(t){u.e(t)}finally{u.f()}for(var m=i.sort((function(t,e){return t[1]-e[1]})),b=[],A=0;A<r;A++)b.push(t[m[A][0]]);for(var w=[],B=r;B<m.length;B++)w.push(t[m[B][0]]);return[b,w]}(Object.values(this._traverser.selectedTiles),t,this.options.maximumTilesSelected),i=Sf()(n,2),o=i[0],a=i[1];r.selectedTiles=o;var s,u=jv(a);try{for(u.s();!(s=u.n()).done;){s.value.unselect()}}catch(t){u.e(t)}finally{u.f()}r._requestedTiles=Object.values(this._traverser.requestedTiles),r._emptyTiles=Object.values(this._traverser.emptyTiles),this.traverseCounter--,this.traverseCounter>0||this._updateTiles()}},{key:"_updateTiles",value:function(){for(var t in this.selectedTiles=[],this._requestedTiles=[],this._emptyTiles=[],this.frameStateData){var 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);var r,n=jv(this.selectedTiles);try{for(n.s();!(r=n.n()).done;){var i=r.value;this._tiles[i.id]=i}}catch(t){n.e(t)}finally{n.f()}this._loadTiles(),this._unloadTiles(),this._updateStats()}},{key:"_tilesChanged",value:function(t,e){if(t.length!==e.length)return!0;var r=new Set(t.map((function(t){return t.id}))),n=new Set(e.map((function(t){return t.id}))),i=t.filter((function(t){return!n.has(t.id)})).length>0;return i=i||e.filter((function(t){return!r.has(t.id)})).length>0}},{key:"_loadTiles",value:function(){var t,e=jv(this._requestedTiles);try{for(e.s();!(t=e.n()).done;){var r=t.value;r.contentUnloaded&&this._loadTile(r)}}catch(t){e.e(t)}finally{e.f()}}},{key:"_unloadTiles",value:function(){this._cache.unloadTiles(this,(function(t,e){return t._unloadTile(e)}))}},{key:"_updateStats",value:function(){var t,e=0,r=0,n=jv(this.selectedTiles);try{for(n.s();!(t=n.n()).done;){var i=t.value;i.contentAvailable&&i.content&&(e++,i.content.pointCount?r+=i.content.pointCount:r+=i.content.vertexCount)}}catch(t){n.e(t)}finally{n.f()}this.stats.get("Tiles In View").count=this.selectedTiles.length,this.stats.get("Tiles To Render").count=e,this.stats.get("Points/Vertices").count=r}},{key:"_initializeTileSet",value:(r=Ds()(js.a.mark((function t(e){return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.type!==zp){t.next=5;break}return this.calculateViewPropsI3S(),t.next=4,e.root;case 4:e.root=t.sent;case 5:this.root=this._initializeTileHeaders(e,null),this.type===Kp&&(this._initializeTiles3DTileset(e),this.calculateViewPropsTiles3D()),this.type===zp&&this._initializeI3STileset();case 8:case"end":return t.stop()}}),t,this)}))),function(t){return r.apply(this,arguments)})},{key:"calculateViewPropsI3S",value:function(){var t,e=this.tileset.fullExtent;if(e){var r=e.xmin,n=e.xmax,i=e.ymin,o=e.ymax,a=e.zmin,s=e.zmax;return this.cartographicCenter=new Lh(r+(n-r)/2,i+(o-i)/2,a+(s-a)/2),this.cartesianCenter=fd.WGS84.cartographicToCartesian(this.cartographicCenter,new Lh),void(this.zoom=Rp(e,this.cartographicCenter,this.cartesianCenter))}var u=null===(t=this.tileset.store)||void 0===t?void 0:t.extent;if(u){var c=Sf()(u,4),l=c[0],f=c[1],h=c[2],d=c[3];return this.cartographicCenter=new Lh(l+(h-l)/2,f+(d-f)/2,0),this.cartesianCenter=fd.WGS84.cartographicToCartesian(this.cartographicCenter,new Lh),void(this.zoom=function(t,e,r){var n=Sf()(t,4),i=n[0],o=n[1];return Rp({xmin:i,xmax:n[2],ymin:o,ymax:n[3],zmin:0,zmax:0},e,r)}(u,this.cartographicCenter,this.cartesianCenter))}console.warn("Extent is not defined in the tileset header"),this.cartographicCenter=new Lh,this.zoom=1}},{key:"calculateViewPropsTiles3D",value:function(){var t=this.root;Zs(t);var e=t.boundingVolume.center;if(!e)return console.warn("center was not pre-calculated for the root tile"),this.cartographicCenter=new Lh,void(this.zoom=1);0!==e[0]||0!==e[1]||0!==e[2]?this.cartographicCenter=fd.WGS84.cartesianToCartographic(e,new Lh):this.cartographicCenter=new Lh(0,0,-fd.WGS84.radii[0]),this.cartesianCenter=e,this.zoom=Ip(t.boundingVolume,this.cartographicCenter)}},{key:"_initializeStats",value:function(){this.stats.get(Vv),this.stats.get("Tiles Loading"),this.stats.get("Tiles In Memory"),this.stats.get("Tiles In View"),this.stats.get("Tiles To Render"),this.stats.get("Tiles Loaded"),this.stats.get("Tiles Unloaded"),this.stats.get("Failed Tile Loads"),this.stats.get("Points/Vertices","memory"),this.stats.get("Tile Memory Use","memory")}},{key:"_initializeTileHeaders",value:function(t,e){var r=new Av(this,t.root,e);if(e&&(e.children.push(r),r.depth=e.depth+1),this.type===Kp){var n=[];for(n.push(r);n.length>0;){var i=n.pop();this.stats.get(Vv).incrementCount();var o,a=jv(i.header.children||[]);try{for(a.s();!(o=a.n()).done;){var s=o.value,u=new Av(this,s,i);i.children.push(u),u.depth=i.depth+1,n.push(u)}}catch(t){a.e(t)}finally{a.f()}}}return r}},{key:"_initializeTraverser",value:function(){var t;switch(this.type){case Kp:t=xv;break;case zp:t=Lv;break;default:t=yv}return new t({basePath:this.basePath,onTraversalEnd:this._onTraversalEnd.bind(this)})}},{key:"_destroyTileHeaders",value:function(t){this._destroySubtree(t)}},{key:"_loadTile",value:(e=Ds()(js.a.mark((function t(e){var r;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,this._onStartTileLoading(),t.next=4,e.loadContent();case 4:r=t.sent,t.next=10;break;case 7:t.prev=7,t.t0=t.catch(0),this._onTileLoadError(e,t.t0);case 10:return t.prev=10,this._onEndTileLoading(),this._onTileLoad(e,r),t.finish(10);case 14:case"end":return t.stop()}}),t,this,[[0,7,10,14]])}))),function(t){return e.apply(this,arguments)})},{key:"_onTileLoadError",value:function(t,e){this.stats.get("Failed Tile Loads").incrementCount();var r=e.message||e.toString(),n=t.url;console.error("A 3D tile failed to load: ".concat(t.url," ").concat(r)),this.options.onTileError(t,r,n)}},{key:"_onTileLoad",value:function(t,e){if(e){if(this.type===zp){var r,n,i=(null===(r=this.tileset)||void 0===r?void 0:null===(n=r.nodePagesTile)||void 0===n?void 0:n.nodesInNodePages)||0;this.stats.get(Vv).reset(),this.stats.get(Vv).addCount(i)}t&&t.content&&function(t,e){Zs(t),Zs(e);var r=e.rtcCenter,n=e.gltfUpAxis,i=t.computedTransform,o=t.boundingVolume.center,a=new Mh(i);switch(r&&a.translate(r),n){case"Z":break;case"Y":var s=(new Mh).rotateX(Math.PI/2);a=a.multiplyRight(s);break;case"X":var u=(new Mh).rotateY(-Math.PI/2);a=a.multiplyRight(u)}e.isQuantized&&a.translate(e.quantizedVolumeOffset).scale(e.quantizedVolumeScale);var c=new Lh(o);e.cartesianModelMatrix=a,e.cartesianOrigin=c;var l=fd.WGS84.cartesianToCartographic(c,new Lh),f=fd.WGS84.eastNorthUpToFixedFrame(c).invert();e.cartographicModelMatrix=f.multiplyRight(a),e.cartographicOrigin=l,e.coordinateSystem||(e.modelMatrix=e.cartographicModelMatrix)}(t,t.content),this._addTileToCache(t),this.options.onTileLoad(t)}}},{key:"_onStartTileLoading",value:function(){this._pendingCount++,this.stats.get("Tiles Loading").incrementCount()}},{key:"_onEndTileLoading",value:function(){this._pendingCount--,this.stats.get("Tiles Loading").decrementCount()}},{key:"_addTileToCache",value:function(t){this._cache.add(this,t,(function(e){return e._updateCacheStats(t)}))}},{key:"_updateCacheStats",value:function(t){this.stats.get("Tiles Loaded").incrementCount(),this.stats.get("Tiles In Memory").incrementCount(),this.gpuMemoryUsageInBytes+=t.content.byteLength||0,this.stats.get("Tile Memory Use").count=this.gpuMemoryUsageInBytes}},{key:"_unloadTile",value:function(t){this.gpuMemoryUsageInBytes-=t.content&&t.content.byteLength||0,this.stats.get("Tiles In Memory").decrementCount(),this.stats.get("Tiles Unloaded").incrementCount(),this.stats.get("Tile Memory Use").count=this.gpuMemoryUsageInBytes,this.options.onTileUnload(t),t.unloadContent()}},{key:"_destroy",value:function(){var t=[];for(this.root&&t.push(this.root);t.length>0;){var e,r=t.pop(),n=jv(r.children);try{for(n.s();!(e=n.n()).done;){var i=e.value;t.push(i)}}catch(t){n.e(t)}finally{n.f()}this._destroyTile(r)}this.root=null}},{key:"_destroySubtree",value:function(t){var e=t,r=[];for(r.push(e);r.length>0;){var n,i=jv((t=r.pop()).children);try{for(i.s();!(n=i.n()).done;){var o=n.value;r.push(o)}}catch(t){i.e(t)}finally{i.f()}t!==e&&this._destroyTile(t)}e.children=[]}},{key:"_destroyTile",value:function(t){this._cache.unloadTile(this,t),this._unloadTile(t),t.destroy()}},{key:"_initializeTiles3DTileset",value:function(t){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)throw new Error("The tileset must be 3D Tiles version 0.0 or 1.0.");"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}},{key:"_initializeI3STileset",value:function(){this.loadOptions.i3s&&"token"in this.loadOptions.i3s&&(this._queryParams.token=this.loadOptions.i3s.token)}}]),t}();var zv={COMPOSITE:"cmpt",POINT_CLOUD:"pnts",BATCHED_3D_MODEL:"b3dm",INSTANCED_3D_MODEL:"i3dm",GEOMETRY:"geom",VECTOR:"vect",GLTF:"glTF"};Object.keys(zv);function Kv(t,e,r){Zs(t instanceof ArrayBuffer);var n=new TextDecoder("utf8"),i=new Uint8Array(t,e,r);return n.decode(i)}function qv(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=new DataView(t);return"".concat(String.fromCharCode(r.getUint8(e+0))).concat(String.fromCharCode(r.getUint8(e+1))).concat(String.fromCharCode(r.getUint8(e+2))).concat(String.fromCharCode(r.getUint8(e+3)))}var Wv={draco:{decoderType:"object"===("undefined"==typeof WebAssembly?"undefined":Ns()(WebAssembly))?"wasm":"js",libraryPath:"libs/",extraAttributes:{},attributeNameEntry:void 0}},Qv={name:"Draco",id:kc?"draco":"draco-nodejs",module:"draco",shapes:["mesh"],version:"3.3.0-alpha.5",worker:!0,extensions:["drc"],mimeTypes:["application/octet-stream"],binary:!0,tests:["DRACO"],options:Wv};function Xv(t){for(var e=1/0,r=1/0,n=1/0,i=-1/0,o=-1/0,a=-1/0,s=t.POSITION?t.POSITION.value:[],u=s&&s.length,c=0;c<u;c+=3){var l=s[c],f=s[c+1],h=s[c+2];e=l<e?l:e,r=f<r?f:r,n=h<n?h:n,i=l>i?l:i,o=f>o?f:o,a=h>a?h:a}return[[e,r,n],[i,o,a]]}function Yv(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return Zv(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Zv(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function Zv(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var $v=function(){function t(e,r){ku()(this,t),Tu(this,"fields",void 0),Tu(this,"metadata",void 0),function(t,e){if(!t)throw new Error(e||"loader assertion failed.")}(Array.isArray(e)),function(t){var e,r={},n=Yv(t);try{for(n.s();!(e=n.n()).done;){var i=e.value;r[i.name]&&console.warn("Schema: duplicated field name",i.name,i),r[i.name]=!0}}catch(t){n.e(t)}finally{n.f()}}(e),this.fields=e,this.metadata=r||new Map}return Ou()(t,[{key:"compareTo",value:function(t){if(this.metadata!==t.metadata)return!1;if(this.fields.length!==t.fields.length)return!1;for(var e=0;e<this.fields.length;++e)if(!this.fields[e].compareTo(t.fields[e]))return!1;return!0}},{key:"select",value:function(){for(var e=Object.create(null),r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];for(var o=0,a=n;o<a.length;o++){var s=a[o];e[s]=!0}var u=this.fields.filter((function(t){return e[t.name]}));return new t(u,this.metadata)}},{key:"selectAt",value:function(){for(var e=this,r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];var o=n.map((function(t){return e.fields[t]})).filter(Boolean);return new t(o,this.metadata)}},{key:"assign",value:function(e){var r,n=this.metadata;if(e instanceof t){var i=e;r=i.fields,n=ty(ty(new Map,this.metadata),i.metadata)}else r=e;var o,a=Object.create(null),s=Yv(this.fields);try{for(s.s();!(o=s.n()).done;){var u=o.value;a[u.name]=u}}catch(t){s.e(t)}finally{s.f()}var c,l=Yv(r);try{for(l.s();!(c=l.n()).done;){var f=c.value;a[f.name]=f}}catch(t){l.e(t)}finally{l.f()}return new t(Object.values(a),n)}}]),t}();function ty(t,e){return new Map([].concat(Mu()(t||new Map),Mu()(e||new Map)))}var ey,ry=function(){function t(e,r){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new Map;ku()(this,t),Tu(this,"name",void 0),Tu(this,"type",void 0),Tu(this,"nullable",void 0),Tu(this,"metadata",void 0),this.name=e,this.type=r,this.nullable=n,this.metadata=i}return Ou()(t,[{key:"typeId",get:function(){return this.type&&this.type.typeId}},{key:"clone",value:function(){return new t(this.name,this.type,this.nullable,this.metadata)}},{key:"compareTo",value:function(t){return this.name===t.name&&this.type===t.type&&this.nullable===t.nullable&&this.metadata===t.metadata}},{key:"toString",value:function(){return"".concat(this.type).concat(this.nullable?", nullable":"").concat(this.metadata?", metadata: ".concat(this.metadata):"")}}]),t}();function ny(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Df()(t);if(e){var i=Df()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Pf()(this,r)}}!function(t){t[t.NONE=0]="NONE",t[t.Null=1]="Null",t[t.Int=2]="Int",t[t.Float=3]="Float",t[t.Binary=4]="Binary",t[t.Utf8=5]="Utf8",t[t.Bool=6]="Bool",t[t.Decimal=7]="Decimal",t[t.Date=8]="Date",t[t.Time=9]="Time",t[t.Timestamp=10]="Timestamp",t[t.Interval=11]="Interval",t[t.List=12]="List",t[t.Struct=13]="Struct",t[t.Union=14]="Union",t[t.FixedSizeBinary=15]="FixedSizeBinary",t[t.FixedSizeList=16]="FixedSizeList",t[t.Map=17]="Map",t[t.Dictionary=-1]="Dictionary",t[t.Int8=-2]="Int8",t[t.Int16=-3]="Int16",t[t.Int32=-4]="Int32",t[t.Int64=-5]="Int64",t[t.Uint8=-6]="Uint8",t[t.Uint16=-7]="Uint16",t[t.Uint32=-8]="Uint32",t[t.Uint64=-9]="Uint64",t[t.Float16=-10]="Float16",t[t.Float32=-11]="Float32",t[t.Float64=-12]="Float64",t[t.DateDay=-13]="DateDay",t[t.DateMillisecond=-14]="DateMillisecond",t[t.TimestampSecond=-15]="TimestampSecond",t[t.TimestampMillisecond=-16]="TimestampMillisecond",t[t.TimestampMicrosecond=-17]="TimestampMicrosecond",t[t.TimestampNanosecond=-18]="TimestampNanosecond",t[t.TimeSecond=-19]="TimeSecond",t[t.TimeMillisecond=-20]="TimeMillisecond",t[t.TimeMicrosecond=-21]="TimeMicrosecond",t[t.TimeNanosecond=-22]="TimeNanosecond",t[t.DenseUnion=-23]="DenseUnion",t[t.SparseUnion=-24]="SparseUnion",t[t.IntervalDayTime=-25]="IntervalDayTime",t[t.IntervalYearMonth=-26]="IntervalYearMonth"}(ey||(ey={}));var iy=function(){function t(){ku()(this,t)}return Ou()(t,[{key:"typeId",get:function(){return ey.NONE}},{key:"compareTo",value:function(t){return this===t}}],[{key:"isNull",value:function(t){return t&&t.typeId===ey.Null}},{key:"isInt",value:function(t){return t&&t.typeId===ey.Int}},{key:"isFloat",value:function(t){return t&&t.typeId===ey.Float}},{key:"isBinary",value:function(t){return t&&t.typeId===ey.Binary}},{key:"isUtf8",value:function(t){return t&&t.typeId===ey.Utf8}},{key:"isBool",value:function(t){return t&&t.typeId===ey.Bool}},{key:"isDecimal",value:function(t){return t&&t.typeId===ey.Decimal}},{key:"isDate",value:function(t){return t&&t.typeId===ey.Date}},{key:"isTime",value:function(t){return t&&t.typeId===ey.Time}},{key:"isTimestamp",value:function(t){return t&&t.typeId===ey.Timestamp}},{key:"isInterval",value:function(t){return t&&t.typeId===ey.Interval}},{key:"isList",value:function(t){return t&&t.typeId===ey.List}},{key:"isStruct",value:function(t){return t&&t.typeId===ey.Struct}},{key:"isUnion",value:function(t){return t&&t.typeId===ey.Union}},{key:"isFixedSizeBinary",value:function(t){return t&&t.typeId===ey.FixedSizeBinary}},{key:"isFixedSizeList",value:function(t){return t&&t.typeId===ey.FixedSizeList}},{key:"isMap",value:function(t){return t&&t.typeId===ey.Map}},{key:"isDictionary",value:function(t){return t&&t.typeId===ey.Dictionary}}]),t}(),oy=(Symbol.toStringTag,Symbol.toStringTag,function(t,e){If()(n,t);var r=ny(n);function n(t,e){var i;return ku()(this,n),i=r.call(this),Tu(kv()(i),"isSigned",void 0),Tu(kv()(i),"bitWidth",void 0),i.isSigned=t,i.bitWidth=e,i}return Ou()(n,[{key:"typeId",get:function(){return ey.Int}},{key:e,get:function(){return"Int"}},{key:"toString",value:function(){return"".concat(this.isSigned?"I":"Ui","nt").concat(this.bitWidth)}}]),n}(iy,Symbol.toStringTag)),ay=function(t){If()(r,t);var e=ny(r);function r(){return ku()(this,r),e.call(this,!0,8)}return r}(oy),sy=function(t){If()(r,t);var e=ny(r);function r(){return ku()(this,r),e.call(this,!0,16)}return r}(oy),uy=function(t){If()(r,t);var e=ny(r);function r(){return ku()(this,r),e.call(this,!0,32)}return r}(oy),cy=function(t){If()(r,t);var e=ny(r);function r(){return ku()(this,r),e.call(this,!1,8)}return r}(oy),ly=function(t){If()(r,t);var e=ny(r);function r(){return ku()(this,r),e.call(this,!1,16)}return r}(oy),fy=function(t){If()(r,t);var e=ny(r);function r(){return ku()(this,r),e.call(this,!1,32)}return r}(oy),hy=32,dy=64,py=function(t,e){If()(n,t);var r=ny(n);function n(t){var e;return ku()(this,n),e=r.call(this),Tu(kv()(e),"precision",void 0),e.precision=t,e}return Ou()(n,[{key:"typeId",get:function(){return ey.Float}},{key:e,get:function(){return"Float"}},{key:"toString",value:function(){return"Float".concat(this.precision)}}]),n}(iy,Symbol.toStringTag),vy=function(t){If()(r,t);var e=ny(r);function r(){return ku()(this,r),e.call(this,hy)}return r}(py),yy=function(t){If()(r,t);var e=ny(r);function r(){return ku()(this,r),e.call(this,dy)}return r}(py),gy=(Symbol.toStringTag,Symbol.toStringTag,{DAY:0,MILLISECOND:1}),my=(Symbol.toStringTag,{SECOND:1,MILLISECOND:1e3,MICROSECOND:1e6,NANOSECOND:1e9}),by=(Symbol.toStringTag,Symbol.toStringTag,{DAY_TIME:0,YEAR_MONTH:1}),Ay=(Symbol.toStringTag,function(t,e){If()(n,t);var r=ny(n);function n(t,e){var i;return ku()(this,n),i=r.call(this),Tu(kv()(i),"listSize",void 0),Tu(kv()(i),"children",void 0),i.listSize=t,i.children=[e],i}return Ou()(n,[{key:"typeId",get:function(){return ey.FixedSizeList}},{key:"valueType",get:function(){return this.children[0].type}},{key:"valueField",get:function(){return this.children[0]}},{key:e,get:function(){return"FixedSizeList"}},{key:"toString",value:function(){return"FixedSizeList[".concat(this.listSize,"]<").concat(this.valueType,">")}}]),n}(iy,Symbol.toStringTag));Symbol.toStringTag;function wy(t,e,r){var n=function(t){switch(t.constructor){case Int8Array:return new ay;case Uint8Array:return new cy;case Int16Array:return new sy;case Uint16Array:return new ly;case Int32Array:return new uy;case Uint32Array:return new fy;case Float32Array:return new vy;case Float64Array:return new yy;default:throw new Error("array type not supported")}}(e.value),i=r||function(t){var e=new Map;"byteOffset"in t&&e.set("byteOffset",t.byteOffset.toString(10));"byteStride"in t&&e.set("byteStride",t.byteStride.toString(10));"normalized"in t&&e.set("normalized",t.normalized.toString());return e}(e);return new ry(t,new Ay(e.size,new ry("value",n)),!1,i)}function By(t,e,r){var n=xy(e.metadata),i=[],o=function(t){var e={};for(var r in t){var n=t[r];e[n.name||"undefined"]=n}return e}(e.attributes);for(var a in t){var s=_y(a,t[a],o[a]);i.push(s)}if(r){var u=_y("indices",r);i.push(u)}return new $v(i,n)}function _y(t,e,r){return wy(t,e,r?xy(r.metadata):void 0)}function xy(t){var e=new Map;for(var r in t)e.set("".concat(r,".string"),JSON.stringify(t[r]));return e}function Cy(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return ky(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ky(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function ky(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Ey(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Oy(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Ey(Object(r),!0).forEach((function(e){Ys()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ey(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var Ty={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},Sy={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array},My=function(){function t(e){ku()(this,t),Tu(this,"draco",void 0),Tu(this,"decoder",void 0),Tu(this,"metadataQuerier",void 0),this.draco=e,this.decoder=new this.draco.Decoder,this.metadataQuerier=new this.draco.MetadataQuerier}return Ou()(t,[{key:"destroy",value:function(){this.draco.destroy(this.decoder),this.draco.destroy(this.metadataQuerier)}},{key:"parseSync",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=new this.draco.DecoderBuffer;r.Init(new Int8Array(t),t.byteLength),this._disableAttributeTransforms(e);var n=this.decoder.GetEncodedGeometryType(r),i=n===this.draco.TRIANGULAR_MESH?new this.draco.Mesh:new this.draco.PointCloud;try{var o;switch(n){case this.draco.TRIANGULAR_MESH:o=this.decoder.DecodeBufferToMesh(r,i);break;case this.draco.POINT_CLOUD:o=this.decoder.DecodeBufferToPointCloud(r,i);break;default:throw new Error("DRACO: Unknown geometry type.")}if(!o.ok()||!i.ptr){var a="DRACO decompression failed: ".concat(o.error_msg());throw new Error(a)}var s=this._getDracoLoaderData(i,n,e),u=this._getMeshData(i,s,e),c=Xv(u.attributes),l=By(u.attributes,s,u.indices),f=Oy(Oy({loader:"draco",loaderData:s,header:{vertexCount:i.num_points(),boundingBox:c}},u),{},{schema:l});return f}finally{this.draco.destroy(r),i&&this.draco.destroy(i)}}},{key:"_getDracoLoaderData",value:function(t,e,r){var n=this._getTopLevelMetadata(t),i=this._getDracoAttributes(t,r);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:n,attributes:i}}},{key:"_getDracoAttributes",value:function(t,e){for(var r={},n=0;n<t.num_attributes();n++){var i=this.decoder.GetAttribute(t,n),o=this._getAttributeMetadata(t,n);r[i.unique_id()]={unique_id:i.unique_id(),attribute_type:i.attribute_type(),data_type:i.data_type(),num_components:i.num_components(),byte_offset:i.byte_offset(),byte_stride:i.byte_stride(),normalized:i.normalized(),attribute_index:n,metadata:o};var a=this._getQuantizationTransform(i,e);a&&(r[i.unique_id()].quantization_transform=a);var s=this._getOctahedronTransform(i,e);s&&(r[i.unique_id()].octahedron_transform=s)}return r}},{key:"_getMeshData",value:function(t,e,r){var n=this._getMeshAttributes(e,t,r);if(!n.POSITION)throw new Error("DRACO: No position attribute found.");if(t instanceof this.draco.Mesh)switch(r.topology){case"triangle-strip":return{topology:"triangle-strip",mode:4,attributes:n,indices:{value:this._getTriangleStripIndices(t),size:1}};case"triangle-list":default:return{topology:"triangle-list",mode:5,attributes:n,indices:{value:this._getTriangleListIndices(t),size:1}}}return{topology:"point-list",mode:0,attributes:n}}},{key:"_getMeshAttributes",value:function(t,e,r){for(var n={},i=0,o=Object.values(t.attributes);i<o.length;i++){var a=o[i],s=this._deduceAttributeName(a,r);a.name=s;var u=this._getAttributeValues(e,a),c=u.value,l=u.size;n[s]={value:c,size:l,byteOffset:a.byte_offset,byteStride:a.byte_stride,normalized:a.normalized}}return n}},{key:"_getTriangleListIndices",value:function(t){var e=3*t.num_faces(),r=4*e,n=this.draco._malloc(r);try{return this.decoder.GetTrianglesUInt32Array(t,r,n),new Uint32Array(this.draco.HEAPF32.buffer,n,e).slice()}finally{this.draco._free(n)}}},{key:"_getTriangleStripIndices",value:function(t){var e=new this.draco.DracoInt32Array;try{return this.decoder.GetTriangleStripsFromMesh(t,e),function(t){for(var e=t.size(),r=new Int32Array(e),n=0;n<e;n++)r[n]=t.GetValue(n);return r}(e)}finally{this.draco.destroy(e)}}},{key:"_getAttributeValues",value:function(t,e){var r,n=Sy[e.data_type],i=e.num_components,o=t.num_points()*i,a=o*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),u=this.draco._malloc(a);try{var c=this.decoder.GetAttribute(t,e.attribute_index);this.decoder.GetAttributeDataArrayForAllPoints(t,c,s,a,u),r=new n(this.draco.HEAPF32.buffer,u,o).slice()}finally{this.draco._free(u)}return{value:r,size:i}}},{key:"_deduceAttributeName",value:function(t,e){for(var r=t.unique_id,n=0,i=Object.entries(e.extraAttributes||{});n<i.length;n++){var o=Sf()(i[n],2),a=o[0];if(o[1]===r)return a}var s=t.attribute_type;for(var u in Ty){if(this.draco[u]===s)return Ty[u]}var c=e.attributeNameEntry||"name";return t.metadata[c]?t.metadata[c].string:"CUSTOM_ATTRIBUTE_".concat(r)}},{key:"_getTopLevelMetadata",value:function(t){var e=this.decoder.GetMetadata(t);return this._getDracoMetadata(e)}},{key:"_getAttributeMetadata",value:function(t,e){var r=this.decoder.GetAttributeMetadata(t,e);return this._getDracoMetadata(r)}},{key:"_getDracoMetadata",value:function(t){if(!t||!t.ptr)return{};for(var e={},r=this.metadataQuerier.NumEntries(t),n=0;n<r;n++){var i=this.metadataQuerier.GetEntryName(t,n);e[i]=this._getDracoMetadataField(t,i)}return e}},{key:"_getDracoMetadataField",value:function(t,e){var r=new this.draco.DracoInt32Array;try{this.metadataQuerier.GetIntEntryArray(t,e,r);var n=function(t){for(var e=t.size(),r=new Int32Array(e),n=0;n<e;n++)r[n]=t.GetValue(n);return r}(r);return{int:this.metadataQuerier.GetIntEntry(t,e),string:this.metadataQuerier.GetStringEntry(t,e),double:this.metadataQuerier.GetDoubleEntry(t,e),intArray:n}}finally{this.draco.destroy(r)}}},{key:"_disableAttributeTransforms",value:function(t){var e,r=t.quantizedAttributes,n=void 0===r?[]:r,i=t.octahedronAttributes,o=void 0===i?[]:i,a=Cy([].concat(Mu()(n),Mu()(o)));try{for(a.s();!(e=a.n()).done;){var s=e.value;this.decoder.SkipAttributeTransform(this.draco[s])}}catch(t){a.e(t)}finally{a.f()}}},{key:"_getQuantizationTransform",value:function(t,e){var r=this,n=e.quantizedAttributes,i=void 0===n?[]:n,o=t.attribute_type();if(i.map((function(t){return r.decoder[t]})).includes(o)){var a=new this.draco.AttributeQuantizationTransform;try{if(a.InitFromAttribute(t))return{quantization_bits:a.quantization_bits(),range:a.range(),min_values:new Float32Array([1,2,3]).map((function(t){return a.min_value(t)}))}}finally{this.draco.destroy(a)}}return null}},{key:"_getOctahedronTransform",value:function(t,e){var r=this,n=e.octahedronAttributes,i=void 0===n?[]:n,o=t.attribute_type();if(i.map((function(t){return r.decoder[t]})).includes(o)){var a=new this.draco.AttributeQuantizationTransform;try{if(a.InitFromAttribute(t))return{quantization_bits:a.quantization_bits()}}finally{this.draco.destroy(a)}}return null}}]),t}();var Iy=r(42),Ry={};function Py(t){return Fy.apply(this,arguments)}function Fy(){return(Fy=Ds()(js.a.mark((function t(e){var r,n,i=arguments;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=i.length>1&&void 0!==i[1]?i[1]:null,n=i.length>2&&void 0!==i[2]?i[2]:{},r&&(e=Dy(e,r,n)),Ry[e]=Ry[e]||Ly(e),t.next=6,Ry[e];case 6:return t.abrupt("return",t.sent);case 7:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Dy(t,e,r){if(t.startsWith("http"))return t;var n=r.modules||{};return n[t]?n[t]:kc?r.CDN?(Bc(r.CDN.startsWith("http")),"".concat(r.CDN,"/").concat(e,"@").concat("3.3.0-alpha.5","/dist/libs/").concat(t)):Ec?"../src/libs/".concat(t):"modules/".concat(e,"/src/libs/").concat(t):"modules/".concat(e,"/dist/libs/").concat(t)}function Ly(t){return jy.apply(this,arguments)}function jy(){return(jy=Ds()(js.a.mark((function t(e){var r,n,i;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e.endsWith("wasm")){t.next=7;break}return t.next=3,fetch(e);case 3:return r=t.sent,t.next=6,r.arrayBuffer();case 6:return t.abrupt("return",t.sent);case 7:if(kc){t.next=20;break}if(t.prev=8,t.t0=Iy&&Iy.requireFromFile,!t.t0){t.next=14;break}return t.next=13,Iy.requireFromFile(e);case 13:t.t0=t.sent;case 14:return t.abrupt("return",t.t0);case 17:return t.prev=17,t.t1=t.catch(8),t.abrupt("return",null);case 20:if(!Ec){t.next=22;break}return t.abrupt("return",importScripts(e));case 22:return t.next=24,fetch(e);case 24:return n=t.sent,t.next=27,n.text();case 27:return i=t.sent,t.abrupt("return",Gy(i,e));case 29:case"end":return t.stop()}}),t,null,[[8,17]])})))).apply(this,arguments)}function Gy(t,e){if(!kc)return Iy.requireFromString&&Iy.requireFromString(t,e);if(Ec)return eval.call(Cc,t),null;var r=document.createElement("script");r.id=e;try{r.appendChild(document.createTextNode(t))}catch(e){r.text=t}return document.body.appendChild(r),null}function Ny(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Uy(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Ny(Object(r),!0).forEach((function(e){Ys()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ny(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var Hy,Vy="https://www.gstatic.com/draco/versioned/decoders/".concat("1.4.1","/draco_decoder.js"),Jy="https://www.gstatic.com/draco/versioned/decoders/".concat("1.4.1","/draco_wasm_wrapper.js"),zy="https://www.gstatic.com/draco/versioned/decoders/".concat("1.4.1","/draco_decoder.wasm");"https://raw.githubusercontent.com/google/draco/".concat("1.4.1","/javascript/draco_encoder.js");function Ky(t){return qy.apply(this,arguments)}function qy(){return(qy=Ds()(js.a.mark((function t(e){var r;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.modules||{},Hy=r.draco3d?Hy||r.draco3d.createDecoderModule({}).then((function(t){return{draco:t}})):Hy||Wy(e),t.next=4,Hy;case 4:return t.abrupt("return",t.sent);case 5:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Wy(t){return Qy.apply(this,arguments)}function Qy(){return(Qy=Ds()(js.a.mark((function t(e){var r,n,i,o;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:t.t0=e.draco&&e.draco.decoderType,t.next="js"===t.t0?3:(t.t0,7);break;case 3:return t.next=5,Py(Vy,"draco",e);case 5:return r=t.sent,t.abrupt("break",21);case 7:return t.t1=Promise,t.next=10,Py(Jy,"draco",e);case 10:return t.t2=t.sent,t.next=13,Py(zy,"draco",e);case 13:return t.t3=t.sent,t.t4=[t.t2,t.t3],t.next=17,t.t1.all.call(t.t1,t.t4);case 17:i=t.sent,o=Sf()(i,2),r=o[0],n=o[1];case 21:return r=r||globalThis.DracoDecoderModule,t.next=24,Xy(r,n);case 24:return t.abrupt("return",t.sent);case 25:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Xy(t,e){var r={};return e&&(r.wasmBinary=e),new Promise((function(e){t(Uy(Uy({},r),{},{onModuleLoaded:function(t){return e({draco:t})}}))}))}function Yy(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Zy(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Yy(Object(r),!0).forEach((function(e){Ys()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Yy(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var $y=Zy(Zy({},Qv),{},{parse:function(t,e){return tg.apply(this,arguments)}});function tg(){return(tg=Ds()(js.a.mark((function t(e,r){var n,i,o;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Ky(r);case 2:return n=t.sent,i=n.draco,o=new My(i),t.prev=5,t.abrupt("return",o.parseSync(e,null==r?void 0:r.draco));case 7:return t.prev=7,o.destroy(),t.finish(7);case 10:case"end":return t.stop()}}),t,null,[[5,,7,10]])})))).apply(this,arguments)}var eg,rg=(eg={},Ys()(eg,5130,Float64Array),Ys()(eg,5126,Float32Array),Ys()(eg,5123,Uint16Array),Ys()(eg,5125,Uint32Array),Ys()(eg,5121,Uint8Array),Ys()(eg,5120,Int8Array),Ys()(eg,5122,Int16Array),Ys()(eg,5124,Int32Array),eg),ng={DOUBLE:5130,FLOAT:5126,UNSIGNED_SHORT:5123,UNSIGNED_INT:5125,UNSIGNED_BYTE:5121,BYTE:5120,SHORT:5122,INT:5124},ig=function(){function t(){ku()(this,t)}return Ou()(t,null,[{key:"fromTypedArray",value:function(t){for(var e in t=ArrayBuffer.isView(t)?t.constructor:t,rg){if(rg[e]===t)return e}throw new Error("Failed to convert GL type")}},{key:"fromName",value:function(t){var e=ng[t];if(!e)throw new Error("Failed to convert GL type");return e}},{key:"getArrayType",value:function(t){switch(t){case 33635:case 32819:case 32820:return Uint16Array;default:var e=rg[t];if(!e)throw new Error("Failed to convert GL type");return e}}},{key:"getByteSize",value:function(e){return t.getArrayType(e).BYTES_PER_ELEMENT}},{key:"validate",value:function(e){return Boolean(t.getArrayType(e))}},{key:"createTypedArray",value:function(e,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3?arguments[3]:void 0;void 0===i&&(i=(r.byteLength-n)/t.getByteSize(e));var o=t.getArrayType(e);return new o(r,n,i)}}]),t}(),og=function(){function t(e,r){ku()(this,t),Tu(this,"json",void 0),Tu(this,"buffer",void 0),Tu(this,"featuresLength",0),Tu(this,"_cachedTypedArrays",{}),this.json=e,this.buffer=r}return Ou()(t,[{key:"getExtension",value:function(t){return this.json.extensions&&this.json.extensions[t]}},{key:"hasProperty",value:function(t){return Boolean(this.json[t])}},{key:"getGlobalProperty",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5125,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,n=this.json[t];return n&&Number.isFinite(n.byteOffset)?this._getTypedArrayFromBinary(t,e,r,1,n.byteOffset):n}},{key:"getPropertyArray",value:function(t,e,r){var n=this.json[t];return n&&Number.isFinite(n.byteOffset)?("componentType"in n&&(e=ig.fromName(n.componentType)),this._getTypedArrayFromBinary(t,e,r,this.featuresLength,n.byteOffset)):this._getTypedArrayFromArray(t,e,n)}},{key:"getProperty",value:function(t,e,r,n,i){var o=this.json[t];if(!o)return o;var a=this.getPropertyArray(t,e,r);if(1===r)return a[n];for(var s=0;s<r;++s)i[s]=a[r*n+s];return i}},{key:"_getTypedArrayFromBinary",value:function(t,e,r,n,i){var o=this._cachedTypedArrays,a=o[t];return a||(a=ig.createTypedArray(e,this.buffer.buffer,this.buffer.byteOffset+i,n*r),o[t]=a),a}},{key:"_getTypedArrayFromArray",value:function(t,e,r){var n=this._cachedTypedArrays,i=n[t];return i||(i=ig.createTypedArray(e,r),n[t]=i),i}}]),t}(),ag={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},sg={SCALAR:function(t,e){return t[e]},VEC2:function(t,e){return[t[2*e+0],t[2*e+1]]},VEC3:function(t,e){return[t[3*e+0],t[3*e+1],t[3*e+2]]},VEC4:function(t,e){return[t[4*e+0],t[4*e+1],t[4*e+2],t[4*e+3]]},MAT2:function(t,e){return[t[4*e+0],t[4*e+1],t[4*e+2],t[4*e+3]]},MAT3:function(t,e){return[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:function(t,e){return[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]]}},ug={SCALAR:function(t,e,r){e[r]=t},VEC2:function(t,e,r){e[2*r+0]=t[0],e[2*r+1]=t[1]},VEC3:function(t,e,r){e[3*r+0]=t[0],e[3*r+1]=t[1],e[3*r+2]=t[2]},VEC4:function(t,e,r){e[4*r+0]=t[0],e[4*r+1]=t[1],e[4*r+2]=t[2],e[4*r+3]=t[3]},MAT2:function(t,e,r){e[4*r+0]=t[0],e[4*r+1]=t[1],e[4*r+2]=t[2],e[4*r+3]=t[3]},MAT3:function(t,e,r){e[9*r+0]=t[0],e[9*r+1]=t[1],e[9*r+2]=t[2],e[9*r+3]=t[3],e[9*r+4]=t[4],e[9*r+5]=t[5],e[9*r+6]=t[6],e[9*r+7]=t[7],e[9*r+8]=t[8],e[9*r+9]=t[9]},MAT4:function(t,e,r){e[16*r+0]=t[0],e[16*r+1]=t[1],e[16*r+2]=t[2],e[16*r+3]=t[3],e[16*r+4]=t[4],e[16*r+5]=t[5],e[16*r+6]=t[6],e[16*r+7]=t[7],e[16*r+8]=t[8],e[16*r+9]=t[9],e[16*r+10]=t[10],e[16*r+11]=t[11],e[16*r+12]=t[12],e[16*r+13]=t[13],e[16*r+14]=t[14],e[16*r+15]=t[15]}};var cg=function(t){return void 0!==t};function lg(t,e,r){if(!e)return null;var n=t.getExtension("3DTILES_batch_table_hierarchy"),i=e.HIERARCHY;return i&&(console.warn("3D Tile Parser: HIERARCHY is deprecated. Use 3DTILES_batch_table_hierarchy."),e.extensions=e.extensions||{},e.extensions["3DTILES_batch_table_hierarchy"]=i,n=i),n?function(t,e){var r,n,i,o,a=t.instancesLength,s=t.classes,u=t.classIds,c=t.parentCounts,l=t.parentIds,f=a;cg(u.byteOffset)&&(u.componentType=defaultValue(u.componentType,5123),u.type=AttributeType.SCALAR,i=getBinaryAccessor(u),u=i.createArrayBufferView(e.buffer,e.byteOffset+u.byteOffset,a));if(cg(c))for(cg(c.byteOffset)&&(c.componentType=defaultValue(c.componentType,5123),c.type=AttributeType.SCALAR,i=getBinaryAccessor(c),c=i.createArrayBufferView(e.buffer,e.byteOffset+c.byteOffset,a)),o=new Uint16Array(a),f=0,r=0;r<a;++r)o[r]=f,f+=c[r];cg(l)&&cg(l.byteOffset)&&(l.componentType=defaultValue(l.componentType,5123),l.type=AttributeType.SCALAR,i=getBinaryAccessor(l),l=i.createArrayBufferView(e.buffer,e.byteOffset+l.byteOffset,f));var h=s.length;for(r=0;r<h;++r){var d=s[r].length,p=s[r].instances,v=getBinaryProperties(d,p,e);s[r].instances=combine(v,p)}var y=new Array(h).fill(0),g=new Uint16Array(a);for(r=0;r<a;++r)n=u[r],g[r]=y[n],++y[n];var m={classes:s,classIds:u,classIndexes:g,parentCounts:c,parentIndexes:o,parentIds:l};return function(t){for(var e=t.classIds.length,r=0;r<e;++r)hg(t,r,stack)}(m),m}(n,r):null}function fg(t,e,r){if(t){var n=t.parentCounts;return t.parentIds?r(t,e):n>0?function(t,e,r){var n=t.classIds,i=t.parentCounts,o=t.parentIds,a=t.parentIndexes,s=n.length,u=scratchVisited;u.length=Math.max(u.length,s);var c=++marker,l=scratchStack;l.length=0,l.push(e);for(;l.length>0;)if(e=l.pop(),u[e]!==c){u[e]=c;var f=r(t,e);if(cg(f))return f;for(var h=i[e],d=a[e],p=0;p<h;++p){var v=o[d+p];v!==e&&l.push(v)}}return null}(t,e,r):function(t,e,r){var n=!0;for(;n;){var i=r(t,e);if(cg(i))return i;var o=t.parentIds[e];n=o!==e,e=o}throw new Error("traverseHierarchySingleParent")}(t,e,r)}}function hg(t,e,r){var n=t.parentCounts,i=t.parentIds,o=t.parentIndexes,a=t.classIds.length;if(cg(i)){assert(e<a,"Parent index ".concat(e," exceeds the total number of instances: ").concat(a)),assert(-1===r.indexOf(e),"Circular dependency detected in the batch table hierarchy."),r.push(e);for(var s=cg(n)?n[e]:1,u=cg(n)?o[e]:e,c=0;c<s;++c){var l=i[u+c];l!==e&&hg(t,l,r)}r.pop(e)}}function dg(t){return null!=t}var pg=function(t,e){return t},vg={HIERARCHY:!0,extensions:!0,extras:!0},yg=function(){function t(e,r,n){var i,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};for(var a in ku()(this,t),Tu(this,"json",void 0),Tu(this,"binary",void 0),Tu(this,"featureCount",void 0),Tu(this,"_extensions",void 0),Tu(this,"_properties",void 0),Tu(this,"_binaryProperties",void 0),Tu(this,"_hierarchy",void 0),Zs(n>=0),this.json=e||{},this.binary=r,this.featureCount=n,this._extensions=(null===(i=this.json)||void 0===i?void 0:i.extensions)||{},this._properties={},this.json)vg[a]||(this._properties[a]=this.json[a]);this._binaryProperties=this._initializeBinaryProperties(),o["3DTILES_batch_table_hierarchy"]&&(this._hierarchy=lg(this,this.json,this.binary))}return Ou()(t,[{key:"getExtension",value:function(t){return this.json&&this.json.extensions&&this.json.extensions[t]}},{key:"memorySizeInBytes",value:function(){return 0}},{key:"isClass",value:function(t,e){return this._checkBatchId(t),Zs("string"==typeof e,e),!!this._hierarchy&&dg(fg(this._hierarchy,t,(function(t,r){var n=t.classIds[r];return t.classes[n].name===e})))}},{key:"isExactClass",value:function(t,e){return Zs("string"==typeof e,e),this.getExactClassName(t)===e}},{key:"getExactClassName",value:function(t){if(this._checkBatchId(t),this._hierarchy){var e=this._hierarchy.classIds[t];return this._hierarchy.classes[e].name}}},{key:"hasProperty",value:function(t,e){return this._checkBatchId(t),Zs("string"==typeof e,e),dg(this._properties[e])||this._hasPropertyInHierarchy(t,e)}},{key:"getPropertyNames",value:function(t,e){var r;this._checkBatchId(t),(e=dg(e)?e:[]).length=0;var n=Object.keys(this._properties);return(r=e).push.apply(r,Mu()(n)),this._hierarchy&&this._getPropertyNamesInHierarchy(t,e),e}},{key:"getProperty",value:function(t,e){if(this._checkBatchId(t),Zs("string"==typeof e,e),this._binaryProperties){var r=this._binaryProperties[e];if(dg(r))return this._getBinaryProperty(r,t)}var n=this._properties[e];if(dg(n))return pg(n[t]);if(this._hierarchy){var i=this._getHierarchyProperty(t,e);if(dg(i))return i}}},{key:"setProperty",value:function(t,e,r){var n=this.featureCount;if(this._checkBatchId(t),Zs("string"==typeof e,e),this._binaryProperties){var i=this._binaryProperties[e];if(i)return void this._setBinaryProperty(i,t,r)}if(!this._hierarchy||!this._setHierarchyProperty(this,t,e,r)){var o=this._properties[e];dg(o)||(this._properties[e]=new Array(n),o=this._properties[e]),o[t]=pg(r)}}},{key:"_checkBatchId",value:function(t){if(!(t>=0&&t<this.featureCount))throw new Error("batchId not in range [0, featureCount - 1].")}},{key:"_getBinaryProperty",value:function(t,e){return t.unpack(t.typedArray,e)}},{key:"_setBinaryProperty",value:function(t,e,r){t.pack(r,t.typedArray,e)}},{key:"_initializeBinaryProperties",value:function(){var t=null;for(var e in this._properties){var r=this._properties[e],n=this._initializeBinaryProperty(e,r);n&&((t=t||{})[e]=n)}return t}},{key:"_initializeBinaryProperty",value:function(t,e){if("byteOffset"in e){var r=e;Zs(this.binary,"Property ".concat(t," requires a batch table binary.")),Zs(r.type,"Property ".concat(t," requires a type."));var n=function(t,e,r,n){var i=t.componentType;Zs(t.componentType);var o="string"==typeof i?ig.fromName(i):i,a=ag[t.type],s=sg[t.type],u=ug[t.type];return r+=t.byteOffset,{values:ig.createTypedArray(o,e,r,a*n),type:o,size:a,unpacker:s,packer:u}}(r,this.binary.buffer,0|this.binary.byteOffset,this.featureCount);return{typedArray:n.values,componentCount:n.size,unpack:n.unpacker,pack:n.packer}}return null}},{key:"_hasPropertyInHierarchy",value:function(t,e){if(!this._hierarchy)return!1;var r=fg(this._hierarchy,t,(function(t,r){var n=t.classIds[r];return dg(t.classes[n].instances[e])}));return dg(r)}},{key:"_getPropertyNamesInHierarchy",value:function(t,e){fg(this._hierarchy,t,(function(t,r){var n=t.classIds[r],i=t.classes[n].instances;for(var o in i)i.hasOwnProperty(o)&&-1===e.indexOf(o)&&e.push(o)}))}},{key:"_getHierarchyProperty",value:function(t,e){var r=this;return fg(this._hierarchy,t,(function(t,n){var i=t.classIds[n],o=t.classes[i],a=t.classIndexes[n],s=o.instances[e];return dg(s)?dg(s.typedArray)?r._getBinaryProperty(s,a):pg(s[a]):null}))}},{key:"_setHierarchyProperty",value:function(t,e,r,n){var i=this,o=fg(this._hierarchy,e,(function(t,o){var a=t.classIds[o],s=t.classes[a],u=t.classIndexes[o],c=s.instances[r];return!!dg(c)&&(Zs(o===e,'Inherited property "'.concat(r,'" is read-only.')),dg(c.typedArray)?i._setBinaryProperty(c,u,n):c[u]=pg(n),!0)}));return dg(o)}}]),t}();function gg(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=new DataView(e);if(t.magic=n.getUint32(r,!0),r+=4,t.version=n.getUint32(r,!0),r+=4,t.byteLength=n.getUint32(r,!0),r+=4,1!==t.version)throw new Error("3D Tile Version ".concat(t.version," not supported"));return r}function mg(t,e,r){var n,i=new DataView(e);t.header=t.header||{};var o=i.getUint32(r,!0);r+=4;var a=i.getUint32(r,!0);r+=4;var s=i.getUint32(r,!0);r+=4;var u=i.getUint32(r,!0);return r+=4,s>=570425344?(r-=8,n=o,s=a,u=0,o=0,a=0,console.warn("b3dm tile in legacy format.")):u>=570425344&&(r-=4,n=s,s=o,u=a,o=0,a=0,console.warn("b3dm tile in legacy format.")),t.header.featureTableJsonByteLength=o,t.header.featureTableBinaryByteLength=a,t.header.batchTableJsonByteLength=s,t.header.batchTableBinaryByteLength=u,t.header.batchLength=n,r}function bg(t,e,r,n){return r=function(t,e,r,n){var i=t.header,o=i.featureTableJsonByteLength,a=i.featureTableBinaryByteLength,s=i.batchLength;if(t.featureTableJson={BATCH_LENGTH:s||0},o>0){var u=Kv(e,r,o);t.featureTableJson=JSON.parse(u)}return r+=o,t.featureTableBinary=new Uint8Array(e,r,a),r+=a}(t,e,r),r=function(t,e,r,n){var i=t.header,o=i.batchTableJsonByteLength,a=i.batchTableBinaryByteLength;if(o>0){var s=Kv(e,r,o);t.batchTableJson=JSON.parse(s),r+=o,a>0&&(t.batchTableBinary=new Uint8Array(e,r,a),t.batchTableBinary=new Uint8Array(t.batchTableBinary),r+=a)}return r}(t,e,r)}function Ag(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0],r=t>>11&31,n=t>>5&63,i=31&t;return e[0]=r<<3,e[1]=n<<2,e[2]=i<<3,e}function wg(t,e,r){if(!(e||t&&t.batchIds&&r))return null;var n=t.batchIds,i=t.isRGB565,o=t.pointCount;if(n&&r){for(var a=new Uint8ClampedArray(3*o),s=0;s<o;s++){var u=n[s],c=r.getProperty(u,"dimensions").map((function(t){return 255*t}));a[3*s]=c[0],a[3*s+1]=c[1],a[3*s+2]=c[2]}return{type:5121,value:a,size:3,normalized:!0}}if(i){for(var l=new Uint8ClampedArray(3*o),f=0;f<o;f++){var h=Ag(e[f]);l[3*f]=h[0],l[3*f+1]=h[1],l[3*f+2]=h[2]}return{type:5121,value:l,size:3,normalized:!0}}return e&&e.length===3*o?{type:5121,value:e,size:3,normalized:!0}:{type:5121,value:e,size:4,normalized:!0}}function Bg(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Df()(t);if(e){var i=Df()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Pf()(this,r)}}var _g=function(t){If()(r,t);var e=Bg(r);function r(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return ku()(this,r),t=e.call(this,2),Vf(n)&&1===arguments.length?t.copy(n):(Nf.debug&&(Yf(n),Yf(i)),t[0]=n,t[1]=i),t}return Ou()(r,[{key:"set",value:function(t,e){return this[0]=t,this[1]=e,this.check()}},{key:"copy",value:function(t){return this[0]=t[0],this[1]=t[1],this.check()}},{key:"fromObject",value:function(t){return Nf.debug&&(Yf(t.x),Yf(t.y)),this[0]=t.x,this[1]=t.y,this.check()}},{key:"toObject",value:function(t){return t.x=this[0],t.y=this[1],t}},{key:"ELEMENTS",get:function(){return 2}},{key:"horizontalAngle",value:function(){return Math.atan2(this.y,this.x)}},{key:"verticalAngle",value:function(){return Math.atan2(this.x,this.y)}},{key:"transform",value:function(t){return this.transformAsPoint(t)}},{key:"transformAsPoint",value:function(t){return ph(this,this,t),this.check()}},{key:"transformAsVector",value:function(t){return oh(this,this,t),this.check()}},{key:"transformByMatrix3",value:function(t){return dh(this,this,t),this.check()}},{key:"transformByMatrix2x3",value:function(t){return function(t,e,r){var n=e[0],i=e[1];t[0]=r[0]*n+r[2]*i+r[4],t[1]=r[1]*n+r[3]*i+r[5]}(this,this,t),this.check()}},{key:"transformByMatrix2",value:function(t){return function(t,e,r){var n=e[0],i=e[1];t[0]=r[0]*n+r[2]*i,t[1]=r[1]*n+r[3]*i}(this,this,t),this.check()}}]),r}(Rh);function xg(t,e){if(!t)throw new Error("math.gl assertion failed. ".concat(e))}new _g,new Lh,new _g,new _g,new Uint8Array(1);function Cg(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:255;return Wf(t,0,e)/e*2-1}function kg(t){return t<0?-1:1}function Eg(t,e,r,n){if(xg(n),t<0||t>r||e<0||e>r)throw new Error("x and y must be unsigned normalized integers between 0 and ".concat(r));if(n.x=Cg(t,r),n.y=Cg(e,r),n.z=1-(Math.abs(n.x)+Math.abs(n.y)),n.z<0){var i=n.x;n.x=(1-Math.abs(n.y))*kg(i),n.y=(1-Math.abs(i))*kg(n.y)}return n.normalize()}function Og(t,e,r){return Eg(t,e,255,r)}var Tg=new Lh;function Sg(t,e,r){return t.isQuantized?r["3d-tiles"]&&r["3d-tiles"].decodeQuantizedPositions?(t.isQuantized=!1,function(t,e){for(var r=new Lh,n=new Float32Array(3*t.pointCount),i=0;i<t.pointCount;i++)r.set(e[3*i],e[3*i+1],e[3*i+2]).scale(1/t.quantizedRange).multiply(t.quantizedVolumeScale).add(t.quantizedVolumeOffset).toArray(n,3*i);return n}(t,e)):{type:5123,value:e,size:3,normalized:!0}:e}function Mg(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Ig(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Mg(Object(r),!0).forEach((function(e){Ys()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Mg(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Rg(t,e,r,n,i){return Pg.apply(this,arguments)}function Pg(){return(Pg=Ds()(js.a.mark((function t(e,r,n,i,o){var a,s,u;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=gg(e,r,n),n=mg(e,r,n),n=bg(e,r,n),Fg(e),a=Dg(e),s=a.featureTable,u=a.batchTable,t.next=7,Ng(e,s,u,i,o);case 7:return Lg(e,s,i),jg(e,s,u),Gg(e,s),t.abrupt("return",n);case 11:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Fg(t){t.attributes={positions:null,colors:null,normals:null,batchIds:null},t.isQuantized=!1,t.isTranslucent=!1,t.isRGB565=!1,t.isOctEncoded16P=!1}function Dg(t){var e=new og(t.featureTableJson,t.featureTableBinary),r=e.getGlobalProperty("POINTS_LENGTH");if(!Number.isFinite(r))throw new Error("POINTS_LENGTH must be defined");e.featuresLength=r,t.featuresLength=r,t.pointsLength=r,t.pointCount=r,t.rtcCenter=e.getGlobalProperty("RTC_CENTER",5126,3);var n=function(t,e){var r=null;if(!t.batchIds&&e.hasProperty("BATCH_ID")&&(t.batchIds=e.getPropertyArray("BATCH_ID",5123,1),t.batchIds)){var n=e.getGlobalProperty("BATCH_LENGTH");if(!n)throw new Error("Global property: BATCH_LENGTH must be defined when BATCH_ID is defined.");var i=t.batchTableJson,o=t.batchTableBinary;r=new yg(i,o,n)}return r}(t,e);return{featureTable:e,batchTable:n}}function Lg(t,e,r){if(!t.attributes.positions)if(e.hasProperty("POSITION"))t.attributes.positions=e.getPropertyArray("POSITION",5126,3);else if(e.hasProperty("POSITION_QUANTIZED")){var n=e.getPropertyArray("POSITION_QUANTIZED",5123,3);if(t.isQuantized=!0,t.quantizedRange=65535,t.quantizedVolumeScale=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",5126,3),!t.quantizedVolumeScale)throw new Error("QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");if(t.quantizedVolumeOffset=e.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",5126,3),!t.quantizedVolumeOffset)throw new Error("QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");t.attributes.positions=Sg(t,n,r)}if(!t.attributes.positions)throw new Error("Either POSITION or POSITION_QUANTIZED must be defined.")}function jg(t,e,r){if(!t.attributes.colors){var n=null;e.hasProperty("RGBA")?(n=e.getPropertyArray("RGBA",5121,4),t.isTranslucent=!0):e.hasProperty("RGB")?n=e.getPropertyArray("RGB",5121,3):e.hasProperty("RGB565")&&(n=e.getPropertyArray("RGB565",5123,1),t.isRGB565=!0),t.attributes.colors=wg(t,n,r)}e.hasProperty("CONSTANT_RGBA")&&(t.constantRGBA=e.getGlobalProperty("CONSTANT_RGBA",5121,4))}function Gg(t,e){if(!t.attributes.normals){var r=null;e.hasProperty("NORMAL")?r=e.getPropertyArray("NORMAL",5126,3):e.hasProperty("NORMAL_OCT16P")&&(r=e.getPropertyArray("NORMAL_OCT16P",5121,2),t.isOctEncoded16P=!0),t.attributes.normals=function(t,e){if(!e)return null;if(t.isOctEncoded16P){for(var r=new Float32Array(3*t.pointsLength),n=0;n<t.pointsLength;n++)Og(e[2*n],e[2*n+1],Tg),Tg.toArray(r,3*n);return{type:5126,size:2,value:r}}return{type:5126,size:2,value:e}}(t,r)}}function Ng(t,e,r,n,i){return Ug.apply(this,arguments)}function Ug(){return(Ug=Ds()(js.a.mark((function t(e,r,n,i,o){var a,s,u,c,l,f,h,d;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if((c=e.batchTableJson&&e.batchTableJson.extensions&&e.batchTableJson.extensions["3DTILES_draco_point_compression"])&&(u=c.properties),!(l=r.getExtension("3DTILES_draco_point_compression"))){t.next=15;break}if(s=l.properties,f=l.byteOffset,h=l.byteLength,s&&Number.isFinite(f)&&h){t.next=9;break}throw new Error("Draco properties, byteOffset, and byteLength must be defined");case 9:a=e.featureTableBinary.slice(f,f+h),e.hasPositions=Number.isFinite(s.POSITION),e.hasColors=Number.isFinite(s.RGB)||Number.isFinite(s.RGBA),e.hasNormals=Number.isFinite(s.NORMAL),e.hasBatchIds=Number.isFinite(s.BATCH_ID),e.isTranslucent=Number.isFinite(s.RGBA);case 15:if(a){t.next=17;break}return t.abrupt("return",!0);case 17:return d={buffer:a,properties:Ig(Ig({},s),u),featureTableProperties:s,batchTableProperties:u,dequantizeInShader:!1},t.next=20,Hg(e,d,i,o);case 20:return t.abrupt("return",t.sent);case 21:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Hg(t,e,r,n){return Vg.apply(this,arguments)}function Vg(){return(Vg=Ds()(js.a.mark((function t(e,r,n,i){var o,a,s,u,c,l,f,h,d,p,v,y,g,m,b;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=i.parse,delete(a=Ig(Ig({},n),{},{draco:Ig(Ig({},n.draco),{},{extraAttributes:r.batchTableProperties||{}})}))["3d-tiles"],t.next=5,o(r.buffer,$y,a);case 5:if(s=t.sent,u=s.attributes.POSITION&&s.attributes.POSITION.value,c=s.attributes.COLOR_0&&s.attributes.COLOR_0.value,l=s.attributes.NORMAL&&s.attributes.NORMAL.value,f=s.attributes.BATCH_ID&&s.attributes.BATCH_ID.value,h=u&&s.attributes.POSITION.value.quantization,d=l&&s.attributes.NORMAL.value.quantization,h&&(p=s.POSITION.data.quantization,v=p.range,e.quantizedVolumeScale=new Lh(v,v,v),e.quantizedVolumeOffset=new Lh(p.minValues),e.quantizedRange=(1<<p.quantizationBits)-1,e.isQuantizedDraco=!0),d&&(e.octEncodedRange=(1<<s.NORMAL.data.quantization.quantizationBits)-1,e.isOctEncodedDraco=!0),y={},r.batchTableProperties)for(g=0,m=Object.keys(r.batchTableProperties);g<m.length;g++)b=m[g],s.attributes[b]&&s.attributes[b].value&&(y[b.toLowerCase()]=s.attributes[b].value);e.attributes=Ig({positions:u,colors:wg(e,c,void 0),normals:l,batchIds:f},y);case 17:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var Jg,zg,Kg="https://unpkg.com/@loaders.gl/textures@".concat("3.3.0-alpha.5","/dist/libs/basis_encoder.wasm"),qg="https://unpkg.com/@loaders.gl/textures@".concat("3.3.0-alpha.5","/dist/libs/basis_encoder.js");function Wg(t){return Qg.apply(this,arguments)}function Qg(){return(Qg=Ds()(js.a.mark((function t(e){var r;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(r=e.modules||{}).basis){t.next=3;break}return t.abrupt("return",r.basis);case 3:return Jg=Jg||Xg(e),t.next=6,Jg;case 6:return t.abrupt("return",t.sent);case 7:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Xg(t){return Yg.apply(this,arguments)}function Yg(){return(Yg=Ds()(js.a.mark((function t(e){var r,n,i,o;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=null,n=null,t.t0=Promise,t.next=5,Py("basis_transcoder.js","textures",e);case 5:return t.t1=t.sent,t.next=8,Py("basis_transcoder.wasm","textures",e);case 8:return t.t2=t.sent,t.t3=[t.t1,t.t2],t.next=12,t.t0.all.call(t.t0,t.t3);case 12:return i=t.sent,o=Sf()(i,2),r=o[0],n=o[1],r=r||globalThis.BASIS,t.next=19,Zg(r,n);case 19:return t.abrupt("return",t.sent);case 20:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Zg(t,e){var r={};return e&&(r.wasmBinary=e),new Promise((function(e){t(r).then((function(t){var r=t.BasisFile;(0,t.initializeBasis)(),e({BasisFile:r})}))}))}function $g(t){return tm.apply(this,arguments)}function tm(){return(tm=Ds()(js.a.mark((function t(e){var r;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(r=e.modules||{}).basisEncoder){t.next=3;break}return t.abrupt("return",r.basisEncoder);case 3:return zg=zg||em(e),t.next=6,zg;case 6:return t.abrupt("return",t.sent);case 7:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function em(t){return rm.apply(this,arguments)}function rm(){return(rm=Ds()(js.a.mark((function t(e){var r,n,i,o;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=null,n=null,t.t0=Promise,t.next=5,Py(qg,"textures",e);case 5:return t.t1=t.sent,t.next=8,Py(Kg,"textures",e);case 8:return t.t2=t.sent,t.t3=[t.t1,t.t2],t.next=12,t.t0.all.call(t.t0,t.t3);case 12:return i=t.sent,o=Sf()(i,2),r=o[0],n=o[1],r=r||globalThis.BASIS,t.next=19,nm(r,n);case 19:return t.abrupt("return",t.sent);case 20:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function nm(t,e){var r={};return e&&(r.wasmBinary=e),new Promise((function(e){t(r).then((function(t){var r=t.BasisFile,n=t.KTX2File,i=t.initializeBasis,o=t.BasisEncoder;i(),e({BasisFile:r,KTX2File:n,BasisEncoder:o})}))}))}var im={COMPRESSED_RGB_S3TC_DXT1_EXT:33776,COMPRESSED_RGBA_S3TC_DXT1_EXT:33777,COMPRESSED_RGBA_S3TC_DXT3_EXT:33778,COMPRESSED_RGBA_S3TC_DXT5_EXT:33779,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_RGBA8_ETC2_EAC:37493,COMPRESSED_SRGB8_ETC2:37494,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37495,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37496,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37497,COMPRESSED_RGB_PVRTC_4BPPV1_IMG:35840,COMPRESSED_RGBA_PVRTC_4BPPV1_IMG:35842,COMPRESSED_RGB_PVRTC_2BPPV1_IMG:35841,COMPRESSED_RGBA_PVRTC_2BPPV1_IMG:35843,COMPRESSED_RGB_ETC1_WEBGL:36196,COMPRESSED_RGB_ATC_WEBGL:35986,COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL:35987,COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL:34798,COMPRESSED_RGBA_ASTC_4X4_KHR:37808,COMPRESSED_RGBA_ASTC_5X4_KHR:37809,COMPRESSED_RGBA_ASTC_5X5_KHR:37810,COMPRESSED_RGBA_ASTC_6X5_KHR:37811,COMPRESSED_RGBA_ASTC_6X6_KHR:37812,COMPRESSED_RGBA_ASTC_8X5_KHR:37813,COMPRESSED_RGBA_ASTC_8X6_KHR:37814,COMPRESSED_RGBA_ASTC_8X8_KHR:37815,COMPRESSED_RGBA_ASTC_10X5_KHR:37816,COMPRESSED_RGBA_ASTC_10X6_KHR:37817,COMPRESSED_RGBA_ASTC_10X8_KHR:37818,COMPRESSED_RGBA_ASTC_10X10_KHR:37819,COMPRESSED_RGBA_ASTC_12X10_KHR:37820,COMPRESSED_RGBA_ASTC_12X12_KHR:37821,COMPRESSED_SRGB8_ALPHA8_ASTC_4X4_KHR:37840,COMPRESSED_SRGB8_ALPHA8_ASTC_5X4_KHR:37841,COMPRESSED_SRGB8_ALPHA8_ASTC_5X5_KHR:37842,COMPRESSED_SRGB8_ALPHA8_ASTC_6X5_KHR:37843,COMPRESSED_SRGB8_ALPHA8_ASTC_6X6_KHR:37844,COMPRESSED_SRGB8_ALPHA8_ASTC_8X5_KHR:37845,COMPRESSED_SRGB8_ALPHA8_ASTC_8X6_KHR:37846,COMPRESSED_SRGB8_ALPHA8_ASTC_8X8_KHR:37847,COMPRESSED_SRGB8_ALPHA8_ASTC_10X5_KHR:37848,COMPRESSED_SRGB8_ALPHA8_ASTC_10X6_KHR:37849,COMPRESSED_SRGB8_ALPHA8_ASTC_10X8_KHR:37850,COMPRESSED_SRGB8_ALPHA8_ASTC_10X10_KHR:37851,COMPRESSED_SRGB8_ALPHA8_ASTC_12X10_KHR:37852,COMPRESSED_SRGB8_ALPHA8_ASTC_12X12_KHR:37853,COMPRESSED_RED_RGTC1_EXT:36283,COMPRESSED_SIGNED_RED_RGTC1_EXT:36284,COMPRESSED_RED_GREEN_RGTC2_EXT:36285,COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT:36286,COMPRESSED_SRGB_S3TC_DXT1_EXT:35916,COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT:35917,COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT:35918,COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT:35919};function om(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return am(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return am(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function am(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var sm=["","WEBKIT_","MOZ_"],um={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"},cm=null;function lm(t){if(!cm){t=t||function(){try{return document.createElement("canvas").getContext("webgl")}catch(t){return null}}()||void 0,cm=new Set;var e,r=om(sm);try{for(r.s();!(e=r.n()).done;){var n=e.value;for(var i in um)if(t&&t.getExtension("".concat(n).concat(i))){var o=um[i];cm.add(o)}}}catch(t){r.e(t)}finally{r.f()}}return cm}new Uint8Array([0]);var fm,hm,dm,pm,vm,ym,gm,mm,bm;(bm=fm||(fm={}))[bm.NONE=0]="NONE",bm[bm.BASISLZ=1]="BASISLZ",bm[bm.ZSTD=2]="ZSTD",bm[bm.ZLIB=3]="ZLIB",function(t){t[t.BASICFORMAT=0]="BASICFORMAT"}(hm||(hm={})),function(t){t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.ETC1S=163]="ETC1S",t[t.UASTC=166]="UASTC"}(dm||(dm={})),function(t){t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.SRGB=1]="SRGB"}(pm||(pm={})),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"}(vm||(vm={})),function(t){t[t.ALPHA_STRAIGHT=0]="ALPHA_STRAIGHT",t[t.ALPHA_PREMULTIPLIED=1]="ALPHA_PREMULTIPLIED"}(ym||(ym={})),function(t){t[t.RGB=0]="RGB",t[t.RRR=3]="RRR",t[t.GGG=4]="GGG",t[t.AAA=15]="AAA"}(gm||(gm={})),function(t){t[t.RGB=0]="RGB",t[t.RGBA=3]="RGBA",t[t.RRR=4]="RRR",t[t.RRRG=5]="RRRG"}(mm||(mm={}));var Am=[171,75,84,88,32,50,48,187,13,10,26,10];function wm(t){var e=new Uint8Array(t);return!(e.byteLength<Am.length||e[0]!==Am[0]||e[1]!==Am[1]||e[2]!==Am[2]||e[3]!==Am[3]||e[4]!==Am[4]||e[5]!==Am[5]||e[6]!==Am[6]||e[7]!==Am[7]||e[8]!==Am[8]||e[9]!==Am[9]||e[10]!==Am[10]||e[11]!==Am[11])}var Bm={etc1:{basisFormat:0,compressed:!0,format:im.COMPRESSED_RGB_ETC1_WEBGL},etc2:{basisFormat:1,compressed:!0},bc1:{basisFormat:2,compressed:!0,format:im.COMPRESSED_RGB_S3TC_DXT1_EXT},bc3:{basisFormat:3,compressed:!0,format:im.COMPRESSED_RGBA_S3TC_DXT5_EXT},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:im.COMPRESSED_RGB_PVRTC_4BPPV1_IMG},"pvrtc1-4-rgba":{basisFormat:9,compressed:!0,format:im.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG},"astc-4x4":{basisFormat:10,compressed:!0,format:im.COMPRESSED_RGBA_ASTC_4X4_KHR},"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 _m(){return(_m=Ds()(js.a.mark((function t(e,r){var n,i,o,a,s,u;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("auto"!==r.basis.containerFormat){t.next=11;break}if(!wm(e)){t.next=6;break}return t.next=4,$g(r);case 4:return n=t.sent,t.abrupt("return",km(n.KTX2File,e,r));case 6:return t.next=8,Wg(r);case 8:return i=t.sent,o=i.BasisFile,t.abrupt("return",xm(o,e,r));case 11:t.t0=r.basis.module,t.next="encoder"===t.t0?14:(t.t0,22);break;case 14:return t.next=16,$g(r);case 16:a=t.sent,t.t1=r.basis.containerFormat,t.next="ktx2"===t.t1?20:(t.t1,21);break;case 20:return t.abrupt("return",km(a.KTX2File,e,r));case 21:return t.abrupt("return",xm(a.BasisFile,e,r));case 22:return t.next=24,Wg(r);case 24:return s=t.sent,u=s.BasisFile,t.abrupt("return",xm(u,e,r));case 27:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function xm(t,e,r){var n=new t(new Uint8Array(e));try{if(!n.startTranscoding())throw new Error("Failed to start basis transcoding");for(var i=n.getNumImages(),o=[],a=0;a<i;a++){for(var s=n.getNumLevels(a),u=[],c=0;c<s;c++)u.push(Cm(n,a,c,r));o.push(u)}return o}finally{n.close(),n.delete()}}function Cm(t,e,r,n){var i=t.getImageWidth(e,r),o=t.getImageHeight(e,r),a=t.getHasAlpha(),s=Om(n,a),u=s.compressed,c=s.format,l=s.basisFormat,f=t.getImageTranscodedSizeInBytes(e,r,l),h=new Uint8Array(f);if(!t.transcodeImage(h,e,r,l,0,0))throw new Error("failed to start Basis transcoding");return{width:i,height:o,data:h,compressed:u,format:c,hasAlpha:a}}function km(t,e,r){var n=new t(new Uint8Array(e));try{if(!n.startTranscoding())throw new Error("failed to start KTX2 transcoding");for(var i=n.getLevels(),o=[],a=0;a<i;a++){o.push(Em(n,a,r));break}return[o]}finally{n.close(),n.delete()}}function Em(t,e,r){var n=t.getImageLevelInfo(e,0,0),i=n.alphaFlag,o=n.height,a=n.width,s=Om(r,i),u=s.compressed,c=s.format,l=s.basisFormat,f=t.getImageTranscodedSizeInBytes(e,0,0,l),h=new Uint8Array(f);if(!t.transcodeImage(h,e,0,0,l,0,-1,-1))throw new Error("Failed to transcode KTX2 image");return{width:a,height:o,data:h,compressed:u,hasAlpha:i,format:c}}function Om(t,e){var r=t&&t.basis&&t.basis.format;return"auto"===r&&(r=Tm()),"object"===Ns()(r)&&(r=e?r.alpha:r.noAlpha),r=r.toLowerCase(),Bm[r]}function Tm(){var t=lm();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"}function Sm(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Mm(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Sm(Object(r),!0).forEach((function(e){Ys()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Sm(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var Im={name:"Basis",id:kc?"basis":"basis-nodejs",module:"textures",version:"3.3.0-alpha.5",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"}}},Rm=Mm(Mm({},Im),{},{parse:function(t,e){return _m.apply(this,arguments)}}),Pm=globalThis._parseImageNode,Fm="undefined"!=typeof Image,Dm="undefined"!=typeof ImageBitmap,Lm=Boolean(Pm),jm=!!ac||Lm;function Gm(t){var e=Um(t);if(!e)throw new Error("Not an image");return e}function Nm(t){switch(Gm(t)){case"data":return t;case"image":case"imagebitmap":var e=document.createElement("canvas"),r=e.getContext("2d");if(!r)throw new Error("getImageData");return e.width=t.width,e.height=t.height,r.drawImage(t,0,0),r.getImageData(0,0,t.width,t.height);default:throw new Error("getImageData")}}function Um(t){return"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap?"imagebitmap":"undefined"!=typeof Image&&t instanceof Image?"image":t&&"object"===Ns()(t)&&t.data&&t.width&&t.height?"data":null}var Hm=/^data:image\/svg\+xml/,Vm=/\.svg((\?|#).*)?$/;function Jm(t){return t&&(Hm.test(t)||Vm.test(t))}function zm(t,e){if(Jm(e)){var r=(new TextDecoder).decode(t);try{"function"==typeof unescape&&"function"==typeof encodeURIComponent&&(r=unescape(encodeURIComponent(r)))}catch(t){throw new Error(t.message)}return"data:image/svg+xml;base64,".concat(btoa(r))}return Km(t,e)}function Km(t,e){if(Jm(e))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(t)])}function qm(t,e,r){return Wm.apply(this,arguments)}function Wm(){return(Wm=Ds()(js.a.mark((function t(e,r,n){var i,o,a;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=zm(e,n),o=self.URL||self.webkitURL,a="string"!=typeof i&&o.createObjectURL(i),t.prev=3,t.next=6,Qm(a||i,r);case 6:return t.abrupt("return",t.sent);case 7:return t.prev=7,a&&o.revokeObjectURL(a),t.finish(7);case 10:case"end":return t.stop()}}),t,null,[[3,,7,10]])})))).apply(this,arguments)}function Qm(t,e){return Xm.apply(this,arguments)}function Xm(){return(Xm=Ds()(js.a.mark((function t(e,r){var n;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if((n=new Image).src=e,!(r.image&&r.image.decode&&n.decode)){t.next=6;break}return t.next=5,n.decode();case 5:return t.abrupt("return",n);case 6:return t.next=8,new Promise((function(t,r){try{n.onload=function(){return t(n)},n.onerror=function(t){return r(new Error("Could not load image ".concat(e,": ").concat(t)))}}catch(t){r(t)}}));case 8:return t.abrupt("return",t.sent);case 9:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var Ym={},Zm=!0;function $m(t,e,r){return tb.apply(this,arguments)}function tb(){return(tb=Ds()(js.a.mark((function t(e,r,n){var i,o,a;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!Jm(n)){t.next=7;break}return t.next=3,qm(e,r,n);case 3:o=t.sent,i=o,t.next=8;break;case 7:i=Km(e,n);case 8:return a=r&&r.imagebitmap,t.next=11,eb(i,a);case 11:return t.abrupt("return",t.sent);case 12:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function eb(t){return rb.apply(this,arguments)}function rb(){return(rb=Ds()(js.a.mark((function t(e){var r,n=arguments;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!nb(r=n.length>1&&void 0!==n[1]?n[1]:null)&&Zm||(r=null),!r){t.next=13;break}return t.prev=3,t.next=6,createImageBitmap(e,r);case 6:return t.abrupt("return",t.sent);case 9:t.prev=9,t.t0=t.catch(3),console.warn(t.t0),Zm=!1;case 13:return t.next=15,createImageBitmap(e);case 15:return t.abrupt("return",t.sent);case 16:case"end":return t.stop()}}),t,null,[[3,9]])})))).apply(this,arguments)}function nb(t){for(var e in t||Ym)return!1;return!0}function ib(t){var e=ob(t);return function(t){var e=ob(t);if(!(e.byteLength>=24&&2303741511===e.getUint32(0,!1)))return null;return{mimeType:"image/png",width:e.getUint32(16,!1),height:e.getUint32(20,!1)}}(e)||function(t){var e=ob(t);if(!(e.byteLength>=3&&65496===e.getUint16(0,!1)&&255===e.getUint8(2)))return null;var r=function(){for(var t=new Set([65499,65476,65484,65501,65534]),e=65504;e<65520;++e)t.add(e);var r=new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502]);return{tableMarkers:t,sofMarkers:r}}(),n=r.tableMarkers,i=r.sofMarkers,o=2;for(;o+9<e.byteLength;){var a=e.getUint16(o,!1);if(i.has(a))return{mimeType:"image/jpeg",height:e.getUint16(o+5,!1),width:e.getUint16(o+7,!1)};if(!n.has(a))return null;o+=2,o+=e.getUint16(o,!1)}return null}(e)||function(t){var e=ob(t);if(!(e.byteLength>=10&&1195984440===e.getUint32(0,!1)))return null;return{mimeType:"image/gif",width:e.getUint16(6,!0),height:e.getUint16(8,!0)}}(e)||function(t){var e=ob(t);if(!(e.byteLength>=14&&16973===e.getUint16(0,!1)&&e.getUint32(2,!0)===e.byteLength))return null;return{mimeType:"image/bmp",width:e.getUint32(18,!0),height:e.getUint32(22,!0)}}(e)}function ob(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")}function ab(t,e){return sb.apply(this,arguments)}function sb(){return(sb=Ds()(js.a.mark((function t(e,r){var n,i,o;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=ib(e)||{},i=n.mimeType,Zs(o=globalThis._parseImageNode),t.next=5,o(e,i);case 5:return t.abrupt("return",t.sent);case 6:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function ub(){return(ub=Ds()(js.a.mark((function t(e,r,n){var i,o,a,s,u;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:i=(r=r||{}).image||{},o=i.type||"auto",a=(n||{}).url,s=cb(o),t.t0=s,t.next="imagebitmap"===t.t0?8:"image"===t.t0?12:"data"===t.t0?16:20;break;case 8:return t.next=10,$m(e,r,a);case 10:return u=t.sent,t.abrupt("break",21);case 12:return t.next=14,qm(e,r,a);case 14:return u=t.sent,t.abrupt("break",21);case 16:return t.next=18,ab(e,r);case 18:return u=t.sent,t.abrupt("break",21);case 20:Zs(!1);case 21:return"data"===o&&(u=Nm(u)),t.abrupt("return",u);case 23:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function cb(t){switch(t){case"auto":case"data":return function(){if(Dm)return"imagebitmap";if(Fm)return"image";if(jm)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}();default:return function(t){switch(t){case"auto":return Dm||Fm||jm;case"imagebitmap":return Dm;case"image":return Fm;case"data":return jm;default:throw new Error("@loaders.gl/images: image ".concat(t," not supported in this environment"))}}(t),t}}var lb={id:"image",module:"images",name:"Images",version:"3.3.0-alpha.5",mimeTypes:["image/png","image/jpeg","image/gif","image/webp","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],extensions:["png","jpg","jpeg","gif","webp","bmp","ico","svg"],parse:function(t,e,r){return ub.apply(this,arguments)},tests:[function(t){return Boolean(ib(new DataView(t)))}],options:{image:{type:"auto",decode:!0}}};function fb(t,e,r){if(t.byteLength<=e+r)return"";for(var n=new DataView(t),i="",o=0;o<r;o++)i+=String.fromCharCode(n.getUint8(e+o));return i}function hb(t){try{return JSON.parse(t)}catch(e){throw new Error('Failed to parse JSON from data starting with "'.concat(function(t){var 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 fb(t.buffer,t.byteOffset,e);if(t instanceof ArrayBuffer){var r=0;return fb(t,r,e)}return""}(t),'"'))}}function db(t,e){if(!t)throw new Error(e||"assert failed: gltf")}function pb(t,e){if(t.startsWith("data:")||t.startsWith("http:")||t.startsWith("https:"))return t;var r=e.baseUri||e.uri;if(!r)throw new Error("'baseUri' must be provided to resolve relative url ".concat(t));return r.substr(0,r.lastIndexOf("/")+1)+t}function vb(t,e,r){var n=t.bufferViews[r];db(n);var i=e[n.buffer];db(i);var o=(n.byteOffset||0)+i.byteOffset;return new Uint8Array(i.arrayBuffer,o,n.byteLength)}function yb(t,e){return Zs(t>=0),Zs(e>0),t+(e-1)&~(e-1)}function gb(t,e,r){var n;if(t instanceof ArrayBuffer)n=new Uint8Array(t);else{var i=t.byteOffset,o=t.byteLength;n=new Uint8Array(t.buffer||t.arrayBuffer,i,o)}return e.set(n,r),r+yb(n.byteLength,4)}var mb=["SCALAR","VEC2","VEC3","VEC4"],bb=[[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Uint32Array,5125],[Float32Array,5126],[Float64Array,5130]],Ab=new Map(bb),wb={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Bb={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},_b={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function xb(t){return mb[t-1]||mb[0]}function Cb(t){var e=Ab.get(t.constructor);if(!e)throw new Error("Illegal typed array");return e}function kb(t,e){var r=_b[t.componentType],n=wb[t.type],i=Bb[t.componentType],o=t.count*n,a=t.count*n*i;return db(a>=0&&a<=e.byteLength),{ArrayType:r,length:o,byteLength:a}}function Eb(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return Ob(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ob(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function Ob(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Tb(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Sb(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Tb(Object(r),!0).forEach((function(e){Ys()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Tb(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var Mb,Ib={asset:{version:"2.0",generator:"loaders.gl"},buffers:[]},Rb=function(){function t(e){ku()(this,t),Tu(this,"gltf",void 0),Tu(this,"sourceBuffers",void 0),Tu(this,"byteLength",void 0),this.gltf=e||{json:Sb({},Ib),buffers:[]},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]])}return Ou()(t,[{key:"json",get:function(){return this.gltf.json}},{key:"getApplicationData",value:function(t){return this.json[t]}},{key:"getExtraData",value:function(t){return(this.json.extras||{})[t]}},{key:"getExtension",value:function(t){var e=this.getUsedExtensions().find((function(e){return e===t})),r=this.json.extensions||{};return e?r[t]||!0:null}},{key:"getRequiredExtension",value:function(t){return this.getRequiredExtensions().find((function(e){return e===t}))?this.getExtension(t):null}},{key:"getRequiredExtensions",value:function(){return this.json.extensionsRequired||[]}},{key:"getUsedExtensions",value:function(){return this.json.extensionsUsed||[]}},{key:"getObjectExtension",value:function(t,e){return(t.extensions||{})[e]}},{key:"getScene",value:function(t){return this.getObject("scenes",t)}},{key:"getNode",value:function(t){return this.getObject("nodes",t)}},{key:"getSkin",value:function(t){return this.getObject("skins",t)}},{key:"getMesh",value:function(t){return this.getObject("meshes",t)}},{key:"getMaterial",value:function(t){return this.getObject("materials",t)}},{key:"getAccessor",value:function(t){return this.getObject("accessors",t)}},{key:"getTexture",value:function(t){return this.getObject("textures",t)}},{key:"getSampler",value:function(t){return this.getObject("samplers",t)}},{key:"getImage",value:function(t){return this.getObject("images",t)}},{key:"getBufferView",value:function(t){return this.getObject("bufferViews",t)}},{key:"getBuffer",value:function(t){return this.getObject("buffers",t)}},{key:"getObject",value:function(t,e){if("object"===Ns()(e))return e;var r=this.json[t]&&this.json[t][e];if(!r)throw new Error("glTF file error: Could not find ".concat(t,"[").concat(e,"]"));return r}},{key:"getTypedArrayForBufferView",value:function(t){var e=(t=this.getBufferView(t)).buffer,r=this.gltf.buffers[e];db(r);var n=(t.byteOffset||0)+r.byteOffset;return new Uint8Array(r.arrayBuffer,n,t.byteLength)}},{key:"getTypedArrayForAccessor",value:function(t){t=this.getAccessor(t);var e=this.getBufferView(t.bufferView),r=this.getBuffer(e.buffer).data,n=kb(t,e),i=n.ArrayType,o=n.length;return new i(r,e.byteOffset+t.byteOffset,o)}},{key:"getTypedArrayForImageData",value:function(t){t=this.getAccessor(t);var e=this.getBufferView(t.bufferView),r=this.getBuffer(e.buffer).data,n=e.byteOffset||0;return new Uint8Array(r,n,e.byteLength)}},{key:"addApplicationData",value:function(t,e){return this.json[t]=e,this}},{key:"addExtraData",value:function(t,e){return this.json.extras=this.json.extras||{},this.json.extras[t]=e,this}},{key:"addObjectExtension",value:function(t,e,r){return t.extensions=t.extensions||{},t.extensions[e]=r,this.registerUsedExtension(e),this}},{key:"setObjectExtension",value:function(t,e,r){(t.extensions||{})[e]=r}},{key:"removeObjectExtension",value:function(t,e){var r=t.extensions||{},n=r[e];return delete r[e],n}},{key:"addExtension",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return db(e),this.json.extensions=this.json.extensions||{},this.json.extensions[t]=e,this.registerUsedExtension(t),e}},{key:"addRequiredExtension",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return db(e),this.addExtension(t,e),this.registerRequiredExtension(t),e}},{key:"registerUsedExtension",value:function(t){this.json.extensionsUsed=this.json.extensionsUsed||[],this.json.extensionsUsed.find((function(e){return e===t}))||this.json.extensionsUsed.push(t)}},{key:"registerRequiredExtension",value:function(t){this.registerUsedExtension(t),this.json.extensionsRequired=this.json.extensionsRequired||[],this.json.extensionsRequired.find((function(e){return e===t}))||this.json.extensionsRequired.push(t)}},{key:"removeExtension",value:function(t){this.json.extensionsRequired&&this._removeStringFromArray(this.json.extensionsRequired,t),this.json.extensionsUsed&&this._removeStringFromArray(this.json.extensionsUsed,t),this.json.extensions&&delete this.json.extensions[t]}},{key:"setDefaultScene",value:function(t){this.json.scene=t}},{key:"addScene",value:function(t){var e=t.nodeIndices;return this.json.scenes=this.json.scenes||[],this.json.scenes.push({nodes:e}),this.json.scenes.length-1}},{key:"addNode",value:function(t){var e=t.meshIndex,r=t.matrix;this.json.nodes=this.json.nodes||[];var n={mesh:e};return r&&(n.matrix=r),this.json.nodes.push(n),this.json.nodes.length-1}},{key:"addMesh",value:function(t){var e=t.attributes,r=t.indices,n=t.material,i=t.mode,o=void 0===i?4:i,a={primitives:[{attributes:this._addAttributes(e),mode:o}]};if(r){var s=this._addIndices(r);a.primitives[0].indices=s}return Number.isFinite(n)&&(a.primitives[0].material=n),this.json.meshes=this.json.meshes||[],this.json.meshes.push(a),this.json.meshes.length-1}},{key:"addPointCloud",value:function(t){var 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}},{key:"addImage",value:function(t,e){var r=ib(t),n=e||(null==r?void 0:r.mimeType),i={bufferView:this.addBufferView(t),mimeType:n};return this.json.images=this.json.images||[],this.json.images.push(i),this.json.images.length-1}},{key:"addBufferView",value:function(t){var e=t.byteLength;db(Number.isFinite(e)),this.sourceBuffers=this.sourceBuffers||[],this.sourceBuffers.push(t);var r={buffer:0,byteOffset:this.byteLength,byteLength:e};return this.byteLength+=yb(e,4),this.json.bufferViews=this.json.bufferViews||[],this.json.bufferViews.push(r),this.json.bufferViews.length-1}},{key:"addAccessor",value:function(t,e){var r={bufferView:t,type:xb(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(r),this.json.accessors.length-1}},{key:"addBinaryBuffer",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{size:3},r=this.addBufferView(t),n={min:e.min,max:e.max};n.min&&n.max||(n=this._getAccessorMinMax(t,e.size));var i={size:e.size,componentType:Cb(t),count:Math.round(t.length/e.size),min:n.min,max:n.max};return this.addAccessor(r,Object.assign(i,e))}},{key:"addTexture",value:function(t){var e={source:t.imageIndex};return this.json.textures=this.json.textures||[],this.json.textures.push(e),this.json.textures.length-1}},{key:"addMaterial",value:function(t){return this.json.materials=this.json.materials||[],this.json.materials.push(t),this.json.materials.length-1}},{key:"createBinaryChunk",value:function(){var t,e;this.gltf.buffers=[];var r,n=this.byteLength,i=new ArrayBuffer(n),o=new Uint8Array(i),a=0,s=Eb(this.sourceBuffers||[]);try{for(s.s();!(r=s.n()).done;){a=gb(r.value,o,a)}}catch(t){s.e(t)}finally{s.f()}null!==(t=this.json)&&void 0!==t&&null!==(e=t.buffers)&&void 0!==e&&e[0]?this.json.buffers[0].byteLength=n:this.json.buffers=[{byteLength:n}],this.gltf.binary=i,this.sourceBuffers=[i]}},{key:"_removeStringFromArray",value:function(t,e){for(var r=!0;r;){var n=t.indexOf(e);n>-1?t.splice(n,1):r=!1}}},{key:"_addAttributes",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e={};for(var r in t){var n=t[r],i=this._getGltfAttributeName(r),o=this.addBinaryBuffer(n.value,n);e[i]=o}return e}},{key:"_addIndices",value:function(t){return this.addBinaryBuffer(t,{size:1})}},{key:"_getGltfAttributeName",value:function(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}}},{key:"_getAccessorMinMax",value:function(t,e){var r={min:null,max:null};if(t.length<e)return r;r.min=[],r.max=[];var n,i=Eb(t.subarray(0,e));try{for(i.s();!(n=i.n()).done;){var o=n.value;r.min.push(o),r.max.push(o)}}catch(t){i.e(t)}finally{i.f()}for(var a=e;a<t.length;a+=e)for(var s=0;s<e;s++)r.min[0+s]=Math.min(r.min[0+s],t[a+s]),r.max[0+s]=Math.max(r.max[0+s],t[a+s]);return r}}]),t}(),Pb=("undefined"==typeof WebAssembly||Ns()(WebAssembly),"B9h9z9tFBBBF8fL9gBB9gLaaaaaFa9gEaaaB9gFaFa9gEaaaFaEMcBFFFGGGEIIILF9wFFFLEFBFKNFaFCx/IFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBF8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBGy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBEn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBIi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBKI9z9iqlBOc+x8ycGBM/qQFTa8jUUUUBCU/EBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAGTkUUUBRNCUoBAG9uC/wgBZHKCUGAKCUG9JyRVAECFJRICBRcGXEXAcAF9PQFAVAFAclAcAVJAF9JyRMGXGXAG9FQBAMCbJHKC9wZRSAKCIrCEJCGrRQANCUGJRfCBRbAIRTEXGXAOATlAQ9PQBCBRISEMATAQJRIGXAS9FQBCBRtCBREEXGXAOAIlCi9PQBCBRISLMANCU/CBJAEJRKGXGXGXGXGXATAECKrJ2BBAtCKZrCEZfIBFGEBMAKhB83EBAKCNJhB83EBSEMAKAI2BIAI2BBHmCKrHYAYCE6HYy86BBAKCFJAICIJAYJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCGJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCEJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCIJAYAmJHY2BBAI2BFHmCKrHPAPCE6HPy86BBAKCLJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCKJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCOJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCNJAYAmJHY2BBAI2BGHmCKrHPAPCE6HPy86BBAKCVJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCcJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCMJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCSJAYAmJHm2BBAI2BEHICKrHYAYCE6HYy86BBAKCQJAmAYJHm2BBAICIrCEZHYAYCE6HYy86BBAKCfJAmAYJHm2BBAICGrCEZHYAYCE6HYy86BBAKCbJAmAYJHK2BBAICEZHIAICE6HIy86BBAKAIJRISGMAKAI2BNAI2BBHmCIrHYAYCb6HYy86BBAKCFJAICNJAYJHY2BBAmCbZHmAmCb6Hmy86BBAKCGJAYAmJHm2BBAI2BFHYCIrHPAPCb6HPy86BBAKCEJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCIJAmAYJHm2BBAI2BGHYCIrHPAPCb6HPy86BBAKCLJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCKJAmAYJHm2BBAI2BEHYCIrHPAPCb6HPy86BBAKCOJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCNJAmAYJHm2BBAI2BIHYCIrHPAPCb6HPy86BBAKCVJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCcJAmAYJHm2BBAI2BLHYCIrHPAPCb6HPy86BBAKCMJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCSJAmAYJHm2BBAI2BKHYCIrHPAPCb6HPy86BBAKCQJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCfJAmAYJHm2BBAI2BOHICIrHYAYCb6HYy86BBAKCbJAmAYJHK2BBAICbZHIAICb6HIy86BBAKAIJRISFMAKAI8pBB83BBAKCNJAICNJ8pBB83BBAICTJRIMAtCGJRtAECTJHEAS9JQBMMGXAIQBCBRISEMGXAM9FQBANAbJ2BBRtCBRKAfREEXAEANCU/CBJAKJ2BBHTCFrCBATCFZl9zAtJHt86BBAEAGJREAKCFJHKAM9HQBMMAfCFJRfAIRTAbCFJHbAG9HQBMMABAcAG9sJANCUGJAMAG9sTkUUUBpANANCUGJAMCaJAG9sJAGTkUUUBpMAMCBAIyAcJRcAIQBMC9+RKSFMCBC99AOAIlAGCAAGCA9Ly6yRKMALCU/EBJ8kUUUUBAKM+OmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUFT+JUUUBpALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+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"),Fb="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",Db=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]),Lb=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]),jb={0:"",1:"meshopt_decodeFilterOct",2:"meshopt_decodeFilterQuat",3:"meshopt_decodeFilterExp",NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},Gb={0:"meshopt_decodeVertexBuffer",1:"meshopt_decodeIndexBuffer",2:"meshopt_decodeIndexSequence",ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"};function Nb(t,e,r,n,i){return Ub.apply(this,arguments)}function Ub(){return(Ub=Ds()(js.a.mark((function t(e,r,n,i,o){var a,s,u=arguments;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a=u.length>5&&void 0!==u[5]?u[5]:"NONE",t.next=3,Hb();case 3:qb(s=t.sent,s.exports[Gb[o]],e,r,n,i,s.exports[jb[a||"NONE"]]);case 5:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Hb(){return Vb.apply(this,arguments)}function Vb(){return(Vb=Ds()(js.a.mark((function t(){return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return Mb||(Mb=Jb()),t.abrupt("return",Mb);case 2:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Jb(){return zb.apply(this,arguments)}function zb(){return(zb=Ds()(js.a.mark((function t(){var e,r;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=Pb,WebAssembly.validate(Db)&&(e=Fb,console.log("Warning: meshopt_decoder is using experimental SIMD support")),t.next=4,WebAssembly.instantiate(Kb(e),{});case 4:return r=t.sent,t.next=7,r.instance.exports.__wasm_call_ctors();case 7:return t.abrupt("return",r.instance);case 8:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Kb(t){for(var e=new Uint8Array(t.length),r=0;r<t.length;++r){var n=t.charCodeAt(r);e[r]=n>96?n-71:n>64?n-65:n>47?n+4:n>46?63:62}for(var i=0,o=0;o<t.length;++o)e[i++]=e[o]<60?Lb[e[o]]:64*(e[o]-60)+e[++o];return e.buffer.slice(0,i)}function qb(t,e,r,n,i,o,a){var s=t.exports.sbrk,u=n+3&-4,c=s(u*i),l=s(o.length),f=new Uint8Array(t.exports.memory.buffer);f.set(o,l);var h=e(c,n,i,l,o.length);if(0===h&&a&&a(c,u,i),r.set(f.subarray(c,c+n*i)),s(c-s(0)),0!==h)throw new Error("Malformed buffer data: ".concat(h))}function Wb(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return Qb(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Qb(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function Qb(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var Xb="EXT_meshopt_compression";function Yb(t,e){return Zb.apply(this,arguments)}function Zb(){return(Zb=Ds()(js.a.mark((function t(e,r){var n,i,o,a,s,u;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i=new Rb(e),null!=r&&null!==(n=r.gltf)&&void 0!==n&&n.decompressMeshes){t.next=3;break}return t.abrupt("return");case 3:o=[],a=Wb(e.json.bufferViews||[]);try{for(a.s();!(s=a.n()).done;)u=s.value,o.push($b(i,u))}catch(t){a.e(t)}finally{a.f()}return t.next=8,Promise.all(o);case 8:i.removeExtension("EXT_meshopt_compression");case 9:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function $b(t,e){return tA.apply(this,arguments)}function tA(){return(tA=Ds()(js.a.mark((function t(e,r){var n,i,o,a,s,u,c,l,f,h,d,p,v,y;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(n=e.getObjectExtension(r,"EXT_meshopt_compression"))){t.next=9;break}return i=n.byteOffset,o=void 0===i?0:i,a=n.byteLength,s=void 0===a?0:a,u=n.byteStride,c=n.count,l=n.mode,f=n.filter,h=void 0===f?"NONE":f,d=n.buffer,p=e.gltf.buffers[d],v=new Uint8Array(p.arrayBuffer,p.byteOffset+o,s),y=new Uint8Array(e.gltf.buffers[r.buffer].arrayBuffer,r.byteOffset,r.byteLength),t.next=8,Nb(y,c,u,v,l,h);case 8:return t.abrupt("return",y);case 9:return t.abrupt("return",null);case 10:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var eA=["image/png","image/jpeg","image/gif"],rA={};function nA(t){return void 0===rA[t]&&(rA[t]=function(t){switch(t){case"image/webp":return function(){if(!ac)return!1;try{return 0===document.createElement("canvas").toDataURL("image/webp").indexOf("data:image/webp")}catch(t){return!1}}();case"image/svg":return ac;default:if(!ac){var e=globalThis._parseImageNode;return Boolean(e)&&eA.includes(t)}return!0}}(t)),rA[t]}function iA(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return oA(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return oA(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function oA(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var aA="EXT_texture_webp";function sA(t,e){var r=new Rb(t);if(nA("image/webp")){var n,i=iA(r.json.textures||[]);try{for(i.s();!(n=i.n()).done;){var o=n.value,a=r.getObjectExtension(o,"EXT_texture_webp");a&&(o.source=a.source),r.removeObjectExtension(o,"EXT_texture_webp")}}catch(t){i.e(t)}finally{i.f()}r.removeExtension("EXT_texture_webp")}else if(r.getRequiredExtensions().includes("EXT_texture_webp"))throw new Error("gltf: Required extension ".concat("EXT_texture_webp"," not supported by browser"))}function uA(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return cA(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return cA(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function cA(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var lA="KHR_texture_basisu";function fA(t,e){var r,n=new Rb(t),i=uA(n.json.textures||[]);try{for(i.s();!(r=i.n()).done;){var o=r.value,a=n.getObjectExtension(o,"KHR_texture_basisu");a&&(o.source=a.source),n.removeObjectExtension(o,"KHR_texture_basisu")}}catch(t){i.e(t)}finally{i.f()}n.removeExtension("KHR_texture_basisu")}function hA(t){var e={};for(var r in t){var n=t[r];if("indices"!==r){var i=dA(n);e[r]=i}}return e}function dA(t){var e=function(t){var e=t,r=1,n=0;t&&t.value&&(e=t.value,r=t.size||1);e&&(ArrayBuffer.isView(e)||(e=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!t)return null;if(Array.isArray(t))return new e(t);if(r&&!(t instanceof e))return new e(t);return t}(e,Float32Array)),n=e.length/r);return{buffer:e,size:r,count:n}}(t),r=e.buffer,n=e.size;return{value:r,size:n,byteOffset:0,count:e.count,type:xb(n),componentType:Cb(r)}}function pA(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function vA(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?pA(Object(r),!0).forEach((function(e){Ys()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):pA(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var yA=js.a.mark(OA);function gA(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return mA(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return mA(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function mA(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var bA="KHR_draco_mesh_compression";function AA(t,e,r){var n,i=new Rb(t),o=gA(OA(i));try{for(o.s();!(n=o.n()).done;){var a=n.value;i.getObjectExtension(a,"KHR_draco_mesh_compression")}}catch(t){o.e(t)}finally{o.f()}}function wA(t,e,r){return BA.apply(this,arguments)}function BA(){return(BA=Ds()(js.a.mark((function t(e,r,n){var i,o,a,s,u,c;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(null!=r&&null!==(i=r.gltf)&&void 0!==i&&i.decompressMeshes){t.next=2;break}return t.abrupt("return");case 2:o=new Rb(e),a=[],s=gA(OA(o));try{for(s.s();!(u=s.n()).done;)c=u.value,o.getObjectExtension(c,"KHR_draco_mesh_compression")&&a.push(xA(o,c,r,n))}catch(t){s.e(t)}finally{s.f()}return t.next=8,Promise.all(a);case 8:o.removeExtension("KHR_draco_mesh_compression");case 9:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function _A(t){var e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=new Rb(t),i=gA(n.json.meshes||[]);try{for(i.s();!(e=i.n()).done;){var o=e.value;kA(o,r),n.addRequiredExtension("KHR_draco_mesh_compression")}}catch(t){i.e(t)}finally{i.f()}}function xA(t,e,r,n){return CA.apply(this,arguments)}function CA(){return(CA=Ds()(js.a.mark((function t(e,r,n,i){var o,a,s,u,c,l,f,h,d,p,v,y,g,m;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(o=e.getObjectExtension(r,"KHR_draco_mesh_compression")){t.next=3;break}return t.abrupt("return");case 3:return a=e.getTypedArrayForBufferView(o.bufferView),s=al(a.buffer,a.byteOffset),u=i.parse,delete(c=vA({},n))["3d-tiles"],t.next=10,u(s,$y,c,i);case 10:for(l=t.sent,f=hA(l.attributes),h=0,d=Object.entries(f);h<d.length;h++)p=Sf()(d[h],2),v=p[0],y=p[1],v in r.attributes&&(g=r.attributes[v],null!=(m=e.getAccessor(g))&&m.min&&null!=m&&m.max&&(y.min=m.min,y.max=m.max));r.attributes=f,l.indices&&(r.indices=dA(l.indices)),EA(r);case 16:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function kA(t,e){var r,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:4,i=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0;if(!i.DracoWriter)throw new Error("options.gltf.DracoWriter not provided");var a=i.DracoWriter.encodeSync({attributes:t}),s=null==o?void 0:null===(r=o.parseSync)||void 0===r?void 0:r.call(o,{attributes:t}),u=i._addFauxAttributes(s.attributes),c=i.addBufferView(a),l={primitives:[{attributes:u,mode:n,extensions:Ys()({},"KHR_draco_mesh_compression",{bufferView:c,attributes:u})}]};return l}function EA(t){if(!t.attributes&&Object.keys(t.attributes).length>0)throw new Error("glTF: Empty primitive detected: Draco decompression failure?")}function OA(t){var e,r,n,i,o,a;return js.a.wrap((function(s){for(;;)switch(s.prev=s.next){case 0:e=gA(t.json.meshes||[]),s.prev=1,e.s();case 3:if((r=e.n()).done){s.next=24;break}n=r.value,i=gA(n.primitives),s.prev=6,i.s();case 8:if((o=i.n()).done){s.next=14;break}return a=o.value,s.next=12,a;case 12:s.next=8;break;case 14:s.next=19;break;case 16:s.prev=16,s.t0=s.catch(6),i.e(s.t0);case 19:return s.prev=19,i.f(),s.finish(19);case 22:s.next=3;break;case 24:s.next=29;break;case 26:s.prev=26,s.t1=s.catch(1),e.e(s.t1);case 29:return s.prev=29,e.f(),s.finish(29);case 32:case"end":return s.stop()}}),yA,null,[[1,26,29,32],[6,16,19,22]])}var TA={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},SA={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4};function MA(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return IA(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return IA(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function IA(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var RA="KHR_texture_transform",PA=new Lh,FA=new Pd,DA=new Pd;function LA(t,e){return jA.apply(this,arguments)}function jA(){return(jA=Ds()(js.a.mark((function t(e,r){var n,i,o;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=new Rb(e),n.getExtension("KHR_texture_transform")){t.next=4;break}return t.abrupt("return");case 4:for(i=e.json.materials||[],o=0;o<i.length;o++)GA(o,e);case 6:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function GA(t,e){var r,n,i,o=[],a=null===(r=e.json.materials)||void 0===r?void 0:r[t],s=null==a?void 0:null===(n=a.pbrMetallicRoughness)||void 0===n?void 0:n.baseColorTexture;s&&NA(e,t,s,o);var u=null==a?void 0:a.emissiveTexture;u&&NA(e,t,u,o);var c=null==a?void 0:a.normalTexture;c&&NA(e,t,c,o);var l=null==a?void 0:a.occlusionTexture;l&&NA(e,t,l,o);var f=null==a?void 0:null===(i=a.pbrMetallicRoughness)||void 0===i?void 0:i.metallicRoughnessTexture;f&&NA(e,t,f,o)}function NA(t,e,r,n){var i=function(t,e){var r,n=null===(r=t.extensions)||void 0===r?void 0:r.KHR_texture_transform,i=t.texCoord,o=void 0===i?0:i,a=n.texCoord,s=void 0===a?o:a;if(-1===e.findIndex((function(t){var e=Sf()(t,2),r=e[0],n=e[1];return r===o&&n===s}))){var u=(l=(c=n).offset,f=void 0===l?[0,0]:l,h=c.rotation,d=void 0===h?0:h,p=c.scale,v=void 0===p?[1,1]:p,y=(new Pd).set(1,0,0,0,1,0,f[0],f[1],1),g=FA.set(Math.cos(d),Math.sin(d),0,-Math.sin(d),Math.cos(d),0,0,0,1),m=DA.set(v[0],0,0,0,v[1],0,0,0,1),y.multiplyRight(g).multiplyRight(m));return o!==s&&(t.texCoord=s),e.push([o,s]),{originalTexCoord:o,texCoord:s,matrix:u}}var c,l,f,h,d,p,v,y,g,m;return null}(r,n);if(i){var o,a=MA(t.json.meshes||[]);try{for(a.s();!(o=a.n()).done;){var s,u=MA(o.value.primitives);try{for(u.s();!(s=u.n()).done;){var c=s.value,l=c.material;Number.isFinite(l)&&e===l&&UA(t,c,i)}}catch(t){u.e(t)}finally{u.f()}}}catch(t){a.e(t)}finally{a.f()}}}function UA(t,e,r){var n=r.originalTexCoord,i=r.texCoord,o=r.matrix,a=e.attributes["TEXCOORD_".concat(n)];if(Number.isFinite(a)){var s,u=null===(s=t.json.accessors)||void 0===s?void 0:s[a];if(u&&u.bufferView){var c,l=null===(c=t.json.bufferViews)||void 0===c?void 0:c[u.bufferView];if(l){for(var f=t.buffers[l.buffer],h=f.arrayBuffer,d=(f.byteOffset||0)+(u.byteOffset||0)+(l.byteOffset||0),p=kb(u,l),v=p.ArrayType,y=p.length,g=SA[u.componentType],m=TA[u.type],b=l.byteStride||g*m,A=new Float32Array(y),w=0;w<u.count;w++){var B=new v(h,d+w*b,2);PA.set(B[0],B[1],1),PA.transformByMatrix3(o),A.set([PA[0],PA[1]],w*m)}n===i?function(t,e,r,n){t.componentType=5126,r.push({arrayBuffer:n.buffer,byteOffset:0,byteLength:n.buffer.byteLength}),e.buffer=r.length-1,e.byteLength=n.buffer.byteLength,e.byteOffset=0,delete e.byteStride}(u,l,t.buffers,A):function(t,e,r,n,i){n.buffers.push({arrayBuffer:i.buffer,byteOffset:0,byteLength:i.buffer.byteLength});var o=n.json.bufferViews;if(!o)return;o.push({buffer:n.buffers.length-1,byteLength:i.buffer.byteLength,byteOffset:0});var a=n.json.accessors;if(!a)return;a.push({bufferView:(null==o?void 0:o.length)-1,byteOffset:0,componentType:5126,count:e.count,type:"VEC2"}),r.attributes["TEXCOORD_".concat(t)]=a.length-1}(i,u,e,t,A)}}}}function HA(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return VA(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return VA(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function VA(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var JA="KHR_lights_punctual";function zA(t){return KA.apply(this,arguments)}function KA(){return(KA=Ds()(js.a.mark((function t(e){var r,n,i,o,a,s,u;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=new Rb(e),n=r.json,(i=r.getExtension("KHR_lights_punctual"))&&(r.json.lights=i.lights,r.removeExtension("KHR_lights_punctual")),o=HA(n.nodes||[]);try{for(o.s();!(a=o.n()).done;)s=a.value,(u=r.getObjectExtension(s,"KHR_lights_punctual"))&&(s.light=u.light),r.removeObjectExtension(s,"KHR_lights_punctual")}catch(t){o.e(t)}finally{o.f()}case 6:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function qA(t){return WA.apply(this,arguments)}function WA(){return(WA=Ds()(js.a.mark((function t(e){var r,n,i,o,a,s,u;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=new Rb(e),(n=r.json).lights&&(db(!(i=r.addExtension("KHR_lights_punctual")).lights),i.lights=n.lights,delete n.lights),r.json.lights){o=HA(r.json.lights);try{for(o.s();!(a=o.n()).done;)s=a.value,u=s.node,r.addObjectExtension(u,"KHR_lights_punctual",s)}catch(t){o.e(t)}finally{o.f()}delete r.json.lights}case 4:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function QA(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return XA(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return XA(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function XA(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var YA="KHR_materials_unlit";function ZA(t){return $A.apply(this,arguments)}function $A(){return($A=Ds()(js.a.mark((function t(e){var r,n,i,o,a;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=new Rb(e),n=r.json,r.removeExtension("KHR_materials_unlit"),i=QA(n.materials||[]);try{for(i.s();!(o=i.n()).done;)a=o.value,a.extensions&&a.extensions.KHR_materials_unlit&&(a.unlit=!0),r.removeObjectExtension(a,"KHR_materials_unlit")}catch(t){i.e(t)}finally{i.f()}case 5:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function tw(t){var e=new Rb(t),r=e.json;if(e.materials){var n,i=QA(r.materials||[]);try{for(i.s();!(n=i.n()).done;){var o=n.value;o.unlit&&(delete o.unlit,e.addObjectExtension(o,"KHR_materials_unlit",{}),e.addExtension("KHR_materials_unlit"))}}catch(t){i.e(t)}finally{i.f()}}}function ew(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return rw(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return rw(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function rw(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var nw="KHR_techniques_webgl";function iw(t){return ow.apply(this,arguments)}function ow(){return(ow=Ds()(js.a.mark((function t(e){var r,n,i,o,a,s,u,c;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=new Rb(e),n=r.json,i=r.getExtension("KHR_techniques_webgl")){o=uw(i,r),a=ew(n.materials||[]);try{for(a.s();!(s=a.n()).done;)u=s.value,(c=r.getObjectExtension(u,"KHR_techniques_webgl"))&&(u.technique=Object.assign({},c,o[c.technique]),u.technique.values=cw(u.technique,r)),r.removeObjectExtension(u,"KHR_techniques_webgl")}catch(t){a.e(t)}finally{a.f()}r.removeExtension("KHR_techniques_webgl")}case 4:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function aw(t,e){return sw.apply(this,arguments)}function sw(){return(sw=Ds()(js.a.mark((function t(e,r){return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function uw(t,e){var r=t.programs,n=void 0===r?[]:r,i=t.shaders,o=void 0===i?[]:i,a=t.techniques,s=void 0===a?[]:a,u=new TextDecoder;return o.forEach((function(t){if(!Number.isFinite(t.bufferView))throw new Error("KHR_techniques_webgl: no shader code");t.code=u.decode(e.getTypedArrayForBufferView(t.bufferView))})),n.forEach((function(t){t.fragmentShader=o[t.fragmentShader],t.vertexShader=o[t.vertexShader]})),s.forEach((function(t){t.program=n[t.program]})),s}function cw(t,e){var r=Object.assign({},t.values);return Object.keys(t.uniforms||{}).forEach((function(e){!t.uniforms[e].value||e in r||(r[e]=t.uniforms[e].value)})),Object.keys(r).forEach((function(t){"object"===Ns()(r[t])&&void 0!==r[t].index&&(r[t].texture=e.getTexture(r[t].index))})),r}var lw="EXT_feature_metadata";function fw(t){return hw.apply(this,arguments)}function hw(){return(hw=Ds()(js.a.mark((function t(e){return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:dw(new Rb(e));case 2:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function dw(t){var e,r=t.getExtension("EXT_feature_metadata"),n=null==r?void 0:null===(e=r.schema)||void 0===e?void 0:e.classes,i=null==r?void 0:r.featureTables;if((null==r?void 0:r.featureTextures)&&console.warn('featureTextures is not yet supported in the "EXT_feature_metadata" extension.'),n&&i)for(var o in n){var a=n[o],s=yw(i,o);s&&pw(t,s,a)}}function pw(t,e,r){for(var n in r.properties){var i,o=r.properties[n],a=null==e?void 0:null===(i=e.properties)||void 0===i?void 0:i[n],s=e.count;if(a){var u=vw(t,o,s,a);a.data=u}}}function vw(t,e,r,n){var i=n.bufferView,o=t.getTypedArrayForBufferView(i);switch(e.type){case"STRING":var a=n.stringOffsetBufferView;o=function(t,e,r){for(var n=[],i=new TextDecoder("utf8"),o=0,a=0;a<r;a++){var s=e[4*(a+1)]-e[4*a],u=t.subarray(o,s+o),c=i.decode(u);n.push(c),o+=s}return n}(o,t.getTypedArrayForBufferView(a),r)}return o}function yw(t,e){for(var r in t){var n=t[r];if(n.class===e)return n}return null}function gw(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return mw(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return mw(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function mw(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var bw=[i,o,a,s,c,l,f,u,h];function Aw(t){var e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,i=bw.filter((function(t){return _w(t.name,r)})),o=gw(i);try{for(o.s();!(e=o.n()).done;){var a,s=e.value;null===(a=s.preprocess)||void 0===a||a.call(s,t,r,n)}}catch(t){o.e(t)}finally{o.f()}}function ww(t){return Bw.apply(this,arguments)}function Bw(){return(Bw=Ds()(js.a.mark((function t(e){var r,n,i,o,a,s,u,c=arguments;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=c.length>1&&void 0!==c[1]?c[1]:{},n=c.length>2?c[2]:void 0,i=bw.filter((function(t){return _w(t.name,r)})),o=gw(i),t.prev=4,o.s();case 6:if((a=o.n()).done){t.next=12;break}return s=a.value,t.next=10,null===(u=s.decode)||void 0===u?void 0:u.call(s,e,r,n);case 10:t.next=6;break;case 12:t.next=17;break;case 14:t.prev=14,t.t0=t.catch(4),o.e(t.t0);case 17:return t.prev=17,o.f(),t.finish(17);case 20:case"end":return t.stop()}}),t,null,[[4,14,17,20]])})))).apply(this,arguments)}function _w(t,e){var r,n=(null==e?void 0:null===(r=e.gltf)||void 0===r?void 0:r.excludeExtensions)||{};return!(t in n&&!n[t])}function xw(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return Cw(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Cw(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function Cw(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function kw(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return Ew(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ew(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function Ew(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var Ow,Tw={accessors:"accessor",animations:"animation",buffers:"buffer",bufferViews:"bufferView",images:"image",materials:"material",meshes:"mesh",nodes:"node",samplers:"sampler",scenes:"scene",skins:"skin",textures:"texture"},Sw={accessor:"accessors",animations:"animation",buffer:"buffers",bufferView:"bufferViews",image:"images",material:"materials",mesh:"meshes",node:"nodes",sampler:"samplers",scene:"scenes",skin:"skins",texture:"textures"},Mw=function(){function t(){ku()(this,t),Tu(this,"idToIndexMap",{animations:{},accessors:{},buffers:{},bufferViews:{},images:{},materials:{},meshes:{},nodes:{},samplers:{},scenes:{},skins:{},textures:{}}),Tu(this,"json",void 0)}return Ou()(t,[{key:"normalize",value:function(t,e){this.json=t.json;var r=t.json;switch(r.asset&&r.asset.version){case"2.0":return;case void 0:case"1.0":break;default:return void console.warn("glTF: Unknown version ".concat(r.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(r),this._convertTopLevelObjectsToArrays(r),function(t){var e,r=new Rb(t),n=r.json,i=xw(n.images||[]);try{for(i.s();!(e=i.n()).done;){var o=e.value,a=r.getObjectExtension(o,"KHR_binary_glTF");a&&Object.assign(o,a),r.removeObjectExtension(o,"KHR_binary_glTF")}}catch(t){i.e(t)}finally{i.f()}n.buffers&&n.buffers[0]&&delete n.buffers[0].uri,r.removeExtension("KHR_binary_glTF")}(t),this._convertObjectIdsToArrayIndices(r),this._updateObjects(r),this._updateMaterial(r)}},{key:"_addAsset",value:function(t){t.asset=t.asset||{},t.asset.version="2.0",t.asset.generator=t.asset.generator||"Normalized to glTF 2.0 by loaders.gl"}},{key:"_convertTopLevelObjectsToArrays",value:function(t){for(var e in Tw)this._convertTopLevelObjectToArray(t,e)}},{key:"_convertTopLevelObjectToArray",value:function(t,e){var r=t[e];if(r&&!Array.isArray(r))for(var n in t[e]=[],r){var i=r[n];i.id=i.id||n;var o=t[e].length;t[e].push(i),this.idToIndexMap[e][n]=o}}},{key:"_convertObjectIdsToArrayIndices",value:function(t){for(var e in Tw)this._convertIdsToIndices(t,e);"scene"in t&&(t.scene=this._convertIdToIndex(t.scene,"scene"));var r,n=kw(t.textures);try{for(n.s();!(r=n.n()).done;){var i=r.value;this._convertTextureIds(i)}}catch(t){n.e(t)}finally{n.f()}var o,a=kw(t.meshes);try{for(a.s();!(o=a.n()).done;){var s=o.value;this._convertMeshIds(s)}}catch(t){a.e(t)}finally{a.f()}var u,c=kw(t.nodes);try{for(c.s();!(u=c.n()).done;){var l=u.value;this._convertNodeIds(l)}}catch(t){c.e(t)}finally{c.f()}var f,h=kw(t.scenes);try{for(h.s();!(f=h.n()).done;){var d=f.value;this._convertSceneIds(d)}}catch(t){h.e(t)}finally{h.f()}}},{key:"_convertTextureIds",value:function(t){t.source&&(t.source=this._convertIdToIndex(t.source,"image"))}},{key:"_convertMeshIds",value:function(t){var e,r=kw(t.primitives);try{for(r.s();!(e=r.n()).done;){var n=e.value,i=n.attributes,o=n.indices,a=n.material;for(var s in i)i[s]=this._convertIdToIndex(i[s],"accessor");o&&(n.indices=this._convertIdToIndex(o,"accessor")),a&&(n.material=this._convertIdToIndex(a,"material"))}}catch(t){r.e(t)}finally{r.f()}}},{key:"_convertNodeIds",value:function(t){var e=this;t.children&&(t.children=t.children.map((function(t){return e._convertIdToIndex(t,"node")}))),t.meshes&&(t.meshes=t.meshes.map((function(t){return e._convertIdToIndex(t,"mesh")})))}},{key:"_convertSceneIds",value:function(t){var e=this;t.nodes&&(t.nodes=t.nodes.map((function(t){return e._convertIdToIndex(t,"node")})))}},{key:"_convertIdsToIndices",value:function(t,e){t[e]||(console.warn("gltf v1: json doesn't contain attribute ".concat(e)),t[e]=[]);var r,n=kw(t[e]);try{for(n.s();!(r=n.n()).done;){var i=r.value;for(var o in i){var a=i[o],s=this._convertIdToIndex(a,o);i[o]=s}}}catch(t){n.e(t)}finally{n.f()}}},{key:"_convertIdToIndex",value:function(t,e){var r=Sw[e];if(r in this.idToIndexMap){var n=this.idToIndexMap[r][t];if(!Number.isFinite(n))throw new Error("gltf v1: failed to resolve ".concat(e," with id ").concat(t));return n}return t}},{key:"_updateObjects",value:function(t){var e,r=kw(this.json.buffers);try{for(r.s();!(e=r.n()).done;){delete e.value.type}}catch(t){r.e(t)}finally{r.f()}}},{key:"_updateMaterial",value:function(t){var e,r=kw(t.materials);try{var n=function(){var r=e.value;r.pbrMetallicRoughness={baseColorFactor:[1,1,1,1],metallicFactor:1,roughnessFactor:1};var n=(null===(i=r.values)||void 0===i?void 0:i.tex)||(null===(o=r.values)||void 0===o?void 0:o.texture2d_0)||(null===(a=r.values)||void 0===a?void 0:a.diffuseTex),s=t.textures.findIndex((function(t){return t.id===n}));-1!==s&&(r.pbrMetallicRoughness.baseColorTexture={index:s})};for(r.s();!(e=r.n()).done;){var i,o,a;n()}}catch(t){r.e(t)}finally{r.f()}}}]),t}();function Iw(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(new Mw).normalize(t,e)}function Rw(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Pw(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Rw(Object(r),!0).forEach((function(e){Ys()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Rw(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var Fw={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Dw={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},Lw=10240,jw=10241,Gw=10242,Nw=10243,Uw=10497,Hw=9729,Vw=9986,Jw={magFilter:Lw,minFilter:jw,wrapS:Gw,wrapT:Nw},zw=(Ow={},Ys()(Ow,Lw,Hw),Ys()(Ow,jw,Vw),Ys()(Ow,Gw,Uw),Ys()(Ow,Nw,Uw),Ow);var Kw=function(){function t(){ku()(this,t),Tu(this,"baseUri",""),Tu(this,"json",{}),Tu(this,"buffers",[]),Tu(this,"images",[])}return Ou()(t,[{key:"postProcess",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.json,n=t.buffers,i=void 0===n?[]:n,o=t.images,a=void 0===o?[]:o,s=t.baseUri,u=void 0===s?"":s;return db(r),this.baseUri=u,this.json=r,this.buffers=i,this.images=a,this._resolveTree(this.json,e),this.json}},{key:"_resolveTree",value:function(t){var e=this;arguments.length>1&&void 0!==arguments[1]&&arguments[1];t.bufferViews&&(t.bufferViews=t.bufferViews.map((function(t,r){return e._resolveBufferView(t,r)}))),t.images&&(t.images=t.images.map((function(t,r){return e._resolveImage(t,r)}))),t.samplers&&(t.samplers=t.samplers.map((function(t,r){return e._resolveSampler(t,r)}))),t.textures&&(t.textures=t.textures.map((function(t,r){return e._resolveTexture(t,r)}))),t.accessors&&(t.accessors=t.accessors.map((function(t,r){return e._resolveAccessor(t,r)}))),t.materials&&(t.materials=t.materials.map((function(t,r){return e._resolveMaterial(t,r)}))),t.meshes&&(t.meshes=t.meshes.map((function(t,r){return e._resolveMesh(t,r)}))),t.nodes&&(t.nodes=t.nodes.map((function(t,r){return e._resolveNode(t,r)}))),t.skins&&(t.skins=t.skins.map((function(t,r){return e._resolveSkin(t,r)}))),t.scenes&&(t.scenes=t.scenes.map((function(t,r){return e._resolveScene(t,r)}))),void 0!==t.scene&&(t.scene=t.scenes[this.json.scene])}},{key:"getScene",value:function(t){return this._get("scenes",t)}},{key:"getNode",value:function(t){return this._get("nodes",t)}},{key:"getSkin",value:function(t){return this._get("skins",t)}},{key:"getMesh",value:function(t){return this._get("meshes",t)}},{key:"getMaterial",value:function(t){return this._get("materials",t)}},{key:"getAccessor",value:function(t){return this._get("accessors",t)}},{key:"getCamera",value:function(t){return null}},{key:"getTexture",value:function(t){return this._get("textures",t)}},{key:"getSampler",value:function(t){return this._get("samplers",t)}},{key:"getImage",value:function(t){return this._get("images",t)}},{key:"getBufferView",value:function(t){return this._get("bufferViews",t)}},{key:"getBuffer",value:function(t){return this._get("buffers",t)}},{key:"_get",value:function(t,e){if("object"===Ns()(e))return e;var r=this.json[t]&&this.json[t][e];return r||console.warn("glTF file error: Could not find ".concat(t,"[").concat(e,"]")),r}},{key:"_resolveScene",value:function(t,e){var r=this;return t.id=t.id||"scene-".concat(e),t.nodes=(t.nodes||[]).map((function(t){return r.getNode(t)})),t}},{key:"_resolveNode",value:function(t,e){var r=this;return t.id=t.id||"node-".concat(e),t.children&&(t.children=t.children.map((function(t){return r.getNode(t)}))),void 0!==t.mesh?t.mesh=this.getMesh(t.mesh):void 0!==t.meshes&&t.meshes.length&&(t.mesh=t.meshes.reduce((function(t,e){var n=r.getMesh(e);return t.id=n.id,t.primitives=t.primitives.concat(n.primitives),t}),{primitives:[]})),void 0!==t.camera&&(t.camera=this.getCamera(t.camera)),void 0!==t.skin&&(t.skin=this.getSkin(t.skin)),t}},{key:"_resolveSkin",value:function(t,e){return t.id=t.id||"skin-".concat(e),t.inverseBindMatrices=this.getAccessor(t.inverseBindMatrices),t}},{key:"_resolveMesh",value:function(t,e){var r=this;return t.id=t.id||"mesh-".concat(e),t.primitives&&(t.primitives=t.primitives.map((function(t){var e=(t=Pw({},t)).attributes;for(var n in t.attributes={},e)t.attributes[n]=r.getAccessor(e[n]);return void 0!==t.indices&&(t.indices=r.getAccessor(t.indices)),void 0!==t.material&&(t.material=r.getMaterial(t.material)),t}))),t}},{key:"_resolveMaterial",value:function(t,e){if(t.id=t.id||"material-".concat(e),t.normalTexture&&(t.normalTexture=Pw({},t.normalTexture),t.normalTexture.texture=this.getTexture(t.normalTexture.index)),t.occlusionTexture&&(t.occlustionTexture=Pw({},t.occlustionTexture),t.occlusionTexture.texture=this.getTexture(t.occlusionTexture.index)),t.emissiveTexture&&(t.emmisiveTexture=Pw({},t.emmisiveTexture),t.emissiveTexture.texture=this.getTexture(t.emissiveTexture.index)),t.emissiveFactor||(t.emissiveFactor=t.emmisiveTexture?[1,1,1]:[0,0,0]),t.pbrMetallicRoughness){t.pbrMetallicRoughness=Pw({},t.pbrMetallicRoughness);var r=t.pbrMetallicRoughness;r.baseColorTexture&&(r.baseColorTexture=Pw({},r.baseColorTexture),r.baseColorTexture.texture=this.getTexture(r.baseColorTexture.index)),r.metallicRoughnessTexture&&(r.metallicRoughnessTexture=Pw({},r.metallicRoughnessTexture),r.metallicRoughnessTexture.texture=this.getTexture(r.metallicRoughnessTexture.index))}return t}},{key:"_resolveAccessor",value:function(t,e){var r,n;if(t.id=t.id||"accessor-".concat(e),void 0!==t.bufferView&&(t.bufferView=this.getBufferView(t.bufferView)),t.bytesPerComponent=(r=t.componentType,Dw[r]),t.components=(n=t.type,Fw[n]),t.bytesPerElement=t.bytesPerComponent*t.components,t.bufferView){var i=t.bufferView.buffer,o=kb(t,t.bufferView),a=o.ArrayType,s=o.byteLength,u=(t.bufferView.byteOffset||0)+(t.byteOffset||0)+i.byteOffset,c=i.arrayBuffer.slice(u,u+s);t.bufferView.byteStride&&(c=this._getValueFromInterleavedBuffer(i,u,t.bufferView.byteStride,t.bytesPerElement,t.count)),t.value=new a(c)}return t}},{key:"_getValueFromInterleavedBuffer",value:function(t,e,r,n,i){for(var o=new Uint8Array(i*n),a=0;a<i;a++){var s=e+a*r;o.set(new Uint8Array(t.arrayBuffer.slice(s,s+n)),a*n)}return o.buffer}},{key:"_resolveTexture",value:function(t,e){return t.id=t.id||"texture-".concat(e),t.sampler="sampler"in t?this.getSampler(t.sampler):zw,t.source=this.getImage(t.source),t}},{key:"_resolveSampler",value:function(t,e){for(var r in t.id=t.id||"sampler-".concat(e),t.parameters={},t){var n=this._enumSamplerParameter(r);void 0!==n&&(t.parameters[n]=t[r])}return t}},{key:"_enumSamplerParameter",value:function(t){return Jw[t]}},{key:"_resolveImage",value:function(t,e){t.id=t.id||"image-".concat(e),void 0!==t.bufferView&&(t.bufferView=this.getBufferView(t.bufferView));var r=this.images[e];return r&&(t.image=r),t}},{key:"_resolveBufferView",value:function(t,e){var r=t.buffer,n=Pw(Pw({id:"bufferView-".concat(e)},t),{},{buffer:this.buffers[r]}),i=this.buffers[r].arrayBuffer,o=this.buffers[r].byteOffset||0;return"byteOffset"in t&&(o+=t.byteOffset),n.data=new Uint8Array(i,o,t.byteLength),n}},{key:"_resolveCamera",value:function(t,e){return t.id=t.id||"camera-".concat(e),t.perspective,t.orthographic,t}}]),t}();function qw(t,e){return(new Kw).postProcess(t,e)}function Ww(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return"".concat(String.fromCharCode(t.getUint8(e+0))).concat(String.fromCharCode(t.getUint8(e+1))).concat(String.fromCharCode(t.getUint8(e+2))).concat(String.fromCharCode(t.getUint8(e+3)))}function Qw(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=new DataView(t),i=r.magic,o=void 0===i?1735152710:i,a=n.getUint32(e,!1);return a===o||1735152710===a}function Xw(t,e,r){Zs(t.header.byteLength>20);var n=e.getUint32(r+0,!0),i=e.getUint32(r+4,!0);return r+=8,Zs(0===i),Zw(t,e,r,n),r+=n,r+=$w(t,e,r,t.header.byteLength)}function Yw(t,e,r,n){return Zs(t.header.byteLength>20),function(t,e,r,n){for(;r+8<=t.header.byteLength;){var i=e.getUint32(r+0,!0),o=e.getUint32(r+4,!0);switch(r+=8,o){case 1313821514:Zw(t,e,r,i);break;case 5130562:$w(t,e,r,i);break;case 0:n.strict||Zw(t,e,r,i);break;case 1:n.strict||$w(t,e,r,i)}r+=yb(i,4)}}(t,e,r,n),r+t.header.byteLength}function Zw(t,e,r,n){var i=new Uint8Array(e.buffer,r,n),o=new TextDecoder("utf8").decode(i);return t.json=JSON.parse(o),yb(n,4)}function $w(t,e,r,n){return t.header.hasBinChunk=!0,t.binChunks.push({byteOffset:r,byteLength:n,arrayBuffer:e.buffer}),yb(n,4)}function tB(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return eB(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return eB(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function eB(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function rB(t,e){return nB.apply(this,arguments)}function nB(){return(nB=Ds()(js.a.mark((function t(e,r){var n,i,o,a,s,u,c,l,f,h,d=arguments;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=d.length>2&&void 0!==d[2]?d[2]:0,i=d.length>3?d[3]:void 0,o=d.length>4?d[4]:void 0,iB(e,r,n,i),Iw(e,{normalize:null==i?void 0:null===(a=i.gltf)||void 0===a?void 0:a.normalize}),Aw(e,i,o),l=[],null==i||null===(s=i.gltf)||void 0===s||!s.loadBuffers||!e.json.buffers){t.next=10;break}return t.next=10,oB(e,i,o);case 10:return null!=i&&null!==(u=i.gltf)&&void 0!==u&&u.loadImages&&(f=sB(e,i,o),l.push(f)),h=ww(e,i,o),l.push(h),t.next=15,Promise.all(l);case 15:return t.abrupt("return",null!=i&&null!==(c=i.gltf)&&void 0!==c&&c.postProcess?qw(e,i):e);case 16:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function iB(t,e,r,n){(n.uri&&(t.baseUri=n.uri),e instanceof ArrayBuffer&&!Qw(e,r,n))&&(e=(new TextDecoder).decode(e));if("string"==typeof e)t.json=hb(e);else if(e instanceof ArrayBuffer){var i={};r=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=(arguments.length>3&&void 0!==arguments[3]&&arguments[3],new DataView(e)),i=Ww(n,r+0),o=n.getUint32(r+4,!0),a=n.getUint32(r+8,!0);switch(Object.assign(t,{header:{byteOffset:r,byteLength:a,hasBinChunk:!1},type:i,version:o,json:{},binChunks:[]}),r+=12,t.version){case 1:return Xw(t,n,r);case 2:return Yw(t,n,r,{});default:throw new Error("Invalid GLB version ".concat(t.version,". Only supports v1 and v2."))}}(i,e,r,n.glb),db("glTF"===i.type,"Invalid GLB magic string ".concat(i.type)),t._glb=i,t.json=i.json}else db(!1,"GLTF: must be ArrayBuffer or string");var o=t.json.buffers||[];if(t.buffers=new Array(o.length).fill(null),t._glb&&t._glb.header.hasBinChunk){var a=t._glb.binChunks;t.buffers[0]={arrayBuffer:a[0].arrayBuffer,byteOffset:a[0].byteOffset,byteLength:a[0].byteLength}}var s=t.json.images||[];t.images=new Array(s.length).fill({})}function oB(t,e,r){return aB.apply(this,arguments)}function aB(){return(aB=Ds()(js.a.mark((function t(e,r,n){var i,o,a,s,u,c,l,f;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:i=e.json.buffers||[],o=0;case 2:if(!(o<i.length)){t.next=22;break}if(!(a=i[o]).uri){t.next=18;break}return db(n.fetch),c=pb(a.uri,r),t.next=10,null==n?void 0:null===(s=n.fetch)||void 0===s?void 0:s.call(n,c);case 10:return l=t.sent,t.next=13,null==l?void 0:null===(u=l.arrayBuffer)||void 0===u?void 0:u.call(l);case 13:f=t.sent,e.buffers[o]={arrayBuffer:f,byteOffset:0,byteLength:f.byteLength},delete a.uri,t.next=19;break;case 18:null===e.buffers[o]&&(e.buffers[o]={arrayBuffer:new ArrayBuffer(a.byteLength),byteOffset:0,byteLength:a.byteLength});case 19:++o,t.next=2;break;case 22:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function sB(t,e,r){return uB.apply(this,arguments)}function uB(){return(uB=Ds()(js.a.mark((function t(e,r,n){var i,o,a,s,u,c;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:i=cB(e),o=e.json.images||[],a=[],s=tB(i);try{for(s.s();!(u=s.n()).done;)c=u.value,a.push(lB(e,o[c],c,r,n))}catch(t){s.e(t)}finally{s.f()}return t.next=7,Promise.all(a);case 7:return t.abrupt("return",t.sent);case 8:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function cB(t){var e,r=new Set,n=tB(t.json.textures||[]);try{for(n.s();!(e=n.n()).done;){var i=e.value;void 0!==i.source&&r.add(i.source)}}catch(t){n.e(t)}finally{n.f()}return Array.from(r).sort()}function lB(t,e,r,n,i){return fB.apply(this,arguments)}function fB(){return(fB=Ds()(js.a.mark((function t(e,r,n,i,o){var a,s,u,c,l,f,h;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(a=o.fetch,s=o.parse,!r.uri||r.hasOwnProperty("bufferView")){t.next=10;break}return c=pb(r.uri,i),t.next=5,a(c);case 5:return l=t.sent,t.next=8,l.arrayBuffer();case 8:u=t.sent,r.bufferView={data:u};case 10:return Number.isFinite(r.bufferView)&&(f=vb(e.json,e.buffers,r.bufferView),u=al(f.buffer,f.byteOffset,f.byteLength)),db(u,"glTF image has no data"),t.next=14,s(u,[lb,Rm],{mimeType:r.mimeType,basis:i.basis||{format:Tm()}},o);case 14:(h=t.sent)&&h[0]&&(h={compressed:!0,mipmaps:!1,width:h[0].width,height:h[0].height,data:h[0]}),e.images=e.images||[],e.images[n]=h;case 18:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function hB(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function dB(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?hB(Object(r),!0).forEach((function(e){Ys()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):hB(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var pB={name:"glTF",id:"gltf",module:"gltf",version:"3.3.0-alpha.5",extensions:["gltf","glb"],mimeTypes:["model/gltf+json","model/gltf-binary"],text:!0,binary:!0,tests:["glTF"],parse:function(t){return vB.apply(this,arguments)},options:{gltf:{normalize:!0,loadBuffers:!0,loadImages:!0,decompressMeshes:!0,postProcess:!0},log:console},deprecatedOptions:{fetchImages:"gltf.loadImages",createImages:"gltf.loadImages",decompress:"gltf.decompressMeshes",postProcess:"gltf.postProcess",gltf:{decompress:"gltf.decompressMeshes"}}};function vB(){return(vB=Ds()(js.a.mark((function t(e){var r,n,i,o,a,s=arguments;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=s.length>1&&void 0!==s[1]?s[1]:{},n=s.length>2?s[2]:void 0,(r=dB(dB({},pB.options),r)).gltf=dB(dB({},pB.options.gltf),r.gltf),i=r.byteOffset,o=void 0===i?0:i,a={},t.next=8,rB(a,e,o,r,n);case 8:return t.abrupt("return",t.sent);case 9:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var yB=0,gB=1;function mB(t,e,r,n){t.rotateYtoZ=!0;var i=t.byteOffset+t.byteLength-r;if(0===i)throw new Error("glTF byte length must be greater than 0.");return t.gltfUpAxis=n["3d-tiles"]&&n["3d-tiles"].assetGltfUpAxis?n["3d-tiles"].assetGltfUpAxis:"Y",t.gltfArrayBuffer=al(e,r,i),t.gltfByteOffset=0,t.gltfByteLength=i,r%4==0||console.warn("".concat(t.type,": embedded glb is not aligned to a 4-byte boundary.")),t.byteOffset+t.byteLength}function bB(t,e,r,n){return AB.apply(this,arguments)}function AB(){return(AB=Ds()(js.a.mark((function t(e,r,n,i){var o,a,s;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(o=n["3d-tiles"]||{},wB(e,r,n),!o.loadGLTF){t.next=16;break}if(a=i.parse,s=i.fetch,!e.gltfUrl){t.next=9;break}return t.next=7,s(e.gltfUrl,n);case 7:e.gltfArrayBuffer=t.sent,e.gltfByteOffset=0;case 9:if(!e.gltfArrayBuffer){t.next=16;break}return t.next=12,a(e.gltfArrayBuffer,pB,n,i);case 12:e.gltf=t.sent,delete e.gltfArrayBuffer,delete e.gltfByteOffset,delete e.gltfByteLength;case 16:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function wB(t,e,r){switch(e){case yB:var n=new Uint8Array(t.gltfArrayBuffer,t.gltfByteOffset),i=(new TextDecoder).decode(n);t.gltfUrl=i.replace(/[\s\0]+$/,""),delete t.gltfArrayBuffer,delete t.gltfByteOffset,delete t.gltfByteLength;break;case gB:break;default:throw new Error("b3dm: Illegal glTF format field")}}function BB(t,e,r,n,i){return _B.apply(this,arguments)}function _B(){return(_B=Ds()(js.a.mark((function t(e,r,n,i,o){var a,s;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=xB(e,r,n,i,o),t.next=3,bB(e,gB,i,o);case 3:return(s=null==e?void 0:null===(a=e.gltf)||void 0===a?void 0:a.extensions)&&s.CESIUM_RTC&&(e.rtcCenter=s.CESIUM_RTC.center),t.abrupt("return",n);case 6:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function xB(t,e,r,n,i){r=mB(t,e,r=bg(t,e,r=mg(t,e,r=gg(t,e,r))),n);var o=new og(t.featureTableJson,t.featureTableBinary);return t.rtcCenter=o.getGlobalProperty("RTC_CENTER",5126,3),r}function CB(t,e,r,n,i){return kB.apply(this,arguments)}function kB(){return(kB=Ds()(js.a.mark((function t(e,r,n,i,o){return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=EB(e,r,n,i,o),t.next=3,bB(e,e.gltfFormat,i,o);case 3:return t.abrupt("return",n);case 4:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function EB(t,e,r,n,i){if(r=gg(t,e,r),1!==t.version)throw new Error("Instanced 3D Model version ".concat(t.version," is not supported"));r=mg(t,e,r);var o=new DataView(e);if(t.gltfFormat=o.getUint32(r,!0),r=mB(t,e,r=bg(t,e,r+=4),n),0===t.featureTableJsonByteLength)throw new Error("i3dm parser: featureTableJsonByteLength is zero.");var a=new og(t.featureTableJson,t.featureTableBinary),s=a.getGlobalProperty("INSTANCES_LENGTH");if(a.featuresLength=s,!Number.isFinite(s))throw new Error("i3dm parser: INSTANCES_LENGTH must be defined");t.eastNorthUp=a.getGlobalProperty("EAST_NORTH_UP"),t.rtcCenter=a.getGlobalProperty("RTC_CENTER",5126,3);new yg(t.batchTableJson,t.batchTableBinary,s);return function(t,e,r,n){for(var i=[new Array(n),t._batchTable][0],o=new Lh,a=(new Lh,new Lh,new Lh,new Pd),s=new Xd,u=new Lh,c={},l=new Mh,f=[],h=[],d=new Lh,p=new Lh,v=0;v<n;v++){var y=void 0;if(e.hasProperty("POSITION"))y=e.getProperty("POSITION",5126,3,v,o);else if(e.hasProperty("POSITION_QUANTIZED")){y=e.getProperty("POSITION_QUANTIZED",5123,3,v,o);var g=e.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",5126,3,d);if(!g)throw new Error("i3dm parser: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");var m=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",5126,3,p);if(!m)throw new Error("i3dm parser: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");for(var b=0;b<3;b++)y[b]=y[b]/65535*m[b]+g[b]}if(!y)throw new Error("i3dm: POSITION or POSITION_QUANTIZED must be defined for each instance.");o.copy(y),c.translation=o,t.normalUp=e.getProperty("NORMAL_UP",5126,3,v,f),t.normalRight=e.getProperty("NORMAL_RIGHT",5126,3,v,h);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",5123,2,f),t.octNormalRight=e.getProperty("NORMAL_RIGHT_OCT32P",5123,2,h),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?(fd.WGS84.eastNorthUpToFixedFrame(o,l),l.getRotationMatrix3(a)):a.identity()}!1,s.fromMatrix3(a),c.rotation=s,u.set(1,1,1);var A=e.getProperty("SCALE",5126,1,v);Number.isFinite(A)&&u.multiplyByScalar(A);var w=e.getProperty("SCALE_NON_UNIFORM",5126,3,v,f);w&&u.scale(w),c.scale=u;var B=e.getProperty("BATCH_ID",5123,1,v);void 0===B&&(B=v);var _=(new Mh).fromQuaternion(c.rotation);l.identity(),l.translate(c.translation),l.multiplyRight(_),l.scale(c.scale);var x=l.clone();i[v]={modelMatrix:x,batchId:B}}t.instances=i}(t,a,0,s),r}function OB(t,e,r,n,i,o){return TB.apply(this,arguments)}function TB(){return(TB=Ds()(js.a.mark((function t(e,r,n,i,o,a){var s,u;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=gg(e,r,n),s=new DataView(r),e.tilesLength=s.getUint32(n,!0),n+=4,e.tiles=[];case 5:if(!(e.tiles.length<e.tilesLength&&e.byteLength-n>12)){t.next=13;break}return u={},e.tiles.push(u),t.next=10,a(r,n,i,o,u);case 10:n=t.sent,t.next=5;break;case 13:return t.abrupt("return",n);case 14:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function SB(t,e,r,n){return MB.apply(this,arguments)}function MB(){return(MB=Ds()(js.a.mark((function t(e,r,n,i){var o;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e.rotateYtoZ=!0,e.gltfUpAxis=n["3d-tiles"]&&n["3d-tiles"].assetGltfUpAxis?n["3d-tiles"].assetGltfUpAxis:"Y",o=i.parse,t.next=5,o(r,pB,n,i);case 5:e.gltf=t.sent;case 6:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function IB(t){return RB.apply(this,arguments)}function RB(){return(RB=Ds()(js.a.mark((function t(e){var r,n,i,o,a=arguments;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=a.length>1&&void 0!==a[1]?a[1]:0,n=a.length>2?a[2]:void 0,i=a.length>3?a[3]:void 0,(o=a.length>4&&void 0!==a[4]?a[4]:{}).byteOffset=r,o.type=qv(e,r),t.t0=o.type,t.next=t.t0===zv.COMPOSITE?9:t.t0===zv.BATCHED_3D_MODEL?12:t.t0===zv.GLTF?15:t.t0===zv.INSTANCED_3D_MODEL?18:t.t0===zv.POINT_CLOUD?21:24;break;case 9:return t.next=11,OB(o,e,r,n,i,IB);case 11:return t.abrupt("return",t.sent);case 12:return t.next=14,BB(o,e,r,n,i);case 14:return t.abrupt("return",t.sent);case 15:return t.next=17,SB(o,e,n,i);case 17:return t.abrupt("return",t.sent);case 18:return t.next=20,CB(o,e,r,n,i);case 20:return t.abrupt("return",t.sent);case 21:return t.next=23,Rg(o,e,r,n,i);case 23:return t.abrupt("return",t.sent);case 24:throw new Error("3DTileLoader: unknown type ".concat(o.type));case 25:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function PB(){return(PB=Ds()(js.a.mark((function t(e,r,n){var i,o,a,s,u,c,l;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(1952609651===new Uint32Array(e.slice(0,4))[0]){t.next=3;break}throw new Error("Wrong subtree file magic number");case 3:if(1===new Uint32Array(e.slice(4,8))[0]){t.next=6;break}throw new Error("Wrong subtree file verson, must be 1");case 6:if(i=jB(e.slice(8,16)),o=new Uint8Array(e,24,i),a=new TextDecoder("utf8"),s=a.decode(o),u=JSON.parse(s),c=jB(e.slice(16,24)),l=new ArrayBuffer(0),c&&(l=e.slice(24+i)),!("bufferView"in u.tileAvailability)){t.next=18;break}return t.next=17,DB(u,"tileAvailability",l,n);case 17:u.tileAvailability.explicitBitstream=t.sent;case 18:if(!("bufferView"in u.contentAvailability)){t.next=22;break}return t.next=21,DB(u,"contentAvailability",l,n);case 21:u.contentAvailability.explicitBitstream=t.sent;case 22:if(!("bufferView"in u.childSubtreeAvailability)){t.next=26;break}return t.next=25,DB(u,"childSubtreeAvailability",l,n);case 25:u.childSubtreeAvailability.explicitBitstream=t.sent;case 26:return t.abrupt("return",u);case 27:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function FB(t,e){if(e.startsWith("http")){var r=new URL(t,e);return decodeURI(r.toString())}var n="http://".concat(e),i=new URL(t,n);return"/".concat(i.host).concat(i.pathname)}function DB(t,e,r,n){return LB.apply(this,arguments)}function LB(){return(LB=Ds()(js.a.mark((function t(e,r,n,i){var o,a,s,u,c,l;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(o=e[r].bufferView,a=e.bufferViews[o],s=e.buffers[a.buffer],null!=i&&i.url&&i.fetch){t.next=5;break}throw new Error("Url is not provided");case 5:if(i.fetch){t.next=7;break}throw new Error("fetch is not provided");case 7:if(!s.uri){t.next=16;break}return u=FB(s.uri,null==i?void 0:i.url),t.next=11,i.fetch(u);case 11:return c=t.sent,t.next=14,c.arrayBuffer();case 14:return l=t.sent,t.abrupt("return",new Uint8Array(l,a.byteOffset,a.byteLength));case 16:return t.abrupt("return",new Uint8Array(n,a.byteOffset,a.byteLength));case 17:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function jB(t){var e=new DataView(t),r=e.getUint32(0,!0),n=e.getUint32(4,!0);return r+Math.pow(2,32)*n}var GB={id:"3d-tiles-subtree",name:"3D Tiles Subtree",module:"3d-tiles",version:"3.3.0-alpha.5",extensions:["subtree"],mimeTypes:["application/octet-stream"],tests:["subtree"],parse:function(t,e,r){return PB.apply(this,arguments)},options:{}},NB={QUADTREE:4,OCTREE:8};function UB(t){return HB.apply(this,arguments)}function HB(){return(HB=Ds()(js.a.mark((function t(e){var r,n,i,o,a,s,u,c,l,f,h,d,p,v,y,g,m,b,A,w,B,_,x,C,k,E,O,T,S,M,I,R,P,F,D,L,j,G,N,U;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.options,n=e.parentData,i=void 0===n?{mortonIndex:0,x:0,y:0,z:0}:n,o=e.childIndex,a=void 0===o?0:o,s=e.globalData,u=void 0===s?{level:0,mortonIndex:0,x:0,y:0,z:0}:s,c=e.subtree,l=e.level,f=void 0===l?0:l,h=r.subdivisionScheme,d=r.subtreeLevels,p=r.maximumLevel,v=r.contentUrlTemplate,y=r.subtreesUriTemplate,g=r.basePath,m={children:[],lodMetricValue:0,contentUrl:""},b=NB[h],A=1&a,w=a>>1&1,B=a>>2&1,_=(Math.pow(b,f)-1)/(b-1),x=zB(i.mortonIndex,a),C=_+x,k=zB(i.x,A),E=zB(i.y,w),O=zB(i.z,B),T=!1,f+1>d&&(T=VB(c.childSubtreeAvailability,x)),S=zB(u.x,k),M=zB(u.y,E),I=zB(u.z,O),R=f+u.level,!T){t.next=38;break}return P="".concat(g,"/").concat(y),F=KB(P,R,S,M,I),t.next=25,Ef(F,GB);case 25:D=t.sent,c=D,u.mortonIndex=x,u.x=k,u.y=E,u.z=O,u.level=f,x=0,C=0,k=0,E=0,O=0,f=0;case 38:if(VB(c.tileAvailability,C)&&!(f>p)){t.next=41;break}return t.abrupt("return",m);case 41:VB(c.contentAvailability,C)&&(m.contentUrl=KB(v,R,S,M,I)),L=f+1,j={mortonIndex:x,x:k,y:E,z:O},G=0;case 46:if(!(G<b)){t.next=54;break}return t.next=49,UB({subtree:c,options:r,parentData:j,childIndex:G,level:L,globalData:u});case 49:((N=t.sent).contentUrl||N.children.length)&&(U=JB(N,R+1,{childTileX:k,childTileY:E,childTileZ:O},r),m.children.push(U));case 51:G++,t.next=46;break;case 54:return t.abrupt("return",m);case 55:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function VB(t,e){return"constant"in t?Boolean(t.constant):!!t.explicitBitstream&&(r=e,n=t.explicitBitstream,i=Math.floor(r/8),o=r%8,1==(n[i]>>o&1));var r,n,i,o}function JB(t,e,r,n){var i=n.basePath,o=n.refine,a=n.getRefine,s=n.lodMetricType,u=n.getTileType,c=n.rootLodMetricValue,l=n.rootBoundingVolume,f=t.contentUrl&&t.contentUrl.replace("".concat(i,"/"),""),h=c/Math.pow(2,e),d=function(t,e,r){if(e.region){var n=r.childTileX,i=r.childTileY,o=r.childTileZ,a=Sf()(e.region,6),s=a[0],u=a[1],c=a[2],l=a[3],f=a[4],h=a[5],d=Math.pow(2,t),p=(c-s)/d,v=(l-u)/d,y=(h-f)/d;return{region:[s+p*n,u+v*i,s+p*(n+1),u+v*(i+1),f+y*o,f+y*(o+1)]}}return console.warn("Unsupported bounding volume type: ",e),null}(e,l,r);return{children:t.children,contentUrl:t.contentUrl,content:{uri:f},id:t.contentUrl,refine:a(o),type:u(t),lodMetricType:s,lodMetricValue:h,geometricError:h,transform:t.transform,boundingVolume:d}}function zB(t,e){return parseInt(t.toString(2)+e.toString(2),2)}function KB(t,e,r,n,i){var o=function(t){var e={};for(var r in t)e["{".concat(r,"}")]=t[r];return e}({level:e,x:r,y:n,z:i});return t.replace(/{level}|{x}|{y}|{z}/gi,(function(t){return o[t]}))}function qB(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return WB(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return WB(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function WB(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function QB(t){if(!t.contentUrl)return Up;var e=t.contentUrl.split(".").pop();switch(e){case"pnts":return Vp;case"i3dm":case"b3dm":case"glb":case"gltf":return Hp;default:return e}}function XB(t){switch(t){case"REPLACE":case"replace":return Np;case"ADD":case"add":return Gp;default:return t}}function YB(t,e){if(/^[a-z][0-9a-z+.-]*:/i.test(e)){var r=new URL(t,"".concat(e,"/"));return decodeURI(r.toString())}return t.startsWith("/")?t:"".concat(e,"/").concat(t)}function ZB(t,e){if(!t)return null;if(t.content){var r=t.content.uri||t.content.url;t.contentUrl=YB(r,e.basePath)}return t.id=t.contentUrl,t.lodMetricType=qp,t.lodMetricValue=t.geometricError,t.transformMatrix=t.transform,t.type=QB(t),t.refine=XB(t.refine),t}function $B(t,e){return t_.apply(this,arguments)}function t_(){return(t_=Ds()(js.a.mark((function t(e,r){var n,i,o,a,s,u,c,l,f,h;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=e.basePath,!(o=o_(null==e?void 0:e.root))||!e.root){t.next=8;break}return t.next=5,e_(e.root,e,o,r);case 5:i=t.sent,t.next=9;break;case 8:i=ZB(e.root,e);case 9:(a=[]).push(i);case 11:if(!(a.length>0)){t.next=40;break}s=a.pop()||{},u=s.children||[],c=qB(u),t.prev=15,c.s();case 17:if((l=c.n()).done){t.next=30;break}if(f=l.value,!(h=o_(f))){t.next=26;break}return t.next=23,e_(f,e,h,r);case 23:f=t.sent,t.next=27;break;case 26:ZB(f,{basePath:n});case 27:a.push(f);case 28:t.next=17;break;case 30:t.next=35;break;case 32:t.prev=32,t.t0=t.catch(15),c.e(t.t0);case 35:return t.prev=35,c.f(),t.finish(35);case 38:t.next=11;break;case 40:return t.abrupt("return",i);case 41:case"end":return t.stop()}}),t,null,[[15,32,35,38]])})))).apply(this,arguments)}function e_(t,e,r,n){return r_.apply(this,arguments)}function r_(){return(r_=Ds()(js.a.mark((function t(e,r,n,i){var o,a,s,u,c,l,f,h,d,p,v,y,g,m;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a=r.basePath,s=n.subdivisionScheme,u=n.maximumLevel,c=n.subtreeLevels,l=n.subtrees.uri,f=KB(l,0,0,0,0),h=YB(f,a),t.next=6,Ef(h,GB,i);case 6:return d=t.sent,p=YB(e.content.uri,a),v=null==r?void 0:null===(o=r.root)||void 0===o?void 0:o.refine,y=e.geometricError,g=e.boundingVolume,m={contentUrlTemplate:p,subtreesUriTemplate:l,subdivisionScheme:s,subtreeLevels:c,maximumLevel:u,refine:v,basePath:a,lodMetricType:qp,rootLodMetricValue:y,rootBoundingVolume:g,getTileType:QB,getRefine:XB},t.next=14,n_(e,d,m);case 14:return t.abrupt("return",t.sent);case 15:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function n_(t,e,r){return i_.apply(this,arguments)}function i_(){return(i_=Ds()(js.a.mark((function t(e,r,n){var i,o,a;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e){t.next=2;break}return t.abrupt("return",null);case 2:return e.lodMetricType=qp,e.lodMetricValue=e.geometricError,e.transformMatrix=e.transform,t.next=7,UB({subtree:r,options:n});case 7:return i=t.sent,o=i.children,(a=i.contentUrl)&&(e.contentUrl=a,e.content={uri:a.replace("".concat(n.basePath,"/"),"")}),e.refine=XB(e.refine),e.type=QB(e),e.children=o,e.id=e.contentUrl,t.abrupt("return",e);case 16:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function o_(t){var e;return(null==t?void 0:null===(e=t.extensions)||void 0===e?void 0:e["3DTILES_implicit_tiling"])||(null==t?void 0:t.implicitTiling)}var a_={id:"3d-tiles",name:"3D Tiles",module:"3d-tiles",version:"3.3.0-alpha.5",extensions:["cmpt","pnts","b3dm","i3dm"],mimeTypes:["application/octet-stream"],tests:["cmpt","pnts","b3dm","i3dm"],parse:function(t,e,r){return h_.apply(this,arguments)},options:{"3d-tiles":{loadGLTF:!0,decodeQuantizedPositions:!1,isTileset:"auto",assetGltfUpAxis:null}}};function s_(t){return n.dirname(t.url)}function u_(t,e,r){return c_.apply(this,arguments)}function c_(){return(c_=Ds()(js.a.mark((function t(e,r,n){var i;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i={content:{featureIds:null}},0,t.next=4,IB(e,0,r,n,i.content);case 4:return t.abrupt("return",i.content);case 5:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function l_(t,e,r){return f_.apply(this,arguments)}function f_(){return(f_=Ds()(js.a.mark((function t(e,r,n){var i,o;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return(o=JSON.parse((new TextDecoder).decode(e))).loader=r.loader||a_,o.url=n.url,o.basePath=s_(o),t.next=6,$B(o,r);case 6:return o.root=t.sent,o.type=Kp,o.lodMetricType=qp,o.lodMetricValue=(null===(i=o.root)||void 0===i?void 0:i.lodMetricValue)||0,t.abrupt("return",o);case 11:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function h_(){return(h_=Ds()(js.a.mark((function t(e,r,n){var i;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i=r["3d-tiles"]||{},!("auto"===i.isTileset?n.url&&-1!==n.url.indexOf(".json"):i.isTileset)){t.next=8;break}return t.next=5,l_(e,r,n);case 5:e=t.sent,t.next=11;break;case 8:return t.next=10,u_(e,r,n);case 10:e=t.sent;case 11:return t.abrupt("return",e);case 12:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function d_(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function p_(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?d_(Object(r),!0).forEach((function(e){B()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):d_(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function v_(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=A()(t);if(e){var i=A()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return m()(this,r)}}var y_=[0],g_={getPointColor:{type:"accessor",value:[0,0,0,255]},pointSize:1,data:null,loader:a_,onTilesetLoad:{type:"function",value:function(t){},compare:!1},onTileLoad:{type:"function",value:function(t){},compare:!1},onTileUnload:{type:"function",value:function(t){},compare:!1},onTileError:{type:"function",value:function(t,e,r){},compare:!1},_getMeshColor:{type:"function",value:function(t){return[255,255,255]},compare:!1}},m_=function(t){y()(n,t);var e,r=v_(n);function n(){var t;p()(this,n);for(var e=arguments.length,i=new Array(e),o=0;o<e;o++)i[o]=arguments[o];return t=r.call.apply(r,[this].concat(i)),B()(ai()(t),"state",void 0),t}return E()(n,[{key:"initializeState",value:function(){"onTileLoadFail"in this.props&&_.log.removed("onTileLoadFail","onTileError")(),this.state={layerMap:{},tileset3d:null,activeViewports:{},lastUpdatedViewports:null}}},{key:"isLoaded",get:function(){var t=this.state.tileset3d;return null!==t&&t.isLoaded()}},{key:"shouldUpdateState",value:function(t){return t.changeFlags.somethingChanged}},{key:"updateState",value:function(t){var e=t.props,r=t.oldProps,n=t.changeFlags;if(e.data&&e.data!==r.data&&this._loadTileset(e.data),n.viewportChanged){var i=this.state.activeViewports;Object.keys(i).length&&(this._updateTileset(i),this.state.lastUpdatedViewports=i,this.state.activeViewports={})}if(n.propsChanged){var o=this.state.layerMap;for(var a in o)o[a].needsUpdate=!0}}},{key:"activateViewport",value:function(t){var e=this.state,r=e.activeViewports,n=e.lastUpdatedViewports;this.internalState.viewport=t,r[t.id]=t;var i=null==n?void 0:n[t.id];i&&t.equals(i)||(this.setChangeFlags({viewportChanged:!0}),this.setNeedsUpdate())}},{key:"getPickingInfo",value:function(t){var e=t.info,r=t.sourceLayer,n=this.state.layerMap,i=r&&r.id;if(i){var o=i.substring(this.id.length+1),a=o.substring(o.indexOf("-")+1);e.object=n[a]&&n[a].tile}return e}},{key:"filterSubLayer",value:function(t){var e=t.layer,r=t.viewport,n=e.props.tile,i=r.id;return n.selected&&n.viewportIds.includes(i)}},{key:"_updateAutoHighlight",value:function(t){t.sourceLayer&&t.sourceLayer.updateAutoHighlight(t)}},{key:"_loadTileset",value:(e=It()(Pt.a.mark((function t(e){var r,n,i,o,a,s,u;return Pt.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=this.props.loadOptions,n=void 0===r?{}:r,i=this.props.loader||this.props.loaders,Array.isArray(i)&&(i=i[0]),o={loadOptions:p_({},n)},!i.preload){t.next=10;break}return t.next=7,i.preload(e,n);case 7:(a=t.sent).headers&&(o.loadOptions.fetch=p_(p_({},o.loadOptions.fetch),{},{headers:a.headers})),Object.assign(o,a);case 10:return t.next=12,Ef(e,i,o.loadOptions);case 12:s=t.sent,u=new Jv(s,p_({onTileLoad:this._onTileLoad.bind(this),onTileUnload:this._onTileUnload.bind(this),onTileError:this.props.onTileError},o)),this.setState({tileset3d:u,layerMap:{}}),this._updateTileset(this.state.activeViewports),this.props.onTilesetLoad(u);case 17:case"end":return t.stop()}}),t,this)}))),function(t){return e.apply(this,arguments)})},{key:"_onTileLoad",value:function(t){var e=this.state.lastUpdatedViewports;this.props.onTileLoad(t),this._updateTileset(e),this.setNeedsUpdate()}},{key:"_onTileUnload",value:function(t){delete this.state.layerMap[t.id],this.props.onTileUnload(t)}},{key:"_updateTileset",value:function(t){var e=this;if(t){var r=this.state.tileset3d,n=this.context.timeline,i=Object.keys(t).length;n&&i&&r&&r.selectTiles(Object.values(t)).then((function(t){e.state.frameNumber!==t&&e.setState({frameNumber:t})}))}}},{key:"_getSubLayer",value:function(t,e){if(!t.content)return null;switch(t.type){case Vp:return this._makePointCloudLayer(t,e);case Hp:return this._make3DModelLayer(t);case Jp:return this._makeSimpleMeshLayer(t,e);default:throw new Error("Tile3DLayer: Failed to render layer of type ".concat(t.content.type))}}},{key:"_makePointCloudLayer",value:function(t,e){var r=t.content,n=r.attributes,i=r.pointCount,o=r.constantRGBA,a=r.cartographicOrigin,s=r.modelMatrix,u=n.positions,c=n.normals,l=n.colors;if(!u)return null;var f=e&&e.props.data||{header:{vertexCount:i},attributes:{POSITION:u,NORMAL:c,COLOR_0:l}},h=this.props,d=h.pointSize,p=h.getPointColor;return new(this.getSubLayerClass("pointcloud",_.PointCloudLayer))({pointSize:d},this.getSubLayerProps({id:"pointcloud"}),{id:"".concat(this.id,"-pointcloud-").concat(t.id),tile:t,data:f,coordinateSystem:_.COORDINATE_SYSTEM.METER_OFFSETS,coordinateOrigin:a,modelMatrix:s,getColor:o||p,_offset:0})}},{key:"_make3DModelLayer",value:function(t){var e=t.content,r=e.gltf,n=e.instances,i=e.cartographicOrigin,o=e.modelMatrix;return new(this.getSubLayerClass("scenegraph",_.ScenegraphLayer))({_lighting:"pbr"},this.getSubLayerProps({id:"scenegraph"}),{id:"".concat(this.id,"-scenegraph-").concat(t.id),tile:t,data:n||y_,scenegraph:r,coordinateSystem:_.COORDINATE_SYSTEM.METER_OFFSETS,coordinateOrigin:i,modelMatrix:o,getTransformMatrix:function(t){return t.modelMatrix},getPosition:[0,0,0],_offset:0})}},{key:"_makeSimpleMeshLayer",value:function(t,e){var r=t.content,n=r.attributes,i=r.indices,o=r.modelMatrix,a=r.cartographicOrigin,s=r.coordinateSystem,u=void 0===s?_.COORDINATE_SYSTEM.METER_OFFSETS:s,c=r.material,l=r.featureIds,f=this.props._getMeshColor,h=e&&e.props.mesh||new xi.Geometry({drawMode:4,attributes:b_(n),indices:i});return new(this.getSubLayerClass("mesh",Ps))(this.getSubLayerProps({id:"mesh"}),{id:"".concat(this.id,"-mesh-").concat(t.id),tile:t,mesh:h,data:y_,getColor:f(t),pbrMaterial:c,modelMatrix:o,coordinateOrigin:a,coordinateSystem:u,featureIds:l,_offset:0})}},{key:"renderLayers",value:function(){var t=this,e=this.state,r=e.tileset3d,n=e.layerMap;return r?r.tiles.map((function(e){var r=n[e.id]=n[e.id]||{tile:e},i=r.layer;return e.selected&&(i?r.needsUpdate&&(i=t._getSubLayer(e,i),r.needsUpdate=!1):i=t._getSubLayer(e)),r.layer=i,i})).filter(Boolean):null}}]),n}(_.CompositeLayer);function b_(t){var e={};return e.positions=p_(p_({},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}B()(m_,"defaultProps",g_),B()(m_,"layerName","Tile3DLayer");var A_={name:"Terrain",id:"terrain",module:"terrain",version:"3.2.10",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:null,meshMaxError:10,elevationDecoder:{rScaler:1,gScaler:0,bScaler:0,offset:0},skirtHeight:null}}};function w_(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=A()(t);if(e){var i=A()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return m()(this,r)}}function B_(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function __(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?B_(Object(r),!0).forEach((function(e){B()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):B_(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var x_=[1],C_=__(__({},Yn.defaultProps),{},{elevationData:Bn,texture:__(__({},Bn),{},{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:{type:"string",value:null},wireframe:!1,material:!0,loaders:[A_]});function k_(t){return Array.isArray(t)?t.join(";"):t||""}var E_=function(t){y()(r,t);var e=w_(r);function r(){var t;p()(this,r);for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return t=e.call.apply(e,[this].concat(i)),B()(ai()(t),"state",void 0),t}return E()(r,[{key:"updateState",value:function(t){var e=t.props,r=t.oldProps,n=e.elevationData!==r.elevationData;if(n){var i=e.elevationData,o=i&&(Array.isArray(i)||i.includes("{x}")&&i.includes("{y}"));this.setState({isTiled:o})}var a=n||e.meshMaxError!==r.meshMaxError||e.elevationDecoder!==r.elevationDecoder||e.bounds!==r.bounds;if(!this.state.isTiled&&a){var s=this.loadTerrain(e);this.setState({terrain:s})}e.workerUrl&&_.log.removed("workerUrl","loadOptions.terrain.workerUrl")()}},{key:"loadTerrain",value:function(t){var e,r=t.elevationData,n=t.bounds,i=t.elevationDecoder,o=t.meshMaxError,a=t.signal;if(!r)return null;var s=this.getLoadOptions();return s=__(__({},s),{},{terrain:__(__({skirtHeight:this.state.isTiled?2*o:0},null===(e=s)||void 0===e?void 0:e.terrain),{},{bounds:n,meshMaxError:o,elevationDecoder:i})}),(0,this.props.fetch)(r,{propName:"elevationData",layer:this,loadOptions:s,signal:a})}},{key:"getTiledTerrainData",value:function(t){var e=this.props,r=e.elevationData,n=e.fetch,i=e.texture,o=e.elevationDecoder,a=e.meshMaxError,s=this.context.viewport,u=xn(r,t),c=i&&xn(i,t),l=t.signal,f=[0,0],h=[0,0];if(s.isGeospatial){var d=t.bbox;f=s.projectFlat([d.west,d.south]),h=s.projectFlat([d.east,d.north])}else{var p=t.bbox;f=[p.left,p.bottom],h=[p.right,p.top]}var v=[f[0],f[1],h[0],h[1]],y=this.loadTerrain({elevationData:u,bounds:v,elevationDecoder:o,meshMaxError:a,signal:l}),g=c?n(c,{propName:"texture",layer:this,loaders:[],signal:l}).catch((function(t){return null})):Promise.resolve(null);return Promise.all([y,g])}},{key:"renderSubLayers",value:function(t){var e=this.getSubLayerClass("mesh",_.SimpleMeshLayer),r=this.props,n=r.color,i=r.wireframe,o=r.material,a=t.data;if(!a)return null;var s=R()(a,2),u=s[0],c=s[1];return new e(t,{data:x_,mesh:u,texture:c,_instanced:!1,coordinateSystem:_.COORDINATE_SYSTEM.CARTESIAN,getPosition:function(t){return[0,0,0]},getColor:n,wireframe:i,material:o})}},{key:"onViewportLoad",value:function(t){if(t){var e=this.state.zRange,r=t.map((function(t){return t.content})).filter(Boolean).map((function(t){return t[0].header.boundingBox.map((function(t){return t[2]}))}));if(0!==r.length){var n=Math.min.apply(Math,Lt()(r.map((function(t){return t[0]})))),i=Math.max.apply(Math,Lt()(r.map((function(t){return t[1]}))));(!e||n<e[0]||i>e[1])&&this.setState({zRange:[n,i]})}}}},{key:"renderLayers",value:function(){var t=this.props,e=t.color,r=t.material,n=t.elevationData,i=t.texture,o=t.wireframe,a=t.meshMaxError,s=t.elevationDecoder,u=t.tileSize,c=t.maxZoom,l=t.minZoom,f=t.extent,h=t.maxRequests,d=t.onTileLoad,p=t.onTileUnload,v=t.onTileError,y=t.maxCacheSize,g=t.maxCacheByteSize,m=t.refinementStrategy;return this.state.isTiled?new Yn(this.getSubLayerProps({id:"tiles"}),{getTileData:this.getTiledTerrainData.bind(this),renderSubLayers:this.renderSubLayers.bind(this),updateTriggers:{getTileData:{elevationData:k_(n),texture:k_(i),meshMaxError:a,elevationDecoder:s}},onViewportLoad:this.onViewportLoad.bind(this),zRange:this.state.zRange||null,tileSize:u,maxZoom:c,minZoom:l,extent:f,maxRequests:h,onTileLoad:d,onTileUnload:p,onTileError:v,maxCacheSize:y,maxCacheByteSize:g,refinementStrategy:m}):new(this.getSubLayerClass("mesh",_.SimpleMeshLayer))(this.getSubLayerProps({id:"mesh"}),{data:x_,mesh:this.state.terrain,texture:i,_instanced:!1,getPosition:function(t){return[0,0,0]},getColor:e,material:r,wireframe:o})}}]),r}(_.CompositeLayer);B()(E_,"defaultProps",C_),B()(E_,"layerName","TerrainLayer");function O_(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.start,n=void 0===r?0:r,i=e.end,o=void 0===i?t.length:i,a=e.size||2,s=0,u=n,c=o-a;u<o;u+=a)s+=(t[u]-t[c])*(t[u+1]+t[c+1]),c=u;return s/2}function T_(t,e,r,n,i,o){var a,s;if(void 0===o&&(o=O_(t,{start:e,end:r,size:n})),i===o<0)for(a=e;a<r;a+=n)s=Y_(a,t[a],t[a+1],s);else for(a=r-n;a>=e;a-=n)s=Y_(a,t[a],t[a+1],s);return s&&z_(s,s.next)&&(Z_(s),s=s.next),s}function S_(t,e){if(!t)return t;e||(e=t);var r,n=t;do{if(r=!1,n.steiner||!z_(n,n.next)&&0!==J_(n.prev,n,n.next))n=n.next;else{if(Z_(n),(n=e=n.prev)===n.next)break;r=!0}}while(r||n!==e);return e}function M_(t,e,r,n,i,o,a){if(t){!a&&o&&function(t,e,r,n){var i=t;do{null===i.z&&(i.z=N_(i.x,i.y,e,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,function(t){var e,r,n,i,o,a,s,u,c=1;do{for(i=t,t=null,u=null,n=0;i;){for(n++,a=i,o=0,r=0;r<c&&(o++,a=a.nextZ);r++);for(s=c;o>0||s>0&&a;)0!==o&&(0===s||!a||i.z<=a.z)?(e=i,i=i.nextZ,o--):(e=a,a=a.nextZ,s--),u?u.nextZ=e:t=e,e.prevZ=u,u=e;i=a}u.nextZ=null,c*=2}while(n>1)}(i)}(t,n,i,o);for(var s,u,c=t;t.prev!==t.next;)if(s=t.prev,u=t.next,o?R_(t,n,i,o):I_(t))e.push(s.i/r),e.push(t.i/r),e.push(u.i/r),Z_(t),t=u.next,c=u.next;else if((t=u)===c){a?1===a?M_(t=P_(S_(t),e,r),e,r,n,i,o,2):2===a&&F_(t,e,r,n,i,o):M_(S_(t),e,r,n,i,o,1);break}}}function I_(t){var e=t.prev,r=t,n=t.next;if(J_(e,r,n)>=0)return!1;for(var i=t.next.next;i!==t.prev;){if(H_(e.x,e.y,r.x,r.y,n.x,n.y,i.x,i.y)&&J_(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function R_(t,e,r,n){var i=t.prev,o=t,a=t.next;if(J_(i,o,a)>=0)return!1;for(var s=i.x<o.x?i.x<a.x?i.x:a.x:o.x<a.x?o.x:a.x,u=i.y<o.y?i.y<a.y?i.y:a.y:o.y<a.y?o.y:a.y,c=i.x>o.x?i.x>a.x?i.x:a.x:o.x>a.x?o.x:a.x,l=i.y>o.y?i.y>a.y?i.y:a.y:o.y>a.y?o.y:a.y,f=N_(s,u,e,r,n),h=N_(c,l,e,r,n),d=t.prevZ,p=t.nextZ;d&&d.z>=f&&p&&p.z<=h;){if(d!==t.prev&&d!==t.next&&H_(i.x,i.y,o.x,o.y,a.x,a.y,d.x,d.y)&&J_(d.prev,d,d.next)>=0)return!1;if(d=d.prevZ,p!==t.prev&&p!==t.next&&H_(i.x,i.y,o.x,o.y,a.x,a.y,p.x,p.y)&&J_(p.prev,p,p.next)>=0)return!1;p=p.nextZ}for(;d&&d.z>=f;){if(d!==t.prev&&d!==t.next&&H_(i.x,i.y,o.x,o.y,a.x,a.y,d.x,d.y)&&J_(d.prev,d,d.next)>=0)return!1;d=d.prevZ}for(;p&&p.z<=h;){if(p!==t.prev&&p!==t.next&&H_(i.x,i.y,o.x,o.y,a.x,a.y,p.x,p.y)&&J_(p.prev,p,p.next)>=0)return!1;p=p.nextZ}return!0}function P_(t,e,r){var n=t;do{var i=n.prev,o=n.next.next;!z_(i,o)&&K_(i,n,n.next,o)&&Q_(i,o)&&Q_(o,i)&&(e.push(i.i/r),e.push(n.i/r),e.push(o.i/r),Z_(n),Z_(n.next),n=t=o),n=n.next}while(n!==t);return S_(n)}function F_(t,e,r,n,i,o){var a=t;do{for(var s=a.next.next;s!==a.prev;){if(a.i!==s.i&&V_(a,s)){var u=X_(a,s);return a=S_(a,a.next),u=S_(u,u.next),M_(a,e,r,n,i,o),void M_(u,e,r,n,i,o)}s=s.next}a=a.next}while(a!==t)}function D_(t,e,r,n,i){var o,a,s,u=[];for(o=0,a=e.length;o<a;o++)(s=T_(t,e[o]*n,o<a-1?e[o+1]*n:t.length,n,!1,i&&i[o+1]))===s.next&&(s.steiner=!0),u.push(U_(s));for(u.sort(L_),o=0;o<u.length;o++)j_(u[o],r),r=S_(r,r.next);return r}function L_(t,e){return t.x-e.x}function j_(t,e){if(e=function(t,e){var r,n=e,i=t.x,o=t.y,a=-1/0;do{if(o<=n.y&&o>=n.next.y&&n.next.y!==n.y){var s=n.x+(o-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=i&&s>a){if(a=s,s===i){if(o===n.y)return n;if(o===n.next.y)return n.next}r=n.x<n.next.x?n:n.next}}n=n.next}while(n!==e);if(!r)return null;if(i===a)return r;var u,c=r,l=r.x,f=r.y,h=1/0;n=r;do{i>=n.x&&n.x>=l&&i!==n.x&&H_(o<f?i:a,o,l,f,o<f?a:i,o,n.x,n.y)&&(u=Math.abs(o-n.y)/(i-n.x),Q_(n,t)&&(u<h||u===h&&(n.x>r.x||n.x===r.x&&G_(r,n)))&&(r=n,h=u)),n=n.next}while(n!==c);return r}(t,e)){var r=X_(e,t);S_(e,e.next),S_(r,r.next)}}function G_(t,e){return J_(t.prev,t,e.prev)<0&&J_(e.next,t,t.next)<0}function N_(t,e,r,n,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*i)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*i)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function U_(t){var e=t,r=t;do{(e.x<r.x||e.x===r.x&&e.y<r.y)&&(r=e),e=e.next}while(e!==t);return r}function H_(t,e,r,n,i,o,a,s){return(i-a)*(e-s)-(t-a)*(o-s)>=0&&(t-a)*(n-s)-(r-a)*(e-s)>=0&&(r-a)*(o-s)-(i-a)*(n-s)>=0}function V_(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&K_(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&(Q_(t,e)&&Q_(e,t)&&function(t,e){var r=t,n=!1,i=(t.x+e.x)/2,o=(t.y+e.y)/2;do{r.y>o!=r.next.y>o&&r.next.y!==r.y&&i<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==t);return n}(t,e)&&(J_(t.prev,t,e.prev)||J_(t,e.prev,e))||z_(t,e)&&J_(t.prev,t,t.next)>0&&J_(e.prev,e,e.next)>0)}function J_(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function z_(t,e){return t.x===e.x&&t.y===e.y}function K_(t,e,r,n){var i=W_(J_(t,e,r)),o=W_(J_(t,e,n)),a=W_(J_(r,n,t)),s=W_(J_(r,n,e));return i!==o&&a!==s||(!(0!==i||!q_(t,r,e))||(!(0!==o||!q_(t,n,e))||(!(0!==a||!q_(r,t,n))||!(0!==s||!q_(r,e,n)))))}function q_(t,e,r){return e.x<=Math.max(t.x,r.x)&&e.x>=Math.min(t.x,r.x)&&e.y<=Math.max(t.y,r.y)&&e.y>=Math.min(t.y,r.y)}function W_(t){return t>0?1:t<0?-1:0}function Q_(t,e){return J_(t.prev,t,t.next)<0?J_(t,e,t.next)>=0&&J_(t,t.prev,e)>=0:J_(t,e,t.prev)<0||J_(t,t.next,e)<0}function X_(t,e){var r=new $_(t.i,t.x,t.y),n=new $_(e.i,e.x,e.y),i=t.next,o=e.prev;return t.next=e,e.prev=t,r.next=i,i.prev=r,n.next=r,r.prev=n,o.next=n,n.prev=o,n}function Y_(t,e,r,n){var i=new $_(t,e,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function Z_(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 $_(t,e,r){this.i=t,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function tx(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return ex(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ex(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function ex(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function rx(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function nx(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?rx(Object(r),!0).forEach((function(e){B()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):rx(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function ix(t,e,r){var n=ox(t),i=Object.keys(n).filter((function(t){return n[t]!==Array}));return function(t,e,r){for(var n=e.pointPositionsCount,i=e.pointFeaturesCount,o=e.linePositionsCount,a=e.linePathsCount,s=e.lineFeaturesCount,u=e.polygonPositionsCount,c=e.polygonObjectsCount,l=e.polygonRingsCount,f=e.polygonFeaturesCount,h=e.propArrayTypes,d=e.coordLength,p=r.numericPropKeys,v=void 0===p?[]:p,y=r.PositionDataType,g=void 0===y?Float32Array:y,m=(t[0]&&"id"in t[0]),b=t.length>65535?Uint32Array:Uint16Array,A={type:"Point",positions:new g(n*d),globalFeatureIds:new b(n),featureIds:i>65535?new Uint32Array(n):new Uint16Array(n),numericProps:{},properties:[],fields:[]},w={type:"LineString",pathIndices:o>65535?new Uint32Array(a+1):new Uint16Array(a+1),positions:new g(o*d),globalFeatureIds:new b(o),featureIds:s>65535?new Uint32Array(o):new Uint16Array(o),numericProps:{},properties:[],fields:[]},B={type:"Polygon",polygonIndices:u>65535?new Uint32Array(c+1):new Uint16Array(c+1),primitivePolygonIndices:u>65535?new Uint32Array(l+1):new Uint16Array(l+1),positions:new g(u*d),triangles:[],globalFeatureIds:new b(u),featureIds:f>65535?new Uint32Array(u):new Uint16Array(u),numericProps:{},properties:[],fields:[]},_=0,x=[A,w,B];_<x.length;_++){var C,k=x[_],E=tx(v);try{for(E.s();!(C=E.n()).done;){var O=C.value,T=h[O];k.numericProps[O]=new T(k.positions.length/d)}}catch(t){E.e(t)}finally{E.f()}}w.pathIndices[a]=o,B.polygonIndices[c]=u,B.primitivePolygonIndices[l]=u;var S,M={pointPosition:0,pointFeature:0,linePosition:0,linePath:0,lineFeature:0,polygonPosition:0,polygonObject:0,polygonRing:0,polygonFeature:0,feature:0},I=tx(t);try{for(I.s();!(S=I.n()).done;){var R=S.value,P=R.geometry,F=R.properties||{};switch(P.type){case"Point":ax(P,A,M,d,F),A.properties.push(hx(F,v)),m&&A.fields.push({id:R.id}),M.pointFeature++;break;case"LineString":sx(P,w,M,d,F),w.properties.push(hx(F,v)),m&&w.fields.push({id:R.id}),M.lineFeature++;break;case"Polygon":ux(P,B,M,d,F),B.properties.push(hx(F,v)),m&&B.fields.push({id:R.id}),M.polygonFeature++;break;default:throw new Error("Invalid geometry type")}M.feature++}}catch(t){I.e(t)}finally{I.f()}return function(t,e,r,n){return{points:nx(nx({},t),{},{positions:{value:t.positions,size:n},globalFeatureIds:{value:t.globalFeatureIds,size:1},featureIds:{value:t.featureIds,size:1},numericProps:lx(t.numericProps,1)}),lines:nx(nx({},e),{},{positions:{value:e.positions,size:n},pathIndices:{value:e.pathIndices,size:1},globalFeatureIds:{value:e.globalFeatureIds,size:1},featureIds:{value:e.featureIds,size:1},numericProps:lx(e.numericProps,1)}),polygons:nx(nx({},r),{},{positions:{value:r.positions,size:n},polygonIndices:{value:r.polygonIndices,size:1},primitivePolygonIndices:{value:r.primitivePolygonIndices,size:1},triangles:{value:new Uint32Array(r.triangles),size:1},globalFeatureIds:{value:r.globalFeatureIds,size:1},featureIds:{value:r.featureIds,size:1},numericProps:lx(r.numericProps,1)})}}(A,w,B,d)}(t,nx({propArrayTypes:n},e),{numericPropKeys:r&&r.numericPropKeys||i,PositionDataType:r?r.PositionDataType:Float32Array})}function ox(t){var e,r={},n=tx(t);try{for(n.s();!(e=n.n()).done;){var i=e.value;if(i.properties)for(var o in i.properties){var a=i.properties[o];r[o]=dx(a,r[o])}}}catch(t){n.e(t)}finally{n.f()}return r}function ax(t,e,r,n,i){e.positions.set(t.data,r.pointPosition*n);var o=t.data.length/n;fx(e,i,r.pointPosition,o),e.globalFeatureIds.fill(r.feature,r.pointPosition,r.pointPosition+o),e.featureIds.fill(r.pointFeature,r.pointPosition,r.pointPosition+o),r.pointPosition+=o}function sx(t,e,r,n,i){e.positions.set(t.data,r.linePosition*n);var o=t.data.length/n;fx(e,i,r.linePosition,o),e.globalFeatureIds.fill(r.feature,r.linePosition,r.linePosition+o),e.featureIds.fill(r.lineFeature,r.linePosition,r.linePosition+o);for(var a=0,s=t.indices.length;a<s;++a){var u=t.indices[a],c=a===s-1?t.data.length:t.indices[a+1];e.pathIndices[r.linePath++]=r.linePosition,r.linePosition+=(c-u)/n}}function ux(t,e,r,n,i){e.positions.set(t.data,r.polygonPosition*n);var o=t.data.length/n;fx(e,i,r.polygonPosition,o),e.globalFeatureIds.fill(r.feature,r.polygonPosition,r.polygonPosition+o),e.featureIds.fill(r.polygonFeature,r.polygonPosition,r.polygonPosition+o);for(var a=0,s=t.indices.length;a<s;++a){var u=r.polygonPosition;e.polygonIndices[r.polygonObject++]=u;for(var c=t.areas[a],l=t.indices[a],f=t.indices[a+1],h=0,d=l.length;h<d;++h){var p=l[h],v=h===d-1?void 0===f?t.data.length:f[0]:l[h+1];e.primitivePolygonIndices[r.polygonRing++]=r.polygonPosition,r.polygonPosition+=(v-p)/n}cx(e,c,l,{startPosition:u,endPosition:r.polygonPosition,coordLength:n})}}function cx(t,e,r,n){for(var i=n.startPosition,o=n.endPosition,a=n.coordLength,s=i*a,u=o*a,c=t.positions.subarray(s,u),l=r[0],f=function(t,e){var r,n,i,o,a,s,u,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2,l=arguments.length>3?arguments[3]:void 0,f=e&&e.length,h=f?e[0]*c:t.length,d=T_(t,0,h,c,!0,l&&l[0]),p=[];if(!d||d.next===d.prev)return p;if(f&&(d=D_(t,e,d,c,l)),t.length>80*c){o=n=t[0],a=i=t[1];for(var v=c;v<h;v+=c)(s=t[v])<o&&(o=s),(u=t[v+1])<a&&(a=u),s>n&&(n=s),u>i&&(i=u);r=0!==(r=Math.max(n-o,i-a))?1/r:0}return M_(d,p,c,o,a,r),p}(c,r.slice(1).map((function(t){return(t-l)/a})),a,e),h=0,d=f.length;h<d;++h)t.triangles.push(i+f[h])}function lx(t,e){var r={};for(var n in t)r[n]={value:t[n],size:e};return r}function fx(t,e,r,n){for(var i in t.numericProps)if(i in e){var o=e[i];t.numericProps[i].fill(o,r,r+n)}}function hx(t,e){var r={};for(var n in t)e.includes(n)||(r[n]=t[n]);return r}function dx(t,e){return e!==Array&&Number.isFinite(t)?e===Float64Array||Math.fround(t)!==t?Float64Array:Float32Array:Array}var px=r(54),vx=r.n(px);function yx(t){for(var e,r,n=0,i=0,o=t.length-1;i<t.length;o=i++)e=t[i],n+=((r=t[o])[0]-e[0])*(e[1]+r[1]);return n}function gx(t,e,r){e&&r&&(1===t?e.id=r.readVarint():2===t?function(t,e){var r=t.readVarint()+t.pos;for(;t.pos<r;){var n=e._keys[t.readVarint()],i=e._values[t.readVarint()];e.properties[n]=i}}(r,e):3===t?e.type=r.readVarint():4===t&&(e._geometry=r.pos))}var mx=function(){function t(e,r,n,i,o){p()(this,t),In(this,"properties",void 0),In(this,"extent",void 0),In(this,"type",void 0),In(this,"id",void 0),In(this,"_pbf",void 0),In(this,"_geometry",void 0),In(this,"_keys",void 0),In(this,"_values",void 0),this.properties={},this.extent=n,this.type=0,this.id=null,this._pbf=e,this._geometry=-1,this._keys=i,this._values=o,e.readFields(gx,this,r)}return E()(t,[{key:"loadGeometry",value:function(){var t=this._pbf;t.pos=this._geometry;for(var e,r=t.readVarint()+t.pos,n=1,i=0,o=0,a=0,s=[];t.pos<r;){if(i<=0){var u=t.readVarint();n=7&u,i=u>>3}if(i--,1===n||2===n)o+=t.readSVarint(),a+=t.readSVarint(),1===n&&(e&&s.push(e),e=[]),e&&e.push([o,a]);else{if(7!==n)throw new Error("unknown command ".concat(n));e&&e.push(e[0].slice())}}return e&&s.push(e),s}},{key:"bbox",value:function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,r=1,n=0,i=0,o=0,a=1/0,s=-1/0,u=1/0,c=-1/0;t.pos<e;){if(n<=0){var l=t.readVarint();r=7&l,n=l>>3}if(n--,1===r||2===r)(i+=t.readSVarint())<a&&(a=i),i>s&&(s=i),(o+=t.readSVarint())<u&&(u=o),o>c&&(c=o);else if(7!==r)throw new Error("unknown command ".concat(r))}return[a,u,s,c]}},{key:"_toGeoJSON",value:function(e){var r,n,i=this.loadGeometry(),o=t.types[this.type];switch(this.type){case 1:var a=[];for(r=0;r<i.length;r++)a[r]=i[r][0];e(i=a,this);break;case 2:for(r=0;r<i.length;r++)e(i[r],this);break;case 3:for(i=function(t){var e=t.length;if(e<=1)return[t];for(var r,n,i=[],o=0;o<e;o++){var a=yx(t[o]);0!==a&&(void 0===n&&(n=a<0),n===a<0?(r&&i.push(r),r=[t[o]]):r&&r.push(t[o]))}return r&&i.push(r),i}(i),r=0;r<i.length;r++)for(n=0;n<i[r].length;n++)e(i[r][n],this)}1===i.length?i=i[0]:o="Multi".concat(o);var s={type:"Feature",geometry:{type:o,coordinates:i},properties:this.properties};return null!==this.id&&(s.id=this.id),s}},{key:"toGeoJSON",value:function(t){if("function"==typeof t)return this._toGeoJSON(t);var e=t.x,r=t.y,n=t.z,i=this.extent*Math.pow(2,n),o=this.extent*e,a=this.extent*r;return this._toGeoJSON((function(t){for(var e=0;e<t.length;e++){var r=t[e];r[0]=360*(r[0]+o)/i-180;var n=180-360*(r[1]+a)/i;r[1]=360/Math.PI*Math.atan(Math.exp(n*Math.PI/180))-90}}))}}],[{key:"types",get:function(){return["Unknown","Point","LineString","Polygon"]}}]),t}(),bx=function(){function t(e,r){p()(this,t),In(this,"version",void 0),In(this,"name",void 0),In(this,"extent",void 0),In(this,"length",void 0),In(this,"_pbf",void 0),In(this,"_keys",void 0),In(this,"_values",void 0),In(this,"_features",void 0),this.version=1,this.name="",this.extent=4096,this.length=0,this._pbf=e,this._keys=[],this._values=[],this._features=[],e.readFields(Ax,this,r),this.length=this._features.length}return E()(t,[{key:"feature",value: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 mx(this._pbf,e,this.extent,this._keys,this._values)}}]),t}();function Ax(t,e,r){e&&r&&(15===t?e.version=r.readVarint():1===t?e.name=r.readString():5===t?e.extent=r.readVarint():2===t?e._features.push(r.pos):3===t?e._keys.push(r.readString()):4===t&&e._values.push(function(t){var e=null,r=t.readVarint()+t.pos;for(;t.pos<r;){var 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}(r)))}var wx,Bx,_x,xx,Cx,kx,Ex,Ox=function t(e,r){p()(this,t),In(this,"layers",void 0),this.layers=e.readFields(Tx,{},r)};function Tx(t,e,r){if(3===t&&r){var n=new bx(r,r.readVarint()+r.pos);n.length&&e&&(e[n.name]=n)}}function Sx(t){var e=t.indices.length;if(e<=1)return{type:"Polygon",data:t.data,areas:[[O_(t.data)]],indices:[t.indices]};for(var r,n,i,o=[],a=[],s=[],u=[],c=0,l=0;l<e;l++){i=t.indices[l]-c,n=t.indices[l+1]-c||t.data.length;var f=O_(t.data.slice(i,n));if(0!==f)void 0===r&&(r=f<0),r===f<0?(u.length&&(o.push(s),a.push(u)),u=[i],s=[f]):(s.push(f),u.push(i));else{var h=t.data.slice(0,i),d=t.data.slice(n);t.data=h.concat(d),c+=n-i}}return s&&o.push(s),u.length&&a.push(u),{type:"Polygon",areas:o,indices:a,data:t.data}}function Mx(t,e,r){e&&r&&(1===t?e.id=r.readVarint():2===t?function(t,e){var r=t.readVarint()+t.pos;for(;t.pos<r;){var n=e._keys[t.readVarint()],i=e._values[t.readVarint()];e.properties[n]=i}}(r,e):3===t?e.type=r.readVarint():4===t&&(e._geometry=r.pos))}function Ix(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return Rx(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Rx(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function Rx(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Px(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Fx(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Px(Object(r),!0).forEach((function(e){B()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Px(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var Dx=function(){function t(e,r,n,i,o,a){p()(this,t),In(this,"properties",void 0),In(this,"extent",void 0),In(this,"type",void 0),In(this,"id",void 0),In(this,"_pbf",void 0),In(this,"_geometry",void 0),In(this,"_keys",void 0),In(this,"_values",void 0),In(this,"_geometryInfo",void 0),this.properties={},this.extent=n,this.type=0,this.id=null,this._pbf=e,this._geometry=-1,this._keys=i,this._values=o,this._geometryInfo=a,e.readFields(Mx,this,r)}return E()(t,[{key:"loadGeometry",value:function(){var t=this._pbf;t.pos=this._geometry,wx=t.readVarint()+t.pos,Bx=1,xx=0,Cx=0,kx=0,Ex=0;for(var e=[],r=[];t.pos<wx;)if(xx<=0&&(_x=t.readVarint(),Bx=7&_x,xx=_x>>3),xx--,1===Bx||2===Bx)Cx+=t.readSVarint(),kx+=t.readSVarint(),1===Bx&&e.push(Ex),r.push(Cx,kx),Ex+=2;else{if(7!==Bx)throw new Error("unknown command ".concat(Bx));if(Ex>0){var n=e[e.length-1];r.push(r[n],r[n+1]),Ex+=2}}return{data:r,indices:e}}},{key:"_toBinaryCoordinates",value:function(t){var e,r=this.loadGeometry();t(r.data,this);switch(this.type){case 1:this._geometryInfo.pointFeaturesCount++,this._geometryInfo.pointPositionsCount+=r.indices.length,e=Fx({type:"Point"},r);break;case 2:this._geometryInfo.lineFeaturesCount++,this._geometryInfo.linePathsCount+=r.indices.length,this._geometryInfo.linePositionsCount+=r.data.length/2,e=Fx({type:"LineString"},r);break;case 3:e=Sx(r),this._geometryInfo.polygonFeaturesCount++,this._geometryInfo.polygonObjectsCount+=e.indices.length;var n,i=Ix(e.indices);try{for(i.s();!(n=i.n()).done;){var o=n.value;this._geometryInfo.polygonRingsCount+=o.length}}catch(t){i.e(t)}finally{i.f()}this._geometryInfo.polygonPositionsCount+=e.data.length/2;break;default:throw new Error("Invalid geometry type: ".concat(this.type))}var a={type:"Feature",geometry:e,properties:this.properties};return null!==this.id&&(a.id=this.id),a}},{key:"toBinaryCoordinates",value:function(t){if("function"==typeof t)return this._toBinaryCoordinates(t);var e=t.x,r=t.y,n=t.z,i=this.extent*Math.pow(2,n),o=this.extent*e,a=this.extent*r;return this._toBinaryCoordinates((function(t){return function(t,e,r,n){for(var i=0,o=t.length;i<o;i+=2){t[i]=360*(t[i]+e)/n-180;var a=180-360*(t[i+1]+r)/n;t[i+1]=360/Math.PI*Math.atan(Math.exp(a*Math.PI/180))-90}}(t,o,a,i)}))}}]),t}(),Lx=function(){function t(e,r){p()(this,t),In(this,"version",void 0),In(this,"name",void 0),In(this,"extent",void 0),In(this,"length",void 0),In(this,"_pbf",void 0),In(this,"_keys",void 0),In(this,"_values",void 0),In(this,"_features",void 0),this.version=1,this.name="",this.extent=4096,this.length=0,this._pbf=e,this._keys=[],this._values=[],this._features=[],e.readFields(jx,this,r),this.length=this._features.length}return E()(t,[{key:"feature",value:function(t,e){if(t<0||t>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[t];var r=this._pbf.readVarint()+this._pbf.pos;return new Dx(this._pbf,r,this.extent,this._keys,this._values,e)}}]),t}();function jx(t,e,r){e&&r&&(15===t?e.version=r.readVarint():1===t?e.name=r.readString():5===t?e.extent=r.readVarint():2===t?e._features.push(r.pos):3===t?e._keys.push(r.readString()):4===t&&e._values.push(function(t){var e=null,r=t.readVarint()+t.pos;for(;t.pos<r;){var 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}(r)))}var Gx=function t(e,r){p()(this,t),In(this,"layers",void 0),this.layers=e.readFields(Nx,{},r)};function Nx(t,e,r){if(3===t&&r){var n=new Lx(r,r.readVarint()+r.pos);n.length&&e&&(e[n.name]=n)}}function Ux(t,e){var r,n,i=function(t){var e;if(null==t||!t.mvt)throw new Error("mvt options required");var r="wgs84"===(null===(e=t.mvt)||void 0===e?void 0:e.coordinates),n=t.mvt.tileIndex,i=n&&Number.isFinite(n.x)&&Number.isFinite(n.y)&&Number.isFinite(n.z);if(r&&!i)throw new Error("MVT Loader: WGS84 coordinates need tileIndex property");return t.mvt}(e),o=(null==e?void 0:null===(r=e.gis)||void 0===r?void 0:r.format)||(null==e?void 0:null===(n=e.mvt)||void 0===n?void 0:n.shape);switch(o){case"columnar-table":return{shape:"columnar-table",data:Hx(t,i)};case"geojson-row-table":return{shape:"geojson-row-table",data:Vx(t,i)};case"geojson":return Vx(t,i);case"binary-geometry":case"binary":return Hx(t,i);default:throw new Error(o)}}function Hx(t,e){var r=function(t,e){var r=[],n={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[r,n];var i=new Gx(new vx.a(t));return(e&&Array.isArray(e.layers)?e.layers:Object.keys(i.layers)).forEach((function(t){var o=i.layers[t];if(o)for(var a=0;a<o.length;a++){var s=zx(o.feature(a,n),e,t);r.push(s)}})),[r,n]}(t,e),n=R()(r,2),i=ix(n[0],n[1]);return i.byteLength=t.byteLength,i}function Vx(t,e){if(t.byteLength<=0)return[];var r=[],n=new Ox(new vx.a(t));return(Array.isArray(e.layers)?e.layers:Object.keys(n.layers)).forEach((function(t){var i=n.layers[t];if(i)for(var o=0;o<i.length;o++){var a=Jx(i.feature(o),e,t);r.push(a)}})),r}function Jx(t,e,r){var n=t.toGeoJSON("wgs84"===e.coordinates?e.tileIndex:Kx);return e.layerProperty&&(n.properties[e.layerProperty]=r),n}function zx(t,e,r){var n=t.toBinaryCoordinates("wgs84"===e.coordinates?e.tileIndex:qx);return e.layerProperty&&n.properties&&(n.properties[e.layerProperty]=r),n}function Kx(t,e){for(var r=e.extent,n=0;n<t.length;n++){var i=t[n];i[0]/=r,i[1]/=r}}function qx(t,e){for(var r=e.extent,n=0,i=t.length;n<i;++n)t[n]/=r}function Wx(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Qx(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Wx(Object(r),!0).forEach((function(e){B()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Wx(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var Xx,Yx={name:"Mapbox Vector Tile",id:"mvt",module:"mvt",version:"3.2.10",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}}};Qx(Qx({},Yx),{},{parse:(Xx=It()(Pt.a.mark((function t(e,r){return Pt.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",Ux(e,r));case 1:case"end":return t.stop()}}),t)}))),function(t,e){return Xx.apply(this,arguments)}),parseSync:Ux,binary:!0});function Zx(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function $x(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return tC(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return tC(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function tC(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function eC(t,e){var r=null==e?void 0:e.globalFeatureId;return void 0!==r?function(t,e){var r,n=$x(iC(t));try{for(n.s();!(r=n.n()).done;){for(var i=r.value,o=0,a=i.featureIds.value[0],s=0;s<i.featureIds.value.length;s++){var u=i.featureIds.value[s];if(u!==a){if(e===i.globalFeatureIds.value[o])return oC(i,o,s);o=s,a=u}}if(e===i.globalFeatureIds.value[o])return oC(i,o,i.featureIds.value.length)}}catch(t){n.e(t)}finally{n.f()}throw new Error("featureId:".concat(e," not found"))}(t,r):rC(t,null==e?void 0:e.type)}function rC(t,e){return function(t){var e,r=[],n=$x(t);try{for(n.s();!(e=n.n()).done;){var i=e.value;if(0!==i.featureIds.value.length){for(var o=0,a=i.featureIds.value[0],s=0;s<i.featureIds.value.length;s++){var u=i.featureIds.value[s];u!==a&&(r.push(oC(i,o,s)),o=s,a=u)}r.push(oC(i,o,i.featureIds.value.length))}}}catch(t){n.e(t)}finally{n.f()}return r}(iC(t,e))}function nC(t,e,r){switch(t.type){case"Point":return function(t,e,r){var n=aC(t.positions,e,r);if(n.length>1)return{type:"MultiPoint",coordinates:n};return{type:"Point",coordinates:n[0]}}(t,e,r);case"LineString":return function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1/0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1/0,n=t.positions,i=t.pathIndices.value.filter((function(t){return t>=e&&t<=r})),o=i.length>2;if(!o){var a=aC(n,i[0],i[1]);return{type:"LineString",coordinates:a}}for(var s=[],u=0;u<i.length-1;u++){var c=aC(n,i[u],i[u+1]);s.push(c)}return{type:"MultiLineString",coordinates:s}}(t,e,r);case"Polygon":return function t(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1/0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1/0,i=e.positions,o=e.polygonIndices.value.filter((function(t){return t>=r&&t<=n})),a=e.primitivePolygonIndices.value.filter((function(t){return t>=r&&t<=n})),s=o.length>2;if(!s){for(var u=[],c=0;c<a.length-1;c++){var l=a[c],f=a[c+1],h=aC(i,l,f);u.push(h)}return{type:"Polygon",coordinates:u}}for(var d=[],p=0;p<o.length-1;p++){var v=o[p],y=o[p+1],g=t(e,v,y).coordinates;d.push(g)}return{type:"MultiPolygon",coordinates:d}}(t,e,r);default:var n=t;throw new Error("Unsupported geometry type: ".concat(null==n?void 0:n.type))}}function iC(t,e){if(!Boolean(t.points||t.lines||t.polygons))return t.type=e||function(t){if(t.pathIndices)return"LineString";if(t.polygonIndices)return"Polygon";return"Point"}(t),[t];var r=[];return t.points&&(t.points.type="Point",r.push(t.points)),t.lines&&(t.lines.type="LineString",r.push(t.lines)),t.polygons&&(t.polygons.type="Polygon",r.push(t.polygons)),r}function oC(t,e,r){return function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Zx(Object(r),!0).forEach((function(e){B()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Zx(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}({type:"Feature",geometry:nC(t,e,r),properties:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=(arguments.length>2&&arguments[2],Object.assign({},t.properties[t.featureIds.value[e]]));for(var n in t.numericProps)r[n]=t.numericProps[n].value[e];return r}(t,e,r)},function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;arguments.length>2&&arguments[2];return t.fields&&t.fields[t.featureIds.value[e]]}(t,e,r))}function aC(t,e,r){e=e||0,r=r||t.value.length/t.size;for(var n=[],i=e;i<r;i++){for(var o=Array(),a=i*t.size;a<(i+1)*t.size;a++)o.push(Number(t.value[a]));n.push(o)}return n}function sC(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function uC(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?sC(Object(r),!0).forEach((function(e){B()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):sC(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var cC={Point:lC,MultiPoint:function(t,e,r){return fC(t,e,r)},LineString:hC,MultiLineString:function(t,e,r){return t.map((function(t){return hC(t,e,r)}))},Polygon:dC,MultiPolygon:function(t,e,r){return t.map((function(t){return dC(t,e,r)}))}};function lC(t,e,r){var n=R()(t,2),i=n[0],o=n[1],a=R()(e,2),s=a[0],u=a[1],c=ae(s[0],u[0],i),l=ae(s[1],u[1],o);return r.unprojectFlat([c,l])}function fC(t,e,r){return t.map((function(t){return lC(t,e,r)}))}function hC(t,e,r){return fC(t,e,r)}function dC(t,e,r){return t.map((function(t){return fC(t,e,r)}))}function pC(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return vC(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return vC(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function vC(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var yC=["points","lines","polygons"];function gC(t,e,r,n){var i=t.featureIds.value;if(!i.length)return-1;var o=0,a=i[i.length-1]+1;if(n){var s=function(t,e){if(!t.__layers){for(var r={},n=t.properties,i=0;i<n.length;i++){var o=n[i].layerName;o&&(r[o]?r[o][1]=i:r[o]=[i,i])}t.__layers=r}return t.__layers[e]}(t,n);if(!s)return-1;o=s[0],a=s[1]+1}var u=-1;if(e in t.numericProps){var c=t.numericProps[e].value.findIndex((function(t,e){return t===r&&i[e]>=o&&i[e]<a}));return c>=0?t.globalFeatureIds.value[c]:-1}return e?u=mC(t.properties,(function(t){return t[e]===r}),o,a):t.fields&&(u=mC(t.fields,(function(t){return t.id===r}),o,a)),u>=0?function(t,e){if(!t.__ids){for(var r=[],n=t.featureIds.value,i=t.globalFeatureIds.value,o=0;o<n.length;o++)r[n[o]]=i[o];t.__ids=r}return t.__ids[e]}(t,u):-1}function mC(t,e,r,n){for(var i=r;i<n;i++)if(e(t[i],i))return i;return-1}function bC(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return AC(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return AC(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function AC(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function wC(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=A()(t);if(e){var i=A()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return m()(this,r)}}function BC(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function _C(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?BC(Object(r),!0).forEach((function(e){B()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):BC(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var xC=_C(_C({},_.GeoJsonLayer.defaultProps),{},{onDataLoad:{type:"function",value:null,optional:!0,compare:!1},uniqueIdProperty:"",highlightedFeatureId:null,loaders:[Yx],binary:!0}),CC=function(t){y()(n,t);var e,r=wC(n);function n(){return p()(this,n),r.apply(this,arguments)}return E()(n,[{key:"initializeState",value:function(){$n()(A()(n.prototype),"initializeState",this).call(this);var t=void 0===this.context.viewport.resolution&&this.props.binary;this.setState({binary:t,data:null,tileJSON:null})}},{key:"isLoaded",get:function(){return this.state&&this.state.data&&this.state.tileset&&$n()(A()(n.prototype),"isLoaded",this)}},{key:"updateState",value:function(t){var e,r=t.props,i=t.oldProps,o=t.context,a=t.changeFlags;a.dataChanged&&this._updateTileData(),null!==(e=this.state)&&void 0!==e&&e.data&&($n()(A()(n.prototype),"updateState",this).call(this,{props:r,oldProps:i,context:o,changeFlags:a}),this._setWGS84PropertyForTiles());var s=r.highlightColor;s!==i.highlightColor&&Array.isArray(s)&&this.setState({highlightColor:s})}},{key:"_updateTileData",value:(e=It()(Pt.a.mark((function t(){var e,r,n,i,o;return Pt.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=this.props.data,r=null,"string"!=typeof e||/(?=.*{z})(?=.*{x})(?=.*({y}|{-y}))/.test(e)){t.next=18;break}return n=this.props,i=n.onDataLoad,o=n.fetch,this.setState({data:null,tileJSON:null}),t.prev=5,t.next=8,o(e,{propName:"data",layer:this,loaders:[]});case 8:r=t.sent,t.next=15;break;case 11:t.prev=11,t.t0=t.catch(5),this.raiseError(t.t0,"loading TileJSON"),e=null;case 15:i&&i(r,{propName:"data",layer:this}),t.next=19;break;case 18:e.tilejson&&(r=e);case 19:r&&(e=r.tiles),this.setState({data:e,tileJSON:r});case 21:case"end":return t.stop()}}),t,this,[[5,11]])}))),function(){return e.apply(this,arguments)})},{key:"_getTilesetOptions",value:function(){var t=$n()(A()(n.prototype),"_getTilesetOptions",this).call(this),e=this.state.tileJSON,r=this.props,i=r.minZoom,o=r.maxZoom;return e&&(Number.isFinite(e.minzoom)&&e.minzoom>i&&(t.minZoom=e.minzoom),Number.isFinite(e.maxzoom)&&(!Number.isFinite(o)||e.maxzoom<o)&&(t.maxZoom=e.maxzoom)),t}},{key:"renderLayers",value:function(){var t;return null!==(t=this.state)&&void 0!==t&&t.data?$n()(A()(n.prototype),"renderLayers",this).call(this):null}},{key:"getTileData",value:function(t){var e,r=this.state,n=r.data,i=r.binary,o=t.index,a=t.signal,s=xn(n,t);if(!s)return Promise.reject("Invalid URL");var u=this.getLoadOptions();return(0,this.props.fetch)(s,{propName:"data",layer:this,loadOptions:u=_C(_C({},u),{},{mimeType:"application/x-protobuf",mvt:_C(_C({},null===(e=u)||void 0===e?void 0:e.mvt),{},{coordinates:this.context.viewport.resolution?"wgs84":"local",tileIndex:o}),gis:i?{format:"binary"}:{}}),signal:a})}},{key:"renderSubLayers",value:function(t){var e=t.tile.index,r=e.x,i=e.y,o=e.z,a=Math.pow(2,o),s=512/a,u=-s,c=512*r/a,l=512*(1-i/a),f=(new Jr).scale([s,u,1]);t.autoHighlight=!1,this.context.viewport.resolution||(t.modelMatrix=f,t.coordinateOrigin=[c,l,0],t.coordinateSystem=_.COORDINATE_SYSTEM.CARTESIAN,t.extensions=[].concat(Lt()(t.extensions||[]),[new _.ClipExtension]));var h=$n()(A()(n.prototype),"renderSubLayers",this).call(this,t);return!this.state.binary||h instanceof _.GeoJsonLayer||_.log.warn("renderSubLayers() must return GeoJsonLayer when using binary:true")(),h}},{key:"_updateAutoHighlight",value:function(t){var e,r,n=this.props.uniqueIdProperty,i=this.state,o=i.hoveredFeatureId,a=i.hoveredFeatureLayerName,s=t.object;s&&(e=kC(s,n),r=EC(s));var u=this.props.highlightColor;"function"==typeof u&&(u=u(t)),o===e&&a===r||this.setState({highlightColor:u,hoveredFeatureId:e,hoveredFeatureLayerName:r})}},{key:"getPickingInfo",value:function(t){var e=$n()(A()(n.prototype),"getPickingInfo",this).call(this,t),r=Boolean(this.context.viewport.resolution);if(this.state.binary&&-1!==e.index){var i=t.sourceLayer.props.data;e.object=eC(i,{globalFeatureId:e.index})}return e.object&&!r&&(e.object=TC(e.object,e.tile.bbox,this.context.viewport)),e}},{key:"getSubLayerPropsByTile",value:function(t){return{highlightedObjectIndex:this.getHighlightedObjectIndex(t),highlightColor:this.state.highlightColor}}},{key:"getHighlightedObjectIndex",value:function(t){var e=this.state,r=e.hoveredFeatureId,n=e.hoveredFeatureLayerName,i=e.binary,o=this.props,a=o.uniqueIdProperty,s=o.highlightedFeatureId,u=t.content,c=OC(s);if(!(OC(r)||c))return-1;var l=c?s:r;return Array.isArray(u)?u.findIndex((function(t){var e=kC(t,a)===l,r=c||EC(t)===n;return e&&r})):u&&i?function(t,e,r,n){var i,o=pC(yC);try{for(o.s();!(i=o.n()).done;){var a=i.value,s=t[a]&&gC(t[a],e,r,n);if(s>=0)return s}}catch(t){o.e(t)}finally{o.f()}return-1}(u,a,l,c?"":n):-1}},{key:"_pickObjects",value:function(t){var e=this.context,r=e.deck,n=e.viewport,i=n.width,o=n.height,a=n.x,s=n.y,u=[this.id];return r.pickObjects({x:a,y:s,width:i,height:o,layerIds:u,maxObjects:t})}},{key:"getRenderedFeatures",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,r=this._pickObjects(e),n=new Set,i=[],o=bC(r);try{for(o.s();!(t=o.n()).done;){var a=t.value,s=kC(a.object,this.props.uniqueIdProperty);void 0===s?i.push(a.object):n.has(s)||(n.add(s),i.push(a.object))}}catch(t){o.e(t)}finally{o.f()}return i}},{key:"_setWGS84PropertyForTiles",value:function(){var t=this;this.state.tileset.selectedTiles.forEach((function(e){e.hasOwnProperty("dataInWGS84")||Object.defineProperty(e,"dataInWGS84",{get:function(){if(!e.content)return null;if(t.state.binary&&Array.isArray(e.content)&&!e.content.length)return[];var r,n=e.bbox;if(void 0===e._contentWGS84&&(r=n,Number.isFinite(r.west)&&Number.isFinite(r.north)&&Number.isFinite(r.east)&&Number.isFinite(r.south))){var i=t.state.binary?eC(e.content):e.content;e._contentWGS84=i.map((function(e){return TC(e,n,t.context.viewport)}))}return e._contentWGS84}})}))}}]),n}(Yn);function kC(t,e){return t.properties&&e?t.properties[e]:"id"in t?t.id:void 0}function EC(t){var e;return(null===(e=t.properties)||void 0===e?void 0:e.layerName)||null}function OC(t){return null!=t&&""!==t}function TC(t,e,r){var n=_C(_C({},t),{},{geometry:{type:t.geometry.type}});return Object.defineProperty(n.geometry,"coordinates",{get:function(){return function(t,e,r){var n=[r.projectFlat([e.west,e.north]),r.projectFlat([e.east,e.south])];return uC(uC({},t),{},{coordinates:cC[t.type](t.coordinates,n,r)})}(t.geometry,e,r).coordinates}}),n}B()(CC,"layerName","MVTLayer"),B()(CC,"defaultProps",xC);for(var SC={},MC=0;MC<"0123456789bcdefghjkmnpqrstuvwxyz".length;MC++)SC["0123456789bcdefghjkmnpqrstuvwxyz".charAt(MC)]=MC;function IC(t){var e=function(t){for(var e,r=!0,n=90,i=-90,o=180,a=-180,s=0,u=0,c=t.length;u<c;u++){var l=t[u].toLowerCase();s=SC[l];for(var f=4;f>=0;f--){var h=s>>f&1;r?(e=(o+a)/2,1===h?a=e:o=e):(e=(n+i)/2,1===h?i=e:n=e),r=!r}}return[i,a,n,o]}(t),r=R()(e,4),n=r[0],i=r[1],o=r[2],a=r[3];return[a,o,a,n,i,n,i,o,a,o]}function RC(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=A()(t);if(e){var i=A()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return m()(this,r)}}var PC=function(t){y()(r,t);var e=RC(r);function r(){return p()(this,r),e.apply(this,arguments)}return E()(r,[{key:"indexToBounds",value:function(){var t=this.props,e=t.data,r=t.getGeohash;return{data:e,_normalize:!1,positionFormat:"XY",getPolygon:function(t,e){return IC(r(t,e))}}}}]),r}(M);B()(PC,"layerName","GeohashLayer"),B()(PC,"defaultProps",{getGeohash:{type:"accessor",value:function(t){return t.geohash}}}),r.d(e,"GreatCircleLayer",(function(){return C})),r.d(e,"S2Layer",(function(){return z})),r.d(e,"QuadkeyLayer",(function(){return St})),r.d(e,"TileLayer",(function(){return Yn})),r.d(e,"TripsLayer",(function(){return ni})),r.d(e,"H3ClusterLayer",(function(){return _i})),r.d(e,"H3HexagonLayer",(function(){return bi})),r.d(e,"Tile3DLayer",(function(){return m_})),r.d(e,"TerrainLayer",(function(){return E_})),r.d(e,"MVTLayer",(function(){return CC})),r.d(e,"GeohashLayer",(function(){return PC})),r.d(e,"_GeoCellLayer",(function(){return M})),r.d(e,"_getURLFromTemplate",(function(){return xn})),r.d(e,"_Tileset2D",(function(){return Jn})),r.d(e,"_Tile2DHeader",(function(){return Ft}))}])}));
6
+ */i=[],void 0===(o="function"==typeof(n=function(){"use strict";function t(t,e,r){this.low=0|t,this.high=0|e,this.unsigned=!!r}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 r={},n={};function i(t,e){var i,o,s;return e?(s=0<=(t>>>=0)&&t<256)&&(o=n[t])?o:(i=a(t,(0|t)<0?-1:0,!0),s&&(n[t]=i),i):(s=-128<=(t|=0)&&t<128)&&(o=r[t])?o:(i=a(t,t<0?-1:0,!1),s&&(r[t]=i),i)}function o(t,e){if(isNaN(t)||!isFinite(t))return e?v:p;if(e){if(t<0)return v;if(t>=f)return A}else{if(t<=-h)return w;if(t+1>=h)return b}return t<0?o(-t,e).neg():a(t%l|0,t/l|0,e)}function a(e,r,n){return new t(e,r,n)}t.fromInt=i,t.fromNumber=o,t.fromBits=a;var s=Math.pow;function u(t,e,r){if(0===t.length)throw Error("empty string");if("NaN"===t||"Infinity"===t||"+Infinity"===t||"-Infinity"===t)return p;if("number"==typeof e?(r=e,e=!1):e=!!e,(r=r||10)<2||36<r)throw RangeError("radix");var n;if((n=t.indexOf("-"))>0)throw Error("interior hyphen");if(0===n)return u(t.substring(1),e,r).neg();for(var i=o(s(r,8)),a=p,c=0;c<t.length;c+=8){var l=Math.min(8,t.length-c),f=parseInt(t.substring(c,c+l),r);if(l<8){var h=o(s(r,l));a=a.mul(h).add(o(f))}else a=(a=a.mul(i)).add(o(f))}return a.unsigned=e,a}function c(e){return e instanceof t?e:"number"==typeof e?o(e):"string"==typeof e?u(e):a(e.low,e.high,e.unsigned)}t.fromString=u,t.fromValue=c;var l=4294967296,f=l*l,h=f/2,d=i(1<<24),p=i(0);t.ZERO=p;var v=i(0,!0);t.UZERO=v;var y=i(1);t.ONE=y;var g=i(1,!0);t.UONE=g;var m=i(-1);t.NEG_ONE=m;var b=a(-1,2147483647,!1);t.MAX_VALUE=b;var A=a(-1,-1,!0);t.MAX_UNSIGNED_VALUE=A;var w=a(0,-2147483648,!1);t.MIN_VALUE=w;var B=t.prototype;return B.toInt=function(){return this.unsigned?this.low>>>0:this.low},B.toNumber=function(){return this.unsigned?(this.high>>>0)*l+(this.low>>>0):this.high*l+(this.low>>>0)},B.toString=function(t){if((t=t||10)<2||36<t)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(w)){var e=o(t),r=this.div(e),n=r.mul(e).sub(this);return r.toString(t)+n.toInt().toString(t)}return"-"+this.neg().toString(t)}for(var i=o(s(t,6),this.unsigned),a=this,u="";;){var c=a.div(i),l=(a.sub(c.mul(i)).toInt()>>>0).toString(t);if((a=c).isZero())return l+u;for(;l.length<6;)l="0"+l;u=""+l+u}},B.getHighBits=function(){return this.high},B.getHighBitsUnsigned=function(){return this.high>>>0},B.getLowBits=function(){return this.low},B.getLowBitsUnsigned=function(){return this.low>>>0},B.getNumBitsAbs=function(){if(this.isNegative())return this.eq(w)?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},B.isZero=function(){return 0===this.high&&0===this.low},B.isNegative=function(){return!this.unsigned&&this.high<0},B.isPositive=function(){return this.unsigned||this.high>=0},B.isOdd=function(){return 1==(1&this.low)},B.isEven=function(){return 0==(1&this.low)},B.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},B.eq=B.equals,B.notEquals=function(t){return!this.eq(t)},B.neq=B.notEquals,B.lessThan=function(t){return this.comp(t)<0},B.lt=B.lessThan,B.lessThanOrEqual=function(t){return this.comp(t)<=0},B.lte=B.lessThanOrEqual,B.greaterThan=function(t){return this.comp(t)>0},B.gt=B.greaterThan,B.greaterThanOrEqual=function(t){return this.comp(t)>=0},B.gte=B.greaterThanOrEqual,B.compare=function(t){if(e(t)||(t=c(t)),this.eq(t))return 0;var r=this.isNegative(),n=t.isNegative();return r&&!n?-1:!r&&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},B.comp=B.compare,B.negate=function(){return!this.unsigned&&this.eq(w)?w:this.not().add(y)},B.neg=B.negate,B.add=function(t){e(t)||(t=c(t));var r=this.high>>>16,n=65535&this.high,i=this.low>>>16,o=65535&this.low,s=t.high>>>16,u=65535&t.high,l=t.low>>>16,f=0,h=0,d=0,p=0;return d+=(p+=o+(65535&t.low))>>>16,h+=(d+=i+l)>>>16,f+=(h+=n+u)>>>16,f+=r+s,a((d&=65535)<<16|(p&=65535),(f&=65535)<<16|(h&=65535),this.unsigned)},B.subtract=function(t){return e(t)||(t=c(t)),this.add(t.neg())},B.sub=B.subtract,B.multiply=function(t){if(this.isZero())return p;if(e(t)||(t=c(t)),t.isZero())return p;if(this.eq(w))return t.isOdd()?w:p;if(t.eq(w))return this.isOdd()?w:p;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(d)&&t.lt(d))return o(this.toNumber()*t.toNumber(),this.unsigned);var r=this.high>>>16,n=65535&this.high,i=this.low>>>16,s=65535&this.low,u=t.high>>>16,l=65535&t.high,f=t.low>>>16,h=65535&t.low,v=0,y=0,g=0,m=0;return g+=(m+=s*h)>>>16,y+=(g+=i*h)>>>16,g&=65535,y+=(g+=s*f)>>>16,v+=(y+=n*h)>>>16,y&=65535,v+=(y+=i*f)>>>16,y&=65535,v+=(y+=s*l)>>>16,v+=r*h+n*f+i*l+s*u,a((g&=65535)<<16|(m&=65535),(v&=65535)<<16|(y&=65535),this.unsigned)},B.mul=B.multiply,B.divide=function(t){if(e(t)||(t=c(t)),t.isZero())throw Error("division by zero");if(this.isZero())return this.unsigned?v:p;var r,n,i;if(this.unsigned){if(t.unsigned||(t=t.toUnsigned()),t.gt(this))return v;if(t.gt(this.shru(1)))return g;i=v}else{if(this.eq(w))return t.eq(y)||t.eq(m)?w:t.eq(w)?y:(r=this.shr(1).div(t).shl(1)).eq(p)?t.isNegative()?y:m:(n=this.sub(t.mul(r)),i=r.add(n.div(t)));if(t.eq(w))return this.unsigned?v:p;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=p}for(n=this;n.gte(t);){r=Math.max(1,Math.floor(n.toNumber()/t.toNumber()));for(var a=Math.ceil(Math.log(r)/Math.LN2),u=a<=48?1:s(2,a-48),l=o(r),f=l.mul(t);f.isNegative()||f.gt(n);)f=(l=o(r-=u,this.unsigned)).mul(t);l.isZero()&&(l=y),i=i.add(l),n=n.sub(f)}return i},B.div=B.divide,B.modulo=function(t){return e(t)||(t=c(t)),this.sub(this.div(t).mul(t))},B.mod=B.modulo,B.not=function(){return a(~this.low,~this.high,this.unsigned)},B.and=function(t){return e(t)||(t=c(t)),a(this.low&t.low,this.high&t.high,this.unsigned)},B.or=function(t){return e(t)||(t=c(t)),a(this.low|t.low,this.high|t.high,this.unsigned)},B.xor=function(t){return e(t)||(t=c(t)),a(this.low^t.low,this.high^t.high,this.unsigned)},B.shiftLeft=function(t){return e(t)&&(t=t.toInt()),0==(t&=63)?this:t<32?a(this.low<<t,this.high<<t|this.low>>>32-t,this.unsigned):a(0,this.low<<t-32,this.unsigned)},B.shl=B.shiftLeft,B.shiftRight=function(t){return e(t)&&(t=t.toInt()),0==(t&=63)?this:t<32?a(this.low>>>t|this.high<<32-t,this.high>>t,this.unsigned):a(this.high>>t-32,this.high>=0?0:-1,this.unsigned)},B.shr=B.shiftRight,B.shiftRightUnsigned=function(t){if(e(t)&&(t=t.toInt()),0==(t&=63))return this;var r=this.high;return t<32?a(this.low>>>t|r<<32-t,r>>>t,this.unsigned):a(32===t?r:r>>>t-32,0,this.unsigned)},B.shru=B.shiftRightUnsigned,B.toSigned=function(){return this.unsigned?a(this.low,this.high,!1):this},B.toUnsigned=function(){return this.unsigned?this:a(this.low,this.high,!0)},B.toBytes=function(t){return t?this.toBytesLE():this.toBytesBE()},B.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]},B.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=o)},function(t,e,r){var n=r(68);t.exports=function(t){return new n(t)}},function(t,e){},function(t,e){t.exports=r},function(t,e,r){var n=r(114);t.exports=function(t){return function(){return new n(t.apply(this,arguments))}}},function(t,e){t.exports=function(t){var e;if("undefined"!=typeof Symbol){if(Symbol.asyncIterator&&null!=(e=t[Symbol.asyncIterator]))return e.call(t);if(Symbol.iterator&&null!=(e=t[Symbol.iterator]))return e.call(t)}throw new TypeError("Object is not async iterable")}},function(t,e,r){var n=r(87),i=r(88),o=r(62),a=r(89);t.exports=function(t){return n(t)||i(t)||o(t)||a()},t.exports.default=t.exports,t.exports.__esModule=!0},,,,function(t,e){},function(t,e){function r(e){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(t.exports=r=function(t){return typeof t},t.exports.default=t.exports,t.exports.__esModule=!0):(t.exports=r=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.default=t.exports,t.exports.__esModule=!0),r(e)}t.exports=r,t.exports.default=t.exports,t.exports.__esModule=!0},,function(t,e){},function(t,e,r){"use strict";t.exports=i;var n=r(117);function i(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}i.Varint=0,i.Fixed64=1,i.Bytes=2,i.Fixed32=5;var o="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function a(t){return t.type===i.Bytes?t.readVarint()+t.pos:t.pos+1}function s(t,e,r){return r?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function u(t,e,r){var n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));r.realloc(n);for(var i=r.pos-1;i>=t;i--)r.buf[i+n]=r.buf[i]}function c(t,e){for(var r=0;r<t.length;r++)e.writeVarint(t[r])}function l(t,e){for(var r=0;r<t.length;r++)e.writeSVarint(t[r])}function f(t,e){for(var r=0;r<t.length;r++)e.writeFloat(t[r])}function h(t,e){for(var r=0;r<t.length;r++)e.writeDouble(t[r])}function d(t,e){for(var r=0;r<t.length;r++)e.writeBoolean(t[r])}function p(t,e){for(var r=0;r<t.length;r++)e.writeFixed32(t[r])}function v(t,e){for(var r=0;r<t.length;r++)e.writeSFixed32(t[r])}function y(t,e){for(var r=0;r<t.length;r++)e.writeFixed64(t[r])}function g(t,e){for(var r=0;r<t.length;r++)e.writeSFixed64(t[r])}function m(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+16777216*t[e+3]}function b(t,e,r){t[r]=e,t[r+1]=e>>>8,t[r+2]=e>>>16,t[r+3]=e>>>24}function A(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}i.prototype={destroy:function(){this.buf=null},readFields:function(t,e,r){for(r=r||this.length;this.pos<r;){var n=this.readVarint(),i=n>>3,o=this.pos;this.type=7&n,t(i,e,this),this.pos===o&&this.skip(n)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=m(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=A(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=m(this.buf,this.pos)+4294967296*m(this.buf,this.pos+4);return this.pos+=8,t},readSFixed64:function(){var t=m(this.buf,this.pos)+4294967296*A(this.buf,this.pos+4);return this.pos+=8,t},readFloat:function(){var t=n.read(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=n.read(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,r,n=this.buf;return e=127&(r=n[this.pos++]),r<128?e:(e|=(127&(r=n[this.pos++]))<<7,r<128?e:(e|=(127&(r=n[this.pos++]))<<14,r<128?e:(e|=(127&(r=n[this.pos++]))<<21,r<128?e:function(t,e,r){var n,i,o=r.buf;if(i=o[r.pos++],n=(112&i)>>4,i<128)return s(t,n,e);if(i=o[r.pos++],n|=(127&i)<<3,i<128)return s(t,n,e);if(i=o[r.pos++],n|=(127&i)<<10,i<128)return s(t,n,e);if(i=o[r.pos++],n|=(127&i)<<17,i<128)return s(t,n,e);if(i=o[r.pos++],n|=(127&i)<<24,i<128)return s(t,n,e);if(i=o[r.pos++],n|=(1&i)<<31,i<128)return s(t,n,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(r=n[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&&o?function(t,e,r){return o.decode(t.subarray(e,r))}(this.buf,e,t):function(t,e,r){var n="",i=e;for(;i<r;){var o,a,s,u=t[i],c=null,l=u>239?4:u>223?3:u>191?2:1;if(i+l>r)break;1===l?u<128&&(c=u):2===l?128==(192&(o=t[i+1]))&&(c=(31&u)<<6|63&o)<=127&&(c=null):3===l?(o=t[i+1],a=t[i+2],128==(192&o)&&128==(192&a)&&((c=(15&u)<<12|(63&o)<<6|63&a)<=2047||c>=55296&&c<=57343)&&(c=null)):4===l&&(o=t[i+1],a=t[i+2],s=t[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&((c=(15&u)<<18|(63&o)<<12|(63&a)<<6|63&s)<=65535||c>=1114112)&&(c=null)),null===c?(c=65533,l=1):c>65535&&(c-=65536,n+=String.fromCharCode(c>>>10&1023|55296),c=56320|1023&c),n+=String.fromCharCode(c),i+=l}return n}(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!==i.Bytes)return t.push(this.readVarint(e));var r=a(this);for(t=t||[];this.pos<r;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){if(this.type!==i.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!==i.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!==i.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!==i.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!==i.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!==i.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!==i.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!==i.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===i.Varint)for(;this.buf[this.pos++]>127;);else if(e===i.Bytes)this.pos=this.readVarint()+this.pos;else if(e===i.Fixed32)this.pos+=4;else{if(e!==i.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e<this.pos+t;)e*=2;if(e!==this.length){var r=new Uint8Array(e);r.set(this.buf),this.buf=r,this.length=e}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(t){this.realloc(4),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*(1/4294967296)),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*(1/4294967296)),this.pos+4),this.pos+=8},writeVarint:function(t){(t=+t||0)>268435455||t<0?function(t,e){var r,n;t>=0?(r=t%4294967296|0,n=t/4294967296|0):(n=~(-t/4294967296),4294967295^(r=~(-t%4294967296))?r=r+1|0:(r=0,n=n+1|0));if(t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),function(t,e,r){r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos]=127&t}(r,0,e),function(t,e){var r=(7&t)<<4;if(e.buf[e.pos++]|=r|((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}(n,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,r){for(var n,i,o=0;o<e.length;o++){if((n=e.charCodeAt(o))>55295&&n<57344){if(!i){n>56319||o+1===e.length?(t[r++]=239,t[r++]=191,t[r++]=189):i=n;continue}if(n<56320){t[r++]=239,t[r++]=191,t[r++]=189,i=n;continue}n=i-55296<<10|n-56320|65536,i=null}else i&&(t[r++]=239,t[r++]=191,t[r++]=189,i=null);n<128?t[r++]=n:(n<2048?t[r++]=n>>6|192:(n<65536?t[r++]=n>>12|224:(t[r++]=n>>18|240,t[r++]=n>>12&63|128),t[r++]=n>>6&63|128),t[r++]=63&n|128)}return r}(this.buf,t,this.pos);var r=this.pos-e;r>=128&&u(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r},writeFloat:function(t){this.realloc(4),n.write(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),n.write(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var r=0;r<e;r++)this.buf[this.pos++]=t[r]},writeRawMessage:function(t,e){this.pos++;var r=this.pos;t(e,this);var n=this.pos-r;n>=128&&u(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,e,r){this.writeTag(t,i.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,c,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,l,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,d,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,f,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,h,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,p,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,v,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,y,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,g,e)},writeBytesField:function(t,e){this.writeTag(t,i.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,i.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,i.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,i.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,i.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,i.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,i.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,i.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,i.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,i.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}}},,,,,,function(t,e){function r(e,n){return t.exports=r=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},r(e,n)}t.exports=r},function(t,e){t.exports=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,r){var n=r(61);t.exports=function(t,e){if(t){if("string"==typeof t)return n(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(t,e):void 0}},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){},function(t,e,r){var n=r(66);t.exports=function(t,e){if(t){if("string"==typeof t)return n(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(t,e):void 0}}},function(t,e){t.exports=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}},function(t,e){function r(e,n){return t.exports=r=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},r(e,n)}t.exports=r},function(t,e){t.exports=function(t){this.wrapped=t}},function(t,e){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){function r(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}t.exports=function(t,e,n){return e&&r(t.prototype,e),n&&r(t,n),t},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=function(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,r){var n=r(67),i=r(111);function o(e,r,a){return i()?t.exports=o=Reflect.construct:t.exports=o=function(t,e,r){var i=[null];i.push.apply(i,e);var o=new(Function.bind.apply(t,i));return r&&n(o,r.prototype),o},o.apply(null,arguments)}t.exports=o},function(t,e,r){var n=r(115);function i(e,r,o){return"undefined"!=typeof Reflect&&Reflect.get?t.exports=i=Reflect.get:t.exports=i=function(t,e,r){var i=n(t,e);if(i){var o=Object.getOwnPropertyDescriptor(i,e);return o.get?o.get.call(r):o.value}},i(e,r,o||e)}t.exports=i},function(t,e,r){var n=r(60);function i(){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}}function o(e,r,a){return i()?t.exports=o=Reflect.construct:t.exports=o=function(t,e,r){var i=[null];i.push.apply(i,e);var o=new(Function.bind.apply(t,i));return r&&n(o,r.prototype),o},o.apply(null,arguments)}t.exports=o},function(t,e,r){var n=r(118),i=globalThis.deck||{};if(!i.LineLayer)throw new Error("@deck.gl/layers is not found");t.exports=Object.assign(i,n)},,,,,,,,,function(t,e){t.exports=function(t){if(Array.isArray(t))return t}},function(t,e){t.exports=function(t,e){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t)){var r=[],n=!0,i=!1,o=void 0;try{for(var a,s=t[Symbol.iterator]();!(n=(a=s.next()).done)&&(r.push(a.value),!e||r.length!==e);n=!0);}catch(t){i=!0,o=t}finally{try{n||null==s.return||s.return()}finally{if(i)throw o}}return r}}},function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}},function(t,e,r){var n=r(61);t.exports=function(t){if(Array.isArray(t))return n(t)},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=function(t){if(Array.isArray(t))return t},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,o=[],a=!0,s=!1;try{for(r=r.call(t);!(a=(n=r.next()).done)&&(o.push(n.value),!e||o.length!==e);a=!0);}catch(t){s=!0,i=t}finally{try{a||null==r.return||r.return()}finally{if(s)throw i}}return o}},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=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.")},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=function(t){if(Array.isArray(t)){for(var e=0,r=new Array(t.length);e<t.length;e++)r[e]=t[e];return r}}},function(t,e){t.exports=function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}},function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}},function(t,e){function r(e,n){return t.exports=r=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},t.exports.default=t.exports,t.exports.__esModule=!0,r(e,n)}t.exports=r,t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,r){var n=r(63);t.exports=function(t){if(Array.isArray(t))return n(t)},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,r){var n=r(63);t.exports=function(t,e){if(t){if("string"==typeof t)return n(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(t,e):void 0}},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,r){var n=function(t){"use strict";var e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",o=n.asyncIterator||"@@asyncIterator",a=n.toStringTag||"@@toStringTag";function s(t,e,r,n){var i=e&&e.prototype instanceof l?e:l,o=Object.create(i.prototype),a=new B(n||[]);return o._invoke=function(t,e,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return x()}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var s=b(a,r);if(s){if(s===c)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(t,e,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===c)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}(t,r,a),o}function u(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=s;var c={};function l(){}function f(){}function h(){}var d={};d[i]=function(){return this};var p=Object.getPrototypeOf,v=p&&p(p(_([])));v&&v!==e&&r.call(v,i)&&(d=v);var y=h.prototype=l.prototype=Object.create(d);function g(t){["next","throw","return"].forEach((function(e){t[e]=function(t){return this._invoke(e,t)}}))}function m(t){var e;this._invoke=function(n,i){function o(){return new Promise((function(e,o){!function e(n,i,o,a){var s=u(t[n],t,i);if("throw"!==s.type){var c=s.arg,l=c.value;return l&&"object"==typeof l&&r.call(l,"__await")?Promise.resolve(l.__await).then((function(t){e("next",t,o,a)}),(function(t){e("throw",t,o,a)})):Promise.resolve(l).then((function(t){c.value=t,o(c)}),(function(t){return e("throw",t,o,a)}))}a(s.arg)}(n,i,e,o)}))}return e=e?e.then(o,o):o()}}function b(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,b(t,e),"throw"===e.method))return c;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return c}var n=u(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,c;var i=n.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,c):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,c)}function A(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function w(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function B(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(A,this),this.reset(!0)}function _(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:x}}function x(){return{value:void 0,done:!0}}return f.prototype=y.constructor=h,h.constructor=f,h[a]=f.displayName="GeneratorFunction",t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===f||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,h):(t.__proto__=h,a in t||(t[a]="GeneratorFunction")),t.prototype=Object.create(y),t},t.awrap=function(t){return{__await:t}},g(m.prototype),m.prototype[o]=function(){return this},t.AsyncIterator=m,t.async=function(e,r,n,i){var o=new m(s(e,r,n,i));return t.isGeneratorFunction(r)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},g(y),y[a]="Generator",y[i]=function(){return this},y.toString=function(){return"[object Generator]"},t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=_,B.prototype={constructor:B,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(w),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=r.call(o,"catchLoc"),u=r.call(o,"finallyLoc");if(s&&u){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,c):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),c},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),w(r),c}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;w(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:_(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),c}},t}(t.exports);try{regeneratorRuntime=n}catch(t){Function("r","regeneratorRuntime = r")(n)}},function(t,e,r){var n=r(6);t.exports=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=n(t)););return t}},function(t,e,r){var n=function(t){"use strict";var e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",o=n.asyncIterator||"@@asyncIterator",a=n.toStringTag||"@@toStringTag";function s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var i=e&&e.prototype instanceof f?e:f,o=Object.create(i.prototype),a=new _(n||[]);return o._invoke=function(t,e,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return C()}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var s=A(a,r);if(s){if(s===l)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=c(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===l)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}(t,r,a),o}function c(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var l={};function f(){}function h(){}function d(){}var p={};p[i]=function(){return this};var v=Object.getPrototypeOf,y=v&&v(v(x([])));y&&y!==e&&r.call(y,i)&&(p=y);var g=d.prototype=f.prototype=Object.create(p);function m(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function b(t,e){var n;this._invoke=function(i,o){function a(){return new e((function(n,a){!function n(i,o,a,s){var u=c(t[i],t,o);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==typeof f&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){n("next",t,a,s)}),(function(t){n("throw",t,a,s)})):e.resolve(f).then((function(t){l.value=t,a(l)}),(function(t){return n("throw",t,a,s)}))}s(u.arg)}(i,o,n,a)}))}return n=n?n.then(a,a):a()}}function A(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,A(t,e),"throw"===e.method))return l;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var n=c(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,l;var i=n.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,l):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,l)}function w(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function B(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function _(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(w,this),this.reset(!0)}function x(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:C}}function C(){return{value:void 0,done:!0}}return h.prototype=g.constructor=d,d.constructor=h,h.displayName=s(d,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===h||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,s(t,a,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},m(b.prototype),b.prototype[o]=function(){return this},t.AsyncIterator=b,t.async=function(e,r,n,i,o){void 0===o&&(o=Promise);var a=new b(u(e,r,n,i),o);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},m(g),s(g,a,"Generator"),g[i]=function(){return this},g.toString=function(){return"[object Generator]"},t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=x,_.prototype={constructor:_,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(B),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=r.call(o,"catchLoc"),u=r.call(o,"finallyLoc");if(s&&u){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,l):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),l},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),B(r),l}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;B(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:x(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},t}(t.exports);try{regeneratorRuntime=n}catch(t){Function("r","regeneratorRuntime = r")(n)}},function(t,e){t.exports=function(t){if(Array.isArray(t))return t}},function(t,e){t.exports=function(t,e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t)){var r=[],n=!0,i=!1,o=void 0;try{for(var a,s=t[Symbol.iterator]();!(n=(a=s.next()).done)&&(r.push(a.value),!e||r.length!==e);n=!0);}catch(t){i=!0,o=t}finally{try{n||null==s.return||s.return()}finally{if(i)throw o}}return r}}},function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},function(t,e,r){var n=r(66);t.exports=function(t){if(Array.isArray(t))return n(t)}},function(t,e){t.exports=function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}},function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},function(t,e){t.exports=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}}},function(t,e){},function(t,e){},function(t,e,r){var n=r(68);function i(t){var e,r;function i(e,r){try{var a=t[e](r),s=a.value,u=s instanceof n;Promise.resolve(u?s.wrapped:s).then((function(t){u?i("return"===e?"return":"next",t):o(a.done?"return":"normal",t)}),(function(t){i("throw",t)}))}catch(t){o("throw",t)}}function o(t,n){switch(t){case"return":e.resolve({value:n,done:!0});break;case"throw":e.reject(n);break;default:e.resolve({value:n,done:!1})}(e=e.next)?i(e.key,e.arg):r=null}this._invoke=function(t,n){return new Promise((function(o,a){var s={key:t,arg:n,resolve:o,reject:a,next:null};r?r=r.next=s:(e=r=s,i(t,n))}))},"function"!=typeof t.return&&(this.return=void 0)}"function"==typeof Symbol&&Symbol.asyncIterator&&(i.prototype[Symbol.asyncIterator]=function(){return this}),i.prototype.next=function(t){return this._invoke("next",t)},i.prototype.throw=function(t){return this._invoke("throw",t)},i.prototype.return=function(t){return this._invoke("return",t)},t.exports=i},function(t,e,r){var n=r(17);t.exports=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=n(t)););return t}},function(t,e){},function(t,e){e.read=function(t,e,r,n,i){var o,a,s=8*i-n-1,u=(1<<s)-1,c=u>>1,l=-7,f=r?i-1:0,h=r?-1:1,d=t[e+f];for(f+=h,o=d&(1<<-l)-1,d>>=-l,l+=s;l>0;o=256*o+t[e+f],f+=h,l-=8);for(a=o&(1<<-l)-1,o>>=-l,l+=n;l>0;a=256*a+t[e+f],f+=h,l-=8);if(0===o)o=1-c;else{if(o===u)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,n),o-=c}return(d?-1:1)*a*Math.pow(2,o-n)},e.write=function(t,e,r,n,i,o){var a,s,u,c=8*o-i-1,l=(1<<c)-1,f=l>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,p=n?1:-1,v=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=l):(a=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-a))<1&&(a--,u*=2),(e+=a+f>=1?h/u:h*Math.pow(2,1-f))*u>=2&&(a++,u/=2),a+f>=l?(s=0,a=l):a+f>=1?(s=(e*u-1)*Math.pow(2,i),a+=f):(s=e*Math.pow(2,f-1)*Math.pow(2,i),a=0));i>=8;t[r+d]=255&s,d+=p,s/=256,i-=8);for(a=a<<i|s,c+=i;c>0;t[r+d]=255&a,d+=p,a/=256,c-=8);t[r+d-p]|=128*v}},function(t,e,r){"use strict";r.r(e);var n={};r.r(n),r.d(n,"filename",(function(){return Sl})),r.d(n,"dirname",(function(){return Ml})),r.d(n,"join",(function(){return Il}));var i={};r.r(i),r.d(i,"name",(function(){return Xb})),r.d(i,"decode",(function(){return Yb}));var o={};r.r(o),r.d(o,"name",(function(){return aA})),r.d(o,"preprocess",(function(){return sA}));var a={};r.r(a),r.d(a,"name",(function(){return lA})),r.d(a,"preprocess",(function(){return fA}));var s={};r.r(s),r.d(s,"name",(function(){return bA})),r.d(s,"preprocess",(function(){return AA})),r.d(s,"decode",(function(){return wA})),r.d(s,"encode",(function(){return _A}));var u={};r.r(u),r.d(u,"name",(function(){return RA})),r.d(u,"decode",(function(){return LA}));var c={};r.r(c),r.d(c,"name",(function(){return JA})),r.d(c,"decode",(function(){return zA})),r.d(c,"encode",(function(){return qA}));var l={};r.r(l),r.d(l,"name",(function(){return YA})),r.d(l,"decode",(function(){return ZA})),r.d(l,"encode",(function(){return tw}));var f={};r.r(f),r.d(f,"name",(function(){return nw})),r.d(f,"decode",(function(){return iw})),r.d(f,"encode",(function(){return aw}));var h={};r.r(h),r.d(h,"name",(function(){return lw})),r.d(h,"decode",(function(){return fw}));var d=r(5),p=r.n(d),v=r(14),y=r.n(v),g=r(15),m=r.n(g),b=r(6),A=r.n(b),w=r(0),B=r.n(w),_=r(10);function x(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=A()(t);if(e){var i=A()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return m()(this,r)}}var C=function(t){y()(r,t);var e=x(r);function r(){return p()(this,r),e.apply(this,arguments)}return r}(_.ArcLayer);B()(C,"layerName","GreatCircleLayer"),B()(C,"defaultProps",{getHeight:{type:"accessor",value:0},greatCircle:!0});var k=r(7),E=r.n(k);function O(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=A()(t);if(e){var i=A()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return m()(this,r)}}function T(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}var S=function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?T(Object(r),!0).forEach((function(e){B()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):T(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}({},_.PolygonLayer.defaultProps),M=function(t){y()(r,t);var e=O(r);function r(){return p()(this,r),e.apply(this,arguments)}return E()(r,[{key:"indexToBounds",value:function(){return null}},{key:"renderLayers",value:function(){var t=this.props,e=t.elevationScale,r=t.extruded,n=t.wireframe,i=t.filled,o=t.stroked,a=t.lineWidthUnits,s=t.lineWidthScale,u=t.lineWidthMinPixels,c=t.lineWidthMaxPixels,l=t.lineJointRounded,f=t.lineMiterLimit,h=t.lineDashJustified,d=t.getElevation,p=t.getFillColor,v=t.getLineColor,y=t.getLineWidth,g=this.props,m=g.updateTriggers,b=g.material,A=g.transitions;return new(this.getSubLayerClass("cell",_.PolygonLayer))({filled:i,wireframe:n,extruded:r,elevationScale:e,stroked:o,lineWidthUnits:a,lineWidthScale:s,lineWidthMinPixels:u,lineWidthMaxPixels:c,lineJointRounded:l,lineMiterLimit:f,lineDashJustified:h,material:b,transitions:A,getElevation:d,getFillColor:p,getLineColor:v,getLineWidth:y},this.getSubLayerProps({id:"cell",updateTriggers:m&&{getElevation:m.getElevation,getFillColor:m.getFillColor,getLineColor:m.getLineColor,getLineWidth:m.getLineWidth}}),this.indexToBounds())}}]),r}(_.CompositeLayer);B()(M,"layerName","GeoCellLayer"),B()(M,"defaultProps",S);var I=r(12),R=r.n(I),P=r(40),F=r.n(P),D=180/Math.PI;function L(t,e,r){var n=1<<e;return[(t[0]+r[0])/n,(t[1]+r[1])/n]}function j(t){return t>=.5?1/3*(4*t*t-1):1/3*(1-4*(1-t)*(1-t))}function G(t){return[j(t[0]),j(t[1])]}function N(t,e){var r=R()(e,2),n=r[0],i=r[1];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 U(t,e,r,n){if(0===n){1===r&&(e[0]=t-1-e[0],e[1]=t-1-e[1]);var i=e[0];e[0]=e[1],e[1]=i}}function H(t){if("string"==typeof t){if(t.indexOf("/")>0)return t;t=function(t){var e=t.padEnd(16,"0");return F.a.fromString(e,16)}(t)}return function(t){for(var e=F.a.fromString(t,!0,10).toString(2);e.length<64;)e="0"+e;for(var r=e.lastIndexOf("1"),n=e.substring(0,3),i=e.substring(3,r),o=i.length/2,a=F.a.fromString(n,!0,2).toString(10),s=F.a.fromString(i,!0,2).toString(4);s.length<o;)s="0"+s;return"".concat(a,"/").concat(s)}(t.toString())}function V(t){return function(t){for(var e,r,n,i,o,a,s=t.face,u=t.ij,c=t.level,l=[[0,0],[0,1],[1,1],[1,0],[0,0]],f=Math.max(1,Math.ceil(100*Math.pow(2,-c))),h=new Float64Array(4*f*2+2),d=0,p=0,v=0;v<4;v++)for(var y=l[v].slice(0),g=l[v+1],m=(g[0]-y[0])/f,b=(g[1]-y[1])/f,A=0;A<f;A++){y[0]+=m,y[1]+=b;var w=N(s,G(L(u,c,y))),B=(e=w,r=void 0,n=void 0,i=void 0,o=void 0,a=void 0,r=R()(e,3),n=r[0],i=r[1],o=r[2],a=Math.atan2(o,Math.sqrt(n*n+i*i)),[Math.atan2(i,n)*D,a*D]);Math.abs(B[1])>89.999&&(B[0]=p);var _=B[0]-p;B[0]+=_>180?-360:_<-180?360:0,h[d++]=B[0],h[d++]=B[1],p=B[0]}return h[d++]=h[0],h[d++]=h[1],h}(function(t){for(var e,r=t.split("/"),n=parseInt(r[0],10),i=r[1],o=i.length,a=[0,0],s=o-1;s>=0;s--){e=o-s;var u=i[s],c=0,l=0;"1"===u?l=1:"2"===u?(c=1,l=1):"3"===u&&(c=1);var f=Math.pow(2,e-1);U(f,a,c,l),a[0]+=f*c,a[1]+=f*l}if(n%2==1){var h=a[0];a[0]=a[1],a[1]=h}return{face:n,ij:a,level:e}}(H(t)))}function J(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=A()(t);if(e){var i=A()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return m()(this,r)}}var z=function(t){y()(r,t);var e=J(r);function r(){return p()(this,r),e.apply(this,arguments)}return E()(r,[{key:"indexToBounds",value:function(){var t=this.props,e=t.data,r=t.getS2Token;return{data:e,_normalize:!1,positionFormat:"XY",getPolygon:function(t,e){return V(r(t,e))}}}}]),r}(M);B()(z,"layerName","S2Layer"),B()(z,"defaultProps",{getS2Token:{type:"accessor",value:function(t){return t.token}}});r(46);var K=r(28),q=r.n(K);r(69),r(70);var W="undefined"!=typeof Float32Array?Float32Array:Array;Math.random;Math.PI;function Q(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t}function X(t){var e=t[0],r=t[1],n=t[2],i=t[3];return Math.hypot(e,r,n,i)}function Y(t){var e=t[0],r=t[1],n=t[2],i=t[3];return e*e+r*r+n*n+i*i}function Z(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*o+r[12]*a,t[1]=r[1]*n+r[5]*i+r[9]*o+r[13]*a,t[2]=r[2]*n+r[6]*i+r[10]*o+r[14]*a,t[3]=r[3]*n+r[7]*i+r[11]*o+r[15]*a,t}function $(t,e,r){var n=e[0],i=e[1],o=e[2],a=r[0],s=r[1],u=r[2],c=r[3],l=c*n+s*o-u*i,f=c*i+u*n-a*o,h=c*o+a*i-s*n,d=-a*n-s*i-u*o;return t[0]=l*c+d*-a+f*-u-h*-s,t[1]=f*c+d*-s+h*-a-l*-u,t[2]=h*c+d*-u+l*-s-f*-a,t[3]=e[3],t}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});var tt,et;tt=new W(4),W!=Float32Array&&(tt[0]=0,tt[1]=0,tt[2]=0,tt[3]=0),et=tt;Math.log2;function rt(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],c=e[7],l=e[8],f=e[9],h=e[10],d=e[11],p=e[12],v=e[13],y=e[14],g=e[15],m=r*s-n*a,b=r*u-i*a,A=r*c-o*a,w=n*u-i*s,B=n*c-o*s,_=i*c-o*u,x=l*v-f*p,C=l*y-h*p,k=l*g-d*p,E=f*y-h*v,O=f*g-d*v,T=h*g-d*y,S=m*T-b*O+A*E+w*k-B*C+_*x;return S?(S=1/S,t[0]=(s*T-u*O+c*E)*S,t[1]=(i*O-n*T-o*E)*S,t[2]=(v*_-y*B+g*w)*S,t[3]=(h*B-f*_-d*w)*S,t[4]=(u*k-a*T-c*C)*S,t[5]=(r*T-i*k+o*C)*S,t[6]=(y*A-p*_-g*b)*S,t[7]=(l*_-h*A+d*b)*S,t[8]=(a*O-s*k+c*x)*S,t[9]=(n*k-r*O-o*x)*S,t[10]=(p*B-v*A+g*m)*S,t[11]=(f*A-l*B-d*m)*S,t[12]=(s*C-a*E-u*x)*S,t[13]=(r*E-n*C+i*x)*S,t[14]=(v*b-p*w-y*m)*S,t[15]=(l*w-f*b+h*m)*S,t):null}function nt(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=e[6],l=e[7],f=e[8],h=e[9],d=e[10],p=e[11],v=e[12],y=e[13],g=e[14],m=e[15],b=r[0],A=r[1],w=r[2],B=r[3];return t[0]=b*n+A*s+w*f+B*v,t[1]=b*i+A*u+w*h+B*y,t[2]=b*o+A*c+w*d+B*g,t[3]=b*a+A*l+w*p+B*m,b=r[4],A=r[5],w=r[6],B=r[7],t[4]=b*n+A*s+w*f+B*v,t[5]=b*i+A*u+w*h+B*y,t[6]=b*o+A*c+w*d+B*g,t[7]=b*a+A*l+w*p+B*m,b=r[8],A=r[9],w=r[10],B=r[11],t[8]=b*n+A*s+w*f+B*v,t[9]=b*i+A*u+w*h+B*y,t[10]=b*o+A*c+w*d+B*g,t[11]=b*a+A*l+w*p+B*m,b=r[12],A=r[13],w=r[14],B=r[15],t[12]=b*n+A*s+w*f+B*v,t[13]=b*i+A*u+w*h+B*y,t[14]=b*o+A*c+w*d+B*g,t[15]=b*a+A*l+w*p+B*m,t}function it(t,e,r){var n,i,o,a,s,u,c,l,f,h,d,p,v=r[0],y=r[1],g=r[2];return e===t?(t[12]=e[0]*v+e[4]*y+e[8]*g+e[12],t[13]=e[1]*v+e[5]*y+e[9]*g+e[13],t[14]=e[2]*v+e[6]*y+e[10]*g+e[14],t[15]=e[3]*v+e[7]*y+e[11]*g+e[15]):(n=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=e[6],l=e[7],f=e[8],h=e[9],d=e[10],p=e[11],t[0]=n,t[1]=i,t[2]=o,t[3]=a,t[4]=s,t[5]=u,t[6]=c,t[7]=l,t[8]=f,t[9]=h,t[10]=d,t[11]=p,t[12]=n*v+s*y+f*g+e[12],t[13]=i*v+u*y+h*g+e[13],t[14]=o*v+c*y+d*g+e[14],t[15]=a*v+l*y+p*g+e[15]),t}function ot(t,e,r){var n=r[0],i=r[1],o=r[2];return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,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 at(t,e,r){var n=Math.sin(r),i=Math.cos(r),o=e[4],a=e[5],s=e[6],u=e[7],c=e[8],l=e[9],f=e[10],h=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=o*i+c*n,t[5]=a*i+l*n,t[6]=s*i+f*n,t[7]=u*i+h*n,t[8]=c*i-o*n,t[9]=l*i-a*n,t[10]=f*i-s*n,t[11]=h*i-u*n,t}function st(t,e,r){var n=Math.sin(r),i=Math.cos(r),o=e[0],a=e[1],s=e[2],u=e[3],c=e[4],l=e[5],f=e[6],h=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*i+c*n,t[1]=a*i+l*n,t[2]=s*i+f*n,t[3]=u*i+h*n,t[4]=c*i-o*n,t[5]=l*i-a*n,t[6]=f*i-s*n,t[7]=h*i-u*n,t}function ut(t,e){var r=e[0],n=e[1],i=e[2],o=e[4],a=e[5],s=e[6],u=e[8],c=e[9],l=e[10];return t[0]=Math.hypot(r,n,i),t[1]=Math.hypot(o,a,s),t[2]=Math.hypot(u,c,l),t}var ct=function(t,e,r,n,i){var o,a=1/Math.tan(e/2);return t[0]=a/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,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!=i&&i!==1/0?(o=1/(n-i),t[10]=(i+n)*o,t[14]=2*i*n*o):(t[10]=-1,t[14]=-2*n),t};var lt=function(t,e,r,n,i,o,a){var s=1/(e-r),u=1/(n-i),c=1/(o-a);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(e+r)*s,t[13]=(i+n)*u,t[14]=(a+o)*c,t[15]=1,t};function ft(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[3]*i+r[6],t[1]=r[1]*n+r[4]*i+r[7],t}function ht(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[4]*i+r[12],t[1]=r[1]*n+r[5]*i+r[13],t}!function(){var t=function(){var t=new W(2);return W!=Float32Array&&(t[0]=0,t[1]=0),t}()}();function dt(){var t=new W(3);return W!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function pt(t,e,r){var n=new W(3);return n[0]=t,n[1]=e,n[2]=r,n}function vt(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function yt(t,e,r){var n=e[0],i=e[1],o=e[2],a=r[0],s=r[1],u=r[2];return t[0]=i*u-o*s,t[1]=o*a-n*u,t[2]=n*s-i*a,t}function gt(t,e,r){var n=e[0],i=e[1],o=e[2],a=r[3]*n+r[7]*i+r[11]*o+r[15];return a=a||1,t[0]=(r[0]*n+r[4]*i+r[8]*o+r[12])/a,t[1]=(r[1]*n+r[5]*i+r[9]*o+r[13])/a,t[2]=(r[2]*n+r[6]*i+r[10]*o+r[14])/a,t}function mt(t,e,r){var n=e[0],i=e[1],o=e[2];return t[0]=n*r[0]+i*r[3]+o*r[6],t[1]=n*r[1]+i*r[4]+o*r[7],t[2]=n*r[2]+i*r[5]+o*r[8],t}function bt(t,e,r){var n=r[0],i=r[1],o=r[2],a=r[3],s=e[0],u=e[1],c=e[2],l=i*c-o*u,f=o*s-n*c,h=n*u-i*s,d=i*h-o*f,p=o*l-n*h,v=n*f-i*l,y=2*a;return l*=y,f*=y,h*=y,d*=2,p*=2,v*=2,t[0]=s+l+d,t[1]=u+f+p,t[2]=c+h+v,t}var At=function(t){var e=t[0],r=t[1],n=t[2];return Math.hypot(e,r,n)};!function(){var t=dt()}();function wt(t,e){if(!t)throw new Error(e||"@math.gl/web-mercator: assertion failed.")}var Bt=Math.PI,_t=Bt/4,xt=Bt/180,Ct=180/Bt;function kt(t){var e=q()(t,2),r=e[0],n=e[1];wt(Number.isFinite(r)),wt(Number.isFinite(n)&&n>=-90&&n<=90,"invalid latitude");var i=n*xt;return[512*(r*xt+Bt)/(2*Bt),512*(Bt+Math.log(Math.tan(_t+.5*i)))/(2*Bt)]}function Et(t){var e=q()(t,2),r=e[0],n=e[1],i=r/512*(2*Bt)-Bt,o=2*(Math.atan(Math.exp(n/512*(2*Bt)-Bt))-_t);return[i*Ct,o*Ct]}Math.PI;r(71);function Ot(t){var e=function(t){for(var e=0,r=0,n=1<<t.length,i=n/512,o=0;o<t.length;o++){n>>=1;var a=parseInt(t[o]);a%2&&(e|=n),a>1&&(r|=n)}return[[e/i,512-r/i],[(e+.99)/i,512-(r+.99)/i]]}(t),r=R()(e,2),n=r[0],i=r[1],o=Et(n),a=R()(o,2),s=a[0],u=a[1],c=Et(i),l=R()(c,2),f=l[0],h=l[1];return[f,u,f,h,s,h,s,u,f,u]}function Tt(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=A()(t);if(e){var i=A()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return m()(this,r)}}var St=function(t){y()(r,t);var e=Tt(r);function r(){return p()(this,r),e.apply(this,arguments)}return E()(r,[{key:"indexToBounds",value:function(){var t=this.props,e=t.data,r=t.getQuadkey;return{data:e,_normalize:!1,positionFormat:"XY",getPolygon:function(t,e){return Ot(r(t,e))}}}}]),r}(M);B()(St,"layerName","QuadkeyLayer"),B()(St,"defaultProps",{getQuadkey:{type:"accessor",value:function(t){return t.quadkey}}});var Mt=r(36),It=r.n(Mt),Rt=r(32),Pt=r.n(Rt),Ft=function(){function t(e){p()(this,t),B()(this,"index",void 0),B()(this,"isVisible",void 0),B()(this,"isSelected",void 0),B()(this,"parent",void 0),B()(this,"children",void 0),B()(this,"content",void 0),B()(this,"state",void 0),B()(this,"layers",void 0),B()(this,"id",void 0),B()(this,"bbox",void 0),B()(this,"zoom",void 0),B()(this,"userData",void 0),B()(this,"_abortController",void 0),B()(this,"_loader",void 0),B()(this,"_loaderId",void 0),B()(this,"_isLoaded",void 0),B()(this,"_isCancelled",void 0),B()(this,"_needsReload",void 0),this.index=e,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}var e;return E()(t,[{key:"data",get:function(){var t=this;return this.isLoading&&this._loader?this._loader.then((function(){return t.data})):this.content}},{key:"isLoaded",get:function(){return this._isLoaded&&!this._needsReload}},{key:"isLoading",get:function(){return Boolean(this._loader)&&!this._isCancelled}},{key:"needsReload",get:function(){return this._needsReload||this._isCancelled}},{key:"byteLength",get:function(){var t=this.content?this.content.byteLength:0;return Number.isFinite(t)||_.log.error("byteLength not defined in tile data")(),t}},{key:"_loadData",value:(e=It()(Pt.a.mark((function t(e){var r,n,i,o,a,s,u,c,l,f,h,d,p,v;return Pt.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.getData,n=e.requestScheduler,i=e.onLoad,o=e.onError,a=this.index,s=this.id,u=this.bbox,c=this.userData,l=this.zoom,f=this._loaderId,this._abortController=new AbortController,h=this._abortController.signal,t.next=7,n.scheduleRequest(this,(function(t){return t.isSelected?1:-1}));case 7:if(d=t.sent){t.next=11;break}return this._isCancelled=!0,t.abrupt("return");case 11:if(!this._isCancelled){t.next=14;break}return d.done(),t.abrupt("return");case 14:return p=null,t.prev=15,t.next=18,r({index:a,id:s,bbox:u,userData:c,zoom:l,signal:h});case 18:p=t.sent,t.next=24;break;case 21:t.prev=21,t.t0=t.catch(15),v=t.t0||!0;case 24:return t.prev=24,d.done(),t.finish(24);case 27:if(f===this._loaderId){t.next=29;break}return t.abrupt("return");case 29:if(this._loader=void 0,this.content=p,!this._isCancelled||p){t.next=34;break}return this._isLoaded=!1,t.abrupt("return");case 34:this._isLoaded=!0,this._isCancelled=!1,v?o(v,this):i(this);case 37:case"end":return t.stop()}}),t,this,[[15,21,24,27]])}))),function(t){return e.apply(this,arguments)})},{key:"loadData",value:function(t){return this._isLoaded=!1,this._isCancelled=!1,this._needsReload=!1,this._loaderId++,this._loader=this._loadData(t),this._loader}},{key:"setNeedsReload",value:function(){this.isLoading&&(this.abort(),this._loader=void 0),this._needsReload=!0}},{key:"abort",value:function(){var t;this.isLoaded||(this._isCancelled=!0,null===(t=this._abortController)||void 0===t||t.abort())}}]),t}(),Dt=r(16),Lt=r.n(Dt),jt=-1,Gt=0,Nt=1,Ut=r(33),Ht=r.n(Ut),Vt=r(34),Jt=r.n(Vt);function zt(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Kt=r(24),qt=r.n(Kt),Wt=r(25),Qt=r.n(Wt),Xt=r(26),Yt=r.n(Xt),Zt=r(27),$t=r.n(Zt),te=r(20),ee=r.n(te);r(51);function re(t,e){if(!t)throw new Error("math.gl assertion ".concat(e))}Math.PI,Math.PI;var ne={EPSILON:1e-12,debug:!1,precision:4,printTypes:!1,printDegrees:!1,printRowMajor:!0};function ie(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.precision,n=void 0===r?ne.precision:r;return t=ue(t),"".concat(parseFloat(t.toPrecision(n)))}function oe(t){return Array.isArray(t)||ArrayBuffer.isView(t)&&!(t instanceof DataView)}function ae(t,e,r){return oe(t)?t.map((function(t,n){return ae(t,e[n],r)})):r*e+(1-r)*t}function se(t,e,r){var n=ne.EPSILON;r&&(ne.EPSILON=r);try{if(t===e)return!0;if(oe(t)&&oe(e)){if(t.length!==e.length)return!1;for(var i=0;i<t.length;++i)if(!se(t[i],e[i]))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)<=ne.EPSILON*Math.max(1,Math.abs(t),Math.abs(e))}finally{ne.EPSILON=n}}function ue(t){return Math.round(t/ne.EPSILON)*ne.EPSILON}function ce(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=ee()(t);if(e){var i=ee()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return $t()(this,r)}}var le=function(t){Yt()(r,t);var e=ce(r);function r(){return qt()(this,r),e.apply(this,arguments)}return Qt()(r,[{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"fromArray",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=0;r<this.ELEMENTS;++r)this[r]=t[r+e];return this.check()}},{key:"toArray",value:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=0;r<this.ELEMENTS;++r)t[e+r]=this[r];return t}},{key:"from",value:function(t){return Array.isArray(t)?this.copy(t):this.fromObject(t)}},{key:"to",value:function(t){return t===this?this:oe(t)?this.toArray(t):this.toObject(t)}},{key:"toTarget",value:function(t){return t?this.to(t):this}},{key:"toFloat32Array",value:function(){return new Float32Array(this)}},{key:"toString",value:function(){return this.formatString(ne)}},{key:"formatString",value:function(t){for(var e="",r=0;r<this.ELEMENTS;++r)e+=(r>0?", ":"")+ie(this[r],t);return"".concat(t.printTypes?this.constructor.name:"","[").concat(e,"]")}},{key:"equals",value:function(t){if(!t||this.length!==t.length)return!1;for(var e=0;e<this.ELEMENTS;++e)if(!se(this[e],t[e]))return!1;return!0}},{key:"exactEquals",value:function(t){if(!t||this.length!==t.length)return!1;for(var e=0;e<this.ELEMENTS;++e)if(this[e]!==t[e])return!1;return!0}},{key:"negate",value:function(){for(var t=0;t<this.ELEMENTS;++t)this[t]=-this[t];return this.check()}},{key:"lerp",value:function(t,e,r){if(void 0===r)return this.lerp(this,t,e);for(var n=0;n<this.ELEMENTS;++n){var i=t[n];this[n]=i+r*(e[n]-i)}return this.check()}},{key:"min",value:function(t){for(var e=0;e<this.ELEMENTS;++e)this[e]=Math.min(t[e],this[e]);return this.check()}},{key:"max",value:function(t){for(var e=0;e<this.ELEMENTS;++e)this[e]=Math.max(t[e],this[e]);return this.check()}},{key:"clamp",value:function(t,e){for(var r=0;r<this.ELEMENTS;++r)this[r]=Math.min(Math.max(this[r],t[r]),e[r]);return this.check()}},{key:"add",value:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];for(var n=0,i=e;n<i.length;n++)for(var o=i[n],a=0;a<this.ELEMENTS;++a)this[a]+=o[a];return this.check()}},{key:"subtract",value:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];for(var n=0,i=e;n<i.length;n++)for(var o=i[n],a=0;a<this.ELEMENTS;++a)this[a]-=o[a];return this.check()}},{key:"scale",value:function(t){if("number"==typeof t)for(var e=0;e<this.ELEMENTS;++e)this[e]*=t;else for(var r=0;r<this.ELEMENTS&&r<t.length;++r)this[r]*=t[r];return this.check()}},{key:"multiplyByScalar",value:function(t){for(var e=0;e<this.ELEMENTS;++e)this[e]*=t;return this.check()}},{key:"check",value:function(){if(ne.debug&&!this.validate())throw new Error("math.gl: ".concat(this.constructor.name," some fields set to invalid numbers'"));return this}},{key:"validate",value:function(){for(var t=this.length===this.ELEMENTS,e=0;e<this.ELEMENTS;++e)t=t&&Number.isFinite(this[e]);return t}},{key:"sub",value:function(t){return this.subtract(t)}},{key:"setScalar",value:function(t){for(var e=0;e<this.ELEMENTS;++e)this[e]=t;return this.check()}},{key:"addScalar",value:function(t){for(var e=0;e<this.ELEMENTS;++e)this[e]+=t;return this.check()}},{key:"subScalar",value:function(t){return this.addScalar(-t)}},{key:"multiplyScalar",value:function(t){for(var e=0;e<this.ELEMENTS;++e)this[e]*=t;return this.check()}},{key:"divideScalar",value:function(t){return this.multiplyByScalar(1/t)}},{key:"clampScalar",value:function(t,e){for(var r=0;r<this.ELEMENTS;++r)this[r]=Math.min(Math.max(this[r],t),e);return this.check()}},{key:"elements",get:function(){return this}}]),r}(function(t){function e(){var e=Reflect.construct(t,Array.from(arguments));return Object.setPrototypeOf(e,Object.getPrototypeOf(this)),e}return e.prototype=Object.create(t.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t,e}(Array));function fe(t,e){if(t.length!==e)return!1;for(var r=0;r<t.length;++r)if(!Number.isFinite(t[r]))return!1;return!0}function he(t){if(!Number.isFinite(t))throw new Error("Invalid number ".concat(t));return t}function de(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(ne.debug&&!fe(t,e))throw new Error("math.gl: ".concat(r," some fields set to invalid numbers'"));return t}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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=ee()(t);if(e){var i=ee()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return $t()(this,r)}}var ve=function(t){Yt()(r,t);var e=pe(r);function r(){return qt()(this,r),e.apply(this,arguments)}return Qt()(r,[{key:"x",get:function(){return this[0]},set:function(t){this[0]=he(t)}},{key:"y",get:function(){return this[1]},set:function(t){this[1]=he(t)}},{key:"len",value:function(){return Math.sqrt(this.lengthSquared())}},{key:"magnitude",value:function(){return this.len()}},{key:"lengthSquared",value:function(){for(var t=0,e=0;e<this.ELEMENTS;++e)t+=this[e]*this[e];return t}},{key:"magnitudeSquared",value:function(){return this.lengthSquared()}},{key:"distance",value:function(t){return Math.sqrt(this.distanceSquared(t))}},{key:"distanceSquared",value:function(t){for(var e=0,r=0;r<this.ELEMENTS;++r){var n=this[r]-t[r];e+=n*n}return he(e)}},{key:"dot",value:function(t){for(var e=0,r=0;r<this.ELEMENTS;++r)e+=this[r]*t[r];return he(e)}},{key:"normalize",value:function(){var t=this.magnitude();if(0!==t)for(var e=0;e<this.ELEMENTS;++e)this[e]/=t;return this.check()}},{key:"multiply",value:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];for(var n=0,i=e;n<i.length;n++)for(var o=i[n],a=0;a<this.ELEMENTS;++a)this[a]*=o[a];return this.check()}},{key:"divide",value:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];for(var n=0,i=e;n<i.length;n++)for(var o=i[n],a=0;a<this.ELEMENTS;++a)this[a]/=o[a];return this.check()}},{key:"lengthSq",value:function(){return this.lengthSquared()}},{key:"distanceTo",value:function(t){return this.distance(t)}},{key:"distanceToSquared",value:function(t){return this.distanceSquared(t)}},{key:"getComponent",value:function(t){return re(t>=0&&t<this.ELEMENTS,"index is out of range"),he(this[t])}},{key:"setComponent",value:function(t,e){return re(t>=0&&t<this.ELEMENTS,"index is out of range"),this[t]=e,this.check()}},{key:"addVectors",value:function(t,e){return this.copy(t).add(e)}},{key:"subVectors",value:function(t,e){return this.copy(t).subtract(e)}},{key:"multiplyVectors",value:function(t,e){return this.copy(t).multiply(e)}},{key:"addScaledVector",value:function(t,e){return this.add(new this.constructor(t).multiplyScalar(e))}}]),r}(le);function ye(t,e,r){var n=e[0],i=e[1],o=r[3]*n+r[7]*i||1;return t[0]=(r[0]*n+r[4]*i)/o,t[1]=(r[1]*n+r[5]*i)/o,t}function ge(t,e,r){var n=e[0],i=e[1],o=e[2],a=r[3]*n+r[7]*i+r[11]*o||1;return t[0]=(r[0]*n+r[4]*i+r[8]*o)/a,t[1]=(r[1]*n+r[5]*i+r[9]*o)/a,t[2]=(r[2]*n+r[6]*i+r[10]*o)/a,t}function me(t,e,r){var n=e[0],i=e[1],o=e[2];return t[0]=r[0]*n+r[3]*i+r[6]*o,t[1]=r[1]*n+r[4]*i+r[7]*o,t[2]=r[2]*n+r[5]*i+r[8]*o,t[3]=e[3],t}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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=ee()(t);if(e){var i=ee()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return $t()(this,r)}}var Ae,we=[0,0,0],Be=function(t){Yt()(r,t);var e=be(r);function r(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return qt()(this,r),t=e.call(this,-0,-0,-0),1===arguments.length&&oe(n)?t.copy(n):(ne.debug&&(he(n),he(i),he(o)),t[0]=n,t[1]=i,t[2]=o),t}return Qt()(r,[{key:"set",value:function(t,e,r){return this[0]=t,this[1]=e,this[2]=r,this.check()}},{key:"copy",value:function(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this.check()}},{key:"fromObject",value:function(t){return ne.debug&&(he(t.x),he(t.y),he(t.z)),this[0]=t.x,this[1]=t.y,this[2]=t.z,this.check()}},{key:"toObject",value:function(t){return t.x=this[0],t.y=this[1],t.z=this[2],t}},{key:"ELEMENTS",get:function(){return 3}},{key:"z",get:function(){return this[2]},set:function(t){this[2]=he(t)}},{key:"angle",value:function(t){return r=t,n=(e=this)[0],i=e[1],o=e[2],a=r[0],s=r[1],u=r[2],c=Math.sqrt(n*n+i*i+o*o)*Math.sqrt(a*a+s*s+u*u),l=c&&vt(e,r)/c,Math.acos(Math.min(Math.max(l,-1),1));var e,r,n,i,o,a,s,u,c,l}},{key:"cross",value:function(t){return yt(this,this,t),this.check()}},{key:"rotateX",value:function(t){var e=t.radians,r=t.origin;return function(t,e,r,n){var i=[],o=[];i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],o[0]=i[0],o[1]=i[1]*Math.cos(n)-i[2]*Math.sin(n),o[2]=i[1]*Math.sin(n)+i[2]*Math.cos(n),t[0]=o[0]+r[0],t[1]=o[1]+r[1],t[2]=o[2]+r[2]}(this,this,void 0===r?we:r,e),this.check()}},{key:"rotateY",value:function(t){var e=t.radians,r=t.origin;return function(t,e,r,n){var i=[],o=[];i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],o[0]=i[2]*Math.sin(n)+i[0]*Math.cos(n),o[1]=i[1],o[2]=i[2]*Math.cos(n)-i[0]*Math.sin(n),t[0]=o[0]+r[0],t[1]=o[1]+r[1],t[2]=o[2]+r[2]}(this,this,void 0===r?we:r,e),this.check()}},{key:"rotateZ",value:function(t){var e=t.radians,r=t.origin;return function(t,e,r,n){var i=[],o=[];i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],o[0]=i[0]*Math.cos(n)-i[1]*Math.sin(n),o[1]=i[0]*Math.sin(n)+i[1]*Math.cos(n),o[2]=i[2],t[0]=o[0]+r[0],t[1]=o[1]+r[1],t[2]=o[2]+r[2]}(this,this,void 0===r?we:r,e),this.check()}},{key:"transform",value:function(t){return this.transformAsPoint(t)}},{key:"transformAsPoint",value:function(t){return gt(this,this,t),this.check()}},{key:"transformAsVector",value:function(t){return ge(this,this,t),this.check()}},{key:"transformByMatrix3",value:function(t){return mt(this,this,t),this.check()}},{key:"transformByMatrix2",value:function(t){return function(t,e,r){var n=e[0],i=e[1];t[0]=r[0]*n+r[2]*i,t[1]=r[1]*n+r[3]*i,t[2]=e[2]}(this,this,t),this.check()}},{key:"transformByQuaternion",value:function(t){return bt(this,this,t),this.check()}}],[{key:"ZERO",get:function(){return Ae||(Ae=new r(0,0,0),Object.freeze(Ae)),Ae}}]),r}(ve),_e=new Be,xe=new Be,Ce=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[0,0,0],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0],n=arguments.length>2?arguments[2]:void 0;Ht()(this,t),zt(this,"center",void 0),zt(this,"halfDiagonal",void 0),zt(this,"minimum",void 0),zt(this,"maximum",void 0),n=n||_e.copy(e).add(r).scale(.5),this.center=new Be(n),this.halfDiagonal=new Be(r).subtract(this.center),this.minimum=new Be(e),this.maximum=new Be(r)}return Jt()(t,[{key:"clone",value:function(){return new t(this.minimum,this.maximum,this.center)}},{key:"equals",value:function(t){return this===t||Boolean(t)&&this.minimum.equals(t.minimum)&&this.maximum.equals(t.maximum)}},{key:"transform",value:function(t){return this.center.transformAsPoint(t),this.halfDiagonal.transform(t),this.minimum.transform(t),this.maximum.transform(t),this}},{key:"intersectPlane",value:function(t){var e=this.halfDiagonal,r=xe.from(t.normal),n=e.x*Math.abs(r.x)+e.y*Math.abs(r.y)+e.z*Math.abs(r.z),i=this.center.dot(r)+t.distance;return i-n>0?Nt:i+n<0?jt:Gt}},{key:"distanceTo",value:function(t){return Math.sqrt(this.distanceSquaredTo(t))}},{key:"distanceSquaredTo",value:function(t){var e,r=_e.from(t).subtract(this.center),n=this.halfDiagonal,i=0;return(e=Math.abs(r.x)-n.x)>0&&(i+=e*e),(e=Math.abs(r.y)-n.y)>0&&(i+=e*e),(e=Math.abs(r.z)-n.z)>0&&(i+=e*e),i}}]),t}(),ke=new Be,Ee=new Be,Oe=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[0,0,0],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;Ht()(this,t),zt(this,"center",void 0),zt(this,"radius",void 0),this.radius=-0,this.center=new Be,this.fromCenterRadius(e,r)}return Jt()(t,[{key:"fromCenterRadius",value:function(t,e){return this.center.from(t),this.radius=e,this}},{key:"fromCornerPoints",value:function(t,e){return e=ke.from(e),this.center=(new Be).from(t).add(e).scale(.5),this.radius=this.center.distance(e),this}},{key:"equals",value:function(t){return this===t||Boolean(t)&&this.center.equals(t.center)&&this.radius===t.radius}},{key:"clone",value:function(){return new t(this.center,this.radius)}},{key:"union",value:function(t){var e=this.center,r=this.radius,n=t.center,i=t.radius,o=ke.copy(n).subtract(e),a=o.magnitude();if(r>=a+i)return this.clone();if(i>=a+r)return t.clone();var s=.5*(r+a+i);return Ee.copy(o).scale((-r+s)/a).add(e),this.center.copy(Ee),this.radius=s,this}},{key:"expand",value:function(t){var e=ke.from(t).subtract(this.center).magnitude();return e>this.radius&&(this.radius=e),this}},{key:"transform",value:function(t){this.center.transform(t);var e=ut(ke,t);return this.radius=Math.max(e[0],Math.max(e[1],e[2]))*this.radius,this}},{key:"distanceSquaredTo",value:function(t){var e=this.distanceTo(t);return e*e}},{key:"distanceTo",value:function(t){var e=ke.from(t).subtract(this.center);return Math.max(0,e.len()-this.radius)}},{key:"intersectPlane",value:function(t){var e=this.center,r=this.radius,n=t.normal.dot(e)+t.distance;return n<-r?jt:n<r?Gt:Nt}}]),t}(),Te=r(39),Se=r.n(Te);function Me(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=ee()(t);if(e){var i=ee()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return $t()(this,r)}}var Ie=function(t){Yt()(r,t);var e=Me(r);function r(){return qt()(this,r),e.apply(this,arguments)}return Qt()(r,[{key:"toString",value:function(){var t="[";if(ne.printRowMajor){t+="row-major:";for(var e=0;e<this.RANK;++e)for(var r=0;r<this.RANK;++r)t+=" ".concat(this[r*this.RANK+e])}else{t+="column-major:";for(var n=0;n<this.ELEMENTS;++n)t+=" ".concat(this[n])}return t+="]"}},{key:"getElementIndex",value:function(t,e){return e*this.RANK+t}},{key:"getElement",value:function(t,e){return this[e*this.RANK+t]}},{key:"setElement",value:function(t,e,r){return this[e*this.RANK+t]=he(r),this}},{key:"getColumn",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Array(this.RANK).fill(-0),r=t*this.RANK,n=0;n<this.RANK;++n)e[n]=this[r+n];return e}},{key:"setColumn",value:function(t,e){for(var r=t*this.RANK,n=0;n<this.RANK;++n)this[r+n]=e[n];return this}}]),r}(le);function Re(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=e[6],l=e[7],f=e[8],h=r[0],d=r[1],p=r[2],v=r[3],y=r[4],g=r[5],m=r[6],b=r[7],A=r[8];return t[0]=h*n+d*a+p*c,t[1]=h*i+d*s+p*l,t[2]=h*o+d*u+p*f,t[3]=v*n+y*a+g*c,t[4]=v*i+y*s+g*l,t[5]=v*o+y*u+g*f,t[6]=m*n+b*a+A*c,t[7]=m*i+b*s+A*l,t[8]=m*o+b*u+A*f,t}function Pe(t,e,r){var n=r[0],i=r[1];return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=i*e[3],t[4]=i*e[4],t[5]=i*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}var Fe;function De(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=ee()(t);if(e){var i=ee()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return $t()(this,r)}}!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"}(Fe||(Fe={}));var Le,je,Ge,Ne=Object.freeze([1,0,0,0,1,0,0,0,1]),Ue=function(t){Yt()(r,t);var e=De(r);function r(t){for(var n,i=arguments.length,o=new Array(i>1?i-1:0),a=1;a<i;a++)o[a-1]=arguments[a];return qt()(this,r),n=e.call(this,-0,-0,-0,-0,-0,-0,-0,-0,-0),1===arguments.length&&Array.isArray(t)?n.copy(t):o.length>0?n.copy([t].concat(o)):n.identity(),n}return Qt()(r,[{key:"ELEMENTS",get:function(){return 9}},{key:"RANK",get:function(){return 3}},{key:"INDICES",get:function(){return Fe}},{key:"copy",value:function(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()}},{key:"identity",value:function(){return this.copy(Ne)}},{key:"fromObject",value:function(t){return this.check()}},{key:"fromQuaternion",value:function(t){return function(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=r+r,s=n+n,u=i+i,c=r*a,l=n*a,f=n*s,h=i*a,d=i*s,p=i*u,v=o*a,y=o*s,g=o*u;t[0]=1-f-p,t[3]=l-g,t[6]=h+y,t[1]=l+g,t[4]=1-c-p,t[7]=d-v,t[2]=h-y,t[5]=d+v,t[8]=1-c-f}(this,t),this.check()}},{key:"set",value:function(t,e,r,n,i,o,a,s,u){return this[0]=t,this[1]=e,this[2]=r,this[3]=n,this[4]=i,this[5]=o,this[6]=a,this[7]=s,this[8]=u,this.check()}},{key:"setRowMajor",value:function(t,e,r,n,i,o,a,s,u){return this[0]=t,this[1]=n,this[2]=a,this[3]=e,this[4]=i,this[5]=s,this[6]=r,this[7]=o,this[8]=u,this.check()}},{key:"determinant",value:function(){return e=(t=this)[0],r=t[1],n=t[2],i=t[3],o=t[4],a=t[5],s=t[6],u=t[7],c=t[8],e*(c*o-a*u)+r*(-c*i+a*s)+n*(u*i-o*s);var t,e,r,n,i,o,a,s,u,c}},{key:"transpose",value:function(){return function(t,e){if(t===e){var r=e[1],n=e[2],i=e[5];t[1]=e[3],t[2]=e[6],t[3]=r,t[5]=e[7],t[6]=n,t[7]=i}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]}(this,this),this.check()}},{key:"invert",value:function(){return function(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],c=e[7],l=e[8],f=l*a-s*c,h=-l*o+s*u,d=c*o-a*u,p=r*f+n*h+i*d;p&&(p=1/p,t[0]=f*p,t[1]=(-l*n+i*c)*p,t[2]=(s*n-i*a)*p,t[3]=h*p,t[4]=(l*r-i*u)*p,t[5]=(-s*r+i*o)*p,t[6]=d*p,t[7]=(-c*r+n*u)*p,t[8]=(a*r-n*o)*p)}(this,this),this.check()}},{key:"multiplyLeft",value:function(t){return Re(this,t,this),this.check()}},{key:"multiplyRight",value:function(t){return Re(this,this,t),this.check()}},{key:"rotate",value:function(t){return function(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=e[6],l=e[7],f=e[8],h=Math.sin(r),d=Math.cos(r);t[0]=d*n+h*a,t[1]=d*i+h*s,t[2]=d*o+h*u,t[3]=d*a-h*n,t[4]=d*s-h*i,t[5]=d*u-h*o,t[6]=c,t[7]=l,t[8]=f}(this,this,t),this.check()}},{key:"scale",value:function(t){return Array.isArray(t)?Pe(this,this,t):Pe(this,this,[t,t]),this.check()}},{key:"translate",value:function(t){return function(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=e[6],l=e[7],f=e[8],h=r[0],d=r[1];t[0]=n,t[1]=i,t[2]=o,t[3]=a,t[4]=s,t[5]=u,t[6]=h*n+d*a+c,t[7]=h*i+d*s+l,t[8]=h*o+d*u+f}(this,this,t),this.check()}},{key:"transform",value:function(t,e){var r;switch(t.length){case 2:r=ft(e||[-0,-0],t,this);break;case 3:r=mt(e||[-0,-0,-0],t,this);break;case 4:r=me(e||[-0,-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return de(r,t.length),r}},{key:"transformVector",value:function(t,e){return this.transform(t,e)}},{key:"transformVector2",value:function(t,e){return this.transform(t,e)}},{key:"transformVector3",value:function(t,e){return this.transform(t,e)}}],[{key:"IDENTITY",get:function(){return function(){je||(je=new Ue,Object.freeze(je));return je}()}},{key:"ZERO",get:function(){return function(){Le||(Le=new Ue([0,0,0,0,0,0,0,0,0]),Object.freeze(Le));return Le}()}}]),r}(Ie);function He(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=ee()(t);if(e){var i=ee()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return $t()(this,r)}}var Ve=function(t){Yt()(r,t);var e=He(r);function r(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return qt()(this,r),t=e.call(this,-0,-0,-0,-0),oe(n)&&1===arguments.length?t.copy(n):(ne.debug&&(he(n),he(i),he(o),he(a)),t[0]=n,t[1]=i,t[2]=o,t[3]=a),t}return Qt()(r,[{key:"set",value:function(t,e,r,n){return this[0]=t,this[1]=e,this[2]=r,this[3]=n,this.check()}},{key:"copy",value:function(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this.check()}},{key:"fromObject",value:function(t){return ne.debug&&(he(t.x),he(t.y),he(t.z),he(t.w)),this[0]=t.x,this[1]=t.y,this[2]=t.z,this[3]=t.w,this}},{key:"toObject",value:function(t){return t.x=this[0],t.y=this[1],t.z=this[2],t.w=this[3],t}},{key:"ELEMENTS",get:function(){return 4}},{key:"z",get:function(){return this[2]},set:function(t){this[2]=he(t)}},{key:"w",get:function(){return this[3]},set:function(t){this[3]=he(t)}},{key:"transform",value:function(t){return gt(this,this,t),this.check()}},{key:"transformByMatrix3",value:function(t){return me(this,this,t),this.check()}},{key:"transformByMatrix2",value:function(t){return function(t,e,r){var n=e[0],i=e[1];t[0]=r[0]*n+r[2]*i,t[1]=r[1]*n+r[3]*i,t[2]=e[2],t[3]=e[3]}(this,this,t),this.check()}},{key:"transformByQuaternion",value:function(t){return bt(this,this,t),this.check()}},{key:"applyMatrix4",value:function(t){return t.transform(this,this),this}}],[{key:"ZERO",get:function(){return Ge||(Ge=new r(0,0,0,0),Object.freeze(Ge)),Ge}}]),r}(ve);function Je(){var t=new W(4);return W!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function ze(t,e,r){r*=.5;var n=Math.sin(r);return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=Math.cos(r),t}function Ke(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=r[0],u=r[1],c=r[2],l=r[3];return t[0]=n*l+a*s+i*c-o*u,t[1]=i*l+a*u+o*s-n*c,t[2]=o*l+a*c+n*u-i*s,t[3]=a*l-n*s-i*u-o*c,t}function qe(t,e,r,n){var i,o,a,s,u,c=e[0],l=e[1],f=e[2],h=e[3],d=r[0],p=r[1],v=r[2],y=r[3];return(o=c*d+l*p+f*v+h*y)<0&&(o=-o,d=-d,p=-p,v=-v,y=-y),1-o>1e-6?(i=Math.acos(o),a=Math.sin(i),s=Math.sin((1-n)*i)/a,u=Math.sin(n*i)/a):(s=1-n,u=n),t[0]=s*c+u*d,t[1]=s*l+u*p,t[2]=s*f+u*v,t[3]=s*h+u*y,t}function We(t,e){var r,n=e[0]+e[4]+e[8];if(n>0)r=Math.sqrt(n+1),t[3]=.5*r,r=.5/r,t[0]=(e[5]-e[7])*r,t[1]=(e[6]-e[2])*r,t[2]=(e[1]-e[3])*r;else{var i=0;e[4]>e[0]&&(i=1),e[8]>e[3*i+i]&&(i=2);var o=(i+1)%3,a=(i+2)%3;r=Math.sqrt(e[3*i+i]-e[3*o+o]-e[3*a+a]+1),t[i]=.5*r,r=.5/r,t[3]=(e[3*o+a]-e[3*a+o])*r,t[o]=(e[3*o+i]+e[3*i+o])*r,t[a]=(e[3*a+i]+e[3*i+a])*r}return t}var Qe,Xe,Ye,Ze,$e,tr,er=function(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t},rr=Q,nr=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]},ir=function(t,e,r,n){var i=e[0],o=e[1],a=e[2],s=e[3];return t[0]=i+n*(r[0]-i),t[1]=o+n*(r[1]-o),t[2]=a+n*(r[2]-a),t[3]=s+n*(r[3]-s),t},or=X,ar=Y,sr=function(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=r*r+n*n+i*i+o*o;return a>0&&(a=1/Math.sqrt(a)),t[0]=r*a,t[1]=n*a,t[2]=i*a,t[3]=o*a,t},ur=(Qe=dt(),Xe=pt(1,0,0),Ye=pt(0,1,0),function(t,e,r){var n=vt(e,r);return n<-.999999?(yt(Qe,Xe,e),At(Qe)<1e-6&&yt(Qe,Ye,e),function(t,e){var r=e[0],n=e[1],i=e[2],o=r*r+n*n+i*i;o>0&&(o=1/Math.sqrt(o)),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o}(Qe,Qe),ze(t,Qe,Math.PI),t):n>.999999?(t[0]=0,t[1]=0,t[2]=0,t[3]=1,t):(yt(Qe,e,r),t[0]=Qe[0],t[1]=Qe[1],t[2]=Qe[2],t[3]=1+n,sr(t,t))});Ze=Je(),$e=Je(),tr=function(){var t=new W(9);return W!=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 cr(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=ee()(t);if(e){var i=ee()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return $t()(this,r)}}var lr=[0,0,0,1],fr=function(t){Yt()(r,t);var e=cr(r);function r(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;return qt()(this,r),t=e.call(this,-0,-0,-0,-0),Array.isArray(n)&&1===arguments.length?t.copy(n):t.set(n,i,o,a),t}return Qt()(r,[{key:"copy",value:function(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this.check()}},{key:"set",value:function(t,e,r,n){return this[0]=t,this[1]=e,this[2]=r,this[3]=n,this.check()}},{key:"fromObject",value:function(t){return this[0]=t.x,this[1]=t.y,this[2]=t.z,this[3]=t.w,this.check()}},{key:"fromMatrix3",value:function(t){return We(this,t),this.check()}},{key:"fromAxisRotation",value:function(t,e){return ze(this,t,e),this.check()}},{key:"identity",value:function(){return function(t){t[0]=0,t[1]=0,t[2]=0,t[3]=1}(this),this.check()}},{key:"setAxisAngle",value:function(t,e){return this.fromAxisRotation(t,e)}},{key:"ELEMENTS",get:function(){return 4}},{key:"x",get:function(){return this[0]},set:function(t){this[0]=he(t)}},{key:"y",get:function(){return this[1]},set:function(t){this[1]=he(t)}},{key:"z",get:function(){return this[2]},set:function(t){this[2]=he(t)}},{key:"w",get:function(){return this[3]},set:function(t){this[3]=he(t)}},{key:"len",value:function(){return or(this)}},{key:"lengthSquared",value:function(){return ar(this)}},{key:"dot",value:function(t){return nr(this,t)}},{key:"rotationTo",value:function(t,e){return ur(this,t,e),this.check()}},{key:"add",value:function(t){return er(this,this,t),this.check()}},{key:"calculateW",value:function(){return function(t,e){var r=e[0],n=e[1],i=e[2];t[0]=r,t[1]=n,t[2]=i,t[3]=Math.sqrt(Math.abs(1-r*r-n*n-i*i))}(this,this),this.check()}},{key:"conjugate",value:function(){return function(t,e){t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3]}(this,this),this.check()}},{key:"invert",value:function(){return function(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=r*r+n*n+i*i+o*o,s=a?1/a:0;t[0]=-r*s,t[1]=-n*s,t[2]=-i*s,t[3]=o*s}(this,this),this.check()}},{key:"lerp",value:function(t,e,r){return void 0===r?this.lerp(this,t,e):(ir(this,t,e,r),this.check())}},{key:"multiplyRight",value:function(t){return Ke(this,this,t),this.check()}},{key:"multiplyLeft",value:function(t){return Ke(this,t,this),this.check()}},{key:"normalize",value:function(){var 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()}},{key:"rotateX",value:function(t){return function(t,e,r){r*=.5;var n=e[0],i=e[1],o=e[2],a=e[3],s=Math.sin(r),u=Math.cos(r);t[0]=n*u+a*s,t[1]=i*u+o*s,t[2]=o*u-i*s,t[3]=a*u-n*s}(this,this,t),this.check()}},{key:"rotateY",value:function(t){return function(t,e,r){r*=.5;var n=e[0],i=e[1],o=e[2],a=e[3],s=Math.sin(r),u=Math.cos(r);t[0]=n*u-o*s,t[1]=i*u+a*s,t[2]=o*u+n*s,t[3]=a*u-i*s}(this,this,t),this.check()}},{key:"rotateZ",value:function(t){return function(t,e,r){r*=.5;var n=e[0],i=e[1],o=e[2],a=e[3],s=Math.sin(r),u=Math.cos(r);t[0]=n*u+i*s,t[1]=i*u-n*s,t[2]=o*u+a*s,t[3]=a*u-o*s}(this,this,t),this.check()}},{key:"scale",value:function(t){return rr(this,this,t),this.check()}},{key:"slerp",value:function(t,e,r){var n,i,o;switch(arguments.length){case 1:var a=t.start;n=void 0===a?lr:a,i=t.target,o=t.ratio;break;case 2:n=this,i=t,o=e;break;default:n=t,i=e,o=r}return qe(this,n,i,o),this.check()}},{key:"transformVector4",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Ve;return $(e,t,this),de(e,4)}},{key:"lengthSq",value:function(){return this.lengthSquared()}},{key:"setFromAxisAngle",value:function(t,e){return this.setAxisAngle(t,e)}},{key:"premultiply",value:function(t){return this.multiplyLeft(t)}},{key:"multiply",value:function(t){return this.multiplyRight(t)}}]),r}(le),hr=new Be,dr=new Be,pr=new Be,vr=new Be,yr=new Be,gr=new Be,mr=new Be,br=0,Ar=1,wr=2,Br=3,_r=4,xr=5,Cr=6,kr=7,Er=8,Or=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[0,0,0],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0,0,0,0,0,0,0];Ht()(this,t),zt(this,"center",void 0),zt(this,"halfAxes",void 0),this.center=(new Be).from(e),this.halfAxes=new Ue(r)}return Jt()(t,[{key:"halfSize",get:function(){var t=this.halfAxes.getColumn(0),e=this.halfAxes.getColumn(1),r=this.halfAxes.getColumn(2);return[new Be(t).len(),new Be(e).len(),new Be(r).len()]}},{key:"quaternion",get:function(){var t=this.halfAxes.getColumn(0),e=this.halfAxes.getColumn(1),r=this.halfAxes.getColumn(2),n=new Be(t).normalize(),i=new Be(e).normalize(),o=new Be(r).normalize();return(new fr).fromMatrix3(new Ue([].concat(Se()(n),Se()(i),Se()(o))))}},{key:"fromCenterHalfSizeQuaternion",value:function(t,e,r){var n=new fr(r),i=(new Ue).fromQuaternion(n);return i[0]=i[0]*e[0],i[1]=i[1]*e[0],i[2]=i[2]*e[0],i[3]=i[3]*e[1],i[4]=i[4]*e[1],i[5]=i[5]*e[1],i[6]=i[6]*e[2],i[7]=i[7]*e[2],i[8]=i[8]*e[2],this.center=(new Be).from(t),this.halfAxes=i,this}},{key:"clone",value:function(){return new t(this.center,this.halfAxes)}},{key:"equals",value:function(t){return this===t||Boolean(t)&&this.center.equals(t.center)&&this.halfAxes.equals(t.halfAxes)}},{key:"getBoundingSphere",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Oe,e=this.halfAxes,r=e.getColumn(0,pr),n=e.getColumn(1,vr),i=e.getColumn(2,yr),o=hr.copy(r).add(n).add(i);return t.center.copy(this.center),t.radius=o.magnitude(),t}},{key:"intersectPlane",value:function(t){var e=this.center,r=t.normal,n=this.halfAxes,i=r.x,o=r.y,a=r.z,s=Math.abs(i*n[br]+o*n[Ar]+a*n[wr])+Math.abs(i*n[Br]+o*n[_r]+a*n[xr])+Math.abs(i*n[Cr]+o*n[kr]+a*n[Er]),u=r.dot(e)+t.distance;return u<=-s?jt:u>=s?Nt:Gt}},{key:"distanceTo",value:function(t){return Math.sqrt(this.distanceSquaredTo(t))}},{key:"distanceSquaredTo",value:function(t){var e=dr.from(t).subtract(this.center),r=this.halfAxes,n=r.getColumn(0,pr),i=r.getColumn(1,vr),o=r.getColumn(2,yr),a=n.magnitude(),s=i.magnitude(),u=o.magnitude();n.normalize(),i.normalize(),o.normalize();var c,l=0;return(c=Math.abs(e.dot(n))-a)>0&&(l+=c*c),(c=Math.abs(e.dot(i))-s)>0&&(l+=c*c),(c=Math.abs(e.dot(o))-u)>0&&(l+=c*c),l}},{key:"computePlaneDistances",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[-0,-0],n=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY,o=this.center,a=this.halfAxes,s=a.getColumn(0,pr),u=a.getColumn(1,vr),c=a.getColumn(2,yr),l=gr.copy(s).add(u).add(c).add(o),f=mr.copy(l).subtract(t),h=e.dot(f);return n=Math.min(h,n),i=Math.max(h,i),l.copy(o).add(s).add(u).subtract(c),f.copy(l).subtract(t),h=e.dot(f),n=Math.min(h,n),i=Math.max(h,i),l.copy(o).add(s).subtract(u).add(c),f.copy(l).subtract(t),h=e.dot(f),n=Math.min(h,n),i=Math.max(h,i),l.copy(o).add(s).subtract(u).subtract(c),f.copy(l).subtract(t),h=e.dot(f),n=Math.min(h,n),i=Math.max(h,i),o.copy(l).subtract(s).add(u).add(c),f.copy(l).subtract(t),h=e.dot(f),n=Math.min(h,n),i=Math.max(h,i),o.copy(l).subtract(s).add(u).subtract(c),f.copy(l).subtract(t),h=e.dot(f),n=Math.min(h,n),i=Math.max(h,i),o.copy(l).subtract(s).subtract(u).add(c),f.copy(l).subtract(t),h=e.dot(f),n=Math.min(h,n),i=Math.max(h,i),o.copy(l).subtract(s).subtract(u).subtract(c),f.copy(l).subtract(t),h=e.dot(f),n=Math.min(h,n),i=Math.max(h,i),r[0]=n,r[1]=i,r}},{key:"transform",value:function(t){this.center.transformAsPoint(t);var e=this.halfAxes.getColumn(0,pr);e.transformAsPoint(t);var r=this.halfAxes.getColumn(1,vr);r.transformAsPoint(t);var n=this.halfAxes.getColumn(2,yr);return n.transformAsPoint(t),this.halfAxes=new Ue([].concat(Se()(e),Se()(r),Se()(n))),this}},{key:"getTransform",value:function(){throw new Error("not implemented")}}]),t}(),Tr=new Be,Sr=new Be,Mr=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[0,0,1],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;Ht()(this,t),zt(this,"normal",void 0),zt(this,"distance",void 0),this.normal=new Be,this.distance=-0,this.fromNormalDistance(e,r)}return Jt()(t,[{key:"fromNormalDistance",value:function(t,e){return re(Number.isFinite(e)),this.normal.from(t).normalize(),this.distance=e,this}},{key:"fromPointNormal",value:function(t,e){t=Tr.from(t),this.normal.from(e).normalize();var r=-this.normal.dot(t);return this.distance=r,this}},{key:"fromCoefficients",value:function(t,e,r,n){return this.normal.set(t,e,r),re(se(this.normal.len(),1)),this.distance=n,this}},{key:"clone",value:function(){return new t(this.normal,this.distance)}},{key:"equals",value:function(t){return se(this.distance,t.distance)&&se(this.normal,t.normal)}},{key:"getPointDistance",value:function(t){return this.normal.dot(t)+this.distance}},{key:"transform",value:function(t){var e=Sr.copy(this.normal).transformAsVector(t).normalize(),r=this.normal.scale(-this.distance).transform(t);return this.fromPointNormal(r,e)}},{key:"projectPointOntoPlane",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];t=Tr.from(t);var r=this.getPointDistance(t),n=Sr.copy(this.normal).scale(r);return t.subtract(n).to(e)}}]),t}();function Ir(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return Rr(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Rr(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function Rr(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var Pr,Fr=[new Be([1,0,0]),new Be([0,1,0]),new Be([0,0,1])],Dr=new Be,Lr=new Be,jr=(new Mr(new Be(1,0,0),0),function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];Ht()(this,t),zt(this,"planes",void 0),this.planes=e}return Jt()(t,[{key:"fromBoundingSphere",value:function(t){this.planes.length=2*Fr.length;var e,r=t.center,n=t.radius,i=0,o=Ir(Fr);try{for(o.s();!(e=o.n()).done;){var a=e.value,s=this.planes[i],u=this.planes[i+1];s||(s=this.planes[i]=new Mr),u||(u=this.planes[i+1]=new Mr);var c=Dr.copy(a).scale(-n).add(r);a.dot(c);s.fromPointNormal(c,a);var l=Dr.copy(a).scale(n).add(r),f=Lr.copy(a).negate();f.dot(l);u.fromPointNormal(l,f),i+=2}}catch(t){o.e(t)}finally{o.f()}return this}},{key:"computeVisibility",value:function(t){var e,r=Nt,n=Ir(this.planes);try{for(n.s();!(e=n.n()).done;){var i=e.value;switch(t.intersectPlane(i)){case jt:return jt;case Gt:r=Gt}}}catch(t){n.e(t)}finally{n.f()}return r}},{key:"computeVisibilityWithPlaneMask",value:function(e,r){if(re(Number.isFinite(r),"parentPlaneMask is required."),r===t.MASK_OUTSIDE||r===t.MASK_INSIDE)return r;for(var n=t.MASK_INSIDE,i=this.planes,o=0;o<this.planes.length;++o){var a=o<31?1<<o:0;if(!(o<31&&0==(r&a))){var s=i[o],u=e.intersectPlane(s);if(u===jt)return t.MASK_OUTSIDE;u===Gt&&(n|=a)}}return n}}]),t}());function Gr(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=ee()(t);if(e){var i=ee()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return $t()(this,r)}}zt(jr,"MASK_OUTSIDE",4294967295),zt(jr,"MASK_INSIDE",0),zt(jr,"MASK_INDETERMINATE",2147483647),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"}(Pr||(Pr={}));var Nr,Ur,Hr=45*Math.PI/180,Vr=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),Jr=function(t){Yt()(r,t);var e=Gr(r);function r(t){var n;return qt()(this,r),n=e.call(this,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0),1===arguments.length&&Array.isArray(t)?n.copy(t):n.identity(),n}return Qt()(r,[{key:"ELEMENTS",get:function(){return 16}},{key:"RANK",get:function(){return 4}},{key:"INDICES",get:function(){return Pr}},{key:"copy",value:function(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()}},{key:"set",value:function(t,e,r,n,i,o,a,s,u,c,l,f,h,d,p,v){return this[0]=t,this[1]=e,this[2]=r,this[3]=n,this[4]=i,this[5]=o,this[6]=a,this[7]=s,this[8]=u,this[9]=c,this[10]=l,this[11]=f,this[12]=h,this[13]=d,this[14]=p,this[15]=v,this.check()}},{key:"setRowMajor",value:function(t,e,r,n,i,o,a,s,u,c,l,f,h,d,p,v){return this[0]=t,this[1]=i,this[2]=u,this[3]=h,this[4]=e,this[5]=o,this[6]=c,this[7]=d,this[8]=r,this[9]=a,this[10]=l,this[11]=p,this[12]=n,this[13]=s,this[14]=f,this[15]=v,this.check()}},{key:"toRowMajor",value:function(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}},{key:"identity",value:function(){return this.copy(Vr)}},{key:"fromObject",value:function(t){return this.check()}},{key:"fromQuaternion",value:function(t){return function(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=r+r,s=n+n,u=i+i,c=r*a,l=n*a,f=n*s,h=i*a,d=i*s,p=i*u,v=o*a,y=o*s,g=o*u;t[0]=1-f-p,t[1]=l+g,t[2]=h-y,t[3]=0,t[4]=l-g,t[5]=1-c-p,t[6]=d+v,t[7]=0,t[8]=h+y,t[9]=d-v,t[10]=1-c-f,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1}(this,t),this.check()}},{key:"frustum",value:function(t){var e=t.left,r=t.right,n=t.bottom,i=t.top,o=t.near,a=void 0===o?.1:o,s=t.far,u=void 0===s?500:s;return u===1/0?function(t,e,r,n,i,o){var a=2*o/(r-e),s=2*o/(i-n),u=(r+e)/(r-e),c=(i+n)/(i-n),l=-2*o;t[0]=a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=s,t[6]=0,t[7]=0,t[8]=u,t[9]=c,t[10]=-1,t[11]=-1,t[12]=0,t[13]=0,t[14]=l,t[15]=0}(this,e,r,n,i,a):function(t,e,r,n,i,o,a){var s=1/(r-e),u=1/(i-n),c=1/(o-a);t[0]=2*o*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*o*u,t[6]=0,t[7]=0,t[8]=(r+e)*s,t[9]=(i+n)*u,t[10]=(a+o)*c,t[11]=-1,t[12]=0,t[13]=0,t[14]=a*o*2*c,t[15]=0}(this,e,r,n,i,a,u),this.check()}},{key:"lookAt",value:function(t){var e=t.eye,r=t.center,n=void 0===r?[0,0,0]:r,i=t.up;return function(t,e,r,n){var i,o,a,s,u,c,l,f,h,d,p=e[0],v=e[1],y=e[2],g=n[0],m=n[1],b=n[2],A=r[0],w=r[1],B=r[2];Math.abs(p-A)<1e-6&&Math.abs(v-w)<1e-6&&Math.abs(y-B)<1e-6?function(t){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):(l=p-A,f=v-w,h=y-B,i=m*(h*=d=1/Math.hypot(l,f,h))-b*(f*=d),o=b*(l*=d)-g*h,a=g*f-m*l,(d=Math.hypot(i,o,a))?(i*=d=1/d,o*=d,a*=d):(i=0,o=0,a=0),s=f*a-h*o,u=h*i-l*a,c=l*o-f*i,(d=Math.hypot(s,u,c))?(s*=d=1/d,u*=d,c*=d):(s=0,u=0,c=0),t[0]=i,t[1]=s,t[2]=l,t[3]=0,t[4]=o,t[5]=u,t[6]=f,t[7]=0,t[8]=a,t[9]=c,t[10]=h,t[11]=0,t[12]=-(i*p+o*v+a*y),t[13]=-(s*p+u*v+c*y),t[14]=-(l*p+f*v+h*y),t[15]=1)}(this,e,n,void 0===i?[0,1,0]:i),this.check()}},{key:"ortho",value:function(t){var e=t.left,r=t.right,n=t.bottom,i=t.top,o=t.near,a=void 0===o?.1:o,s=t.far;return lt(this,e,r,n,i,a,void 0===s?500:s),this.check()}},{key:"orthographic",value:function(t){var e=t.fovy,r=void 0===e?Hr:e,n=t.aspect,i=void 0===n?1:n,o=t.focalDistance,a=void 0===o?1:o,s=t.near,u=void 0===s?.1:s,c=t.far,l=void 0===c?500:c;zr(r);var f=r/2,h=a*Math.tan(f),d=h*i;return this.ortho({left:-d,right:d,bottom:-h,top:h,near:u,far:l})}},{key:"perspective",value:function(t){var e=t.fovy,r=void 0===e?45*Math.PI/180:e,n=t.aspect,i=void 0===n?1:n,o=t.near,a=void 0===o?.1:o,s=t.far,u=void 0===s?500:s;return zr(r),ct(this,r,i,a,u),this.check()}},{key:"determinant",value:function(){return e=(t=this)[0],r=t[1],n=t[2],i=t[3],o=t[4],a=t[5],s=t[6],u=t[7],c=t[8],l=t[9],f=t[10],h=t[11],d=t[12],p=t[13],v=t[14],y=t[15],(e*a-r*o)*(f*y-h*v)-(e*s-n*o)*(l*y-h*p)+(e*u-i*o)*(l*v-f*p)+(r*s-n*a)*(c*y-h*d)-(r*u-i*a)*(c*v-f*d)+(n*u-i*s)*(c*p-l*d);var t,e,r,n,i,o,a,s,u,c,l,f,h,d,p,v,y}},{key:"getScale",value:function(){var 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}},{key:"getTranslation",value:function(){var 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}},{key:"getRotation",value:function(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];var r=this.getScale(e),n=1/r[0],i=1/r[1],o=1/r[2];return t[0]=this[0]*n,t[1]=this[1]*i,t[2]=this[2]*o,t[3]=0,t[4]=this[4]*n,t[5]=this[5]*i,t[6]=this[6]*o,t[7]=0,t[8]=this[8]*n,t[9]=this[9]*i,t[10]=this[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}},{key:"getRotationMatrix3",value:function(t,e){t=t||[-0,-0,-0,-0,-0,-0,-0,-0,-0],e=e||[-0,-0,-0];var r=this.getScale(e),n=1/r[0],i=1/r[1],o=1/r[2];return t[0]=this[0]*n,t[1]=this[1]*i,t[2]=this[2]*o,t[3]=this[4]*n,t[4]=this[5]*i,t[5]=this[6]*o,t[6]=this[8]*n,t[7]=this[9]*i,t[8]=this[10]*o,t}},{key:"transpose",value:function(){return function(t,e){if(t===e){var r=e[1],n=e[2],i=e[3],o=e[6],a=e[7],s=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=r,t[6]=e[9],t[7]=e[13],t[8]=n,t[9]=o,t[11]=e[14],t[12]=i,t[13]=a,t[14]=s}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]}(this,this),this.check()}},{key:"invert",value:function(){return rt(this,this),this.check()}},{key:"multiplyLeft",value:function(t){return nt(this,t,this),this.check()}},{key:"multiplyRight",value:function(t){return nt(this,this,t),this.check()}},{key:"rotateX",value:function(t){return at(this,this,t),this.check()}},{key:"rotateY",value:function(t){return function(t,e,r){var n=Math.sin(r),i=Math.cos(r),o=e[0],a=e[1],s=e[2],u=e[3],c=e[8],l=e[9],f=e[10],h=e[11];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*i-c*n,t[1]=a*i-l*n,t[2]=s*i-f*n,t[3]=u*i-h*n,t[8]=o*n+c*i,t[9]=a*n+l*i,t[10]=s*n+f*i,t[11]=u*n+h*i}(this,this,t),this.check()}},{key:"rotateZ",value:function(t){return st(this,this,t),this.check()}},{key:"rotateXYZ",value:function(t){return this.rotateX(t[0]).rotateY(t[1]).rotateZ(t[2])}},{key:"rotateAxis",value:function(t,e){return function(t,e,r,n){var i,o,a,s,u,c,l,f,h,d,p,v,y,g,m,b,A,w,B,_,x,C,k,E,O=n[0],T=n[1],S=n[2],M=Math.hypot(O,T,S);M<1e-6||(O*=M=1/M,T*=M,S*=M,i=Math.sin(r),a=1-(o=Math.cos(r)),s=e[0],u=e[1],c=e[2],l=e[3],f=e[4],h=e[5],d=e[6],p=e[7],v=e[8],y=e[9],g=e[10],m=e[11],b=O*O*a+o,A=T*O*a+S*i,w=S*O*a-T*i,B=O*T*a-S*i,_=T*T*a+o,x=S*T*a+O*i,C=O*S*a+T*i,k=T*S*a-O*i,E=S*S*a+o,t[0]=s*b+f*A+v*w,t[1]=u*b+h*A+y*w,t[2]=c*b+d*A+g*w,t[3]=l*b+p*A+m*w,t[4]=s*B+f*_+v*x,t[5]=u*B+h*_+y*x,t[6]=c*B+d*_+g*x,t[7]=l*B+p*_+m*x,t[8]=s*C+f*k+v*E,t[9]=u*C+h*k+y*E,t[10]=c*C+d*k+g*E,t[11]=l*C+p*k+m*E,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]))}(this,this,t,e),this.check()}},{key:"scale",value:function(t){return ot(this,this,Array.isArray(t)?t:[t,t,t]),this.check()}},{key:"translate",value:function(t){return it(this,this,t),this.check()}},{key:"transform",value:function(t,e){return 4===t.length?(de(e=Z(e||[-0,-0,-0,-0],t,this),4),e):this.transformAsPoint(t,e)}},{key:"transformAsPoint",value:function(t,e){var r;switch(t.length){case 2:r=ht(e||[-0,-0],t,this);break;case 3:r=gt(e||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return de(r,t.length),r}},{key:"transformAsVector",value:function(t,e){var r;switch(t.length){case 2:r=ye(e||[-0,-0],t,this);break;case 3:r=ge(e||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return de(r,t.length),r}},{key:"transformPoint",value:function(t,e){return this.transformAsPoint(t,e)}},{key:"transformVector",value:function(t,e){return this.transformAsPoint(t,e)}},{key:"transformDirection",value:function(t,e){return this.transformAsVector(t,e)}},{key:"makeRotationX",value:function(t){return this.identity().rotateX(t)}},{key:"makeTranslation",value:function(t,e,r){return this.identity().translate([t,e,r])}}],[{key:"IDENTITY",get:function(){return function(){Ur||(Ur=new Jr,Object.freeze(Ur));return Ur}()}},{key:"ZERO",get:function(){return function(){Nr||(Nr=new Jr([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Object.freeze(Nr));return Nr}()}}]),r}(Ie);function zr(t){if(t>2*Math.PI)throw Error("expected radians")}new Be,new Be,new Be,new Be,new Be;new Be,new Be,new Be,new Be,new Be,new Be,new Be,new Be,new Be,new Be,new Be,new Be,Math.PI;var Kr=1e-15,qr=1e-20,Wr=(Math.PI,Math.PI,Math.PI,Math.PI,new Ue),Qr=new Ue,Xr=new Ue,Yr=new Ue,Zr=new Ue;function $r(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=qr,n=10,i=0,o=0,a=Qr,s=Xr;a.identity(),s.copy(t);for(var u=r*tn(s);o<n&&nn(s)>u;)on(s,Yr),Zr.copy(Yr).transpose(),s.multiplyRight(Yr),s.multiplyLeft(Zr),a.multiplyRight(Yr),++i>2&&(++o,i=0);return e.unitary=a.toTarget(e.unitary),e.diagonal=s.toTarget(e.diagonal),e}function tn(t){for(var e=0,r=0;r<9;++r){var n=t[r];e+=n*n}return Math.sqrt(e)}var en=[1,0,0],rn=[2,2,1];function nn(t){for(var e=0,r=0;r<3;++r){var n=t[Wr.getElementIndex(rn[r],en[r])];e+=2*n*n}return Math.sqrt(e)}function on(t,e){for(var r=Kr,n=0,i=1,o=0;o<3;++o){var a=Math.abs(t[Wr.getElementIndex(rn[o],en[o])]);a>n&&(i=o,n=a)}var s=en[i],u=rn[i],c=1,l=0;if(Math.abs(t[Wr.getElementIndex(u,s)])>r){var f,h=(t[Wr.getElementIndex(u,u)]-t[Wr.getElementIndex(s,s)])/2/t[Wr.getElementIndex(u,s)];l=(f=h<0?-1/(-h+Math.sqrt(1+h*h)):1/(h+Math.sqrt(1+h*h)))*(c=1/Math.sqrt(1+f*f))}return Ue.IDENTITY.to(e),e[Wr.getElementIndex(s,s)]=e[Wr.getElementIndex(u,u)]=c,e[Wr.getElementIndex(u,s)]=l,e[Wr.getElementIndex(s,u)]=-l,e}function an(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return sn(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return sn(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function sn(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var un=new Be,cn=new Be,ln=new Be,fn=new Be,hn=new Be,dn=new Ue,pn={diagonal:new Ue,unitary:new Ue};function vn(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return yn(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return yn(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function yn(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var gn=[[.5,.5],[0,0],[0,1],[1,0],[1,1]],mn=gn.concat([[0,.5],[.5,0],[1,.5],[.5,1]]),bn=mn.concat([[.25,.5],[.75,.5]]),An=function(){function t(e,r,n){p()(this,t),B()(this,"x",void 0),B()(this,"y",void 0),B()(this,"z",void 0),B()(this,"childVisible",void 0),B()(this,"selected",void 0),B()(this,"_children",void 0),this.x=e,this.y=r,this.z=n}return E()(t,[{key:"children",get:function(){if(!this._children){var e=2*this.x,r=2*this.y,n=this.z+1;this._children=[new t(e,r,n),new t(e,r+1,n),new t(e+1,r,n),new t(e+1,r+1,n)]}return this._children}},{key:"update",value:function(t){var e=t.viewport,r=t.cullingVolume,n=t.elevationBounds,i=t.minZ,o=t.maxZ,a=t.bounds,s=t.offset,u=t.project,c=this.getBoundingVolume(n,s,u);if(a&&!this.insideBounds(a))return!1;if(r.computeVisibility(c)<0)return!1;if(!this.childVisible){var l=this.z;if(l<o&&l>=i){var f=c.distanceTo(e.cameraPosition)*e.scale/e.height;l+=Math.floor(Math.log2(f))}if(l>=o)return this.selected=!0,!0}this.selected=!1,this.childVisible=!0;var h,d=vn(this.children);try{for(d.s();!(h=d.n()).done;){h.value.update(t)}}catch(t){d.e(t)}finally{d.f()}return!0}},{key:"getSelected",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];if(this.selected&&t.push(this),this._children){var e,r=vn(this._children);try{for(r.s();!(e=r.n()).done;){var n=e.value;n.getSelected(t)}}catch(t){r.e(t)}finally{r.f()}}return t}},{key:"insideBounds",value:function(t){var e=R()(t,4),r=e[0],n=e[1],i=e[2],o=e[3],a=512/Math.pow(2,this.z);return this.x*a<i&&this.y*a<o&&(this.x+1)*a>r&&(this.y+1)*a>n}},{key:"getBoundingVolume",value:function(t,e,r){if(r){var n,i=[],o=vn(this.z<1?bn:this.z<2?mn:gn);try{for(o.s();!(n=o.n()).done;){var a=n.value,s=En(this.x+a[0],this.y+a[1],this.z);s[2]=t[0],i.push(r(s)),t[0]!==t[1]&&(s[2]=t[1],i.push(r(s)))}}catch(t){o.e(t)}finally{o.f()}return function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Or;if(!t||0===t.length)return e.halfAxes=new Ue([0,0,0,0,0,0,0,0,0]),e.center=new Be,e;var r,n=t.length,i=new Be(0,0,0),o=an(t);try{for(o.s();!(r=o.n()).done;){var a=r.value;i.add(a)}}catch(t){o.e(t)}finally{o.f()}var s=1/n;i.multiplyByScalar(s);var u,c=0,l=0,f=0,h=0,d=0,p=0,v=an(t);try{for(v.s();!(u=v.n()).done;){var y=u.value,g=un.copy(y).subtract(i);c+=g.x*g.x,l+=g.x*g.y,f+=g.x*g.z,h+=g.y*g.y,d+=g.y*g.z,p+=g.z*g.z}}catch(t){v.e(t)}finally{v.f()}c*=s,l*=s,f*=s,h*=s,d*=s,p*=s;var m=dn;m[0]=c,m[1]=l,m[2]=f,m[3]=l,m[4]=h,m[5]=d,m[6]=f,m[7]=d,m[8]=p;var b,A=$r(m,pn),w=A.unitary,B=e.halfAxes.copy(w),_=B.getColumn(0,ln),x=B.getColumn(1,fn),C=B.getColumn(2,hn),k=-Number.MAX_VALUE,E=-Number.MAX_VALUE,O=-Number.MAX_VALUE,T=Number.MAX_VALUE,S=Number.MAX_VALUE,M=Number.MAX_VALUE,I=an(t);try{for(I.s();!(b=I.n()).done;){var R=b.value;un.copy(R),k=Math.max(un.dot(_),k),E=Math.max(un.dot(x),E),O=Math.max(un.dot(C),O),T=Math.min(un.dot(_),T),S=Math.min(un.dot(x),S),M=Math.min(un.dot(C),M)}}catch(t){I.e(t)}finally{I.f()}_=_.multiplyByScalar(.5*(T+k)),x=x.multiplyByScalar(.5*(S+E)),C=C.multiplyByScalar(.5*(M+O)),e.center.copy(_).add(x).add(C);var P=cn.set(k-T,E-S,O-M).multiplyByScalar(.5),F=new Ue([P[0],0,0,0,P[1],0,0,0,P[2]]);return e.halfAxes.multiplyRight(F),e}(i)}var u=512/Math.pow(2,this.z),c=this.x*u+512*e,l=512-(this.y+1)*u;return new Ce([c,l,t[0]],[c+u,l+u,t[1]])}}]),t}();var wn=[-1/0,-1/0,1/0,1/0],Bn={type:"url",value:null,validate:function(t,e){return e.optional&&null===t||"string"==typeof t||Array.isArray(t)&&t.every((function(t){return"string"==typeof t}))},equals:function(t,e){if(t===e)return!0;if(!Array.isArray(t)||!Array.isArray(e))return!1;var r=t.length;if(r!==e.length)return!1;for(var n=0;n<r;n++)if(t[n]!==e[n])return!1;return!0}};function _n(t,e){var r=[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.apply(Math,Lt()(r.map((function(t){return t[0]})))),Math.min.apply(Math,Lt()(r.map((function(t){return t[1]})))),Math.max.apply(Math,Lt()(r.map((function(t){return t[0]})))),Math.max.apply(Math,Lt()(r.map((function(t){return t[1]}))))]}function xn(t,e){if(!t||!t.length)return null;var r,n=e.index,i=e.id;Array.isArray(t)&&(t=t[(r=i,Math.abs(r.split("").reduce((function(t,e){return(t<<5)-t+e.charCodeAt(0)|0}),0))%t.length)]);for(var o=t,a=0,s=Object.keys(n);a<s.length;a++){var u=s[a],c=new RegExp("{".concat(u,"}"),"g");o=o.replace(c,String(n[u]))}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 Cn(t){var e=t.viewport,r=t.z,n=t.cullRect,i=n.x-e.x,o=n.y-e.y,a=n.width,s=n.height;if(!Array.isArray(r)){var u={targetZ:r||0},c=e.unproject([i,o],u),l=e.unproject([i+a,o],u),f=e.unproject([i,o+s],u),h=e.unproject([i+a,o+s],u);return[Math.min(c[0],l[0],f[0],h[0]),Math.min(c[1],l[1],f[1],h[1]),Math.max(c[0],l[0],f[0],h[0]),Math.max(c[1],l[1],f[1],h[1])]}var d=Cn({viewport:e,z:r[0],cullRect:n}),p=Cn({viewport:e,z:r[1],cullRect:n});return[Math.min(d[0],p[0]),Math.min(d[1],p[1]),Math.max(d[2],p[2]),Math.max(d[3],p[3])]}function kn(t,e){return 512*Math.pow(2,t)/e}function En(t,e,r){var n=kn(r,512),i=t/n*360-180,o=Math.PI-2*Math.PI*e/n;return[i,180/Math.PI*Math.atan(.5*(Math.exp(o)-Math.exp(-o)))]}function On(t,e,r,n){var i=kn(r,n);return[t/i*512,e/i*512]}function Tn(t,e,r,n){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:512;if(t.isGeospatial){var o=En(e,r,n),a=R()(o,2),s=a[0],u=a[1],c=En(e+1,r+1,n),l=R()(c,2),f=l[0],h=l[1];return{west:s,north:u,east:f,south:h}}var d=On(e,r,n,i),p=R()(d,2),v=p[0],y=p[1],g=On(e+1,r+1,n,i),m=R()(g,2),b=m[0],A=m[1];return{left:v,top:y,right:b,bottom:A}}function Sn(t,e,r,n,i){for(var o=function(t,e,r){return r?_n(t,r).map((function(t){return t*e/512})):t.map((function(t){return t*e/512}))}(function(t,e,r){var n;if(e&&2===e.length){var i=R()(e,2),o=i[0],a=i[1],s=t.getBounds({z:o}),u=t.getBounds({z:a});n=[Math.min(s[0],u[0]),Math.min(s[1],u[1]),Math.max(s[2],u[2]),Math.max(s[3],u[3])]}else n=t.getBounds();return t.isGeospatial?[Math.max(n[0],r[0]),Math.max(n[1],r[1]),Math.min(n[2],r[2]),Math.min(n[3],r[3])]:[Math.max(Math.min(n[0],r[2]),r[0]),Math.max(Math.min(n[1],r[3]),r[1]),Math.min(Math.max(n[2],r[0]),r[2]),Math.min(Math.max(n[3],r[1]),r[3])]}(t,null,n),kn(e,r),i),a=R()(o,4),s=a[0],u=a[1],c=a[2],l=a[3],f=[],h=Math.floor(s);h<c;h++)for(var d=Math.floor(u);d<l;d++)f.push({x:h,y:d,z:e});return f}function Mn(t){var e=t.viewport,r=t.maxZoom,n=t.minZoom,i=t.zRange,o=t.extent,a=t.tileSize,s=void 0===a?512:a,u=t.modelMatrix,c=t.modelMatrixInverse,l=t.zoomOffset,f=void 0===l?0:l,h=e.isGeospatial?Math.round(e.zoom+Math.log2(512/s))+f:Math.ceil(e.zoom)+f;if("number"==typeof n&&Number.isFinite(n)&&h<n){if(!o)return[];h=n}"number"==typeof r&&Number.isFinite(r)&&h>r&&(h=r);var d=o;return u&&c&&o&&!e.isGeospatial&&(d=_n(o,u)),e.isGeospatial?function(t,e,r,n){var i=t instanceof _._GlobeViewport&&t.resolution?t.projectPosition:null,o=Object.values(t.getFrustumPlanes()).map((function(t){var e=t.normal,r=t.distance;return new Mr(e.clone().negate(),r)})),a=new jr(o),s=t.distanceScales.unitsPerMeter[2],u=r&&r[0]*s||0,c=r&&r[1]*s||0,l=t instanceof _.WebMercatorViewport&&t.pitch<=60?e:0;if(n){var f=n,h=R()(f,4),d=h[0],p=h[1],v=h[2],y=kt([d,h[3]]),g=kt([v,p]);n=[y[0],512-y[1],g[0],512-g[1]]}var m=new An(0,0,0),b={viewport:t,project:i,cullingVolume:a,elevationBounds:[u,c],minZ:l,maxZ:e,bounds:n,offset:0};if(m.update(b),t instanceof _.WebMercatorViewport&&t.subViewports&&t.subViewports.length>1){for(b.offset=-1;m.update(b)&&!(--b.offset<-3););for(b.offset=1;m.update(b)&&!(++b.offset>3););}return m.getSelected()}(e,h,i,o):Sn(e,h,s,d||wn,c)}function In(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Rn(){var t;if("undefined"!=typeof window&&window.performance)t=window.performance.now();else if("undefined"!=typeof process&&process.hrtime){var e=process.hrtime();t=1e3*e[0]+e[1]/1e6}else t=Date.now();return t}var Pn=function(){function t(e,r){p()(this,t),In(this,"name",void 0),In(this,"type",void 0),In(this,"sampleSize",1),In(this,"time",void 0),In(this,"count",void 0),In(this,"samples",void 0),In(this,"lastTiming",void 0),In(this,"lastSampleTime",void 0),In(this,"lastSampleCount",void 0),In(this,"_count",0),In(this,"_time",0),In(this,"_samples",0),In(this,"_startTime",0),In(this,"_timerPending",!1),this.name=e,this.type=r,this.reset()}return E()(t,[{key:"setSampleSize",value:function(t){return this.sampleSize=t,this}},{key:"incrementCount",value:function(){return this.addCount(1),this}},{key:"decrementCount",value:function(){return this.subtractCount(1),this}},{key:"addCount",value:function(t){return this._count+=t,this._samples++,this._checkSampling(),this}},{key:"subtractCount",value:function(t){return this._count-=t,this._samples++,this._checkSampling(),this}},{key:"addTime",value:function(t){return this._time+=t,this.lastTiming=t,this._samples++,this._checkSampling(),this}},{key:"timeStart",value:function(){return this._startTime=Rn(),this._timerPending=!0,this}},{key:"timeEnd",value:function(){return this._timerPending?(this.addTime(Rn()-this._startTime),this._timerPending=!1,this._checkSampling(),this):this}},{key:"getSampleAverageCount",value:function(){return this.sampleSize>0?this.lastSampleCount/this.sampleSize:0}},{key:"getSampleAverageTime",value:function(){return this.sampleSize>0?this.lastSampleTime/this.sampleSize:0}},{key:"getSampleHz",value:function(){return this.lastSampleTime>0?this.sampleSize/(this.lastSampleTime/1e3):0}},{key:"getAverageCount",value:function(){return this.samples>0?this.count/this.samples:0}},{key:"getAverageTime",value:function(){return this.samples>0?this.time/this.samples:0}},{key:"getHz",value:function(){return this.time>0?this.samples/(this.time/1e3):0}},{key:"reset",value:function(){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}},{key:"_checkSampling",value:function(){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)}}]),t}(),Fn=function(){function t(e){p()(this,t),In(this,"id",void 0),In(this,"stats",{}),this.id=e.id,this.stats={},this._initializeStats(e.stats),Object.seal(this)}return E()(t,[{key:"get",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"count";return this._getOrCreate({name:t,type:e})}},{key:"size",get:function(){return Object.keys(this.stats).length}},{key:"reset",value:function(){for(var t in this.stats)this.stats[t].reset();return this}},{key:"forEach",value:function(t){for(var e in this.stats)t(this.stats[e])}},{key:"getTable",value:function(){var t={};return this.forEach((function(e){t[e.name]={time:e.time||0,count:e.count||0,average:e.getAverageTime()||0,hz:e.getHz()||0}})),t}},{key:"_initializeStats",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];e.forEach((function(e){return t._getOrCreate(e)}))}},{key:"_getOrCreate",value:function(t){if(!t||!t.name)return null;var e=t.name,r=t.type;return this.stats[e]||(this.stats[e]=t instanceof Pn?t:new Pn(e,r)),this.stats[e]}}]),t}();function Dn(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Ln(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Dn(Object(r),!0).forEach((function(e){B()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Dn(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var jn,Gn={id:"request-scheduler",throttleRequests:!0,maxRequests:6},Nn=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};p()(this,t),In(this,"props",void 0),In(this,"stats",void 0),In(this,"activeRequestCount",0),In(this,"requestQueue",[]),In(this,"requestMap",new Map),In(this,"deferredUpdate",null),this.props=Ln(Ln({},Gn),e),this.stats=new Fn({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")}return E()(t,[{key:"scheduleRequest",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){return 0};if(!this.props.throttleRequests)return Promise.resolve({done:function(){}});if(this.requestMap.has(t))return this.requestMap.get(t);var r={handle:t,priority:0,getPriority:e},n=new Promise((function(t){return r.resolve=t,r}));return this.requestQueue.push(r),this.requestMap.set(t,n),this._issueNewRequests(),n}},{key:"_issueRequest",value:function(t){var e=this,r=t.handle,n=t.resolve,i=!1,o=function(){i||(i=!0,e.requestMap.delete(r),e.activeRequestCount--,e._issueNewRequests())};return this.activeRequestCount++,n?n({done:o}):Promise.resolve({done:o})}},{key:"_issueNewRequests",value:function(){var t=this;this.deferredUpdate||(this.deferredUpdate=setTimeout((function(){return t._issueNewRequestsAsync()}),0))}},{key:"_issueNewRequestsAsync",value:function(){this.deferredUpdate=null;var t=Math.max(this.props.maxRequests-this.activeRequestCount,0);if(0!==t){this._updateAllRequests();for(var e=0;e<t;++e){var r=this.requestQueue.shift();r&&this._issueRequest(r)}}}},{key:"_updateAllRequests",value:function(){for(var t=this.requestQueue,e=0;e<t.length;++e){var r=t[e];this._updateRequest(r)||(t.splice(e,1),this.requestMap.delete(r.handle),e--)}t.sort((function(t,e){return t.priority-e.priority}))}},{key:"_updateRequest",value:function(t){return t.priority=t.getPriority(t.handle),!(t.priority<0)||(t.resolve(null),!1)}}]),t}();function Un(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return Hn(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Hn(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function Hn(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var Vn=(jn={},B()(jn,"best-available",(function(t){var e,r=Un(t);try{for(r.s();!(e=r.n()).done;){e.value.state=0}}catch(t){r.e(t)}finally{r.f()}var n,i=Un(t);try{for(i.s();!(n=i.n()).done;){var o=n.value;o.isSelected&&!zn(o)&&Kn(o)}}catch(t){i.e(t)}finally{i.f()}var a,s=Un(t);try{for(s.s();!(a=s.n()).done;){var u=a.value;u.isVisible=Boolean(2&u.state)}}catch(t){s.e(t)}finally{s.f()}})),B()(jn,"no-overlap",(function(t){var e,r=Un(t);try{for(r.s();!(e=r.n()).done;){e.value.state=0}}catch(t){r.e(t)}finally{r.f()}var n,i=Un(t);try{for(i.s();!(n=i.n()).done;){var o=n.value;o.isSelected&&zn(o)}}catch(t){i.e(t)}finally{i.f()}var a,s=Un(Array.from(t).sort((function(t,e){return t.zoom-e.zoom})));try{for(s.s();!(a=s.n()).done;){var u=a.value;if(u.isVisible=Boolean(2&u.state),u.children&&(u.isVisible||1&u.state)){var c,l=Un(u.children);try{for(l.s();!(c=l.n()).done;){c.value.state=1}}catch(t){l.e(t)}finally{l.f()}}else u.isSelected&&Kn(u)}}catch(t){s.e(t)}finally{s.f()}})),B()(jn,"never",(function(){})),jn),Jn=function(){function t(e){var r=this;p()(this,t),B()(this,"opts",void 0),B()(this,"_requestScheduler",void 0),B()(this,"_cache",void 0),B()(this,"_dirty",void 0),B()(this,"_tiles",void 0),B()(this,"_cacheByteSize",void 0),B()(this,"_viewport",void 0),B()(this,"_zRange",void 0),B()(this,"_selectedTiles",void 0),B()(this,"_frameNumber",void 0),B()(this,"_modelMatrix",void 0),B()(this,"_modelMatrixInverse",void 0),B()(this,"_maxZoom",void 0),B()(this,"_minZoom",void 0),B()(this,"onTileLoad",void 0),B()(this,"_getCullBounds",Object(_._memoize)(Cn)),this.opts=e,this.onTileLoad=function(t){r.opts.onTileLoad(t),r.opts.maxCacheByteSize&&(r._cacheByteSize+=t.byteLength,r._resizeCache())},this._requestScheduler=new Nn({maxRequests:e.maxRequests,throttleRequests:e.maxRequests>0}),this._cache=new Map,this._tiles=[],this._dirty=!1,this._cacheByteSize=0,this._viewport=null,this._selectedTiles=null,this._frameNumber=0,this._modelMatrix=new Jr,this._modelMatrixInverse=new Jr,this.setOptions(e)}return E()(t,[{key:"tiles",get:function(){return this._tiles}},{key:"selectedTiles",get:function(){return this._selectedTiles}},{key:"isLoaded",get:function(){return null!==this._selectedTiles&&this._selectedTiles.every((function(t){return t.isLoaded}))}},{key:"needsReload",get:function(){return null!==this._selectedTiles&&this._selectedTiles.some((function(t){return t.needsReload}))}},{key:"setOptions",value:function(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))}},{key:"finalize",value:function(){var t,e=Un(this._cache.values());try{for(e.s();!(t=e.n()).done;){var r=t.value;r.isLoading&&r.abort()}}catch(t){e.e(t)}finally{e.f()}this._cache.clear(),this._tiles=[],this._selectedTiles=null}},{key:"reloadAll",value:function(){var t,e=Un(this._cache.keys());try{for(e.s();!(t=e.n()).done;){var r=t.value,n=this._cache.get(r);this._selectedTiles&&this._selectedTiles.includes(n)?n.setNeedsReload():this._cache.delete(r)}}catch(t){e.e(t)}finally{e.f()}}},{key:"update",value:function(t){var e=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=r.zRange,i=r.modelMatrix,o=new Jr(i),a=!o.equals(this._modelMatrix);if(this._viewport&&t.equals(this._viewport)&&se(this._zRange,n)&&!a)this.needsReload&&(this._selectedTiles=this._selectedTiles.map((function(t){return e._getTile(t.index,!0)})));else{a&&(this._modelMatrixInverse=o.clone().invert(),this._modelMatrix=o),this._viewport=t,this._zRange=n;var s=this.getTileIndices({viewport:t,maxZoom:this._maxZoom,minZoom:this._minZoom,zRange:n,modelMatrix:this._modelMatrix,modelMatrixInverse:this._modelMatrixInverse});this._selectedTiles=s.map((function(t){return e._getTile(t,!0)})),this._dirty&&this._rebuildTree()}var u=this.updateTileStates();return this._pruneRequests(),this._dirty&&this._resizeCache(),u&&this._frameNumber++,this._frameNumber}},{key:"isTileVisible",value:function(t,e){if(!t.isVisible)return!1;if(e&&this._viewport){var r=Cn({viewport:this._viewport,z:this._zRange,cullRect:e}),n=R()(r,4),i=n[0],o=n[1],a=n[2],s=n[3],u=t.bbox;if("west"in u)return u.west<a&&u.east>i&&u.south<s&&u.north>o;var c=Math.min(u.top,u.bottom),l=Math.max(u.top,u.bottom);return u.left<a&&u.right>i&&c<s&&l>o}return!0}},{key:"getTileIndices",value:function(t){var e=t.viewport,r=t.maxZoom,n=t.minZoom,i=t.zRange,o=t.modelMatrix,a=t.modelMatrixInverse,s=this.opts;return Mn({viewport:e,maxZoom:r,minZoom:n,zRange:i,tileSize:s.tileSize,extent:s.extent,modelMatrix:o,modelMatrixInverse:a,zoomOffset:s.zoomOffset})}},{key:"getTileId",value:function(t){return"".concat(t.x,"-").concat(t.y,"-").concat(t.z)}},{key:"getTileZoom",value:function(t){return t.z}},{key:"getTileMetadata",value:function(t){var e=this.opts.tileSize;return{bbox:Tn(this._viewport,t.x,t.y,t.z,e)}}},{key:"getParentIndex",value:function(t){return{x:Math.floor(t.x/2),y:Math.floor(t.y/2),z:t.z-1}}},{key:"updateTileStates",value:function(){var t,e=this.opts.refinementStrategy||"best-available",r=new Array(this._cache.size),n=0,i=Un(this._cache.values());try{for(i.s();!(t=i.n()).done;){var o=t.value;r[n++]=o.isVisible,o.isSelected=!1,o.isVisible=!1}}catch(t){i.e(t)}finally{i.f()}var a,s=Un(this._selectedTiles);try{for(s.s();!(a=s.n()).done;){var u=a.value;u.isSelected=!0,u.isVisible=!0}}catch(t){s.e(t)}finally{s.f()}("function"==typeof e?e:Vn[e])(Array.from(this._cache.values())),n=0;var c,l=Un(this._cache.values());try{for(l.s();!(c=l.n()).done;){var f=c.value;if(r[n++]!==f.isVisible)return!0}}catch(t){l.e(t)}finally{l.f()}return!1}},{key:"_pruneRequests",value:function(){var t,e=this.opts.maxRequests,r=[],n=0,i=Un(this._cache.values());try{for(i.s();!(t=i.n()).done;){var o=t.value;o.isLoading&&(n++,o.isSelected||o.isVisible||r.push(o))}}catch(t){i.e(t)}finally{i.f()}for(;e>0&&n>e&&r.length>0;){r.shift().abort(),n--}}},{key:"_rebuildTree",value:function(){var t,e=this._cache,r=Un(e.values());try{for(r.s();!(t=r.n()).done;){var n=t.value;n.parent=null,n.children&&(n.children.length=0)}}catch(t){r.e(t)}finally{r.f()}var i,o=Un(e.values());try{for(o.s();!(i=o.n()).done;){var a=i.value,s=this._getNearestAncestor(a);a.parent=s,null!=s&&s.children&&s.children.push(a)}}catch(t){o.e(t)}finally{o.f()}}},{key:"_resizeCache",value:function(){var t=this._cache,e=this.opts,r=e.maxCacheSize||(e.maxCacheByteSize?1/0:5*this.selectedTiles.length),n=e.maxCacheByteSize||1/0;if(t.size>r||this._cacheByteSize>n){var i,o=Un(t);try{for(o.s();!(i=o.n()).done;){var a=R()(i.value,2),s=a[0],u=a[1];if(u.isVisible||(this._cacheByteSize-=e.maxCacheByteSize?u.byteLength:0,t.delete(s),this.opts.onTileUnload(u)),t.size<=r&&this._cacheByteSize<=n)break}}catch(t){o.e(t)}finally{o.f()}this._rebuildTree(),this._dirty=!0}this._dirty&&(this._tiles=Array.from(this._cache.values()).sort((function(t,e){return t.zoom-e.zoom})),this._dirty=!1)}},{key:"_getTile",value:function(t,e){var r=this.getTileId(t),n=this._cache.get(r),i=!1;return!n&&e?(n=new Ft(t),Object.assign(n,this.getTileMetadata(n.index)),Object.assign(n,{id:r,zoom:this.getTileZoom(n.index)}),i=!0,this._cache.set(r,n),this._dirty=!0):n&&n.needsReload&&(i=!0),n&&i&&n.loadData({getData:this.opts.getTileData,requestScheduler:this._requestScheduler,onLoad:this.onTileLoad,onError:this.opts.onTileError}),n}},{key:"_getNearestAncestor",value:function(t){for(var e=this._minZoom,r=void 0===e?0:e,n=t.index;this.getTileZoom(n)>r;){n=this.getParentIndex(n);var i=this._getTile(n);if(i)return i}return null}}]),t}();function zn(t){for(var e=t;e;){if(e.isLoaded||e.content)return e.state|=2,!0;e=e.parent}return!1}function Kn(t){var e,r=Un(t.children);try{for(r.s();!(e=r.n()).done;){var n=e.value;n.isLoaded||n.content?n.state|=2:Kn(n)}}catch(t){r.e(t)}finally{r.f()}}function qn(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Wn(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?qn(Object(r),!0).forEach((function(e){B()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):qn(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Qn(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=A()(t);if(e){var i=A()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return m()(this,r)}}var Xn={TilesetClass:Jn,data:{type:"data",value:[]},dataComparator:Bn.equals,renderSubLayers:{type:"function",value:function(t){return new _.GeoJsonLayer(t)},compare:!1},getTileData:{type:"function",optional:!0,value:null,compare:!1},onViewportLoad:{type:"function",optional:!0,value:null,compare:!1},onTileLoad:{type:"function",value:function(t){},compare:!1},onTileUnload:{type:"function",value:function(t){},compare:!1},onTileError:{type:"function",value:function(t){return console.error(t)},compare:!1},extent:{type:"array",optional:!0,value:null,compare:!0},tileSize:512,maxZoom:null,minZoom:0,maxCacheSize:null,maxCacheByteSize:null,refinementStrategy:"best-available",zRange:null,maxRequests:6,zoomOffset:0},Yn=function(t){y()(r,t);var e=Qn(r);function r(){return p()(this,r),e.apply(this,arguments)}return E()(r,[{key:"initializeState",value:function(){this.state={tileset:null,isLoaded:!1}}},{key:"finalizeState",value:function(){var t,e;null===(t=this.state)||void 0===t||null===(e=t.tileset)||void 0===e||e.finalize()}},{key:"isLoaded",get:function(){var t,e;return null===(t=this.state)||void 0===t?void 0:null===(e=t.tileset)||void 0===e?void 0:e.selectedTiles.every((function(t){return t.isLoaded&&t.layers&&t.layers.every((function(t){return t.isLoaded}))}))}},{key:"shouldUpdateState",value:function(t){return t.changeFlags.somethingChanged}},{key:"updateState",value:function(t){var e=t.changeFlags,r=this.state.tileset,n=e.propsOrDataChanged||e.updateTriggersChanged,i=e.dataChanged||e.updateTriggersChanged&&(e.updateTriggersChanged.all||e.updateTriggersChanged.getTileData);r?n&&(r.setOptions(this._getTilesetOptions()),i?r.reloadAll():this.state.tileset.tiles.forEach((function(t){t.layers=null}))):(r=new this.props.TilesetClass(this._getTilesetOptions()),this.setState({tileset:r})),this._updateTileset()}},{key:"_getTilesetOptions",value:function(){var t=this.props,e=t.tileSize,r=t.maxCacheSize,n=t.maxCacheByteSize,i=t.refinementStrategy,o=t.extent;return{maxCacheSize:r,maxCacheByteSize:n,maxZoom:t.maxZoom,minZoom:t.minZoom,tileSize:e,refinementStrategy:i,extent:o,maxRequests:t.maxRequests,zoomOffset:t.zoomOffset,getTileData:this.getTileData.bind(this),onTileLoad:this._onTileLoad.bind(this),onTileError:this._onTileError.bind(this),onTileUnload:this._onTileUnload.bind(this)}}},{key:"_updateTileset",value:function(){var t=this.state.tileset,e=this.props,r=e.zRange,n=e.modelMatrix,i=t.update(this.context.viewport,{zRange:r,modelMatrix:n}),o=t.isLoaded,a=this.state.isLoaded!==o,s=this.state.frameNumber!==i;o&&(a||s)&&this._onViewportLoad(),s&&this.setState({frameNumber:i}),this.state.isLoaded=o}},{key:"_onViewportLoad",value:function(){var t=this.state.tileset,e=this.props.onViewportLoad;e&&e(t.selectedTiles)}},{key:"_onTileLoad",value:function(t){this.props.onTileLoad(t),t.layers=null,this.setNeedsUpdate()}},{key:"_onTileError",value:function(t,e){this.props.onTileError(t),e.layers=null,this.setNeedsUpdate()}},{key:"_onTileUnload",value:function(t){this.props.onTileUnload(t)}},{key:"getTileData",value:function(t){var e=this.props,r=e.data,n=e.getTileData,i=e.fetch,o=t.signal;return t.url="string"==typeof r||Array.isArray(r)?xn(r,t):null,n?n(t):i&&t.url?i(t.url,{propName:"data",layer:this,signal:o}):null}},{key:"renderSubLayers",value:function(t){return this.props.renderSubLayers(t)}},{key:"getSubLayerPropsByTile",value:function(t){return null}},{key:"getPickingInfo",value:function(t){var e=t.info,r=t.sourceLayer;return e.tile=r.props.tile,e}},{key:"_updateAutoHighlight",value:function(t){t.sourceLayer&&t.sourceLayer.updateAutoHighlight(t)}},{key:"renderLayers",value:function(){var t=this;return this.state.tileset.tiles.map((function(e){var r=t.getSubLayerPropsByTile(e);if(e.isLoaded||e.content)if(e.layers)r&&e.layers[0]&&Object.keys(r).some((function(t){return e.layers[0].props[t]!==r[t]}))&&(e.layers=e.layers.map((function(t){return t.clone(r)})));else{var n=t.renderSubLayers(Wn(Wn({},t.props),{},{id:"".concat(t.id,"-").concat(e.id),data:e.content,_offset:0,tile:e}));e.layers=Object(_._flatten)(n,Boolean).map((function(t){return t.clone(Wn({tile:e},r))}))}else;return e.layers}))}},{key:"filterSubLayer",value:function(t){var e=t.layer,r=t.cullRect,n=e.props.tile;return this.state.tileset.isTileVisible(n,r)}}]),r}(_.CompositeLayer);B()(Yn,"defaultProps",Xn),B()(Yn,"layerName","TileLayer");var Zn=r(22),$n=r.n(Zn);function ti(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function ei(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ti(Object(r),!0).forEach((function(e){B()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ti(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function ri(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=A()(t);if(e){var i=A()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return m()(this,r)}}var ni=function(t){y()(r,t);var e=ri(r);function r(){return p()(this,r),e.apply(this,arguments)}return E()(r,[{key:"getShaders",value:function(){var t=$n()(A()(r.prototype),"getShaders",this).call(this);return t.inject={"vs:#decl":"uniform float trailLength;\nattribute float instanceTimestamps;\nattribute float instanceNextTimestamps;\nvarying 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;\nvarying 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}},{key:"initializeState",value:function(){$n()(A()(r.prototype),"initializeState",this).call(this),this.getAttributeManager().addInstanced({timestamps:{size:1,accessor:"getTimestamps",shaderAttributes:{instanceTimestamps:{vertexOffset:0},instanceNextTimestamps:{vertexOffset:1}}}})}},{key:"draw",value:function(t){var e=this.props,n=e.fadeTrail,i=e.trailLength,o=e.currentTime;t.uniforms=ei(ei({},t.uniforms),{},{fadeTrail:n,trailLength:i,currentTime:o}),$n()(A()(r.prototype),"draw",this).call(this,t)}}]),r}(_.PathLayer);B()(ni,"layerName","TripsLayer"),B()(ni,"defaultProps",{fadeTrail:!0,trailLength:{type:"number",value:120,min:0},currentTime:{type:"number",value:0,min:0},getTimestamps:{type:"accessor",value:function(t){return t.timestamps}}});var ii=r(35),oi=r(23),ai=r.n(oi),si=r(31),ui=r.n(si);function ci(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=A()(t);if(e){var i=A()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return m()(this,r)}}function li(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function fi(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?li(Object(r),!0).forEach((function(e){B()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):li(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function hi(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return di(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return di(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function di(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function pi(t,e){e=void 0===e?t[0][0]:e;var r,n=hi(t);try{for(n.s();!(r=n.n()).done;){var i=r.value,o=i[0]-e;o>180?i[0]-=360:o<-180&&(i[0]+=360)}}catch(t){n.e(t)}finally{n.f()}}function vi(t,e,r){var n=Object(ii.h3ToGeo)(t),i=R()(n,2),o=i[0],a=i[1],s=e.length;pi(e,a);for(var u=e[0]===e[s-1]?s-1:s,c=0;c<u;c++)e[c][0]=ae(a,e[c][0],r),e[c][1]=ae(o,e[c][1],r)}function yi(t,e,r){var n=t(e,r),i=Object(ii.h3ToGeo)(n),o=R()(i,2),a=o[0];return[o[1],a]}function gi(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=Object(ii.h3ToGeoBoundary)(t,!0);return 1!==e?vi(t,r,e):pi(r),r}var mi=fi(fi({},_.PolygonLayer.defaultProps),{},{highPrecision:"auto",coverage:{type:"number",min:0,max:1,value:1},centerHexagon:null,getHexagon:{type:"accessor",value:function(t){return t.hexagon}},extruded:!0}),bi=function(t){y()(r,t);var e=ci(r);function r(){var t;p()(this,r);for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return t=e.call.apply(e,[this].concat(i)),B()(ai()(t),"state",void 0),t}return E()(r,[{key:"initializeState",value:function(){r._checkH3Lib(),this.state={edgeLengthKM:0,resolution:-1}}},{key:"shouldUpdateState",value:function(t){var e=t.changeFlags;return this._shouldUseHighPrecision()?e.propsOrDataChanged:e.somethingChanged}},{key:"updateState",value:function(t){var e=t.props,r=t.changeFlags;if(!0!==e.highPrecision&&(r.dataChanged||r.updateTriggersChanged&&r.updateTriggersChanged.getHexagon)){var n=this._calculateH3DataProps();this.setState(n)}this._updateVertices(this.context.viewport)}},{key:"_calculateH3DataProps",value:function(){var t,e=-1,r=!1,n=!1,i=Object(_.createIterable)(this.props.data),o=i.iterable,a=i.objectInfo,s=hi(o);try{for(s.s();!(t=s.n()).done;){var u=t.value;a.index++;var c=this.props.getHexagon(u,a),l=Object(ii.h3GetResolution)(c);if(e<0){if(e=l,!this.props.highPrecision)break}else if(e!==l){n=!0;break}if(Object(ii.h3IsPentagon)(c)){r=!0;break}}}catch(t){s.e(t)}finally{s.f()}return{resolution:e,edgeLengthKM:e>=0?Object(ii.edgeLength)(e,"km"):0,hasMultipleRes:n,hasPentagon:r}}},{key:"_shouldUseHighPrecision",value:function(){if("auto"===this.props.highPrecision){var t=this.state,e=t.resolution,r=t.hasPentagon,n=t.hasMultipleRes,i=this.context.viewport;return Boolean(null==i?void 0:i.resolution)||n||r||e>=0&&e<=5}return this.props.highPrecision}},{key:"_updateVertices",value:function(t){if(!this._shouldUseHighPrecision()){var e=this.state,r=e.resolution,n=e.edgeLengthKM,i=e.centerHex;if(!(r<0)){var o=this.props.centerHexagon||Object(ii.geoToH3)(t.latitude,t.longitude,r);if(i!==o){if(i){var a=Object(ii.h3Distance)(i,o);if(a>=0&&a*n<10)return}var s=t.distanceScales.unitsPerMeter,u=gi(o),c=Object(ii.h3ToGeo)(o),l=R()(c,2),f=l[0],h=l[1],d=t.projectFlat([h,f]),p=R()(d,2),v=p[0],y=p[1];u=u.map((function(e){var r=t.projectFlat(e);return[(r[0]-v)/s[0],(r[1]-y)/s[1]]})),this.setState({centerHex:o,vertices:u})}}}}},{key:"renderLayers",value:function(){return this._shouldUseHighPrecision()?this._renderPolygonLayer():this._renderColumnLayer()}},{key:"_getForwardProps",value:function(){var t=this.props,e=t.elevationScale,r=t.material,n=t.coverage,i=t.extruded,o=t.wireframe,a=t.stroked,s=t.filled,u=t.lineWidthUnits,c=t.lineWidthScale,l=t.lineWidthMinPixels,f=t.lineWidthMaxPixels,h=t.getFillColor,d=t.getElevation,p=t.getLineColor,v=t.getLineWidth,y=t.transitions,g=t.updateTriggers;return{elevationScale:e,extruded:i,coverage:n,wireframe:o,stroked:a,filled:s,lineWidthUnits:u,lineWidthScale:c,lineWidthMinPixels:l,lineWidthMaxPixels:f,material:r,getElevation:d,getFillColor:h,getLineColor:p,getLineWidth:v,transitions:y,updateTriggers:{getFillColor:g.getFillColor,getElevation:g.getElevation,getLineColor:g.getLineColor,getLineWidth:g.getLineWidth}}}},{key:"_renderPolygonLayer",value:function(){var t=this.props,e=t.data,r=t.getHexagon,n=t.updateTriggers,i=t.coverage,o=this.getSubLayerClass("hexagon-cell-hifi",_.PolygonLayer),a=this._getForwardProps();return a.updateTriggers.getPolygon=function(t,e){return null==t?e:"object"===ui()(t)?fi(fi({},t),{},{coverage:e}):{getHexagon:t,coverage:e}}(n.getHexagon,i),new o(a,this.getSubLayerProps({id:"hexagon-cell-hifi",updateTriggers:a.updateTriggers}),{data:e,_normalize:!1,_windingOrder:"CCW",positionFormat:"XY",getPolygon:function(t,e){return function(t){var e,r=new Float64Array(2*t.length),n=0,i=hi(t);try{for(i.s();!(e=i.n()).done;){var o=e.value;r[n++]=o[0],r[n++]=o[1]}}catch(t){i.e(t)}finally{i.f()}return r}(gi(r(t,e),i))}})}},{key:"_renderColumnLayer",value:function(){var t=this.props,e=t.data,r=t.getHexagon,n=t.updateTriggers,i=this.getSubLayerClass("hexagon-cell",_.ColumnLayer),o=this._getForwardProps();return o.updateTriggers.getPosition=n.getHexagon,new i(o,this.getSubLayerProps({id:"hexagon-cell",flatShading:!0,updateTriggers:o.updateTriggers}),{data:e,diskResolution:6,radius:1,vertices:this.state.vertices,getPosition:yi.bind(null,r)})}}]),r}(_.CompositeLayer);function Ai(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return wi(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return wi(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function wi(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Bi(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=A()(t);if(e){var i=A()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return m()(this,r)}}B()(bi,"defaultProps",mi),B()(bi,"layerName","H3HexagonLayer"),B()(bi,"_checkH3Lib",(function(){}));var _i=function(t){y()(r,t);var e=Bi(r);function r(){return p()(this,r),e.apply(this,arguments)}return E()(r,[{key:"initializeState",value:function(){bi._checkH3Lib()}},{key:"updateState",value:function(t){var e=t.props,r=t.changeFlags;if(r.dataChanged||r.updateTriggersChanged&&r.updateTriggersChanged.getHexagons){var n,i=e.data,o=e.getHexagons,a=[],s=Object(_.createIterable)(i),u=s.iterable,c=s.objectInfo,l=Ai(u);try{for(l.s();!(n=l.n()).done;){var f=n.value;c.index++;var h,d=o(f,c),p=Ai(Object(ii.h3SetToMultiPolygon)(d,!0));try{for(p.s();!(h=p.n()).done;){var v=h.value;a.push(this.getSubLayerRow({polygon:v},f,c.index))}}catch(t){p.e(t)}finally{p.f()}}}catch(t){l.e(t)}finally{l.f()}this.setState({polygons:a})}}},{key:"indexToBounds",value:function(){return{data:this.state.polygons,getPolygon:function(t){return t.polygon}}}}]),r}(M);B()(_i,"layerName","H3ClusterLayer"),B()(_i,"defaultProps",{getHexagons:{type:"accessor",value:function(t){return t.hexagons}}});var xi=r(43);function Ci(){return!("object"===("undefined"==typeof process?"undefined":ui()(process))&&"[object process]"===String(process)&&!process.browser)||function(t){if("undefined"!=typeof window&&"object"===ui()(window.process)&&"renderer"===window.process.type)return!0;if("undefined"!=typeof process&&"object"===ui()(process.versions)&&Boolean(process.versions.electron))return!0;var e="object"===("undefined"==typeof navigator?"undefined":ui()(navigator))&&"string"==typeof navigator.userAgent&&navigator.userAgent,r=t||e;return!!(r&&r.indexOf("Electron")>=0)}()}Ci();function ki(t){try{var e=window[t],r="__storage_test__";return e.setItem(r,r),e.removeItem(r),e}catch(t){return null}}var Ei,Oi=function(){function t(e){p()(this,t);var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"sessionStorage";In(this,"storage",void 0),In(this,"id",void 0),In(this,"config",{}),this.storage=ki(n),this.id=e,this.config={},Object.assign(this.config,r),this._loadConfiguration()}return E()(t,[{key:"getConfiguration",value:function(){return this.config}},{key:"setConfiguration",value:function(t){return this.config={},this.updateConfiguration(t)}},{key:"updateConfiguration",value:function(t){if(Object.assign(this.config,t),this.storage){var e=JSON.stringify(this.config);this.storage.setItem(this.id,e)}return this}},{key:"_loadConfiguration",value:function(){var t={};if(this.storage){var e=this.storage.getItem(this.id);t=e?JSON.parse(e):{}}return Object.assign(this.config,t),this}}]),t}();function Ti(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:600,i=t.src.replace(/\(/g,"%28").replace(/\)/g,"%29");t.width>n&&(r=Math.min(r,n/t.width));var o=t.width*r,a=t.height*r,s=["font-size:1px;","padding:".concat(Math.floor(a/2),"px ").concat(Math.floor(o/2),"px;"),"line-height:".concat(a,"px;"),"background:url(".concat(i,");"),"background-size:".concat(o,"px ").concat(a,"px;"),"color:transparent;"].join("");return["".concat(e," %c+"),s]}function Si(t){return"string"==typeof t?Ei[t.toUpperCase()]||Ei.WHITE:t}function Mi(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return Ii(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ii(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function Ii(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Ri(t){var e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["constructor"],n=Object.getPrototypeOf(t),i=Object.getOwnPropertyNames(n),o=Mi(i);try{var a=function(){var n=e.value;"function"==typeof t[n]&&(r.find((function(t){return n===t}))||(t[n]=t[n].bind(t)))};for(o.s();!(e=o.n()).done;)a()}catch(t){o.e(t)}finally{o.f()}}function Pi(t,e){if(!t)throw new Error(e||"Assertion failed")}!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"}(Ei||(Ei={}));var Fi={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document,process:"object"===("undefined"==typeof process?"undefined":ui()(process))&&process},Di=(globalThis,Fi.window||Fi.self||Fi.global),Li=Fi.process||{};console;function ji(){var t,e,r;if(Ci&&"performance"in Di)t=null==Di?void 0:null===(e=Di.performance)||void 0===e?void 0:null===(r=e.now)||void 0===r?void 0:r.call(e);else if("hrtime"in Li){var n,i=null==Li?void 0:null===(n=Li.hrtime)||void 0===n?void 0:n.call(Li);t=1e3*i[0]+i[1]/1e6}else t=Date.now();return t}var Gi={debug:Ci&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},Ni={enabled:!0,level:0};function Ui(){}var Hi={},Vi={once:!0},Ji=function(){function t(){p()(this,t);var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{id:""},r=e.id;In(this,"id",void 0),In(this,"VERSION","8.8.16"),In(this,"_startTs",ji()),In(this,"_deltaTs",ji()),In(this,"_storage",void 0),In(this,"userData",{}),In(this,"LOG_THROTTLE_TIMEOUT",0),this.id=r,this._storage=new Oi("__probe-".concat(this.id,"__"),Ni),this.userData={},this.timeStamp("".concat(this.id," started")),Ri(this),Object.seal(this)}return E()(t,[{key:"level",get:function(){return this.getLevel()},set:function(t){this.setLevel(t)}},{key:"isEnabled",value:function(){return this._storage.config.enabled}},{key:"getLevel",value:function(){return this._storage.config.level}},{key:"getTotal",value:function(){return Number((ji()-this._startTs).toPrecision(10))}},{key:"getDelta",value:function(){return Number((ji()-this._deltaTs).toPrecision(10))}},{key:"priority",get:function(){return this.level},set:function(t){this.level=t}},{key:"getPriority",value:function(){return this.level}},{key:"enable",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this._storage.updateConfiguration({enabled:t}),this}},{key:"setLevel",value:function(t){return this._storage.updateConfiguration({level:t}),this}},{key:"get",value:function(t){return this._storage.config[t]}},{key:"set",value:function(t,e){this._storage.updateConfiguration(B()({},t,e))}},{key:"settings",value:function(){console.table?console.table(this._storage.config):console.log(this._storage.config)}},{key:"assert",value:function(t,e){Pi(t,e)}},{key:"warn",value:function(t){return this._getLogFunction(0,t,Gi.warn,arguments,Vi)}},{key:"error",value:function(t){return this._getLogFunction(0,t,Gi.error,arguments)}},{key:"deprecated",value:function(t,e){return this.warn("`".concat(t,"` is deprecated and will be removed in a later version. Use `").concat(e,"` instead"))}},{key:"removed",value:function(t,e){return this.error("`".concat(t,"` has been removed. Use `").concat(e,"` instead"))}},{key:"probe",value:function(t,e){return this._getLogFunction(t,e,Gi.log,arguments,{time:!0,once:!0})}},{key:"log",value:function(t,e){return this._getLogFunction(t,e,Gi.debug,arguments)}},{key:"info",value:function(t,e){return this._getLogFunction(t,e,console.info,arguments)}},{key:"once",value:function(t,e){for(var r=arguments.length,n=new Array(r>2?r-2:0),i=2;i<r;i++)n[i-2]=arguments[i];return this._getLogFunction(t,e,Gi.debug||Gi.info,arguments,Vi)}},{key:"table",value:function(t,e,r){return e?this._getLogFunction(t,e,console.table||Ui,r&&[r],{tag:qi(e)}):Ui}},{key:"image",value:function(t){var e=t.logLevel,n=t.priority,i=t.image,o=t.message,a=void 0===o?"":o,s=t.scale,u=void 0===s?1:s;return this._shouldLog(e||n)?Ci?function(t){var e=t.image,r=t.message,n=void 0===r?"":r,i=t.scale,o=void 0===i?1:i;if("string"==typeof e){var a=new Image;return a.onload=function(){var t,e=Ti(a,n,o);(t=console).log.apply(t,Lt()(e))},a.src=e,Ui}var s=e.nodeName||"";if("img"===s.toLowerCase()){var u;return(u=console).log.apply(u,Lt()(Ti(e,n,o))),Ui}if("canvas"===s.toLowerCase()){var c=new Image;return c.onload=function(){var t;return(t=console).log.apply(t,Lt()(Ti(c,n,o)))},c.src=e.toDataURL(),Ui}return Ui}({image:i,message:a,scale:u}):function(t){var e=t.image,n=(t.message,t.scale),i=void 0===n?1:n,o=null;try{o=r(116)}catch(t){}if(o)return function(){return o(e,{fit:"box",width:"".concat(Math.round(80*i),"%")}).then((function(t){return console.log(t)}))};return Ui}({image:i,message:a,scale:u}):Ui}},{key:"time",value:function(t,e){return this._getLogFunction(t,e,console.time?console.time:console.info)}},{key:"timeEnd",value:function(t,e){return this._getLogFunction(t,e,console.timeEnd?console.timeEnd:console.info)}},{key:"timeStamp",value:function(t,e){return this._getLogFunction(t,e,console.timeStamp||Ui)}},{key:"group",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{collapsed:!1},n=Ki({logLevel:t,message:e,opts:r}),i=r.collapsed;return n.method=(i?console.groupCollapsed:console.group)||console.info,this._getLogFunction(n)}},{key:"groupCollapsed",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.group(t,e,Object.assign({},r,{collapsed:!0}))}},{key:"groupEnd",value:function(t){return this._getLogFunction(t,"",console.groupEnd||Ui)}},{key:"withGroup",value:function(t,e,r){this.group(t,e)();try{r()}finally{this.groupEnd(t)()}}},{key:"trace",value:function(){console.trace&&console.trace()}},{key:"_shouldLog",value:function(t){return this.isEnabled()&&this.getLevel()>=zi(t)}},{key:"_getLogFunction",value:function(t,e,r,n,i){if(this._shouldLog(t)){var o;i=Ki({logLevel:t,message:e,args:n,opts:i}),Pi(r=r||i.method),i.total=this.getTotal(),i.delta=this.getDelta(),this._deltaTs=ji();var a=i.tag||i.message;if(i.once){if(Hi[a])return Ui;Hi[a]=ji()}return e=function(t,e,r){if("string"==typeof e){var n=r.time?function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8,r=Math.max(e-t.length,0);return"".concat(" ".repeat(r)).concat(t)}((s=r.total)<10?"".concat(s.toFixed(2),"ms"):s<100?"".concat(s.toFixed(1),"ms"):s<1e3?"".concat(s.toFixed(0),"ms"):"".concat((s/1e3).toFixed(2),"s")):"";e=r.time?"".concat(t,": ").concat(n," ").concat(e):"".concat(t,": ").concat(e),i=e,o=r.color,a=r.background,Ci||"string"!=typeof i||(o&&(o=Si(o),i="[".concat(o,"m").concat(i,"")),a&&(o=Si(a),i="[".concat(a+10,"m").concat(i,""))),e=i}var i,o,a;var s;return e}(this.id,i.message,i),(o=r).bind.apply(o,[console,e].concat(Lt()(i.args)))}return Ui}}]),t}();function zi(t){if(!t)return 0;var e;switch(ui()(t)){case"number":e=t;break;case"object":e=t.logLevel||t.priority||0;break;default:return 0}return Pi(Number.isFinite(e)&&e>=0),e}function Ki(t){var e=t.logLevel,r=t.message;t.logLevel=zi(e);for(var n=t.args?Array.from(t.args):[];n.length&&n.shift()!==r;);switch(ui()(e)){case"string":case"function":void 0!==r&&n.unshift(r),t.message=e;break;case"object":Object.assign(t,e)}"function"==typeof t.message&&(t.message=t.message());var i=ui()(t.message);return Pi("string"===i||"object"===i),Object.assign(t,{args:n},t.opts)}function qi(t){for(var e in t)for(var r in t[e])return r||"untitled";return"empty"}In(Ji,"VERSION","8.8.16");var Wi=new Ji({id:"luma.gl"});function Qi(t,e){if(!t)throw new Error(e||"luma.gl: assertion failed.")}function Xi(t){return"undefined"!=typeof WebGLRenderingContext&&t instanceof WebGLRenderingContext||("undefined"!=typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext||Boolean(t&&Number.isFinite(t._version)))}function Yi(t){return"undefined"!=typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext||Boolean(t&&2===t._version)}function Zi(t){return Qi(Xi(t),"Invalid WebGLRenderingContext"),t}function $i(t){return Qi(Yi(t),"Requires WebGL2"),t}var to={};function eo(t,e){var r;to[t]=!0,void 0!==e&&(r=e,globalThis.console&&globalThis.console.error&&globalThis.console.error(r))}var ro=function t(e){var r=e.gl;this.ext=e,this.isAlive=!0,this.hasBeenBound=!1,this.elementArrayBuffer=null,this.attribs=new Array(e.maxVertexAttribs);for(var n=0;n<this.attribs.length;n++){var i=new t.VertexAttrib(r);this.attribs[n]=i}this.maxAttrib=0};(ro.VertexAttrib=function(t){this.enabled=!1,this.buffer=null,this.size=4,this.type=5126,this.normalized=!1,this.stride=16,this.offset=0,this.cached="",this.recache()}).prototype.recache=function(){this.cached=[this.size,this.type,this.normalized,this.stride,this.offset].join(":")};var no,io=function(t){var e=this;this.gl=t,function(t){var e=t.getError;t.getError=function(){var r;do{0!==(r=e.apply(t))&&(to[r]=!0)}while(0!==r);for(r in to)if(to[r])return delete to[r],parseInt(r,10);return 0}}(t);var r=this.original={getParameter:t.getParameter,enableVertexAttribArray:t.enableVertexAttribArray,disableVertexAttribArray:t.disableVertexAttribArray,bindBuffer:t.bindBuffer,getVertexAttrib:t.getVertexAttrib,vertexAttribPointer:t.vertexAttribPointer};t.getParameter=function(t){return t===e.VERTEX_ARRAY_BINDING_OES?e.currentVertexArrayObject===e.defaultVertexArrayObject?null:e.currentVertexArrayObject:r.getParameter.apply(this,arguments)},t.enableVertexAttribArray=function(t){var n=e.currentVertexArrayObject;n.maxAttrib=Math.max(n.maxAttrib,t);var i=n.attribs[t];return i.enabled=!0,r.enableVertexAttribArray.apply(this,arguments)},t.disableVertexAttribArray=function(t){var n=e.currentVertexArrayObject;n.maxAttrib=Math.max(n.maxAttrib,t);var i=n.attribs[t];return i.enabled=!1,r.disableVertexAttribArray.apply(this,arguments)},t.bindBuffer=function(t,n){switch(t){case 34962:e.currentArrayBuffer=n;break;case 34963:e.currentVertexArrayObject.elementArrayBuffer=n}return r.bindBuffer.apply(this,arguments)},t.getVertexAttrib=function(t,n){var i=e.currentVertexArrayObject,o=i.attribs[t];switch(n){case 34975:return o.buffer;case 34338:return o.enabled;case 34339:return o.size;case 34340:return o.stride;case 34341:return o.type;case 34922:return o.normalized;default:return r.getVertexAttrib.apply(this,arguments)}},t.vertexAttribPointer=function(t,n,i,o,a,s){var u=e.currentVertexArrayObject;u.maxAttrib=Math.max(u.maxAttrib,t);var c=u.attribs[t];return c.buffer=e.currentArrayBuffer,c.size=n,c.type=i,c.normalized=o,c.stride=a,c.offset=s,c.recache(),r.vertexAttribPointer.apply(this,arguments)},t.instrumentExtension&&t.instrumentExtension(this,"OES_vertex_array_object"),t.canvas&&t.canvas.addEventListener("webglcontextrestored",(function(){var t;t="OESVertexArrayObject emulation library context restored",globalThis.console&&globalThis.console.log&&globalThis.console.log(t),e.reset_()}),!0),this.reset_()};io.prototype.VERTEX_ARRAY_BINDING_OES=34229,io.prototype.reset_=function(){if(void 0!==this.vertexArrayObjects)for(var t=0;t<this.vertexArrayObjects.length;++t)this.vertexArrayObjects.isAlive=!1;var e=this.gl;this.maxVertexAttribs=e.getParameter(34921),this.defaultVertexArrayObject=new ro(this),this.currentVertexArrayObject=null,this.currentArrayBuffer=null,this.vertexArrayObjects=[this.defaultVertexArrayObject],this.bindVertexArrayOES(null)},io.prototype.createVertexArrayOES=function(){var t=new ro(this);return this.vertexArrayObjects.push(t),t},io.prototype.deleteVertexArrayOES=function(t){t.isAlive=!1,this.vertexArrayObjects.splice(this.vertexArrayObjects.indexOf(t),1),this.currentVertexArrayObject===t&&this.bindVertexArrayOES(null)},io.prototype.isVertexArrayOES=function(t){return!!(t&&t instanceof ro&&t.hasBeenBound&&t.ext===this)},io.prototype.bindVertexArrayOES=function(t){var e=this.gl;if(!t||t.isAlive){var r=this.original,n=this.currentVertexArrayObject;this.currentVertexArrayObject=t||this.defaultVertexArrayObject,this.currentVertexArrayObject.hasBeenBound=!0;var i=this.currentVertexArrayObject;if(n!==i){n&&i.elementArrayBuffer===n.elementArrayBuffer||r.bindBuffer.call(e,34963,i.elementArrayBuffer);for(var o=this.currentArrayBuffer,a=Math.max(n?n.maxAttrib:0,i.maxAttrib),s=0;s<=a;s++){var u=i.attribs[s],c=n?n.attribs[s]:null;if(n&&u.enabled===c.enabled||(u.enabled?r.enableVertexAttribArray.call(e,s):r.disableVertexAttribArray.call(e,s)),u.enabled){var l=!1;n&&u.buffer===c.buffer||(o!==u.buffer&&(r.bindBuffer.call(e,34962,u.buffer),o=u.buffer),l=!0),(l||u.cached!==c.cached)&&r.vertexAttribPointer.call(e,s,u.size,u.type,u.normalized,u.stride,u.offset)}}this.currentArrayBuffer!==o&&r.bindBuffer.call(e,34962,this.currentArrayBuffer)}}else eo(1282,"bindVertexArrayOES: attempt to bind deleted arrayObject")};var oo,ao=function(t){return Yi(t)?void 0:0},so=(no={},B()(no,3074,(function(t){return Yi(t)?void 0:36064})),B()(no,35723,(function(t){return Yi(t)?void 0:4352})),B()(no,35977,ao),B()(no,32937,ao),B()(no,36795,(function(t,e){var r=Yi(t)?t.getExtension("EXT_disjoint_timer_query_webgl2"):t.getExtension("EXT_disjoint_timer_query");return r&&r.GPU_DISJOINT_EXT?e(r.GPU_DISJOINT_EXT):0})),B()(no,37445,(function(t,e){var r=t.getExtension("WEBGL_debug_renderer_info");return e(r&&r.UNMASKED_VENDOR_WEBGL||7936)})),B()(no,37446,(function(t,e){var r=t.getExtension("WEBGL_debug_renderer_info");return e(r&&r.UNMASKED_RENDERER_WEBGL||7937)})),B()(no,34047,(function(t,e){var r=t.luma.extensions.EXT_texture_filter_anisotropic;return r?e(r.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1})),B()(no,32883,ao),B()(no,35071,ao),B()(no,37447,ao),B()(no,36063,(function(t,e){if(!Yi(t)){var r=t.getExtension("WEBGL_draw_buffers");return r?e(r.MAX_COLOR_ATTACHMENTS_WEBGL):0}})),B()(no,35379,ao),B()(no,35374,ao),B()(no,35377,ao),B()(no,34852,(function(t){if(!Yi(t)){var e=t.getExtension("WEBGL_draw_buffers");return e?e.MAX_DRAW_BUFFERS_WEBGL:0}})),B()(no,36203,(function(t){return t.getExtension("OES_element_index")?2147483647:65535})),B()(no,33001,(function(t){return t.getExtension("OES_element_index")?16777216:65535})),B()(no,33e3,(function(t){return 16777216})),B()(no,37157,ao),B()(no,35373,ao),B()(no,35657,ao),B()(no,36183,ao),B()(no,37137,ao),B()(no,34045,ao),B()(no,35978,ao),B()(no,35979,ao),B()(no,35968,ao),B()(no,35376,ao),B()(no,35375,ao),B()(no,35659,ao),B()(no,37154,ao),B()(no,35371,ao),B()(no,35658,ao),B()(no,35076,ao),B()(no,35077,ao),B()(no,35380,ao),no);var uo,co,lo,fo=(oo={},B()(oo,"OES_vertex_array_object",{meta:{suffix:"OES"},createVertexArray:function(){Qi(!1,"VertexArray requires WebGL2 or OES_vertex_array_object extension")},deleteVertexArray:function(){},bindVertexArray:function(){},isVertexArray:function(){return!1}}),B()(oo,"ANGLE_instanced_arrays",{meta:{suffix:"ANGLE"},vertexAttribDivisor:function(t,e){Qi(0===e,"WebGL instanced rendering not supported")},drawElementsInstanced:function(){},drawArraysInstanced:function(){}}),B()(oo,"WEBGL_draw_buffers",{meta:{suffix:"WEBGL"},drawBuffers:function(){Qi(!1)}}),B()(oo,"EXT_disjoint_timer_query",{meta:{suffix:"EXT"},createQuery:function(){Qi(!1)},deleteQuery:function(){Qi(!1)},beginQuery:function(){Qi(!1)},endQuery:function(){},getQuery:function(t,e){return this.getQueryObject(t,e)},getQueryParameter:function(t,e){return this.getQueryObject(t,e)},getQueryObject:function(){}}),oo),ho={readBuffer:function(t,e,r){Yi(t)&&e(r)},getVertexAttrib:function(t,e,r,n){var i,o=function(t,e){return{webgl2:Yi(t),ext:t.getExtension(e)}}(t,"ANGLE_instanced_arrays"),a=o.webgl2,s=o.ext;switch(n){case 35069:i=!!a&&void 0;break;case 35070:i=a||s?void 0:0}return void 0!==i?i:e(r,n)},getProgramParameter:function(t,e,r,n){if(!Yi(t))switch(n){case 35967:return 35981;case 35971:case 35382:return 0}return e(r,n)},getInternalformatParameter:function(t,e,r,n,i){if(!Yi(t))switch(i){case 32937:return new Int32Array([0])}return t.getInternalformatParameter(r,n,i)},getTexParameter:function(t,e,r,n){switch(n){case 34046:var i=t.luma.extensions.EXT_texture_filter_anisotropic;n=i&&i.TEXTURE_MAX_ANISOTROPY_EXT||34046}return e(r,n)},getParameter:function(t,e,r){var n=so[r],i="function"==typeof n?n(t,e,r):n;return void 0!==i?i:e(r)},hint:function(t,e,r,n){return e(r,n)}};function po(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return vo(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return vo(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function vo(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function yo(t,e){var r=e.extension,n=e.target,i=e.target2,o=fo[r];Qi(o);for(var a=o.meta,s=(void 0===a?{}:a).suffix,u=void 0===s?"":s,c=t.getExtension(r),l=function(){var e=h[f],r="".concat(e).concat(u),a=null;"meta"===e||"function"==typeof t[e]||(c&&"function"==typeof c[r]?a=function(){return c[r].apply(c,arguments)}:"function"==typeof o[e]&&(a=o[e].bind(n))),a&&(n[e]=a,i[e]=a)},f=0,h=Object.keys(o);f<h.length;f++)l()}globalThis.polyfillContext=function(t){t.luma=t.luma||{};var e=t.luma;return e.polyfilled||(!function(t){if("function"!=typeof t.createVertexArray){var e=t.getSupportedExtensions;t.getSupportedExtensions=function(){var t=e.call(this)||[];return t.indexOf("OES_vertex_array_object")<0&&t.push("OES_vertex_array_object"),t};var r=t.getExtension;t.getExtension=function(e){var n=r.call(this,e);return n||("OES_vertex_array_object"!==e?null:(t.__OESVertexArrayObject||(this.__OESVertexArrayObject=new io(this)),this.__OESVertexArrayObject))}}}(t),function(t){t.luma.extensions={};var e,r=po(t.getSupportedExtensions()||[]);try{for(r.s();!(e=r.n()).done;){var n=e.value;t.luma[n]=t.getExtension(n)}}catch(t){r.e(t)}finally{r.f()}}(t),function(t,e){var r,n=po(Object.getOwnPropertyNames(e));try{for(n.s();!(r=n.n()).done;){var i=r.value;"overrides"!==i&&yo(t,{extension:i,target:t.luma,target2:t})}}catch(t){n.e(t)}finally{n.f()}}(t,fo),function(t,e){var r=e.target,n=e.target2;Object.keys(ho).forEach((function(e){if("function"==typeof ho[e]){var i=t[e]?t[e].bind(t):function(){},o=ho[e].bind(null,t,i);r[e]=o,n[e]=o}}))}(t,{target:e,target2:t}),e.polyfilled=!0),t};var go=(uo={},B()(uo,3042,!1),B()(uo,32773,new Float32Array([0,0,0,0])),B()(uo,32777,32774),B()(uo,34877,32774),B()(uo,32969,1),B()(uo,32968,0),B()(uo,32971,1),B()(uo,32970,0),B()(uo,3106,new Float32Array([0,0,0,0])),B()(uo,3107,[!0,!0,!0,!0]),B()(uo,2884,!1),B()(uo,2885,1029),B()(uo,2929,!1),B()(uo,2931,1),B()(uo,2932,513),B()(uo,2928,new Float32Array([0,1])),B()(uo,2930,!0),B()(uo,3024,!0),B()(uo,36006,null),B()(uo,2886,2305),B()(uo,33170,4352),B()(uo,2849,1),B()(uo,32823,!1),B()(uo,32824,0),B()(uo,10752,0),B()(uo,32938,1),B()(uo,32939,!1),B()(uo,3089,!1),B()(uo,3088,new Int32Array([0,0,1024,1024])),B()(uo,2960,!1),B()(uo,2961,0),B()(uo,2968,4294967295),B()(uo,36005,4294967295),B()(uo,2962,519),B()(uo,2967,0),B()(uo,2963,4294967295),B()(uo,34816,519),B()(uo,36003,0),B()(uo,36004,4294967295),B()(uo,2964,7680),B()(uo,2965,7680),B()(uo,2966,7680),B()(uo,34817,7680),B()(uo,34818,7680),B()(uo,34819,7680),B()(uo,2978,[0,0,1024,1024]),B()(uo,3333,4),B()(uo,3317,4),B()(uo,37440,!1),B()(uo,37441,!1),B()(uo,37443,37444),B()(uo,35723,4352),B()(uo,36010,null),B()(uo,35977,!1),B()(uo,3330,0),B()(uo,3332,0),B()(uo,3331,0),B()(uo,3314,0),B()(uo,32878,0),B()(uo,3316,0),B()(uo,3315,0),B()(uo,32877,0),uo),mo=function(t,e,r){return e?t.enable(r):t.disable(r)},bo=function(t,e,r){return t.hint(r,e)},Ao=function(t,e,r){return t.pixelStorei(r,e)};function wo(t){return Array.isArray(t)||ArrayBuffer.isView(t)}var Bo=(co={},B()(co,3042,mo),B()(co,32773,(function(t,e){return t.blendColor.apply(t,Lt()(e))})),B()(co,32777,"blendEquation"),B()(co,34877,"blendEquation"),B()(co,32969,"blendFunc"),B()(co,32968,"blendFunc"),B()(co,32971,"blendFunc"),B()(co,32970,"blendFunc"),B()(co,3106,(function(t,e){return t.clearColor.apply(t,Lt()(e))})),B()(co,3107,(function(t,e){return t.colorMask.apply(t,Lt()(e))})),B()(co,2884,mo),B()(co,2885,(function(t,e){return t.cullFace(e)})),B()(co,2929,mo),B()(co,2931,(function(t,e){return t.clearDepth(e)})),B()(co,2932,(function(t,e){return t.depthFunc(e)})),B()(co,2928,(function(t,e){return t.depthRange.apply(t,Lt()(e))})),B()(co,2930,(function(t,e){return t.depthMask(e)})),B()(co,3024,mo),B()(co,35723,bo),B()(co,36006,(function(t,e){var r=Yi(t)?36009:36160;return t.bindFramebuffer(r,e)})),B()(co,2886,(function(t,e){return t.frontFace(e)})),B()(co,33170,bo),B()(co,2849,(function(t,e){return t.lineWidth(e)})),B()(co,32823,mo),B()(co,32824,"polygonOffset"),B()(co,10752,"polygonOffset"),B()(co,35977,mo),B()(co,32938,"sampleCoverage"),B()(co,32939,"sampleCoverage"),B()(co,3089,mo),B()(co,3088,(function(t,e){return t.scissor.apply(t,Lt()(e))})),B()(co,2960,mo),B()(co,2961,(function(t,e){return t.clearStencil(e)})),B()(co,2968,(function(t,e){return t.stencilMaskSeparate(1028,e)})),B()(co,36005,(function(t,e){return t.stencilMaskSeparate(1029,e)})),B()(co,2962,"stencilFuncFront"),B()(co,2967,"stencilFuncFront"),B()(co,2963,"stencilFuncFront"),B()(co,34816,"stencilFuncBack"),B()(co,36003,"stencilFuncBack"),B()(co,36004,"stencilFuncBack"),B()(co,2964,"stencilOpFront"),B()(co,2965,"stencilOpFront"),B()(co,2966,"stencilOpFront"),B()(co,34817,"stencilOpBack"),B()(co,34818,"stencilOpBack"),B()(co,34819,"stencilOpBack"),B()(co,2978,(function(t,e){return t.viewport.apply(t,Lt()(e))})),B()(co,3333,Ao),B()(co,3317,Ao),B()(co,37440,Ao),B()(co,37441,Ao),B()(co,37443,Ao),B()(co,3330,Ao),B()(co,3332,Ao),B()(co,3331,Ao),B()(co,36010,(function(t,e){return t.bindFramebuffer(36008,e)})),B()(co,3314,Ao),B()(co,32878,Ao),B()(co,3316,Ao),B()(co,3315,Ao),B()(co,32877,Ao),B()(co,"framebuffer",(function(t,e){var r=e&&"handle"in e?e.handle:e;return t.bindFramebuffer(36160,r)})),B()(co,"blend",(function(t,e){return e?t.enable(3042):t.disable(3042)})),B()(co,"blendColor",(function(t,e){return t.blendColor.apply(t,Lt()(e))})),B()(co,"blendEquation",(function(t,e){e=wo(e)?e:[e,e],t.blendEquationSeparate.apply(t,Lt()(e))})),B()(co,"blendFunc",(function(t,e){e=wo(e)&&2===e.length?[].concat(Lt()(e),Lt()(e)):e,t.blendFuncSeparate.apply(t,Lt()(e))})),B()(co,"clearColor",(function(t,e){return t.clearColor.apply(t,Lt()(e))})),B()(co,"clearDepth",(function(t,e){return t.clearDepth(e)})),B()(co,"clearStencil",(function(t,e){return t.clearStencil(e)})),B()(co,"colorMask",(function(t,e){return t.colorMask.apply(t,Lt()(e))})),B()(co,"cull",(function(t,e){return e?t.enable(2884):t.disable(2884)})),B()(co,"cullFace",(function(t,e){return t.cullFace(e)})),B()(co,"depthTest",(function(t,e){return e?t.enable(2929):t.disable(2929)})),B()(co,"depthFunc",(function(t,e){return t.depthFunc(e)})),B()(co,"depthMask",(function(t,e){return t.depthMask(e)})),B()(co,"depthRange",(function(t,e){return t.depthRange.apply(t,Lt()(e))})),B()(co,"dither",(function(t,e){return e?t.enable(3024):t.disable(3024)})),B()(co,"derivativeHint",(function(t,e){t.hint(35723,e)})),B()(co,"frontFace",(function(t,e){return t.frontFace(e)})),B()(co,"mipmapHint",(function(t,e){return t.hint(33170,e)})),B()(co,"lineWidth",(function(t,e){return t.lineWidth(e)})),B()(co,"polygonOffsetFill",(function(t,e){return e?t.enable(32823):t.disable(32823)})),B()(co,"polygonOffset",(function(t,e){return t.polygonOffset.apply(t,Lt()(e))})),B()(co,"sampleCoverage",(function(t,e){return t.sampleCoverage.apply(t,Lt()(e))})),B()(co,"scissorTest",(function(t,e){return e?t.enable(3089):t.disable(3089)})),B()(co,"scissor",(function(t,e){return t.scissor.apply(t,Lt()(e))})),B()(co,"stencilTest",(function(t,e){return e?t.enable(2960):t.disable(2960)})),B()(co,"stencilMask",(function(t,e){var r=e=wo(e)?e:[e,e],n=R()(r,2),i=n[0],o=n[1];t.stencilMaskSeparate(1028,i),t.stencilMaskSeparate(1029,o)})),B()(co,"stencilFunc",(function(t,e){var r=e=wo(e)&&3===e.length?[].concat(Lt()(e),Lt()(e)):e,n=R()(r,6),i=n[0],o=n[1],a=n[2],s=n[3],u=n[4],c=n[5];t.stencilFuncSeparate(1028,i,o,a),t.stencilFuncSeparate(1029,s,u,c)})),B()(co,"stencilOp",(function(t,e){var r=e=wo(e)&&3===e.length?[].concat(Lt()(e),Lt()(e)):e,n=R()(r,6),i=n[0],o=n[1],a=n[2],s=n[3],u=n[4],c=n[5];t.stencilOpSeparate(1028,i,o,a),t.stencilOpSeparate(1029,s,u,c)})),B()(co,"viewport",(function(t,e){return t.viewport.apply(t,Lt()(e))})),co);function _o(t,e,r){return void 0!==e[t]?e[t]:r[t]}var xo={blendEquation:function(t,e,r){return t.blendEquationSeparate(_o(32777,e,r),_o(34877,e,r))},blendFunc:function(t,e,r){return t.blendFuncSeparate(_o(32969,e,r),_o(32968,e,r),_o(32971,e,r),_o(32970,e,r))},polygonOffset:function(t,e,r){return t.polygonOffset(_o(32824,e,r),_o(10752,e,r))},sampleCoverage:function(t,e,r){return t.sampleCoverage(_o(32938,e,r),_o(32939,e,r))},stencilFuncFront:function(t,e,r){return t.stencilFuncSeparate(1028,_o(2962,e,r),_o(2967,e,r),_o(2963,e,r))},stencilFuncBack:function(t,e,r){return t.stencilFuncSeparate(1029,_o(34816,e,r),_o(36003,e,r),_o(36004,e,r))},stencilOpFront:function(t,e,r){return t.stencilOpSeparate(1028,_o(2964,e,r),_o(2965,e,r),_o(2966,e,r))},stencilOpBack:function(t,e,r){return t.stencilOpSeparate(1029,_o(34817,e,r),_o(34818,e,r),_o(34819,e,r))}},Co={enable:function(t,e){return t(B()({},e,!0))},disable:function(t,e){return t(B()({},e,!1))},pixelStorei:function(t,e,r){return t(B()({},e,r))},hint:function(t,e,r){return t(B()({},e,r))},bindFramebuffer:function(t,e,r){var n;switch(e){case 36160:return t((n={},B()(n,36006,r),B()(n,36010,r),n));case 36009:return t(B()({},36006,r));case 36008:return t(B()({},36010,r));default:return null}},blendColor:function(t,e,r,n,i){return t(B()({},32773,new Float32Array([e,r,n,i])))},blendEquation:function(t,e){var r;return t((r={},B()(r,32777,e),B()(r,34877,e),r))},blendEquationSeparate:function(t,e,r){var n;return t((n={},B()(n,32777,e),B()(n,34877,r),n))},blendFunc:function(t,e,r){var n;return t((n={},B()(n,32969,e),B()(n,32968,r),B()(n,32971,e),B()(n,32970,r),n))},blendFuncSeparate:function(t,e,r,n,i){var o;return t((o={},B()(o,32969,e),B()(o,32968,r),B()(o,32971,n),B()(o,32970,i),o))},clearColor:function(t,e,r,n,i){return t(B()({},3106,new Float32Array([e,r,n,i])))},clearDepth:function(t,e){return t(B()({},2931,e))},clearStencil:function(t,e){return t(B()({},2961,e))},colorMask:function(t,e,r,n,i){return t(B()({},3107,[e,r,n,i]))},cullFace:function(t,e){return t(B()({},2885,e))},depthFunc:function(t,e){return t(B()({},2932,e))},depthRange:function(t,e,r){return t(B()({},2928,new Float32Array([e,r])))},depthMask:function(t,e){return t(B()({},2930,e))},frontFace:function(t,e){return t(B()({},2886,e))},lineWidth:function(t,e){return t(B()({},2849,e))},polygonOffset:function(t,e,r){var n;return t((n={},B()(n,32824,e),B()(n,10752,r),n))},sampleCoverage:function(t,e,r){var n;return t((n={},B()(n,32938,e),B()(n,32939,r),n))},scissor:function(t,e,r,n,i){return t(B()({},3088,new Int32Array([e,r,n,i])))},stencilMask:function(t,e){var r;return t((r={},B()(r,2968,e),B()(r,36005,e),r))},stencilMaskSeparate:function(t,e,r){return t(B()({},1028===e?2968:36005,r))},stencilFunc:function(t,e,r,n){var i;return t((i={},B()(i,2962,e),B()(i,2967,r),B()(i,2963,n),B()(i,34816,e),B()(i,36003,r),B()(i,36004,n),i))},stencilFuncSeparate:function(t,e,r,n,i){var o;return t((o={},B()(o,1028===e?2962:34816,r),B()(o,1028===e?2967:36003,n),B()(o,1028===e?2963:36004,i),o))},stencilOp:function(t,e,r,n){var i;return t((i={},B()(i,2964,e),B()(i,2965,r),B()(i,2966,n),B()(i,34817,e),B()(i,34818,r),B()(i,34819,n),i))},stencilOpSeparate:function(t,e,r,n,i){var o;return t((o={},B()(o,1028===e?2964:34817,r),B()(o,1028===e?2965:34818,n),B()(o,1028===e?2966:34819,i),o))},viewport:function(t,e,r,n,i){return t(B()({},2978,[e,r,n,i]))}},ko=function(t,e){return t.isEnabled(e)},Eo=(lo={},B()(lo,3042,ko),B()(lo,2884,ko),B()(lo,2929,ko),B()(lo,3024,ko),B()(lo,32823,ko),B()(lo,32926,ko),B()(lo,32928,ko),B()(lo,3089,ko),B()(lo,2960,ko),B()(lo,35977,ko),lo);function Oo(t){for(var e in t)return!1;return!0}function To(t,e){if(t===e)return!0;var r=Array.isArray(t)||ArrayBuffer.isView(t),n=Array.isArray(e)||ArrayBuffer.isView(e);if(r&&n&&t.length===e.length){for(var i=0;i<t.length;++i)if(t[i]!==e[i])return!1;return!0}return!1}function So(t,e){var r=t[e].bind(t);t[e]=function(){var e=arguments.length<=0?void 0:arguments[0];return e in t.state.cache&&t.state.enable?t.state.cache[e]:r.apply(void 0,arguments)},Object.defineProperty(t[e],"name",{value:"".concat(e,"-from-cache"),configurable:!1})}function Mo(t,e,r){var n=t[e].bind(t);t[e]=function(){for(var e=arguments.length,i=new Array(e),o=0;o<e;o++)i[o]=arguments[o];var a=r.apply(void 0,[t.state._updateCache].concat(i)),s=a.valueChanged,u=a.oldValue;return s&&n.apply(void 0,i),u},Object.defineProperty(t[e],"name",{value:"".concat(e,"-to-cache"),configurable:!1})}function Io(t){var e=t.useProgram.bind(t);t.useProgram=function(r){t.state.program!==r&&(e(r),t.state.program=r)}}var Ro=function(){function t(e){p()(this,t);var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=r.copyState,i=void 0!==n&&n,o=r.log,a=void 0===o?function(){}:o;this.gl=e,this.program=null,this.stateStack=[],this.enable=!0,this.cache=i?Go(e):Object.assign({},go),this.log=a,this._updateCache=this._updateCache.bind(this),Object.seal(this)}return E()(t,[{key:"push",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.stateStack.push({})}},{key:"pop",value:function(){Qi(this.stateStack.length>0);var t=this.stateStack[this.stateStack.length-1];jo(this.gl,t),this.stateStack.pop()}},{key:"_updateCache",value:function(t){var e,r=!1,n=this.stateStack.length>0&&this.stateStack[this.stateStack.length-1];for(var i in t){Qi(void 0!==i);var o=t[i],a=this.cache[i];To(o,a)||(r=!0,e=a,!n||i in n||(n[i]=a),this.cache[i]=o)}return{valueChanged:r,oldValue:e}}}]),t}();function Po(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.enable,n=void 0===r||r,i=e.copyState;if(Qi(void 0!==i),!t.state){var o=globalThis.polyfillContext;for(var a in o&&o(t),t.state=new Ro(t,{copyState:i}),Io(t),Co){var s=Co[a];Mo(t,a,s)}So(t,"getParameter"),So(t,"isEnabled")}return t.state.enable=n,t}function Fo(t){Qi(t.state),t.state.pop()}function Do(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return Lo(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Lo(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function Lo(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function jo(t,e){if(Qi(Xi(t),"setParameters requires a WebGL context"),!Oo(e)){var r={};for(var n in e){var i=Number(n),o=Bo[n];o&&("string"==typeof o?r[o]=!0:o(t,e[n],i))}var a=t.state&&t.state.cache;if(a)for(var s in r){(0,xo[s])(t,e,a)}}}function Go(t,e){if("number"==typeof(e=e||go)){var r=e,n=Eo[r];return n?n(t,r):t.getParameter(r)}var i,o={},a=Do(Array.isArray(e)?e:Object.keys(e));try{for(a.s();!(i=a.n()).done;){var s=i.value,u=Eo[s];o[s]=u?u(t,Number(s)):t.getParameter(Number(s))}}catch(t){a.e(t)}finally{a.f()}return o}function No(t,e,r){if(Oo(e))return r(t);var n,i=e.nocatch,o=void 0===i||i;if(function(t){t.state||Po(t,{copyState:!1}),t.state.push()}(t),jo(t,e),o)n=r(t),Fo(t);else try{n=r(t)}finally{Fo(t)}return n}var Uo=Ci();var Ho=function(){function t(){p()(this,t),this.stats=new Map}return E()(t,[{key:"get",value:function(t){return this.stats.has(t)||this.stats.set(t,new Fn({id:t})),this.stats.get(t)}}]),t}(),Vo=new Ho;if(globalThis.luma&&"8.5.16"!==globalThis.luma.VERSION)throw new Error("luma.gl - multiple VERSIONs detected: ".concat(globalThis.luma.VERSION," vs ").concat("8.5.16"));globalThis.luma||(Ci()&&Wi.log(1,"luma.gl ".concat("8.5.16"," - ").concat("set luma.log.level=1 (or higher) to trace rendering"))(),globalThis.luma=globalThis.luma||{VERSION:"8.5.16",version:"8.5.16",log:Wi,stats:Vo,globals:{modules:{},nodeIO:{}}});globalThis.luma;function Jo(t,e){if(!t)throw new Error(e||"luma.gl: assertion failed.")}function zo(t,e){if("string"!=typeof e)return e;var r=Number(e);if(!isNaN(r))return r;var n=t[e=e.replace(/^.*\./,"")];return Jo(void 0!==n,"Accessing undefined constant GL.".concat(e)),n}function Ko(t,e){for(var r in e=Number(e),t)if(t[r]===e)return"GL.".concat(r);return String(e)}var qo={};function Wo(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"id";qo[t]=qo[t]||1;var e=qo[t]++;return"".concat(t,"-").concat(e)}function Qo(t){return Jo("number"==typeof t,"Input must be a number"),t&&0==(t&t-1)}function Xo(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return Yo(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Yo(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function Yo(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var Zo="Resource subclass must define virtual methods",$o=function(t){function e(t){p()(this,e);var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Zi(t);var n=r.id,i=r.userData,o=void 0===i?{}:i;this.gl=t,this.gl2=t,this.id=n||Wo(this[Symbol.toStringTag]),this.userData=o,this._bound=!1,this._handle=r.handle,void 0===this._handle&&(this._handle=this._createHandle()),this.byteLength=0,this._initStats(),this._addStats()}return E()(e,[{key:t,get:function(){return"Resource"}},{key:"toString",value:function(){return"".concat(this[Symbol.toStringTag]||this.constructor.name,"(").concat(this.id,")")}},{key:"handle",get:function(){return this._handle}},{key:"delete",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.deleteChildren,r=void 0!==e&&e,n=this._handle&&this._deleteHandle(this._handle);return this._handle&&this._removeStats(),this._handle=null,n&&r&&n.filter(Boolean).forEach((function(t){return t.delete()})),this}},{key:"bind",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.handle;return"function"!=typeof e?(this._bindHandle(e),this):(this._bound?t=e():(this._bindHandle(this.handle),this._bound=!0,t=e(),this._bound=!1,this._bindHandle(null)),t)}},{key:"unbind",value:function(){this.bind(null)}},{key:"getParameter",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Jo(t=zo(this.gl,t));var r=this.constructor.PARAMETERS||{},n=r[t];if(n){var i=Yi(this.gl),o=(!("webgl2"in n)||i)&&(!("extension"in n)||this.gl.getExtension(n.extension));if(!o){var a=n.webgl1,s="webgl2"in n?n.webgl2:n.webgl1,u=i?s:a;return u}}return this._getParameter(t,e)}},{key:"getParameters",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=e.parameters,n=e.keys,i=this.constructor.PARAMETERS||{},o=Yi(this.gl),a={},s=r||Object.keys(i),u=Xo(s);try{for(u.s();!(t=u.n()).done;){var c=t.value,l=i[c],f=l&&(!("webgl2"in l)||o)&&(!("extension"in l)||this.gl.getExtension(l.extension));if(f){var h=n?Ko(this.gl,c):c;a[h]=this.getParameter(c,e),n&&"GLenum"===l.type&&(a[h]=Ko(this.gl,a[h]))}}}catch(t){u.e(t)}finally{u.f()}return a}},{key:"setParameter",value:function(t,e){Jo(t=zo(this.gl,t));var r=(this.constructor.PARAMETERS||{})[t];if(r){var n=Yi(this.gl);if(!((!("webgl2"in r)||n)&&(!("extension"in r)||this.gl.getExtension(r.extension))))throw new Error("Parameter not available on this platform");"GLenum"===r.type&&(e=zo(e))}return this._setParameter(t,e),this}},{key:"setParameters",value:function(t){for(var e in t)this.setParameter(e,t[e]);return this}},{key:"stubRemovedMethods",value:function(t,e,r){return function(t,e,r,n){var i="See luma.gl ".concat(r," Upgrade Guide at https://luma.gl/docs/upgrade-guide"),o=Object.getPrototypeOf(t);n.forEach((function(t){o.methodName||(o[t]=function(){throw Wi.removed("Calling removed method ".concat(e,".").concat(t,": "),i)(),new Error(t)})}))}(this,t,e,r)}},{key:"initialize",value:function(t){}},{key:"_createHandle",value:function(){throw new Error(Zo)}},{key:"_deleteHandle",value:function(){throw new Error(Zo)}},{key:"_bindHandle",value:function(t){throw new Error(Zo)}},{key:"_getOptsFromHandle",value:function(){throw new Error(Zo)}},{key:"_getParameter",value:function(t,e){throw new Error(Zo)}},{key:"_setParameter",value:function(t,e){throw new Error(Zo)}},{key:"_context",value:function(){return this.gl.luma=this.gl.luma||{},this.gl.luma}},{key:"_initStats",value:function(){this.gl.stats=this.gl.stats||new Ho}},{key:"_addStats",value:function(){var t=this[Symbol.toStringTag],e=Vo.get("Resource Counts");e.get("Resources Created").incrementCount(),e.get("".concat(t,"s Created")).incrementCount(),e.get("".concat(t,"s Active")).incrementCount()}},{key:"_removeStats",value:function(){var t=this[Symbol.toStringTag];Vo.get("Resource Counts").get("".concat(t,"s Active")).decrementCount()}},{key:"_trackAllocatedMemory",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this[Symbol.toStringTag];this._doTrackAllocatedMemory(t,e),this._doTrackAllocatedMemory(t,e,this.gl.stats.get("Memory Usage"))}},{key:"_doTrackAllocatedMemory",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this[Symbol.toStringTag],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Vo.get("Memory Usage");r.get("GPU Memory").addCount(t),r.get("".concat(e," Memory")).addCount(t),this.byteLength=t}},{key:"_trackDeallocatedMemory",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this[Symbol.toStringTag];this._doTrackDeallocatedMemory(t),this._doTrackDeallocatedMemory(t,this.gl.stats.get("Memory Usage"))}},{key:"_doTrackDeallocatedMemory",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this[Symbol.toStringTag],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Vo.get("Memory Usage");e.get("GPU Memory").subtractCount(this.byteLength),e.get("".concat(t," Memory")).subtractCount(this.byteLength),this.byteLength=0}}]),e}(Symbol.toStringTag),ta=r(74),ea=r.n(ta);function ra(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("Failed to deduce GL constant from typed array")}}function na(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.clamped,n=void 0===r||r;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")}}function ia(t){var e=t.data,r=t.width,n=t.height,i=t.bytesPerPixel,o=void 0===i?4:i,a=t.temp,s=r*o;a=a||new Uint8Array(s);for(var u=0;u<n/2;++u){var c=u*s,l=(n-u-1)*s;a.set(e.subarray(c,c+s)),e.copyWithin(c,l,l+s),e.set(a,l)}}function oa(t){for(var e=t.data,r=t.width,n=t.height,i=Math.round(r/2),o=Math.round(n/2),a=new Uint8Array(i*o*4),s=0;s<o;s++)for(var u=0;u<i;u++)for(var c=0;c<4;c++)a[4*(s*i+u)+c]=e[4*(2*s*r+2*u)+c];return{data:a,width:i,height:o}}function aa(t,e,r){var n=r.removedProps,i=void 0===n?{}:n,o=r.deprecatedProps,a=void 0===o?{}:o,s=r.replacedProps,u=void 0===s?{}:s;for(var c in i)if(c in e){var l=i[c]?"".concat(t,".").concat(i[c]):"N/A";Wi.removed("".concat(t,".").concat(c),l)()}for(var f in a)if(f in e){var h=a[f];Wi.deprecated("".concat(t,".").concat(f),"".concat(t,".").concat(h))()}var d=null;for(var p in u)if(p in e){var v=u[p];Wi.deprecated("".concat(t,".").concat(p),"".concat(t,".").concat(v))(),(d=d||Object.assign({},e))[v]=e[p],delete d[p]}return d||e}var sa={offset:0,stride:0,type:5126,size:1,divisor:0,normalized:!1,integer:!1},ua={deprecatedProps:{instanced:"divisor",isInstanced:"divisor"}},ca=function(){function t(){var e=this;p()(this,t);for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];n.forEach((function(t){return e._assign(t)})),Object.freeze(this)}return E()(t,[{key:"toString",value:function(){return JSON.stringify(this)}},{key:"BYTES_PER_ELEMENT",get:function(){return t.getBytesPerElement(this)}},{key:"BYTES_PER_VERTEX",get:function(){return t.getBytesPerVertex(this)}},{key:"_assign",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return void 0!==(t=aa("Accessor",t,ua)).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.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),this}}],[{key:"getBytesPerElement",value:function(t){return na(t.type||5126).BYTES_PER_ELEMENT}},{key:"getBytesPerVertex",value:function(t){return Jo(t.size),na(t.type||5126).BYTES_PER_ELEMENT*t.size}},{key:"resolve",value:function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return ea()(t,[sa].concat(r))}}]),t}();function la(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=A()(t);if(e){var i=A()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return m()(this,r)}}var fa,ha,da,pa={offset:"accessor.offset",stride:"accessor.stride",type:"accessor.type",size:"accessor.size",divisor:"accessor.divisor",normalized:"accessor.normalized",integer:"accessor.integer",instanced:"accessor.divisor",isInstanced:"accessor.divisor"},va={removedProps:{},replacedProps:{bytes:"byteLength"},deprecatedProps:pa},ya={removedProps:pa},ga=function(t,e){y()(n,t);var r=la(n);function n(t){var e;p()(this,n);var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(e=r.call(this,t,i)).stubRemovedMethods("Buffer","v6.0",["layout","setLayout","getIndexedParameter"]),e.target=i.target||(e.gl.webgl2?36662:34962),e.initialize(i),Object.seal(ai()(e)),e}return E()(n,[{key:e,get:function(){return"Buffer"}},{key:"getElementCount",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.accessor;return Math.round(this.byteLength/ca.getBytesPerElement(t))}},{key:"getVertexCount",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.accessor;return Math.round(this.byteLength/ca.getBytesPerVertex(t))}},{key:"initialize",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return ArrayBuffer.isView(t)&&(t={data:t}),Number.isFinite(t)&&(t={byteLength:t}),t=aa("Buffer",t,va),this.usage=t.usage||35044,this.debugData=null,this.setAccessor(Object.assign({},t,t.accessor)),t.data?this._setData(t.data,t.offset,t.byteLength):this._setByteLength(t.byteLength||0),this}},{key:"setProps",value:function(t){return"accessor"in(t=aa("Buffer",t,ya))&&this.setAccessor(t.accessor),this}},{key:"setAccessor",value:function(t){return delete(t=Object.assign({},t)).buffer,this.accessor=new ca(t),this}},{key:"reallocate",value:function(t){return t>this.byteLength?(this._setByteLength(t),!0):(this.bytesUsed=t,!1)}},{key:"setData",value:function(t){return this.initialize(t)}},{key:"subData",value:function(t){ArrayBuffer.isView(t)&&(t={data:t});var e=t,r=e.data,n=e.offset,i=void 0===n?0:n,o=e.srcOffset,a=void 0===o?0:o,s=t.byteLength||t.length;Jo(r);var u=this.gl.webgl2?36663:this.target;return this.gl.bindBuffer(u,this.handle),0!==a||void 0!==s?($i(this.gl),this.gl.bufferSubData(this.target,i,r,a,s)):this.gl.bufferSubData(u,i,r),this.gl.bindBuffer(u,null),this.debugData=null,this._inferType(r),this}},{key:"copyData",value:function(t){var e=t.sourceBuffer,r=t.readOffset,n=void 0===r?0:r,i=t.writeOffset,o=void 0===i?0:i,a=t.size,s=this.gl;return $i(s),s.bindBuffer(36662,e.handle),s.bindBuffer(36663,this.handle),s.copyBufferSubData(36662,36663,n,o,a),s.bindBuffer(36662,null),s.bindBuffer(36663,null),this.debugData=null,this}},{key:"getData",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.dstData,r=void 0===e?null:e,n=t.srcByteOffset,i=void 0===n?0:n,o=t.dstOffset,a=void 0===o?0:o,s=t.length,u=void 0===s?0:s;$i(this.gl);var c,l,f=na(this.accessor.type||5126,{clamped:!1}),h=this._getAvailableElementCount(i),d=a;r?c=(l=r.length)-d:l=d+(c=Math.min(h,u||h));var p=Math.min(h,c);return Jo((u=u||p)<=p),r=r||new f(l),this.gl.bindBuffer(36662,this.handle),this.gl.getBufferSubData(36662,i,r,a,u),this.gl.bindBuffer(36662,null),r}},{key:"bind",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.target,r=void 0===e?this.target:e,n=t.index,i=void 0===n?this.accessor&&this.accessor.index:n,o=t.offset,a=void 0===o?0:o,s=t.size;return 35345===r||35982===r?void 0!==s?this.gl.bindBufferRange(r,i,this.handle,a,s):(Jo(0===a),this.gl.bindBufferBase(r,i,this.handle)):this.gl.bindBuffer(r,this.handle),this}},{key:"unbind",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.target,r=void 0===e?this.target:e,n=t.index,i=void 0===n?this.accessor&&this.accessor.index:n,o=35345===r||35982===r;return o?this.gl.bindBufferBase(r,i,null):this.gl.bindBuffer(r,null),this}},{key:"getDebugData",value:function(){return this.debugData?{data:this.debugData,changed:!1}:(this.debugData=this.getData({length:Math.min(10,this.byteLength)}),{data:this.debugData,changed:!0})}},{key:"invalidateDebugData",value:function(){this.debugData=null}},{key:"_setData",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.byteLength+e;Jo(ArrayBuffer.isView(t)),this._trackDeallocatedMemory();var n=this._getTarget();this.gl.bindBuffer(n,this.handle),this.gl.bufferData(n,r,this.usage),this.gl.bufferSubData(n,e,t),this.gl.bindBuffer(n,null),this.debugData=t.slice(0,10),this.bytesUsed=r,this._trackAllocatedMemory(r);var i=ra(t);return Jo(i),this.setAccessor(new ca(this.accessor,{type:i})),this}},{key:"_setByteLength",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.usage;Jo(t>=0),this._trackDeallocatedMemory();var r=t;0===t&&(r=new Float32Array(0));var n=this._getTarget();return this.gl.bindBuffer(n,this.handle),this.gl.bufferData(n,r,e),this.gl.bindBuffer(n,null),this.usage=e,this.debugData=null,this.bytesUsed=t,this._trackAllocatedMemory(t),this}},{key:"_getTarget",value:function(){return this.gl.webgl2?36663:this.target}},{key:"_getAvailableElementCount",value:function(t){var e=t/na(this.accessor.type||5126,{clamped:!1}).BYTES_PER_ELEMENT;return this.getElementCount()-e}},{key:"_inferType",value:function(t){this.accessor.type||this.setAccessor(new ca(this.accessor,{type:ra(t)}))}},{key:"_createHandle",value:function(){return this.gl.createBuffer()}},{key:"_deleteHandle",value:function(){this.gl.deleteBuffer(this.handle),this._trackDeallocatedMemory()}},{key:"_getParameter",value:function(t){this.gl.bindBuffer(this.target,this.handle);var e=this.gl.getBufferParameter(this.target,t);return this.gl.bindBuffer(this.target,null),e}},{key:"type",get:function(){return Wi.deprecated("Buffer.type","Buffer.accessor.type")(),this.accessor.type}},{key:"bytes",get:function(){return Wi.deprecated("Buffer.bytes","Buffer.byteLength")(),this.byteLength}},{key:"setByteLength",value:function(t){return Wi.deprecated("setByteLength","reallocate")(),this.reallocate(t)}},{key:"updateAccessor",value:function(t){return Wi.deprecated("updateAccessor(...)","setAccessor(new Accessor(buffer.accessor, ...)")(),this.accessor=new ca(this.accessor,t),this}}]),n}($o,Symbol.toStringTag),ma=(fa={},B()(fa,6407,{dataFormat:6407,types:[5121,33635]}),B()(fa,6408,{dataFormat:6408,types:[5121,32819,32820]}),B()(fa,6406,{dataFormat:6406,types:[5121]}),B()(fa,6409,{dataFormat:6409,types:[5121]}),B()(fa,6410,{dataFormat:6410,types:[5121]}),B()(fa,33326,{dataFormat:6403,types:[5126],gl2:!0}),B()(fa,33328,{dataFormat:33319,types:[5126],gl2:!0}),B()(fa,34837,{dataFormat:6407,types:[5126],gl2:!0}),B()(fa,34836,{dataFormat:6408,types:[5126],gl2:!0}),fa),ba=(ha={},B()(ha,6403,1),B()(ha,36244,1),B()(ha,33319,2),B()(ha,33320,2),B()(ha,6407,3),B()(ha,36248,3),B()(ha,6408,4),B()(ha,36249,4),B()(ha,6402,1),B()(ha,34041,1),B()(ha,6406,1),B()(ha,6409,1),B()(ha,6410,2),ha),Aa=(da={},B()(da,5126,4),B()(da,5125,4),B()(da,5124,4),B()(da,5123,2),B()(da,5122,2),B()(da,5131,2),B()(da,5120,1),B()(da,5121,1),da);function wa(t,e){var r=ma[e];if(!r)return!1;if(void 0===r.gl1&&void 0===r.gl2)return!0;var n=Yi(t)&&r.gl2||r.gl1;return"string"==typeof n?t.getExtension(n):n}function Ba(t,e){var r=ma[e];switch(r&&r.types[0]){case 5126:return t.getExtension("OES_texture_float_linear");case 5131:return t.getExtension("OES_texture_half_float_linear");default:return!0}}function _a(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return xa(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return xa(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function xa(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Ca(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=A()(t);if(e){var i=A()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return m()(this,r)}}var ka=[9729,9728],Ea=globalThis.WebGLBuffer||function(){},Oa=function(t,e){y()(n,t);var r=Ca(n);function n(t,e){var i;p()(this,n);var o=e.id,a=void 0===o?Wo("texture"):o,s=e.handle,u=e.target;return(i=r.call(this,t,{id:a,handle:s})).target=u,i.textureUnit=void 0,i.loaded=!1,i.width=void 0,i.height=void 0,i.depth=void 0,i.format=void 0,i.type=void 0,i.dataFormat=void 0,i.border=void 0,i.textureUnit=void 0,i.mipmaps=void 0,i}return E()(n,[{key:e,get:function(){return"Texture"}},{key:"toString",value:function(){return"Texture(".concat(this.id,",").concat(this.width,"x").concat(this.height,")")}},{key:"initialize",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=e.data;if(r instanceof Promise)return r.then((function(r){return t.initialize(Object.assign({},e,{pixels:r,data:r}))})),this;var n="undefined"!=typeof HTMLVideoElement&&r instanceof HTMLVideoElement;if(n&&r.readyState<HTMLVideoElement.HAVE_METADATA)return this._video=null,r.addEventListener("loadeddata",(function(){return t.initialize(e)})),this;var i=e.pixels,o=void 0===i?null:i,a=e.format,s=void 0===a?6408:a,u=e.border,c=void 0===u?0:u,l=e.recreate,f=void 0!==l&&l,h=e.parameters,d=void 0===h?{}:h,p=e.pixelStore,v=void 0===p?{}:p,y=e.textureUnit,g=void 0===y?void 0:y;r||(r=o);var m=e.width,b=e.height,A=e.dataFormat,w=e.type,B=e.compressed,_=void 0!==B&&B,x=e.mipmaps,C=void 0===x||x,k=e.depth,E=void 0===k?0:k,O=this._deduceParameters({format:s,type:w,dataFormat:A,compressed:_,data:r,width:m,height:b});return m=O.width,b=O.height,_=O.compressed,A=O.dataFormat,w=O.type,this.width=m,this.height=b,this.depth=E,this.format=s,this.type=w,this.dataFormat=A,this.border=c,this.textureUnit=g,Number.isFinite(this.textureUnit)&&(this.gl.activeTexture(33984+this.textureUnit),this.gl.bindTexture(this.target,this.handle)),C&&this._isNPOT()&&(Wi.warn("texture: ".concat(this," is Non-Power-Of-Two, disabling mipmaping"))(),C=!1,this._updateForNPOT(d)),this.mipmaps=C,this.setImageData({data:r,width:m,height:b,depth:E,format:s,type:w,dataFormat:A,border:c,mipmaps:C,parameters:v,compressed:_}),C&&this.generateMipmap(),this.setParameters(d),f&&(this.data=r),n&&(this._video={video:r,parameters:d,lastTime:r.readyState>=HTMLVideoElement.HAVE_CURRENT_DATA?r.currentTime:-1}),this}},{key:"update",value:function(){if(this._video){var t=this._video,e=t.video,r=t.parameters;if(t.lastTime===e.currentTime||e.readyState<HTMLVideoElement.HAVE_CURRENT_DATA)return;this.setSubImageData({data:e,parameters:r}),this.mipmaps&&this.generateMipmap(),this._video.lastTime=e.currentTime}}},{key:"resize",value:function(t){var e=t.height,r=t.width,n=t.mipmaps,i=void 0!==n&&n;return r!==this.width||e!==this.height?this.initialize({width:r,height:e,format:this.format,type:this.type,dataFormat:this.dataFormat,border:this.border,mipmaps:i}):this}},{key:"generateMipmap",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._isNPOT()?(Wi.warn("texture: ".concat(this," is Non-Power-Of-Two, disabling mipmaping"))(),this):(this.mipmaps=!0,this.gl.bindTexture(this.target,this.handle),No(this.gl,e,(function(){t.gl.generateMipmap(t.target)})),this.gl.bindTexture(this.target,null),this)}},{key:"setImageData",value:function(t){this._trackDeallocatedMemory("Texture");var e=t.target,r=void 0===e?this.target:e,n=t.pixels,i=void 0===n?null:n,o=t.level,a=void 0===o?0:o,s=t.format,u=void 0===s?this.format:s,c=t.border,l=void 0===c?this.border:c,f=t.offset,h=void 0===f?0:f,d=t.parameters,p=void 0===d?{}:d,v=t.data,y=void 0===v?null:v,g=t.type,m=void 0===g?this.type:g,b=t.width,A=void 0===b?this.width:b,w=t.height,B=void 0===w?this.height:w,_=t.dataFormat,x=void 0===_?this.dataFormat:_,C=t.compressed,k=void 0!==C&&C;y||(y=i);var E=this._deduceParameters({format:u,type:m,dataFormat:x,compressed:k,data:y,width:A,height:B});m=E.type,x=E.dataFormat,k=E.compressed,A=E.width,B=E.height;var O=this.gl;O.bindTexture(this.target,this.handle);var T,S,M=this._getDataType({data:y,compressed:k});y=M.data,T=M.dataType;var I=0;if(No(this.gl,p,(function(){switch(T){case"null":O.texImage2D(r,a,u,A,B,l,x,m,y);break;case"typed-array":O.texImage2D(r,a,u,A,B,l,x,m,y,h);break;case"buffer":(S=$i(O)).bindBuffer(35052,y.handle||y),S.texImage2D(r,a,u,A,B,l,x,m,h),S.bindBuffer(35052,null);break;case"browser-object":Yi(O)?O.texImage2D(r,a,u,A,B,l,x,m,y):O.texImage2D(r,a,u,x,m,y);break;case"compressed":var t,e=_a(y.entries());try{for(e.s();!(t=e.n()).done;){var n=R()(t.value,2),i=n[0],o=n[1];O.compressedTexImage2D(r,i,o.format,o.width,o.height,l,o.data),I+=o.levelSize}}catch(t){e.e(t)}finally{e.f()}break;default:Jo(!1,"Unknown image data type")}})),"compressed"===T)this._trackAllocatedMemory(I,"Texture");else if(y&&y.byteLength)this._trackAllocatedMemory(y.byteLength,"Texture");else{var P=ba[this.dataFormat]||4,F=Aa[this.type]||1;this._trackAllocatedMemory(this.width*this.height*P*F,"Texture")}return this.loaded=!0,this}},{key:"setSubImageData",value:function(t){var e=this,r=t.target,n=void 0===r?this.target:r,i=t.pixels,o=void 0===i?null:i,a=t.data,s=void 0===a?null:a,u=t.x,c=void 0===u?0:u,l=t.y,f=void 0===l?0:l,h=t.width,d=void 0===h?this.width:h,p=t.height,v=void 0===p?this.height:p,y=t.level,g=void 0===y?0:y,m=t.format,b=void 0===m?this.format:m,A=t.type,w=void 0===A?this.type:A,B=t.dataFormat,_=void 0===B?this.dataFormat:B,x=t.compressed,C=void 0!==x&&x,k=t.offset,E=void 0===k?0:k,O=t.border,T=(void 0===O&&this.border,t.parameters),S=void 0===T?{}:T,M=this._deduceParameters({format:b,type:w,dataFormat:_,compressed:C,data:s,width:d,height:v});if(w=M.type,_=M.dataFormat,C=M.compressed,d=M.width,v=M.height,Jo(0===this.depth,"texSubImage not supported for 3D textures"),s||(s=o),s&&s.data){var I=s;s=I.data,d=I.shape[0],v=I.shape[1]}s instanceof ga&&(s=s.handle),this.gl.bindTexture(this.target,this.handle),No(this.gl,S,(function(){if(C)e.gl.compressedTexSubImage2D(n,g,c,f,d,v,b,s);else if(null===s)e.gl.texSubImage2D(n,g,c,f,d,v,_,w,null);else if(ArrayBuffer.isView(s))e.gl.texSubImage2D(n,g,c,f,d,v,_,w,s,E);else if(s instanceof Ea){var t=$i(e.gl);t.bindBuffer(35052,s),t.texSubImage2D(n,g,c,f,d,v,_,w,E),t.bindBuffer(35052,null)}else if(Yi(e.gl)){$i(e.gl).texSubImage2D(n,g,c,f,d,v,_,w,s)}else e.gl.texSubImage2D(n,g,c,f,_,w,s)})),this.gl.bindTexture(this.target,null)}},{key:"copyFramebuffer",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return Wi.error("Texture.copyFramebuffer({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null}},{key:"getActiveUnit",value:function(){return this.gl.getParameter(34016)-33984}},{key:"bind",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.textureUnit,e=this.gl;return void 0!==t&&(this.textureUnit=t,e.activeTexture(33984+t)),e.bindTexture(this.target,this.handle),t}},{key:"unbind",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.textureUnit,e=this.gl;return void 0!==t&&(this.textureUnit=t,e.activeTexture(33984+t)),e.bindTexture(this.target,null),t}},{key:"_getDataType",value:function(t){var e=t.data,r=t.compressed;return void 0!==r&&r?{data:e,dataType:"compressed"}:null===e?{data:e,dataType:"null"}:ArrayBuffer.isView(e)?{data:e,dataType:"typed-array"}:e instanceof ga?{data:e.handle,dataType:"buffer"}:e instanceof Ea?{data:e,dataType:"buffer"}:{data:e,dataType:"browser-object"}}},{key:"_deduceParameters",value:function(t){var e=t.format,r=t.data,n=t.width,i=t.height,o=t.dataFormat,a=t.type,s=t.compressed,u=ma[e];o=o||u&&u.dataFormat,a=a||u&&u.types[0],s=s||u&&u.compressed;var c=this._deduceImageSize(r,n,i);return{dataFormat:o,type:a,compressed:s,width:n=c.width,height:i=c.height,format:e,data:r}}},{key:"_deduceImageSize",value:function(t,e,r){var n;return Jo(n="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?{width:t.width,height:t.height}:"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:r}:{width:e>=0?e:1,height:r>=0?r:1},"Could not deduced texture size"),Jo(void 0===e||n.width===e,"Deduced texture width does not match supplied width"),Jo(void 0===r||n.height===r,"Deduced texture height does not match supplied height"),n}},{key:"_createHandle",value:function(){return this.gl.createTexture()}},{key:"_deleteHandle",value:function(){this.gl.deleteTexture(this.handle),this._trackDeallocatedMemory("Texture")}},{key:"_getParameter",value:function(t){switch(t){case 4096:return this.width;case 4097:return this.height;default:this.gl.bindTexture(this.target,this.handle);var e=this.gl.getTexParameter(this.target,t);return this.gl.bindTexture(this.target,null),e}}},{key:"_setParameter",value:function(t,e){switch(this.gl.bindTexture(this.target,this.handle),e=this._getNPOTParam(t,e),t){case 33082:case 33083:this.gl.texParameterf(this.handle,t,e);break;case 4096:case 4097:Jo(!1);break;default:this.gl.texParameteri(this.target,t,e)}return this.gl.bindTexture(this.target,null),this}},{key:"_isNPOT",value:function(){return!Yi(this.gl)&&(!(!this.width||!this.height)&&(!Qo(this.width)||!Qo(this.height)))}},{key:"_updateForNPOT",value:function(t){void 0===t[this.gl.TEXTURE_MIN_FILTER]&&(t[this.gl.TEXTURE_MIN_FILTER]=this.gl.LINEAR),void 0===t[this.gl.TEXTURE_WRAP_S]&&(t[this.gl.TEXTURE_WRAP_S]=this.gl.CLAMP_TO_EDGE),void 0===t[this.gl.TEXTURE_WRAP_T]&&(t[this.gl.TEXTURE_WRAP_T]=this.gl.CLAMP_TO_EDGE)}},{key:"_getNPOTParam",value:function(t,e){if(this._isNPOT())switch(t){case 10241:-1===ka.indexOf(e)&&(e=9729);break;case 10242:case 10243:33071!==e&&(e=33071)}return e}}],[{key:"isSupported",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.format,n=e.linearFiltering,i=!0;return r&&(i=(i=i&&wa(t,r))&&(!n||Ba(t,r))),i}}]),n}($o,Symbol.toStringTag),Ta="";function Sa(t,e){return Jo("string"==typeof t),t=Ta+t,new Promise((function(r,n){try{var i=new Image;i.onload=function(){return r(i)},i.onerror=function(){return n(new Error("Could not load image ".concat(t,".")))},i.crossOrigin=e&&e.crossOrigin||"anonymous",i.src=t}catch(t){n(t)}}))}function Ma(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=A()(t);if(e){var i=A()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return m()(this,r)}}var Ia,Ra=function(t,e){y()(n,t);var r=Ma(n);function n(t){var e;p()(this,n);var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Zi(t),(i instanceof Promise||"string"==typeof i)&&(i={data:i}),"string"==typeof i.data&&(i=Object.assign({},i,{data:Sa(i.data)})),(e=r.call(this,t,Object.assign({},i,{target:3553}))).initialize(i),Object.seal(ai()(e)),e}return E()(n,[{key:e,get:function(){return"Texture2D"}}],[{key:"isSupported",value:function(t,e){return Oa.isSupported(t,e)}}]),n}(Oa,Symbol.toStringTag),Pa="EXT_color_buffer_float",Fa=(Ia={},B()(Ia,33189,{bpp:2}),B()(Ia,33190,{gl2:!0,bpp:3}),B()(Ia,36012,{gl2:!0,bpp:4}),B()(Ia,36168,{bpp:1}),B()(Ia,34041,{bpp:4}),B()(Ia,35056,{gl2:!0,bpp:4}),B()(Ia,36013,{gl2:!0,bpp:5}),B()(Ia,32854,{bpp:2}),B()(Ia,36194,{bpp:2}),B()(Ia,32855,{bpp:2}),B()(Ia,33321,{gl2:!0,bpp:1}),B()(Ia,33330,{gl2:!0,bpp:1}),B()(Ia,33329,{gl2:!0,bpp:1}),B()(Ia,33332,{gl2:!0,bpp:2}),B()(Ia,33331,{gl2:!0,bpp:2}),B()(Ia,33334,{gl2:!0,bpp:4}),B()(Ia,33333,{gl2:!0,bpp:4}),B()(Ia,33323,{gl2:!0,bpp:2}),B()(Ia,33336,{gl2:!0,bpp:2}),B()(Ia,33335,{gl2:!0,bpp:2}),B()(Ia,33338,{gl2:!0,bpp:4}),B()(Ia,33337,{gl2:!0,bpp:4}),B()(Ia,33340,{gl2:!0,bpp:8}),B()(Ia,33339,{gl2:!0,bpp:8}),B()(Ia,32849,{gl2:!0,bpp:3}),B()(Ia,32856,{gl2:!0,bpp:4}),B()(Ia,32857,{gl2:!0,bpp:4}),B()(Ia,36220,{gl2:!0,bpp:4}),B()(Ia,36238,{gl2:!0,bpp:4}),B()(Ia,36975,{gl2:!0,bpp:4}),B()(Ia,36214,{gl2:!0,bpp:8}),B()(Ia,36232,{gl2:!0,bpp:8}),B()(Ia,36226,{gl2:!0,bpp:16}),B()(Ia,36208,{gl2:!0,bpp:16}),B()(Ia,33325,{gl2:Pa,bpp:2}),B()(Ia,33327,{gl2:Pa,bpp:4}),B()(Ia,34842,{gl2:Pa,bpp:8}),B()(Ia,33326,{gl2:Pa,bpp:4}),B()(Ia,33328,{gl2:Pa,bpp:8}),B()(Ia,34836,{gl2:Pa,bpp:16}),B()(Ia,35898,{gl2:Pa,bpp:4}),Ia);function Da(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=A()(t);if(e){var i=A()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return m()(this,r)}}function La(t,e,r){var n=r[e];if(!n)return!1;var i=Yi(t)&&n.gl2||n.gl1;return"string"==typeof i?t.getExtension(i):i}var ja=function(t,e){y()(n,t);var r=Da(n);function n(t){var e;p()(this,n);var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(e=r.call(this,t,i)).initialize(i),Object.seal(ai()(e)),e}return E()(n,[{key:e,get:function(){return"Renderbuffer"}},{key:"initialize",value:function(t){var e=t.format,r=t.width,n=void 0===r?1:r,i=t.height,o=void 0===i?1:i,a=t.samples,s=void 0===a?0:a;return Jo(e,"Needs format"),this._trackDeallocatedMemory(),this.gl.bindRenderbuffer(36161,this.handle),0!==s&&Yi(this.gl)?this.gl.renderbufferStorageMultisample(36161,s,e,n,o):this.gl.renderbufferStorage(36161,e,n,o),this.format=e,this.width=n,this.height=o,this.samples=s,this._trackAllocatedMemory(this.width*this.height*(this.samples||1)*Fa[this.format].bpp),this}},{key:"resize",value:function(t){var e=t.width,r=t.height;return e!==this.width||r!==this.height?this.initialize({width:e,height:r,format:this.format,samples:this.samples}):this}},{key:"_createHandle",value:function(){return this.gl.createRenderbuffer()}},{key:"_deleteHandle",value:function(){this.gl.deleteRenderbuffer(this.handle),this._trackDeallocatedMemory()}},{key:"_bindHandle",value:function(t){this.gl.bindRenderbuffer(36161,t)}},{key:"_syncHandle",value:function(t){this.format=this.getParameter(36164),this.width=this.getParameter(36162),this.height=this.getParameter(36163),this.samples=this.getParameter(36011)}},{key:"_getParameter",value:function(t){return this.gl.bindRenderbuffer(36161,this.handle),this.gl.getRenderbufferParameter(36161,t)}}],[{key:"isSupported",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{format:null},r=e.format;return!r||La(t,r,Fa)}},{key:"getSamplesForFormat",value:function(t,e){var r=e.format;return t.getInternalformatParameter(36161,r,32937)}}]),n}($o,Symbol.toStringTag);function Ga(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.framebuffer,n=void 0===r?null:r,i=e.color,o=void 0===i?null:i,a=e.depth,s=void 0===a?null:a,u=e.stencil,c=void 0===u?null:u,l={};n&&(l.framebuffer=n);var f=0;o&&(f|=16384,!0!==o&&(l.clearColor=o)),s&&(f|=256,!0!==s&&(l.clearDepth=s)),c&&(f|=1024,!0!==s&&(l.clearStencil=s)),Jo(0!==f,"clear: bad arguments"),No(t,l,(function(){t.clear(f)}))}function Na(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.framebuffer,n=void 0===r?null:r,i=e.buffer,o=void 0===i?6144:i,a=e.drawBuffer,s=void 0===a?0:a,u=e.value,c=void 0===u?[0,0,0,0]:u;$i(t),No(t,{framebuffer:n},(function(){switch(o){case 6144:switch(c.constructor){case Int32Array:t.clearBufferiv(o,s,c);break;case Uint32Array:t.clearBufferuiv(o,s,c);break;case Float32Array:default:t.clearBufferfv(o,s,c)}break;case 6145:t.clearBufferfv(6145,0,[c]);break;case 6146:t.clearBufferiv(6146,0,[c]);break;case 34041:var e=R()(c,2),r=e[0],n=e[1];t.clearBufferfi(34041,0,r,n);break;default:Jo(!1,"clear: bad arguments")}}))}function Ua(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 Jo(!1),0}}function Ha(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=A()(t);if(e){var i=A()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return m()(this,r)}}var Va=[34069,34070,34071,34072,34073,34074],Ja=function(t,e){y()(i,t);var r,n=Ha(i);function i(t){var e;p()(this,i);var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Zi(t),(e=n.call(this,t,Object.assign({},r,{target:34067}))).initialize(r),Object.seal(ai()(e)),e}return E()(i,[{key:e,get:function(){return"TextureCube"}},{key:"initialize",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=e.mipmaps,n=void 0===r||r,i=e.parameters,o=void 0===i?{}:i;return this.opts=e,this.setCubeMapImageData(e).then((function(){t.loaded=!0,n&&t.generateMipmap(e),t.setParameters(o)})),this}},{key:"subImage",value:function(t){var e=t.face,r=t.data,n=t.x,i=void 0===n?0:n,o=t.y,a=void 0===o?0:o,s=t.mipmapLevel,u=void 0===s?0:s;return this._subImage({target:e,data:r,x:i,y:a,mipmapLevel:u})}},{key:"setCubeMapImageData",value:(r=It()(Pt.a.mark((function t(e){var r,n,i,o,a,s,u,c,l,f,h,d,p,v=this;return Pt.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.width,n=e.height,i=e.pixels,o=e.data,a=e.border,s=void 0===a?0:a,u=e.format,c=void 0===u?6408:u,l=e.type,f=void 0===l?5121:l,h=this.gl,d=i||o,t.next=5,Promise.all(Va.map((function(t){var e=d[t];return Promise.all(Array.isArray(e)?e:[e])})));case 5:p=t.sent,this.bind(),Va.forEach((function(t,e){p[e].length>1&&!1!==v.opts.mipmaps&&Wi.warn("".concat(v.id," has mipmap and multiple LODs."))(),p[e].forEach((function(e,i){r&&n?h.texImage2D(t,i,c,r,n,s,c,f,e):h.texImage2D(t,i,c,c,f,e)}))})),this.unbind();case 9:case"end":return t.stop()}}),t,this)}))),function(t){return r.apply(this,arguments)})},{key:"setImageDataForFace",value:function(t){var e=this,r=t.face,n=t.width,i=t.height,o=t.pixels,a=t.data,s=t.border,u=void 0===s?0:s,c=t.format,l=void 0===c?6408:c,f=t.type,h=void 0===f?5121:f,d=this.gl,p=o||a;return this.bind(),p instanceof Promise?p.then((function(n){return e.setImageDataForFace(Object.assign({},t,{face:r,data:n,pixels:n}))})):this.width||this.height?d.texImage2D(r,0,l,n,i,u,l,h,p):d.texImage2D(r,0,l,l,h,p),this}}]),i}(Oa,Symbol.toStringTag);function za(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=A()(t);if(e){var i=A()(this).constructor;Reflect.construct(n,arguments,i)}else n.apply(this,arguments);return m()(this,r)}}Ja.FACES=Va;Symbol.toStringTag;function Ka(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.sourceX,n=void 0===r?0:r,i=e.sourceY,o=void 0===i?0:i,a=e.sourceFormat,s=void 0===a?6408:a,u=e.sourceAttachment,c=void 0===u?36064:u,l=e.target,f=void 0===l?null:l,h=e.sourceWidth,d=e.sourceHeight,p=e.sourceType,v=Wa(t),y=v.framebuffer,g=v.deleteFramebuffer;Jo(y);var m=y.gl,b=y.handle,A=y.attachments;h=h||y.width,d=d||y.height,36064===c&&null===b&&(c=1028),Jo(A[c]),f=Qa(f,p=p||A[c].type,s,h,d),p=p||ra(f);var w=m.bindFramebuffer(36160,b);return m.readPixels(n,o,h,d,s,p,f),m.bindFramebuffer(36160,w||null),g&&y.delete(),f}function qa(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.sourceAttachment,n=void 0===r?36064:r,i=e.targetMaxHeight,o=void 0===i?Number.MAX_SAFE_INTEGER:i,a=Ka(t,{sourceAttachment:n}),s=t.width,u=t.height;u>o;){var c=oa({data:a,width:s,height:u});a=c.data,s=c.width,u=c.height}ia({data:a,width:s,height:u});var l=document.createElement("canvas");l.width=s,l.height=u;var f=l.getContext("2d"),h=f.createImageData(s,u);return h.data.set(a),f.putImageData(h,0,0),l.toDataURL()}function Wa(t){return t instanceof $a?{framebuffer:t,deleteFramebuffer:!1}:{framebuffer:(e=t,n=e.gl,i=e.width,o=e.height,a=e.id,new $a(n,Object.assign({},r,{id:"framebuffer-for-".concat(a),width:i,height:o,attachments:B()({},36064,e)}))),deleteFramebuffer:!0};var e,r,n,i,o,a}function Qa(t,e,r,n,i){return t||new(na(e=e||5121,{clamped:!1}))(n*i*Ua(r))}function Xa(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return Ya(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ya(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function Ya(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Za(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=A()(t);if(e){var i=A()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return m()(this,r)}}var $a=function(t,e){y()(n,t);var r=Za(n);function n(t){var e;p()(this,n);var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(e=r.call(this,t,i)).width=null,e.height=null,e.attachments={},e.readBuffer=36064,e.drawBuffers=[36064],e.ownResources=[],e.initialize(i),Object.seal(ai()(e)),e}return E()(n,[{key:e,get:function(){return"Framebuffer"}},{key:"MAX_COLOR_ATTACHMENTS",get:function(){var t=$i(this.gl);return t.getParameter(t.MAX_COLOR_ATTACHMENTS)}},{key:"MAX_DRAW_BUFFERS",get:function(){var t=$i(this.gl);return t.getParameter(t.MAX_DRAW_BUFFERS)}},{key:"color",get:function(){return this.attachments[36064]||null}},{key:"texture",get:function(){return this.attachments[36064]||null}},{key:"depth",get:function(){return this.attachments[36096]||this.attachments[33306]||null}},{key:"stencil",get:function(){return this.attachments[36128]||this.attachments[33306]||null}},{key:"initialize",value:function(t){var e=t.width,r=void 0===e?1:e,n=t.height,i=void 0===n?1:n,o=t.attachments,a=void 0===o?null:o,s=t.color,u=void 0===s||s,c=t.depth,l=void 0===c||c,f=t.stencil,h=void 0!==f&&f,d=t.check,p=void 0===d||d,v=t.readBuffer,y=void 0===v?void 0:v,g=t.drawBuffers,m=void 0===g?void 0:g;if(Jo(r>=0&&i>=0,"Width and height need to be integers"),this.width=r,this.height=i,a)for(var b in a){var A=a[b];(Array.isArray(A)?A[0]:A).resize({width:r,height:i})}else a=this._createDefaultAttachments(u,l,h,r,i);this.update({clearAttachments:!0,attachments:a,readBuffer:y,drawBuffers:m}),a&&p&&this.checkStatus()}},{key:"delete",value:function(){var t,e=Xa(this.ownResources);try{for(e.s();!(t=e.n()).done;){t.value.delete()}}catch(t){e.e(t)}finally{e.f()}return $n()(A()(n.prototype),"delete",this).call(this),this}},{key:"update",value:function(t){var e=t.attachments,r=void 0===e?{}:e,n=t.readBuffer,i=t.drawBuffers,o=t.clearAttachments,a=void 0!==o&&o,s=t.resizeAttachments,u=void 0===s||s;this.attach(r,{clearAttachments:a,resizeAttachments:u});var c=this.gl,l=c.bindFramebuffer(36160,this.handle);return n&&this._setReadBuffer(n),i&&this._setDrawBuffers(i),c.bindFramebuffer(36160,l||null),this}},{key:"resize",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.width,r=t.height;if(null===this.handle)return Jo(void 0===e&&void 0===r),this.width=this.gl.drawingBufferWidth,this.height=this.gl.drawingBufferHeight,this;for(var n in void 0===e&&(e=this.gl.drawingBufferWidth),void 0===r&&(r=this.gl.drawingBufferHeight),e!==this.width&&r!==this.height&&Wi.log(2,"Resizing framebuffer ".concat(this.id," to ").concat(e,"x").concat(r))(),this.attachments)this.attachments[n].resize({width:e,height:r});return this.width=e,this.height=r,this}},{key:"attach",value:function(t){var e=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=r.clearAttachments,i=void 0!==n&&n,o=r.resizeAttachments,a=void 0===o||o,s={};i&&Object.keys(this.attachments).forEach((function(t){s[t]=null})),Object.assign(s,t);var u=this.gl.bindFramebuffer(36160,this.handle);for(var c in s){Jo(void 0!==c,"Misspelled framebuffer binding point?");var l=Number(c),f=s[l],h=f;if(h)if(h instanceof ja)this._attachRenderbuffer({attachment:l,renderbuffer:h});else if(Array.isArray(f)){var d=R()(f,3),p=d[0],v=d[1],y=void 0===v?0:v,g=d[2],m=void 0===g?0:g;h=p,this._attachTexture({attachment:l,texture:p,layer:y,level:m})}else this._attachTexture({attachment:l,texture:h,layer:0,level:0});else this._unattach(l);a&&h&&h.resize({width:this.width,height:this.height})}this.gl.bindFramebuffer(36160,u||null),Object.assign(this.attachments,t),Object.keys(this.attachments).filter((function(t){return!e.attachments[t]})).forEach((function(t){delete e.attachments[t]}))}},{key:"checkStatus",value:function(){this.gl;var t=this.getStatus();if(36053!==t)throw new Error(function(t){return($a.STATUS||{})[t]||"Framebuffer error ".concat(t)}(t));return this}},{key:"getStatus",value:function(){var t=this.gl,e=t.bindFramebuffer(36160,this.handle),r=t.checkFramebufferStatus(36160);return t.bindFramebuffer(36160,e||null),r}},{key:"clear",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=e.color,n=e.depth,i=e.stencil,o=e.drawBuffers,a=void 0===o?[]:o,s=this.gl.bindFramebuffer(36160,this.handle);return(r||n||i)&&Ga(this.gl,{color:r,depth:n,stencil:i}),a.forEach((function(e,r){Na(t.gl,{drawBuffer:r,value:e})})),this.gl.bindFramebuffer(36160,s||null),this}},{key:"readPixels",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return Wi.error("Framebuffer.readPixels() is no logner supported, use readPixelsToArray(framebuffer)")(),null}},{key:"readPixelsToBuffer",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return Wi.error("Framebuffer.readPixelsToBuffer()is no logner supported, use readPixelsToBuffer(framebuffer)")(),null}},{key:"copyToDataUrl",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return Wi.error("Framebuffer.copyToDataUrl() is no logner supported, use copyToDataUrl(framebuffer)")(),null}},{key:"copyToImage",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return Wi.error("Framebuffer.copyToImage() is no logner supported, use copyToImage(framebuffer)")(),null}},{key:"copyToTexture",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return Wi.error("Framebuffer.copyToTexture({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null}},{key:"blit",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return Wi.error("Framebuffer.blit({...}) is no logner supported, use blit(source, target, opts)")(),null}},{key:"invalidate",value:function(t){var e=t.attachments,r=void 0===e?[]:e,n=t.x,i=void 0===n?0:n,o=t.y,a=void 0===o?0:o,s=t.width,u=t.height,c=$i(this.gl),l=c.bindFramebuffer(36008,this.handle);return 0===i&&0===a&&void 0===s&&void 0===u?c.invalidateFramebuffer(36008,r):c.invalidateFramebuffer(36008,r,i,a,s,u),c.bindFramebuffer(36008,l),this}},{key:"getAttachmentParameter",value:function(t,e,r){var n=this._getAttachmentParameterFallback(e);return null===n&&(this.gl.bindFramebuffer(36160,this.handle),n=this.gl.getFramebufferAttachmentParameter(36160,t,e),this.gl.bindFramebuffer(36160,null)),r&&n>1e3&&(n=Ko(this.gl,n)),n}},{key:"getAttachmentParameters",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:36064,r=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.constructor.ATTACHMENT_PARAMETERS||[],i={},o=Xa(n);try{for(o.s();!(t=o.n()).done;){var a=t.value,s=r?Ko(this.gl,a):a;i[s]=this.getAttachmentParameter(e,a,r)}}catch(t){o.e(t)}finally{o.f()}return i}},{key:"getParameters",value:function(){for(var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=Object.keys(this.attachments),r={},n=0,i=e;n<i.length;n++){var o=i[n],a=Number(o),s=t?Ko(this.gl,a):a;r[s]=this.getAttachmentParameters(a,t)}return r}},{key:"show",value:function(){return"undefined"!=typeof window&&window.open(qa(this),"luma-debug-texture"),this}},{key:"log",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(t>Wi.level||"undefined"==typeof window)return this;e=e||"Framebuffer ".concat(this.id);var r=qa(this,{targetMaxHeight:100});return Wi.image({logLevel:t,message:e,image:r},e)(),this}},{key:"bind",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.target,r=void 0===e?36160:e;return this.gl.bindFramebuffer(r,this.handle),this}},{key:"unbind",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.target,r=void 0===e?36160:e;return this.gl.bindFramebuffer(r,null),this}},{key:"_createDefaultAttachments",value:function(t,e,r,n,i){var o,a=null;t&&((a=a||{})[36064]=new Ra(this.gl,{id:"".concat(this.id,"-color0"),pixels:null,format:6408,type:5121,width:n,height:i,mipmaps:!1,parameters:(o={},B()(o,10241,9729),B()(o,10240,9729),B()(o,10242,33071),B()(o,10243,33071),o)}),this.ownResources.push(a[36064]));return e&&r?((a=a||{})[33306]=new ja(this.gl,{id:"".concat(this.id,"-depth-stencil"),format:35056,width:n,height:111}),this.ownResources.push(a[33306])):e?((a=a||{})[36096]=new ja(this.gl,{id:"".concat(this.id,"-depth"),format:33189,width:n,height:i}),this.ownResources.push(a[36096])):r&&Jo(!1),a}},{key:"_unattach",value:function(t){var e=this.attachments[t];e&&(e instanceof ja?this.gl.framebufferRenderbuffer(36160,t,36161,null):this.gl.framebufferTexture2D(36160,t,3553,null,0),delete this.attachments[t])}},{key:"_attachRenderbuffer",value:function(t){var e=t.attachment,r=void 0===e?36064:e,n=t.renderbuffer;this.gl.framebufferRenderbuffer(36160,r,36161,n.handle),this.attachments[r]=n}},{key:"_attachTexture",value:function(t){var e=t.attachment,r=void 0===e?36064:e,n=t.texture,i=t.layer,o=t.level,a=this.gl;switch(a.bindTexture(n.target,n.handle),n.target){case 35866:case 32879:$i(a).framebufferTextureLayer(36160,r,n.target,o,i);break;case 34067:var s=function(t){return t<34069?t+34069:t}(i);a.framebufferTexture2D(36160,r,s,n.handle,o);break;case 3553:a.framebufferTexture2D(36160,r,3553,n.handle,o);break;default:Jo(!1,"Illegal texture type")}a.bindTexture(n.target,null),this.attachments[r]=n}},{key:"_setReadBuffer",value:function(t){var e,r=Yi(e=this.gl)?e:null;r?r.readBuffer(t):Jo(36064===t||1029===t,"Multiple render targets not supported"),this.readBuffer=t}},{key:"_setDrawBuffers",value:function(t){var e=this.gl,r=$i(e);if(r)r.drawBuffers(t);else{var n=e.getExtension("WEBGL_draw_buffers");n?n.drawBuffersWEBGL(t):Jo(1===t.length&&(36064===t[0]||1029===t[0]),"Multiple render targets not supported")}this.drawBuffers=t}},{key:"_getAttachmentParameterFallback",value:function(t){var e=function(t){for(var e in t.luma=t.luma||{},t.luma.caps=t.luma.caps||{},_s)void 0===t.luma.caps[e]&&(t.luma.caps[e]=Es(t,e));return t.luma.caps}(this.gl);switch(t){case 36052:return e.WEBGL2?null:0;case 33298:case 33299:case 33300:case 33301:case 33302:case 33303:return e.WEBGL2?null:8;case 33297:return e.WEBGL2?null:5125;case 33296:return e.WEBGL2||e.EXT_sRGB?null:9729;default:return null}}},{key:"_createHandle",value:function(){return this.gl.createFramebuffer()}},{key:"_deleteHandle",value:function(){this.gl.deleteFramebuffer(this.handle)}},{key:"_bindHandle",value:function(t){return this.gl.bindFramebuffer(36160,t)}}],[{key:"isSupported",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.colorBufferFloat,n=e.colorBufferHalfFloat,i=!0;return r&&(i=Boolean(t.getExtension("EXT_color_buffer_float")||t.getExtension("WEBGL_color_buffer_float")||t.getExtension("OES_texture_float"))),n&&(i=i&&Boolean(t.getExtension("EXT_color_buffer_float")||t.getExtension("EXT_color_buffer_half_float"))),i}},{key:"getDefaultFramebuffer",value:function(t){return t.luma=t.luma||{},t.luma.defaultFramebuffer=t.luma.defaultFramebuffer||new n(t,{id:"default-framebuffer",handle:null,attachments:{}}),t.luma.defaultFramebuffer}}]),n}($o,Symbol.toStringTag);var ts;$a.ATTACHMENT_PARAMETERS=[36049,36048,33296,33298,33299,33300,33301,33302,33303];var es="WEBGL2",rs="VERTEX_ARRAY_OBJECT",ns="TIMER_QUERY",is="INSTANCED_RENDERING",os="MULTIPLE_RENDER_TARGETS",as="ELEMENT_INDEX_UINT32",ss="BLEND_EQUATION_MINMAX",us="FLOAT_BLEND",cs="COLOR_ENCODING_SRGB",ls="TEXTURE_DEPTH",fs="TEXTURE_FLOAT",hs="TEXTURE_HALF_FLOAT",ds="TEXTURE_FILTER_LINEAR_FLOAT",ps="TEXTURE_FILTER_LINEAR_HALF_FLOAT",vs="TEXTURE_FILTER_ANISOTROPIC",ys="COLOR_ATTACHMENT_RGBA32F",gs="COLOR_ATTACHMENT_FLOAT",ms="COLOR_ATTACHMENT_HALF_FLOAT",bs="GLSL_FRAG_DATA",As="GLSL_FRAG_DEPTH",ws="GLSL_DERIVATIVES",Bs="GLSL_TEXTURE_LOD";var _s=(ts={},B()(ts,es,[!1,!0]),B()(ts,rs,["OES_vertex_array_object",!0]),B()(ts,ns,["EXT_disjoint_timer_query","EXT_disjoint_timer_query_webgl2"]),B()(ts,is,["ANGLE_instanced_arrays",!0]),B()(ts,os,["WEBGL_draw_buffers",!0]),B()(ts,as,["OES_element_index_uint",!0]),B()(ts,ss,["EXT_blend_minmax",!0]),B()(ts,us,["EXT_float_blend"]),B()(ts,cs,["EXT_sRGB",!0]),B()(ts,ls,["WEBGL_depth_texture",!0]),B()(ts,fs,["OES_texture_float",!0]),B()(ts,hs,["OES_texture_half_float",!0]),B()(ts,ds,["OES_texture_float_linear"]),B()(ts,ps,["OES_texture_half_float_linear"]),B()(ts,vs,["EXT_texture_filter_anisotropic"]),B()(ts,ys,[function(t){var e=new Ra(t,{format:6408,type:5126,dataFormat:6408}),r=new $a(t,{id:"test-framebuffer",check:!1,attachments:B()({},36064,e)}),n=r.getStatus();return e.delete(),r.delete(),36053===n},"EXT_color_buffer_float"]),B()(ts,gs,[!1,"EXT_color_buffer_float"]),B()(ts,ms,["EXT_color_buffer_half_float"]),B()(ts,bs,["WEBGL_draw_buffers",!0]),B()(ts,As,["EXT_frag_depth",!0]),B()(ts,ws,["OES_standard_derivatives",!0]),B()(ts,Bs,["EXT_shader_texture_lod",!0]),ts);function xs(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return Cs(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Cs(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function Cs(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function ks(t,e){return function(t,e){return(e=Array.isArray(e)?e:[e]).every((function(e){return Es(t,e)}))}(t,e)}function Es(t,e){return t.luma=t.luma||{},t.luma.caps=t.luma.caps||{},void 0===t.luma.caps[e]&&(t.luma.caps[e]=function(t,e){var r,n=_s[e];Jo(n,e);var i=Yi(t)&&n[1]||n[0];if("function"==typeof i)r=i(t);else if(Array.isArray(i)){r=!0;var o,a=xs(i);try{for(a.s();!(o=a.n()).done;){var s=o.value;r=r&&Boolean(t.getExtension(s))}}catch(t){a.e(t)}finally{a.f()}}else"string"==typeof i?r=Boolean(t.getExtension(i)):"boolean"==typeof i?r=i:Jo(!1);return r}(t,e)),t.luma.caps[e]||Wi.log(2,"Feature: ".concat(e," not supported"))(),t.luma.caps[e]}function Os(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Ts(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Os(Object(r),!0).forEach((function(e){B()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Os(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var Ss=function(){function t(e,r){p()(this,t);var n=r.attributes,i=r.material,o=r.pbrDebug,a=r.imageBasedLightingEnvironment,s=r.lights,u=r.useTangents;this.gl=e,this.defines={MANUAL_SRGB:1,SRGB_FAST_APPROXIMATION:1},ks(e,Bs)&&(this.defines.USE_TEX_LOD=1),this.uniforms={u_Camera:[0,0,0],u_MetallicRoughnessValues:[1,1]},this.parameters={},this.generatedTextures=[],a&&(this.uniforms.u_DiffuseEnvSampler=a.getDiffuseEnvSampler(),this.uniforms.u_SpecularEnvSampler=a.getSpecularEnvSampler(),this.uniforms.u_brdfLUT=a.getBrdfTexture(),this.uniforms.u_ScaleIBLAmbient=[1,1]),o&&(this.uniforms.u_ScaleDiffBaseMR=[0,0,0,0],this.uniforms.u_ScaleFGDSpec=[0,0,0,0]),this.defineIfPresent(n.NORMAL,"HAS_NORMALS"),this.defineIfPresent(n.TANGENT&&u,"HAS_TANGENTS"),this.defineIfPresent(n.TEXCOORD_0,"HAS_UV"),this.defineIfPresent(a,"USE_IBL"),this.defineIfPresent(s,"USE_LIGHTS"),this.defineIfPresent(o,"PBR_DEBUG"),i&&this.parseMaterial(i)}return E()(t,[{key:"defineIfPresent",value:function(t,e){t&&(this.defines[e]=1)}},{key:"parseTexture",value:function(t,e){var r,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=t.texture&&t.texture.sampler&&t.texture.sampler.parameters||{},o=t.texture.source.image,a={};o.compressed?(r=o,a=B()({},this.gl.TEXTURE_MIN_FILTER,o.data.length>1?this.gl.LINEAR_MIPMAP_NEAREST:this.gl.LINEAR)):r={data:o};var s=new Ra(this.gl,Ts({id:t.name||t.id,parameters:Ts(Ts({},i),a),pixelStore:B()({},this.gl.UNPACK_FLIP_Y_WEBGL,!1)},r));this.uniforms[e]=s,this.defineIfPresent(n,n),this.generatedTextures.push(s)}},{key:"parsePbrMetallicRoughness",value:function(t){t.baseColorTexture&&this.parseTexture(t.baseColorTexture,"u_BaseColorSampler","HAS_BASECOLORMAP"),this.uniforms.u_BaseColorFactor=t.baseColorFactor||[1,1,1,1],t.metallicRoughnessTexture&&this.parseTexture(t.metallicRoughnessTexture,"u_MetallicRoughnessSampler","HAS_METALROUGHNESSMAP");var e=t.metallicFactor,r=void 0===e?1:e,n=t.roughnessFactor,i=void 0===n?1:n;this.uniforms.u_MetallicRoughnessValues=[r,i]}},{key:"parseMaterial",value:function(t){if(this.uniforms.pbr_uUnlit=Boolean(t.unlit),t.pbrMetallicRoughness&&this.parsePbrMetallicRoughness(t.pbrMetallicRoughness),t.normalTexture){this.parseTexture(t.normalTexture,"u_NormalSampler","HAS_NORMALMAP");var e=t.normalTexture.scale,r=void 0===e?1:e;this.uniforms.u_NormalScale=r}if(t.occlusionTexture){this.parseTexture(t.occlusionTexture,"u_OcclusionSampler","HAS_OCCLUSIONMAP");var n=t.occlusionTexture.strength,i=void 0===n?1:n;this.uniforms.u_OcclusionStrength=i}if(t.emissiveTexture&&(this.parseTexture(t.emissiveTexture,"u_EmissiveSampler","HAS_EMISSIVEMAP"),this.uniforms.u_EmissiveFactor=t.emissiveFactor||[0,0,0]),"MASK"===t.alphaMode){var o=t.alphaCutoff,a=void 0===o?.5:o;this.defines.ALPHA_CUTOFF=1,this.uniforms.u_AlphaCutoff=a}else"BLEND"===t.alphaMode&&(Wi.warn("BLEND alphaMode might not work well because it requires mesh sorting")(),Object.assign(this.parameters,{blend:!0,blendEquation:this.gl.FUNC_ADD,blendFunc:[this.gl.SRC_ALPHA,this.gl.ONE_MINUS_SRC_ALPHA,this.gl.ONE,this.gl.ONE_MINUS_SRC_ALPHA]}))}},{key:"delete",value:function(){this.generatedTextures.forEach((function(t){return t.delete()}))}}]),t}();function Ms(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Is(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Ms(Object(r),!0).forEach((function(e){B()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ms(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Rs(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=A()(t);if(e){var i=A()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return m()(this,r)}}var Ps=function(t){y()(r,t);var e=Rs(r);function r(){return p()(this,r),e.apply(this,arguments)}return E()(r,[{key:"getShaders",value:function(){var t=$n()(A()(r.prototype),"getShaders",this).call(this);return t.modules.push(xi.pbr),Is(Is({},t),{},{vs:"#version 300 es\n#define SHADER_NAME simple-mesh-layer-vs\n\n// Scale the model\nuniform float sizeScale;\nuniform bool composeModelMatrix;\nuniform bool pickFeatureIds;\n\n// Primitive attributes\nin vec3 positions;\nin vec3 normals;\nin vec3 colors;\nin vec2 texCoords;\nin vec4 uvRegions;\nin vec3 featureIdsPickingColors;\n\n// Instance attributes\nin vec4 instanceColors;\nin vec3 instancePickingColors;\nin mat3 instanceModelMatrix;\n\n// Outputs to fragment shader\nout vec2 vTexCoord;\nout vec3 cameraPosition;\nout vec3 normals_commonspace;\nout vec4 position_commonspace;\nout vec4 vColor;\n\nvec2 applyUVRegion(vec2 uv) {\n #ifdef HAS_UV_REGIONS\n // https://github.com/Esri/i3s-spec/blob/master/docs/1.7/geometryUVRegion.cmn.md\n return fract(uv) * (uvRegions.zw - uvRegions.xy) + uvRegions.xy;\n #else\n return uv;\n #endif\n}\n\nvoid main(void) {\n vec2 uv = applyUVRegion(texCoords);\n geometry.uv = uv;\n\n if (pickFeatureIds) {\n geometry.pickingColor = featureIdsPickingColors;\n } else {\n geometry.pickingColor = instancePickingColors;\n }\n\n vTexCoord = uv;\n cameraPosition = project_uCameraPosition;\n vColor = vec4(colors * instanceColors.rgb, instanceColors.a);\n\n vec3 pos = (instanceModelMatrix * positions) * sizeScale;\n vec3 projectedPosition = project_position(positions);\n position_commonspace = vec4(projectedPosition, 1.0);\n gl_Position = project_common_position_to_clipspace(position_commonspace);\n\n geometry.position = position_commonspace;\n normals_commonspace = project_normal(instanceModelMatrix * normals);\n geometry.normal = normals_commonspace;\n\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n #ifdef MODULE_PBR\n // set PBR data\n pbr_vPosition = geometry.position.xyz;\n #ifdef HAS_NORMALS\n pbr_vNormal = geometry.normal;\n #endif\n\n #ifdef HAS_UV\n pbr_vUV = uv;\n #else\n pbr_vUV = vec2(0., 0.);\n #endif\n geometry.uv = pbr_vUV;\n #endif\n\n DECKGL_FILTER_COLOR(vColor, geometry);\n}\n",fs:"#version 300 es\n#define SHADER_NAME simple-mesh-layer-fs\n\nprecision highp float;\n\nuniform bool hasTexture;\nuniform sampler2D sampler;\nuniform bool flatShading;\nuniform float opacity;\n\nin vec2 vTexCoord;\nin vec3 cameraPosition;\nin vec3 normals_commonspace;\nin vec4 position_commonspace;\nin vec4 vColor;\n\nout vec4 fragColor;\n\nvoid main(void) {\n \n#ifdef MODULE_PBR\n\n fragColor = vColor * pbr_filterColor(vec4(0));\n geometry.uv = pbr_vUV;\n fragColor.a *= opacity;\n\n#else\n\n geometry.uv = vTexCoord;\n\n vec3 normal;\n if (flatShading) {\n\n// NOTE(Tarek): This is necessary because\n// headless.gl reports the extension as\n// available but does not support it in\n// the shader.\n#ifdef DERIVATIVES_AVAILABLE\n normal = normalize(cross(dFdx(position_commonspace.xyz), dFdy(position_commonspace.xyz)));\n#else\n normal = vec3(0.0, 0.0, 1.0);\n#endif\n } else {\n normal = normals_commonspace;\n }\n\n vec4 color = hasTexture ? texture(sampler, vTexCoord) : vColor;\n vec3 lightColor = lighting_getLightColor(color.rgb, cameraPosition, position_commonspace.xyz, normal);\n fragColor = vec4(lightColor, color.a * opacity);\n\n#endif\n\n DECKGL_FILTER_COLOR(fragColor, geometry);\n}\n"})}},{key:"initializeState",value:function(){var t=this.props.featureIds;$n()(A()(r.prototype),"initializeState",this).call(this);var e=this.getAttributeManager();t&&e.add({featureIdsPickingColors:{type:5121,size:3,noAlloc:!0,update:this.calculateFeatureIdsPickingColors}})}},{key:"updateState",value:function(t){$n()(A()(r.prototype),"updateState",this).call(this,t);var e=t.props,n=t.oldProps;e.pbrMaterial!==n.pbrMaterial&&this.updatePbrMaterialUniforms(e.pbrMaterial)}},{key:"draw",value:function(t){var e=this.props.featureIds;this.state.model&&(this.state.model.setUniforms({u_Camera:this.state.model.getUniforms().project_uCameraPosition,pickFeatureIds:Boolean(e)}),$n()(A()(r.prototype),"draw",this).call(this,t))}},{key:"getModel",value:function(t){var e=this.props,r=e.id,n=e.pbrMaterial,i=this.parseMaterial(n,t);this.setState({materialParser:i});var o,a=this.getShaders();return(o=t.attributes).COLOR_0||o.colors||(o.colors={constant:!0,value:new Float32Array([1,1,1])}),new xi.Model(this.context.gl,Is(Is({},this.getShaders()),{},{id:r,geometry:t,defines:Is(Is(Is({},a.defines),null==i?void 0:i.defines),{},{HAS_UV_REGIONS:t.attributes.uvRegions}),parameters:null==i?void 0:i.parameters,isInstanced:!0}))}},{key:"updatePbrMaterialUniforms",value:function(t){var e=this.state.model;if(e){var r=this.props.mesh,n=this.parseMaterial(t,r);this.setState({materialParser:n}),e.setUniforms(n.uniforms)}}},{key:"parseMaterial",value:function(t,e){var r,n=Boolean(t.pbrMetallicRoughness&&t.pbrMetallicRoughness.baseColorTexture);return null===(r=this.state.materialParser)||void 0===r||r.delete(),new Ss(this.context.gl,{attributes:{NORMAL:e.attributes.normals,TEXCOORD_0:e.attributes.texCoords},material:Is({unlit:n},t),pbrDebug:!1,imageBasedLightingEnvironment:null,lights:!0,useTangents:!1})}},{key:"calculateFeatureIdsPickingColors",value:function(t){for(var e=this.props.featureIds,r=new Uint8ClampedArray(e.length*t.size),n=[],i=0;i<e.length;i++)this.encodePickingColor(e[i],n),r[3*i]=n[0],r[3*i+1]=n[1],r[3*i+2]=n[2];t.value=r}},{key:"finalizeState",value:function(t){var e;$n()(A()(r.prototype),"finalizeState",this).call(this,t),null===(e=this.state.materialParser)||void 0===e||e.delete(),this.setState({materialParser:null})}}]),r}(_.SimpleMeshLayer);B()(Ps,"layerName","MeshLayer"),B()(Ps,"defaultProps",{pbrMaterial:{type:"object",value:null},featureIds:{type:"array",value:null,optional:!0}});var Fs=r(3),Ds=r.n(Fs),Ls=r(1),js=r.n(Ls),Gs=r(9),Ns=r.n(Gs),Us=function(t){return"boolean"==typeof t},Hs=function(t){return"function"==typeof t},Vs=function(t){return null!==t&&"object"===Ns()(t)},Js=function(t){return Vs(t)&&t.constructor==={}.constructor},zs=function(t){return t&&"function"==typeof t[Symbol.iterator]},Ks=function(t){return t&&"function"==typeof t[Symbol.asyncIterator]},qs=function(t){return"undefined"!=typeof Response&&t instanceof Response||t&&t.arrayBuffer&&t.text&&t.json},Ws=function(t){return"undefined"!=typeof Blob&&t instanceof Blob},Qs=function(t){return function(t){return"undefined"!=typeof ReadableStream&&t instanceof ReadableStream||Vs(t)&&Hs(t.tee)&&Hs(t.cancel)&&Hs(t.getReader)}(t)||function(t){return Vs(t)&&Hs(t.read)&&Hs(t.pipe)&&Us(t.readable)}(t)},Xs=r(8),Ys=r.n(Xs);function Zs(t,e){if(!t)throw new Error(e||"loader assertion failed.")}function $s(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function tu(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?$s(Object(r),!0).forEach((function(e){Ys()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):$s(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function eu(t){var e;return!!t&&(Array.isArray(t)&&(t=t[0]),Array.isArray(null===(e=t)||void 0===e?void 0:e.extensions))}function ru(t){var e,r,n;return Zs(t,"null loader"),Zs(eu(t),"invalid loader"),Array.isArray(t)&&(n=t[1],t=tu(tu({},t=t[0]),{},{options:tu(tu({},t.options),n)})),(null!==(e=t)&&void 0!==e&&e.parseTextSync||null!==(r=t)&&void 0!==r&&r.parseText)&&(t.text=!0),t.text||(t.binary=!0),t}var nu="",iu={};function ou(t){for(var e in iu)if(t.startsWith(e)){var r=iu[e];t=t.replace(e,r)}return t.startsWith("http://")||t.startsWith("https://")||(t="".concat(nu).concat(t)),t}var au=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,su=/^([-\w.]+\/[-\w.+]+)/;function uu(t){var e=su.exec(t);return e?e[1]:t}function cu(t){var e=au.exec(t);return e?e[1]:""}var lu=/\?.*/;function fu(t){if(qs(t)){var e=du(t.url||"");return{url:e,type:uu(t.headers.get("content-type")||"")||cu(e)}}return Ws(t)?{url:du(t.name||""),type:t.type||""}:"string"==typeof t?{url:du(t),type:cu(t)}:{url:"",type:""}}function hu(t){return qs(t)?t.headers["content-length"]||-1:Ws(t)?t.size:"string"==typeof t?t.length:t instanceof ArrayBuffer?t.byteLength:ArrayBuffer.isView(t)?t.byteLength:-1}function du(t){return t.replace(lu,"")}function pu(t){return vu.apply(this,arguments)}function vu(){return(vu=Ds()(js.a.mark((function t(e){var r,n,i,o,a,s,u;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!qs(e)){t.next=2;break}return t.abrupt("return",e);case 2:return r={},(n=hu(e))>=0&&(r["content-length"]=String(n)),i=fu(e),o=i.url,(a=i.type)&&(r["content-type"]=a),t.next=9,Au(e);case 9:return(s=t.sent)&&(r["x-first-bytes"]=s),"string"==typeof e&&(e=(new TextEncoder).encode(e)),u=new Response(e,{headers:r}),Object.defineProperty(u,"url",{value:o}),t.abrupt("return",u);case 15:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function yu(t){return gu.apply(this,arguments)}function gu(){return(gu=Ds()(js.a.mark((function t(e){var r;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e.ok){t.next=5;break}return t.next=3,mu(e);case 3:throw r=t.sent,new Error(r);case 5:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function mu(t){return bu.apply(this,arguments)}function bu(){return(bu=Ds()(js.a.mark((function t(e){var r,n,i;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r="Failed to fetch resource ".concat(e.url," (").concat(e.status,"): "),t.prev=1,n=e.headers.get("Content-Type"),i=e.statusText,!n.includes("application/json")){t.next=11;break}return t.t0=i,t.t1=" ",t.next=9,e.text();case 9:t.t2=t.sent,i=t.t0+=t.t1.concat.call(t.t1,t.t2);case 11:r=(r+=i).length>60?"".concat(r.slice(0,60),"..."):r,t.next=17;break;case 15:t.prev=15,t.t3=t.catch(1);case 17:return t.abrupt("return",r);case 18:case"end":return t.stop()}}),t,null,[[1,15]])})))).apply(this,arguments)}function Au(t){return wu.apply(this,arguments)}function wu(){return(wu=Ds()(js.a.mark((function t(e){var r,n,i,o;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=5,"string"!=typeof e){t.next=3;break}return t.abrupt("return","data:,".concat(e.slice(0,r)));case 3:if(!(e instanceof Blob)){t.next=8;break}return n=e.slice(0,5),t.next=7,new Promise((function(t){var e=new FileReader;e.onload=function(e){var r;return t(null==e?void 0:null===(r=e.target)||void 0===r?void 0:r.result)},e.readAsDataURL(n)}));case 7:return t.abrupt("return",t.sent);case 8:if(!(e instanceof ArrayBuffer)){t.next=12;break}return i=e.slice(0,r),o=Bu(i),t.abrupt("return","data:base64,".concat(o));case 12:return t.abrupt("return",null);case 13:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Bu(t){for(var e="",r=new Uint8Array(t),n=0;n<r.byteLength;n++)e+=String.fromCharCode(r[n]);return btoa(e)}function _u(t,e){return xu.apply(this,arguments)}function xu(){return(xu=Ds()(js.a.mark((function t(e,r){var n;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("string"!=typeof e){t.next=7;break}return e=ou(e),n=r,null!=r&&r.fetch&&"function"!=typeof(null==r?void 0:r.fetch)&&(n=r.fetch),t.next=6,fetch(e,n);case 6:return t.abrupt("return",t.sent);case 7:return t.next=9,pu(e);case 9:return t.abrupt("return",t.sent);case 10:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var Cu=r(2),ku=r.n(Cu),Eu=r(4),Ou=r.n(Eu);function Tu(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Su=r(13),Mu=r.n(Su);function Iu(){return!("object"===("undefined"==typeof process?"undefined":Ns()(process))&&"[object process]"===String(process)&&!process.browser)||function(t){if("undefined"!=typeof window&&"object"===Ns()(window.process)&&"renderer"===window.process.type)return!0;if("undefined"!=typeof process&&"object"===Ns()(process.versions)&&Boolean(process.versions.electron))return!0;var e="object"===("undefined"==typeof navigator?"undefined":Ns()(navigator))&&"string"==typeof navigator.userAgent&&navigator.userAgent,r=t||e;return!!(r&&r.indexOf("Electron")>=0)}()}var Ru=Iu();function Pu(t){try{var e=window[t],r="__storage_test__";return e.setItem(r,r),e.removeItem(r),e}catch(t){return null}}var Fu=function(){function t(e,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"sessionStorage";ku()(this,t),this.storage=Pu(n),this.id=e,this.config={},Object.assign(this.config,r),this._loadConfiguration()}return Ou()(t,[{key:"getConfiguration",value:function(){return this.config}},{key:"setConfiguration",value:function(t){return this.config={},this.updateConfiguration(t)}},{key:"updateConfiguration",value:function(t){if(Object.assign(this.config,t),this.storage){var e=JSON.stringify(this.config);this.storage.setItem(this.id,e)}return this}},{key:"_loadConfiguration",value:function(){var t={};if(this.storage){var e=this.storage.getItem(this.id);t=e?JSON.parse(e):{}}return Object.assign(this.config,t),this}}]),t}();function Du(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:600,i=t.src.replace(/\(/g,"%28").replace(/\)/g,"%29");t.width>n&&(r=Math.min(r,n/t.width));var o=t.width*r,a=t.height*r,s=["font-size:1px;","padding:".concat(Math.floor(a/2),"px ").concat(Math.floor(o/2),"px;"),"line-height:".concat(a,"px;"),"background:url(".concat(i,");"),"background-size:".concat(o,"px ").concat(a,"px;"),"color:transparent;"].join("");return["".concat(e," %c+"),s]}var Lu={BLACK:30,RED:31,GREEN:32,YELLOW:33,BLUE:34,MAGENTA:35,CYAN:36,WHITE:37,BRIGHT_BLACK:90,BRIGHT_RED:91,BRIGHT_GREEN:92,BRIGHT_YELLOW:93,BRIGHT_BLUE:94,BRIGHT_MAGENTA:95,BRIGHT_CYAN:96,BRIGHT_WHITE:97};function ju(t){return"string"==typeof t?Lu[t.toUpperCase()]||Lu.WHITE:t}function Gu(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return Nu(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Nu(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function Nu(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Uu(t){var e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["constructor"],n=Object.getPrototypeOf(t),i=Object.getOwnPropertyNames(n),o=Gu(i);try{var a=function(){var n=e.value;"function"==typeof t[n]&&(r.find((function(t){return n===t}))||(t[n]=t[n].bind(t)))};for(o.s();!(e=o.n()).done;)a()}catch(t){o.e(t)}finally{o.f()}}function Hu(t,e){if(!t)throw new Error(e||"Assertion failed")}var Vu={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document,process:"object"===("undefined"==typeof process?"undefined":Ns()(process))&&process},Ju=Vu.window||Vu.self||Vu.global,zu=Vu.process||{};console;function Ku(){var t;if(Ru&&Ju.performance)t=Ju.performance.now();else if(zu.hrtime){var e=zu.hrtime();t=1e3*e[0]+e[1]/1e6}else t=Date.now();return t}var qu={debug:Ru&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},Wu={enabled:!0,level:0};function Qu(){}var Xu={},Yu={once:!0};function Zu(t){for(var e in t)for(var r in t[e])return r||"untitled";return"empty"}var $u=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{id:""},r=e.id;ku()(this,t),this.id=r,this.VERSION="8.8.16",this._startTs=Ku(),this._deltaTs=Ku(),this.LOG_THROTTLE_TIMEOUT=0,this._storage=new Fu("__probe-".concat(this.id,"__"),Wu),this.userData={},this.timeStamp("".concat(this.id," started")),Uu(this),Object.seal(this)}return Ou()(t,[{key:"level",get:function(){return this.getLevel()},set:function(t){this.setLevel(t)}},{key:"isEnabled",value:function(){return this._storage.config.enabled}},{key:"getLevel",value:function(){return this._storage.config.level}},{key:"getTotal",value:function(){return Number((Ku()-this._startTs).toPrecision(10))}},{key:"getDelta",value:function(){return Number((Ku()-this._deltaTs).toPrecision(10))}},{key:"priority",get:function(){return this.level},set:function(t){this.level=t}},{key:"getPriority",value:function(){return this.level}},{key:"enable",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this._storage.updateConfiguration({enabled:t}),this}},{key:"setLevel",value:function(t){return this._storage.updateConfiguration({level:t}),this}},{key:"assert",value:function(t,e){Hu(t,e)}},{key:"warn",value:function(t){return this._getLogFunction(0,t,qu.warn,arguments,Yu)}},{key:"error",value:function(t){return this._getLogFunction(0,t,qu.error,arguments)}},{key:"deprecated",value:function(t,e){return this.warn("`".concat(t,"` is deprecated and will be removed in a later version. Use `").concat(e,"` instead"))}},{key:"removed",value:function(t,e){return this.error("`".concat(t,"` has been removed. Use `").concat(e,"` instead"))}},{key:"probe",value:function(t,e){return this._getLogFunction(t,e,qu.log,arguments,{time:!0,once:!0})}},{key:"log",value:function(t,e){return this._getLogFunction(t,e,qu.debug,arguments)}},{key:"info",value:function(t,e){return this._getLogFunction(t,e,console.info,arguments)}},{key:"once",value:function(t,e){return this._getLogFunction(t,e,qu.debug||qu.info,arguments,Yu)}},{key:"table",value:function(t,e,r){return e?this._getLogFunction(t,e,console.table||Qu,r&&[r],{tag:Zu(e)}):Qu}},{key:"image",value:function(t){var e=t.logLevel,n=t.priority,i=t.image,o=t.message,a=void 0===o?"":o,s=t.scale,u=void 0===s?1:s;return this._shouldLog(e||n)?Ru?function(t){var e=t.image,r=t.message,n=void 0===r?"":r,i=t.scale,o=void 0===i?1:i;if("string"==typeof e){var a=new Image;return a.onload=function(){var t,e=Du(a,n,o);(t=console).log.apply(t,Mu()(e))},a.src=e,Qu}var s=e.nodeName||"";if("img"===s.toLowerCase()){var u;return(u=console).log.apply(u,Mu()(Du(e,n,o))),Qu}if("canvas"===s.toLowerCase()){var c=new Image;return c.onload=function(){var t;return(t=console).log.apply(t,Mu()(Du(c,n,o)))},c.src=e.toDataURL(),Qu}return Qu}({image:i,message:a,scale:u}):function(t){var e=t.image,n=(t.message,t.scale),i=void 0===n?1:n,o=null;try{o=r(112)}catch(t){}if(o)return function(){return o(e,{fit:"box",width:"".concat(Math.round(80*i),"%")}).then((function(t){return console.log(t)}))};return Qu}({image:i,message:a,scale:u}):Qu}},{key:"settings",value:function(){console.table?console.table(this._storage.config):console.log(this._storage.config)}},{key:"get",value:function(t){return this._storage.config[t]}},{key:"set",value:function(t,e){this._storage.updateConfiguration(Ys()({},t,e))}},{key:"time",value:function(t,e){return this._getLogFunction(t,e,console.time?console.time:console.info)}},{key:"timeEnd",value:function(t,e){return this._getLogFunction(t,e,console.timeEnd?console.timeEnd:console.info)}},{key:"timeStamp",value:function(t,e){return this._getLogFunction(t,e,console.timeStamp||Qu)}},{key:"group",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{collapsed:!1},n=r=ec({logLevel:t,message:e,opts:r}),i=n.collapsed;return r.method=(i?console.groupCollapsed:console.group)||console.info,this._getLogFunction(r)}},{key:"groupCollapsed",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.group(t,e,Object.assign({},r,{collapsed:!0}))}},{key:"groupEnd",value:function(t){return this._getLogFunction(t,"",console.groupEnd||Qu)}},{key:"withGroup",value:function(t,e,r){this.group(t,e)();try{r()}finally{this.groupEnd(t)()}}},{key:"trace",value:function(){console.trace&&console.trace()}},{key:"_shouldLog",value:function(t){return this.isEnabled()&&this.getLevel()>=tc(t)}},{key:"_getLogFunction",value:function(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],i=arguments.length>4?arguments[4]:void 0;if(this._shouldLog(t)){var o;i=ec({logLevel:t,message:e,args:n,opts:i}),Hu(r=r||i.method),i.total=this.getTotal(),i.delta=this.getDelta(),this._deltaTs=Ku();var a=i.tag||i.message;if(i.once){if(Xu[a])return Qu;Xu[a]=Ku()}return e=rc(this.id,i.message,i),(o=r).bind.apply(o,[console,e].concat(Mu()(i.args)))}return Qu}}]),t}();function tc(t){if(!t)return 0;var e;switch(Ns()(t)){case"number":e=t;break;case"object":e=t.logLevel||t.priority||0;break;default:return 0}return Hu(Number.isFinite(e)&&e>=0),e}function ec(t){var e=t.logLevel,r=t.message;t.logLevel=tc(e);for(var n=t.args?Array.from(t.args):[];n.length&&n.shift()!==r;);switch(t.args=n,Ns()(e)){case"string":case"function":void 0!==r&&n.unshift(r),t.message=e;break;case"object":Object.assign(t,e)}"function"==typeof t.message&&(t.message=t.message());var i=Ns()(t.message);return Hu("string"===i||"object"===i),Object.assign(t,t.opts)}function rc(t,e,r){if("string"==typeof e){var n=r.time?function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8,r=Math.max(e-t.length,0);return"".concat(" ".repeat(r)).concat(t)}((s=r.total)<10?"".concat(s.toFixed(2),"ms"):s<100?"".concat(s.toFixed(1),"ms"):s<1e3?"".concat(s.toFixed(0),"ms"):"".concat((s/1e3).toFixed(2),"s")):"";e=r.time?"".concat(t,": ").concat(n," ").concat(e):"".concat(t,": ").concat(e),i=e,o=r.color,a=r.background,Ru||"string"!=typeof i||(o&&(o=ju(o),i="[".concat(o,"m").concat(i,"")),a&&(o=ju(a),i="[".concat(a+10,"m").concat(i,""))),e=i}var i,o,a,s;return e}$u.VERSION="8.8.16";var nc=new $u({id:"loaders.gl"}),ic=function(){function t(){ku()(this,t)}return Ou()(t,[{key:"log",value:function(){return function(){}}},{key:"info",value:function(){return function(){}}},{key:"warn",value:function(){return function(){}}},{key:"error",value:function(){return function(){}}}]),t}(),oc=function(){function t(){ku()(this,t),Tu(this,"console",void 0),this.console=console}return Ou()(t,[{key:"log",value:function(){for(var t,e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return(t=this.console.log).bind.apply(t,[this.console].concat(r))}},{key:"info",value:function(){for(var t,e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return(t=this.console.info).bind.apply(t,[this.console].concat(r))}},{key:"warn",value:function(){for(var t,e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return(t=this.console.warn).bind.apply(t,[this.console].concat(r))}},{key:"error",value:function(){for(var t,e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return(t=this.console.error).bind.apply(t,[this.console].concat(r))}}]),t}(),ac=("undefined"!=typeof self&&self,"undefined"!=typeof window&&window,"undefined"!=typeof global&&global,"undefined"!=typeof document&&document,Boolean("object"!==("undefined"==typeof process?"undefined":Ns()(process))||"[object process]"!==String(process)||process.browser)),sc="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version),uc=(sc&&parseFloat(sc[1]),{fetch:null,mimeType:void 0,nothrow:!1,log:new oc,CDN:"https://unpkg.com/@loaders.gl",worker:!0,maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:ac,_nodeWorkers:!1,_workerType:"",limit:0,_limitMB:0,batchSize:"auto",batchDebounceMs:0,metadata:!1,transforms:[]}),cc={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 lc(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return fc(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return fc(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function fc(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function hc(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function dc(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?hc(Object(r),!0).forEach((function(e){Ys()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):hc(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function pc(){globalThis.loaders=globalThis.loaders||{};var t=globalThis.loaders;return t._state=t._state||{},t._state}var vc=function(){var t=pc();return t.globalOptions=t.globalOptions||dc({},uc),t.globalOptions};function yc(t,e,r,n){return r=r||[],function(t,e){mc(t,null,uc,cc,e);var r,n=lc(e);try{for(n.s();!(r=n.n()).done;){var i=r.value,o=t&&t[i.id]||{},a=i.options&&i.options[i.id]||{},s=i.deprecatedOptions&&i.deprecatedOptions[i.id]||{};mc(o,i.id,a,s,e)}}catch(t){n.e(t)}finally{n.f()}}(t,r=Array.isArray(r)?r:[r]),Ac(e,t,n)}function gc(t,e){var r=vc(),n=t||r;return"function"==typeof n.fetch?n.fetch:Vs(n.fetch)?function(t){return _u(t,n)}:null!=e&&e.fetch?null==e?void 0:e.fetch:_u}function mc(t,e,r,n,i){var o=e||"Top level",a=e?"".concat(e,"."):"";for(var s in t){var u=!e&&Vs(t[s]);if(!(s in r||"baseUri"===s&&!e||"workerUrl"===s&&e))if(s in n)nc.warn("".concat(o," loader option '").concat(a).concat(s,"' no longer supported, use '").concat(n[s],"'"))();else if(!u){var c=bc(s,i);nc.warn("".concat(o," loader option '").concat(a).concat(s,"' not recognized. ").concat(c))()}}}function bc(t,e){var r,n=t.toLowerCase(),i="",o=lc(e);try{for(o.s();!(r=o.n()).done;){var a=r.value;for(var s in a.options){if(t===s)return"Did you mean '".concat(a.id,".").concat(s,"'?");var u=s.toLowerCase();(n.startsWith(u)||u.startsWith(n))&&(i=i||"Did you mean '".concat(a.id,".").concat(s,"'?"))}}}catch(t){o.e(t)}finally{o.f()}return i}function Ac(t,e,r){var n=dc({},t.options||{});return function(t,e){!e||"baseUri"in t||(t.baseUri=e)}(n,r),null===n.log&&(n.log=new ic),wc(n,vc()),wc(n,e),n}function wc(t,e){for(var r in e)if(r in e){var n=e[r];Js(n)&&Js(t[r])?t[r]=dc(dc({},t[r]),e[r]):t[r]=e[r]}}function Bc(t,e){if(!t)throw new Error(e||"loaders.gl assertion failed.")}function _c(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"3.3.0-alpha.5";Bc(t,"no worker provided");var r=t.version;return!(!e||!r)}var xc={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},Cc=xc.global||xc.self||xc.window||{},kc="object"!==("undefined"==typeof process?"undefined":Ns()(process))||"[object process]"!==String(process)||process.browser,Ec="function"==typeof importScripts,Oc="undefined"!=typeof window&&void 0!==window.orientation,Tc="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version),Sc=(Tc&&parseFloat(Tc[1]),function t(){ku()(this,t)}),Mc=new Map;function Ic(t){Bc(t.source&&!t.url||!t.source&&t.url);var e=Mc.get(t.source||t.url);return e||(t.url&&(e=function(t){if(!t.startsWith("http"))return t;return Rc((e=t,"try {\n importScripts('".concat(e,"');\n} catch (error) {\n console.error(error);\n throw error;\n}")));var e}(t.url),Mc.set(t.url,e)),t.source&&(e=Rc(t.source),Mc.set(t.source,e))),Bc(e),e}function Rc(t){var e=new Blob([t],{type:"application/javascript"});return URL.createObjectURL(e)}function Pc(t){return!!t&&(t instanceof ArrayBuffer||("undefined"!=typeof MessagePort&&t instanceof MessagePort||("undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas)))}var Fc=function(){},Dc=function(){function t(e){ku()(this,t),Tu(this,"name",void 0),Tu(this,"source",void 0),Tu(this,"url",void 0),Tu(this,"terminated",!1),Tu(this,"worker",void 0),Tu(this,"onMessage",void 0),Tu(this,"onError",void 0),Tu(this,"_loadableURL","");var r=e.name,n=e.source,i=e.url;Bc(n||i),this.name=r,this.source=n,this.url=i,this.onMessage=Fc,this.onError=function(t){return console.log(t)},this.worker=kc?this._createBrowserWorker():this._createNodeWorker()}return Ou()(t,[{key:"destroy",value:function(){this.onMessage=Fc,this.onError=Fc,this.worker.terminate(),this.terminated=!0}},{key:"isRunning",get:function(){return Boolean(this.onMessage)}},{key:"postMessage",value:function(t,e){e=e||function t(e){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2?arguments[2]:void 0,i=n||new Set;if(e){if(Pc(e))i.add(e);else if(Pc(e.buffer))i.add(e.buffer);else if(ArrayBuffer.isView(e));else if(r&&"object"===Ns()(e))for(var o in e)t(e[o],r,i)}else;return void 0===n?Array.from(i):[]}(t),this.worker.postMessage(t,e)}},{key:"_getErrorFromErrorEvent",value:function(t){var e="Failed to load ";return e+="worker ".concat(this.name," from ").concat(this.url,". "),t.message&&(e+="".concat(t.message," in ")),t.lineno&&(e+=":".concat(t.lineno,":").concat(t.colno)),new Error(e)}},{key:"_createBrowserWorker",value:function(){var t=this;this._loadableURL=Ic({source:this.source,url:this.url});var e=new Worker(this._loadableURL,{name:this.name});return e.onmessage=function(e){e.data?t.onMessage(e.data):t.onError(new Error("No data received"))},e.onerror=function(e){t.onError(t._getErrorFromErrorEvent(e)),t.terminated=!0},e.onmessageerror=function(t){return console.error(t)},e}},{key:"_createNodeWorker",value:function(){var t,e=this;if(this.url){var r=this.url.includes(":/")||this.url.startsWith("/")?this.url:"./".concat(this.url);t=new Sc(r,{eval:!1})}else{if(!this.source)throw new Error("no worker");t=new Sc(this.source,{eval:!0})}return t.on("message",(function(t){e.onMessage(t)})),t.on("error",(function(t){e.onError(t)})),t.on("exit",(function(t){})),t}}],[{key:"isSupported",value:function(){return"undefined"!=typeof Worker&&kc||!kc}}]),t}(),Lc=function(){function t(e,r){var n=this;ku()(this,t),Tu(this,"name",void 0),Tu(this,"workerThread",void 0),Tu(this,"isRunning",!0),Tu(this,"result",void 0),Tu(this,"_resolve",(function(){})),Tu(this,"_reject",(function(){})),this.name=e,this.workerThread=r,this.result=new Promise((function(t,e){n._resolve=t,n._reject=e}))}return Ou()(t,[{key:"postMessage",value:function(t,e){this.workerThread.postMessage({source:"loaders.gl",type:t,payload:e})}},{key:"done",value:function(t){Bc(this.isRunning),this.isRunning=!1,this._resolve(t)}},{key:"error",value:function(t){Bc(this.isRunning),this.isRunning=!1,this._reject(t)}}]),t}();function jc(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Gc(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?jc(Object(r),!0).forEach((function(e){Ys()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):jc(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var Nc=function(){function t(e){ku()(this,t),Tu(this,"name","unnamed"),Tu(this,"source",void 0),Tu(this,"url",void 0),Tu(this,"maxConcurrency",1),Tu(this,"maxMobileConcurrency",1),Tu(this,"onDebug",(function(){})),Tu(this,"reuseWorkers",!0),Tu(this,"props",{}),Tu(this,"jobQueue",[]),Tu(this,"idleQueue",[]),Tu(this,"count",0),Tu(this,"isDestroyed",!1),this.source=e.source,this.url=e.url,this.setProps(e)}var e,r;return Ou()(t,[{key:"destroy",value:function(){this.idleQueue.forEach((function(t){return t.destroy()})),this.isDestroyed=!0}},{key:"setProps",value:function(t){this.props=Gc(Gc({},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)}},{key:"startJob",value:(r=Ds()(js.a.mark((function t(e){var r,n,i,o=this,a=arguments;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=a.length>1&&void 0!==a[1]?a[1]:function(t,e,r){return t.done(r)},n=a.length>2&&void 0!==a[2]?a[2]:function(t,e){return t.error(e)},i=new Promise((function(t){return o.jobQueue.push({name:e,onMessage:r,onError:n,onStart:t}),o})),this._startQueuedJob(),t.next=6,i;case 6:return t.abrupt("return",t.sent);case 7:case"end":return t.stop()}}),t,this)}))),function(t){return r.apply(this,arguments)})},{key:"_startQueuedJob",value:(e=Ds()(js.a.mark((function t(){var e,r,n;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.jobQueue.length){t.next=2;break}return t.abrupt("return");case 2:if(e=this._getAvailableWorker()){t.next=5;break}return t.abrupt("return");case 5:if(!(r=this.jobQueue.shift())){t.next=18;break}return this.onDebug({message:"Starting job",name:r.name,workerThread:e,backlog:this.jobQueue.length}),n=new Lc(r.name,e),e.onMessage=function(t){return r.onMessage(n,t.type,t.payload)},e.onError=function(t){return r.onError(n,t)},r.onStart(n),t.prev=12,t.next=15,n.result;case 15:return t.prev=15,this.returnWorkerToQueue(e),t.finish(15);case 18:case"end":return t.stop()}}),t,this,[[12,,15,18]])}))),function(){return e.apply(this,arguments)})},{key:"returnWorkerToQueue",value:function(t){this.isDestroyed||!this.reuseWorkers||this.count>this._getMaxConcurrency()?(t.destroy(),this.count--):this.idleQueue.push(t),this.isDestroyed||this._startQueuedJob()}},{key:"_getAvailableWorker",value:function(){if(this.idleQueue.length>0)return this.idleQueue.shift()||null;if(this.count<this._getMaxConcurrency()){this.count++;var t="".concat(this.name.toLowerCase()," (#").concat(this.count," of ").concat(this.maxConcurrency,")");return new Dc({name:t,source:this.source,url:this.url})}return null}},{key:"_getMaxConcurrency",value:function(){return Oc?this.maxMobileConcurrency:this.maxConcurrency}}],[{key:"isSupported",value:function(){return Dc.isSupported()}}]),t}();function Uc(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return Hc(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Hc(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function Hc(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Vc(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Jc(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Vc(Object(r),!0).forEach((function(e){Ys()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Vc(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var zc={maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:!0,onDebug:function(){}},Kc=function(){function t(e){ku()(this,t),Tu(this,"props",void 0),Tu(this,"workerPools",new Map),this.props=Jc({},zc),this.setProps(e),this.workerPools=new Map}return Ou()(t,[{key:"destroy",value:function(){var t,e=Uc(this.workerPools.values());try{for(e.s();!(t=e.n()).done;){t.value.destroy()}}catch(t){e.e(t)}finally{e.f()}this.workerPools=new Map}},{key:"setProps",value:function(t){this.props=Jc(Jc({},this.props),t);var e,r=Uc(this.workerPools.values());try{for(r.s();!(e=r.n()).done;){e.value.setProps(this._getWorkerPoolProps())}}catch(t){r.e(t)}finally{r.f()}}},{key:"getWorkerPool",value:function(t){var e=t.name,r=t.source,n=t.url,i=this.workerPools.get(e);return i||((i=new Nc({name:e,source:r,url:n})).setProps(this._getWorkerPoolProps()),this.workerPools.set(e,i)),i}},{key:"_getWorkerPoolProps",value:function(){return{maxConcurrency:this.props.maxConcurrency,maxMobileConcurrency:this.props.maxMobileConcurrency,reuseWorkers:this.props.reuseWorkers,onDebug:this.props.onDebug}}}],[{key:"isSupported",value:function(){return Dc.isSupported()}},{key:"getWorkerFarm",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t._workerFarm=t._workerFarm||new t({}),t._workerFarm.setProps(e),t._workerFarm}}]),t}();Tu(Kc,"_workerFarm",void 0);function qc(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e[t.id]||{},n="".concat(t.id,"-worker.js"),i=r.workerUrl;if(i||"compression"!==t.id||(i=e.workerUrl),"test"===e._workerType&&(i="modules/".concat(t.module,"/dist/").concat(n)),!i){var o=t.version;"latest"===o&&(o="beta");var a=o?"@".concat(o):"";i="https://unpkg.com/@loaders.gl/".concat(t.module).concat(a,"/dist/").concat(n)}return Bc(i),i}function Wc(t,e){return!!Kc.isSupported()&&(!!(kc||null!=e&&e._nodeWorkers)&&(t.worker&&(null==e?void 0:e.worker)))}function Qc(t,e,r,n,i){return Xc.apply(this,arguments)}function Xc(){return(Xc=Ds()(js.a.mark((function t(e,r,n,i,o){var a,s,u,c,l,f;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a=e.id,s=qc(e,n),u=Kc.getWorkerFarm(n),c=u.getWorkerPool({name:a,url:s}),n=JSON.parse(JSON.stringify(n)),i=JSON.parse(JSON.stringify(i||{})),t.next=8,c.startJob("process-on-worker",Yc.bind(null,o));case 8:return(l=t.sent).postMessage("process",{input:r,options:n,context:i}),t.next=12,l.result;case 12:return f=t.sent,t.next=15,f.result;case 15:return t.abrupt("return",t.sent);case 16:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Yc(t,e,r,n){return Zc.apply(this,arguments)}function Zc(){return(Zc=Ds()(js.a.mark((function t(e,r,n,i){var o,a,s,u,c;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:t.t0=n,t.next="done"===t.t0?3:"error"===t.t0?5:"process"===t.t0?7:20;break;case 3:return r.done(i),t.abrupt("break",21);case 5:return r.error(new Error(i.error)),t.abrupt("break",21);case 7:return o=i.id,a=i.input,s=i.options,t.prev=8,t.next=11,e(a,s);case 11:u=t.sent,r.postMessage("done",{id:o,result:u}),t.next=19;break;case 15:t.prev=15,t.t1=t.catch(8),c=t.t1 instanceof Error?t.t1.message:"unknown error",r.postMessage("error",{id:o,error:c});case 19:return t.abrupt("break",21);case 20:console.warn("parse-with-worker unknown message ".concat(n));case 21:case"end":return t.stop()}}),t,null,[[8,15]])})))).apply(this,arguments)}var $c=r(45),tl=r.n($c);r(53);function el(t){return t&&"object"===Ns()(t)&&t.isBuffer}function rl(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return nl(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return nl(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function nl(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function il(t){if(el(t))return el(e=t)?new Uint8Array(e.buffer,e.byteOffset,e.length).slice().buffer:e;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){var r=t;return(new TextEncoder).encode(r).buffer}if(t&&"object"===Ns()(t)&&t._toArrayBuffer)return t._toArrayBuffer();throw new Error("toArrayBuffer")}function ol(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];var n,i=e.map((function(t){return t instanceof ArrayBuffer?new Uint8Array(t):t})),o=i.reduce((function(t,e){return t+e.byteLength}),0),a=new Uint8Array(o),s=0,u=rl(i);try{for(u.s();!(n=u.n()).done;){var c=n.value;a.set(c,s),s+=c.byteLength}}catch(t){u.e(t)}finally{u.f()}return a.buffer}function al(t,e,r){var n=void 0!==r?new Uint8Array(t).subarray(e,e+r):new Uint8Array(t).subarray(e);return new Uint8Array(n).buffer}function sl(t){return ul.apply(this,arguments)}function ul(){return(ul=Ds()(js.a.mark((function t(e){var r,n,i,o,a,s,u;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=[],n=!1,i=!1,t.prev=3,a=tl()(e);case 5:return t.next=7,a.next();case 7:if(!(n=!(s=t.sent).done)){t.next=13;break}u=s.value,r.push(u);case 10:n=!1,t.next=5;break;case 13:t.next=19;break;case 15:t.prev=15,t.t0=t.catch(3),i=!0,o=t.t0;case 19:if(t.prev=19,t.prev=20,!n||null==a.return){t.next=24;break}return t.next=24,a.return();case 24:if(t.prev=24,!i){t.next=27;break}throw o;case 27:return t.finish(24);case 28:return t.finish(19);case 29:return t.abrupt("return",ol.apply(void 0,r));case 30:case"end":return t.stop()}}),t,null,[[3,15,19,29],[20,,24,28]])})))).apply(this,arguments)}var cl=js.a.mark(ll);function ll(t,e){var r,n,i,o,a;return js.a.wrap((function(s){for(;;)switch(s.prev=s.next){case 0:r=(null==e?void 0:e.chunkSize)||262144,n=0,i=new TextEncoder;case 3:if(!(n<t.length)){s.next=11;break}return o=Math.min(t.length-n,r),a=t.slice(n,n+o),n+=o,s.next=9,i.encode(a);case 9:s.next=3;break;case 11:case"end":return s.stop()}}),cl)}var fl=js.a.mark(hl);function hl(t){var e,r,n,i,o,a,s,u=arguments;return js.a.wrap((function(c){for(;;)switch(c.prev=c.next){case 0:e=u.length>1&&void 0!==u[1]?u[1]:{},r=e.chunkSize,n=void 0===r?262144:r,i=0;case 3:if(!(i<t.byteLength)){c.next=14;break}return o=Math.min(t.byteLength-i,n),a=new ArrayBuffer(o),s=new Uint8Array(t,i,o),new Uint8Array(a).set(s),i+=o,c.next=12,a;case 12:c.next=3;break;case 14:case"end":return c.stop()}}),fl)}var dl=r(41),pl=r.n(dl),vl=r(44),yl=r.n(vl);function gl(){return(gl=yl()(js.a.mark((function t(e,r){var n,i,o,a;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=(null==r?void 0:r.chunkSize)||1048576,i=0;case 2:if(!(i<e.size)){t.next=12;break}return o=i+n,t.next=6,pl()(e.slice(i,o).arrayBuffer());case 6:return a=t.sent,i=o,t.next=10,a;case 10:t.next=2;break;case 12:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function ml(t,e){return ac?function(t,e){return bl.apply(this,arguments)}(t,e):function(t,e){return Al.apply(this,arguments)}(t,e)}function bl(){return(bl=yl()(js.a.mark((function t(e,r){var n,i,o,a,s,u;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=e.getReader(),t.prev=1;case 2:return o=i||n.read(),null!=r&&r._streamReadAhead&&(i=n.read()),t.next=7,pl()(o);case 7:if(a=t.sent,s=a.done,u=a.value,!s){t.next=12;break}return t.abrupt("return");case 12:return t.next=14,il(u);case 14:t.next=2;break;case 16:t.next=21;break;case 18:t.prev=18,t.t0=t.catch(1),n.releaseLock();case 21:case"end":return t.stop()}}),t,null,[[1,18]])})))).apply(this,arguments)}function Al(){return(Al=yl()(js.a.mark((function t(e,r){var n,i,o,a,s,u;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=!1,i=!1,t.prev=2,a=tl()(e);case 4:return t.next=6,pl()(a.next());case 6:if(!(n=!(s=t.sent).done)){t.next=13;break}return u=s.value,t.next=10,il(u);case 10:n=!1,t.next=4;break;case 13:t.next=19;break;case 15:t.prev=15,t.t0=t.catch(2),i=!0,o=t.t0;case 19:if(t.prev=19,t.prev=20,!n||null==a.return){t.next=24;break}return t.next=24,pl()(a.return());case 24:if(t.prev=24,!i){t.next=27;break}throw o;case 27:return t.finish(24);case 28:return t.finish(19);case 29:case"end":return t.stop()}}),t,null,[[2,15,19,29],[20,,24,28]])})))).apply(this,arguments)}function wl(t,e){if("string"==typeof t)return ll(t,e);if(t instanceof ArrayBuffer)return hl(t,e);if(Ws(t))return function(t,e){return gl.apply(this,arguments)}(t,e);if(Qs(t))return ml(t,e);if(qs(t))return ml(t.body,e);throw new Error("makeIterator")}var Bl="Cannot convert supplied data type";function _l(t,e,r){if(e.text&&"string"==typeof t)return t;var n;if((n=t)&&"object"===Ns()(n)&&n.isBuffer&&(t=t.buffer),t instanceof ArrayBuffer){var i=t;return e.text&&!e.binary?new TextDecoder("utf8").decode(i):i}if(ArrayBuffer.isView(t)){if(e.text&&!e.binary)return new TextDecoder("utf8").decode(t);var o=t.buffer,a=t.byteLength||t.length;return 0===t.byteOffset&&a===o.byteLength||(o=o.slice(t.byteOffset,t.byteOffset+a)),o}throw new Error(Bl)}function xl(t,e,r){return Cl.apply(this,arguments)}function Cl(){return(Cl=Ds()(js.a.mark((function t(e,r,n){var i,o;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i=e instanceof ArrayBuffer||ArrayBuffer.isView(e),"string"!=typeof e&&!i){t.next=3;break}return t.abrupt("return",_l(e,r));case 3:if(!Ws(e)){t.next=7;break}return t.next=6,pu(e);case 6:e=t.sent;case 7:if(!qs(e)){t.next=21;break}return o=e,t.next=11,yu(o);case 11:if(!r.binary){t.next=17;break}return t.next=14,o.arrayBuffer();case 14:t.t0=t.sent,t.next=20;break;case 17:return t.next=19,o.text();case 19:t.t0=t.sent;case 20:return t.abrupt("return",t.t0);case 21:if(Qs(e)&&(e=wl(e,n)),!zs(e)&&!Ks(e)){t.next=24;break}return t.abrupt("return",sl(e));case 24:throw new Error(Bl);case 25:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function kl(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function El(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?kl(Object(r),!0).forEach((function(e){Ys()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):kl(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Ol(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(r)return r;var n=El({fetch:gc(e,t)},t);return Array.isArray(n.loaders)||(n.loaders=null),n}function Tl(t,e){if(!e&&t&&!Array.isArray(t))return t;var r;if(t&&(r=Array.isArray(t)?t:[t]),e&&e.loaders){var n=Array.isArray(e.loaders)?e.loaders:[e.loaders];r=r?[].concat(Mu()(r),Mu()(n)):n}return r&&r.length?r:null}function Sl(t){var e=t&&t.lastIndexOf("/");return e>=0?t.substr(e+1):""}function Ml(t){var e=t&&t.lastIndexOf("/");return e>=0?t.substr(0,e):""}function Il(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];var n="/";return(e=e.map((function(t,r){return r&&(t=t.replace(new RegExp("^".concat(n)),"")),r!==e.length-1&&(t=t.replace(new RegExp("".concat(n,"$")),"")),t}))).join(n)}r(50),r(64);function Rl(){return!("object"===("undefined"==typeof process?"undefined":Ns()(process))&&"[object process]"===String(process)&&!process.browser)||function(t){if("undefined"!=typeof window&&"object"===Ns()(window.process)&&"renderer"===window.process.type)return!0;if("undefined"!=typeof process&&"object"===Ns()(process.versions)&&Boolean(process.versions.electron))return!0;var e="object"===("undefined"==typeof navigator?"undefined":Ns()(navigator))&&"string"==typeof navigator.userAgent&&navigator.userAgent,r=t||e;return!!(r&&r.indexOf("Electron")>=0)}()}Rl();function Pl(t){try{var e=window[t],r="__storage_test__";return e.setItem(r,r),e.removeItem(r),e}catch(t){return null}}var Fl,Dl=function(){function t(e){ku()(this,t);var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"sessionStorage";Tu(this,"storage",void 0),Tu(this,"id",void 0),Tu(this,"config",{}),this.storage=Pl(n),this.id=e,this.config={},Object.assign(this.config,r),this._loadConfiguration()}return Ou()(t,[{key:"getConfiguration",value:function(){return this.config}},{key:"setConfiguration",value:function(t){return this.config={},this.updateConfiguration(t)}},{key:"updateConfiguration",value:function(t){if(Object.assign(this.config,t),this.storage){var e=JSON.stringify(this.config);this.storage.setItem(this.id,e)}return this}},{key:"_loadConfiguration",value:function(){var t={};if(this.storage){var e=this.storage.getItem(this.id);t=e?JSON.parse(e):{}}return Object.assign(this.config,t),this}}]),t}();function Ll(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:600,i=t.src.replace(/\(/g,"%28").replace(/\)/g,"%29");t.width>n&&(r=Math.min(r,n/t.width));var o=t.width*r,a=t.height*r,s=["font-size:1px;","padding:".concat(Math.floor(a/2),"px ").concat(Math.floor(o/2),"px;"),"line-height:".concat(a,"px;"),"background:url(".concat(i,");"),"background-size:".concat(o,"px ").concat(a,"px;"),"color:transparent;"].join("");return["".concat(e," %c+"),s]}function jl(t){return"string"==typeof t?Fl[t.toUpperCase()]||Fl.WHITE:t}function Gl(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return Nl(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Nl(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function Nl(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Ul(t){var e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["constructor"],n=Object.getPrototypeOf(t),i=Object.getOwnPropertyNames(n),o=Gl(i);try{var a=function(){var n=e.value;"function"==typeof t[n]&&(r.find((function(t){return n===t}))||(t[n]=t[n].bind(t)))};for(o.s();!(e=o.n()).done;)a()}catch(t){o.e(t)}finally{o.f()}}function Hl(t,e){if(!t)throw new Error(e||"Assertion failed")}!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"}(Fl||(Fl={}));var Vl={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document,process:"object"===("undefined"==typeof process?"undefined":Ns()(process))&&process},Jl=(globalThis,Vl.window||Vl.self||Vl.global),zl=Vl.process||{};console;function Kl(){var t,e,r;if(Rl&&"performance"in Jl)t=null==Jl?void 0:null===(e=Jl.performance)||void 0===e?void 0:null===(r=e.now)||void 0===r?void 0:r.call(e);else if("hrtime"in zl){var n,i=null==zl?void 0:null===(n=zl.hrtime)||void 0===n?void 0:n.call(zl);t=1e3*i[0]+i[1]/1e6}else t=Date.now();return t}var ql={debug:Rl&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},Wl={enabled:!0,level:0};function Ql(){}var Xl={},Yl={once:!0},Zl=function(){function t(){ku()(this,t);var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{id:""},r=e.id;Tu(this,"id",void 0),Tu(this,"VERSION","8.8.16"),Tu(this,"_startTs",Kl()),Tu(this,"_deltaTs",Kl()),Tu(this,"_storage",void 0),Tu(this,"userData",{}),Tu(this,"LOG_THROTTLE_TIMEOUT",0),this.id=r,this._storage=new Dl("__probe-".concat(this.id,"__"),Wl),this.userData={},this.timeStamp("".concat(this.id," started")),Ul(this),Object.seal(this)}return Ou()(t,[{key:"level",get:function(){return this.getLevel()},set:function(t){this.setLevel(t)}},{key:"isEnabled",value:function(){return this._storage.config.enabled}},{key:"getLevel",value:function(){return this._storage.config.level}},{key:"getTotal",value:function(){return Number((Kl()-this._startTs).toPrecision(10))}},{key:"getDelta",value:function(){return Number((Kl()-this._deltaTs).toPrecision(10))}},{key:"priority",get:function(){return this.level},set:function(t){this.level=t}},{key:"getPriority",value:function(){return this.level}},{key:"enable",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this._storage.updateConfiguration({enabled:t}),this}},{key:"setLevel",value:function(t){return this._storage.updateConfiguration({level:t}),this}},{key:"get",value:function(t){return this._storage.config[t]}},{key:"set",value:function(t,e){this._storage.updateConfiguration(Ys()({},t,e))}},{key:"settings",value:function(){console.table?console.table(this._storage.config):console.log(this._storage.config)}},{key:"assert",value:function(t,e){Hl(t,e)}},{key:"warn",value:function(t){return this._getLogFunction(0,t,ql.warn,arguments,Yl)}},{key:"error",value:function(t){return this._getLogFunction(0,t,ql.error,arguments)}},{key:"deprecated",value:function(t,e){return this.warn("`".concat(t,"` is deprecated and will be removed in a later version. Use `").concat(e,"` instead"))}},{key:"removed",value:function(t,e){return this.error("`".concat(t,"` has been removed. Use `").concat(e,"` instead"))}},{key:"probe",value:function(t,e){return this._getLogFunction(t,e,ql.log,arguments,{time:!0,once:!0})}},{key:"log",value:function(t,e){return this._getLogFunction(t,e,ql.debug,arguments)}},{key:"info",value:function(t,e){return this._getLogFunction(t,e,console.info,arguments)}},{key:"once",value:function(t,e){for(var r=arguments.length,n=new Array(r>2?r-2:0),i=2;i<r;i++)n[i-2]=arguments[i];return this._getLogFunction(t,e,ql.debug||ql.info,arguments,Yl)}},{key:"table",value:function(t,e,r){return e?this._getLogFunction(t,e,console.table||Ql,r&&[r],{tag:ef(e)}):Ql}},{key:"image",value:function(t){var e=t.logLevel,n=t.priority,i=t.image,o=t.message,a=void 0===o?"":o,s=t.scale,u=void 0===s?1:s;return this._shouldLog(e||n)?Rl?function(t){var e=t.image,r=t.message,n=void 0===r?"":r,i=t.scale,o=void 0===i?1:i;if("string"==typeof e){var a=new Image;return a.onload=function(){var t,e=Ll(a,n,o);(t=console).log.apply(t,Mu()(e))},a.src=e,Ql}var s=e.nodeName||"";if("img"===s.toLowerCase()){var u;return(u=console).log.apply(u,Mu()(Ll(e,n,o))),Ql}if("canvas"===s.toLowerCase()){var c=new Image;return c.onload=function(){var t;return(t=console).log.apply(t,Mu()(Ll(c,n,o)))},c.src=e.toDataURL(),Ql}return Ql}({image:i,message:a,scale:u}):function(t){var e=t.image,n=(t.message,t.scale),i=void 0===n?1:n,o=null;try{o=r(113)}catch(t){}if(o)return function(){return o(e,{fit:"box",width:"".concat(Math.round(80*i),"%")}).then((function(t){return console.log(t)}))};return Ql}({image:i,message:a,scale:u}):Ql}},{key:"time",value:function(t,e){return this._getLogFunction(t,e,console.time?console.time:console.info)}},{key:"timeEnd",value:function(t,e){return this._getLogFunction(t,e,console.timeEnd?console.timeEnd:console.info)}},{key:"timeStamp",value:function(t,e){return this._getLogFunction(t,e,console.timeStamp||Ql)}},{key:"group",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{collapsed:!1},n=tf({logLevel:t,message:e,opts:r}),i=r.collapsed;return n.method=(i?console.groupCollapsed:console.group)||console.info,this._getLogFunction(n)}},{key:"groupCollapsed",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.group(t,e,Object.assign({},r,{collapsed:!0}))}},{key:"groupEnd",value:function(t){return this._getLogFunction(t,"",console.groupEnd||Ql)}},{key:"withGroup",value:function(t,e,r){this.group(t,e)();try{r()}finally{this.groupEnd(t)()}}},{key:"trace",value:function(){console.trace&&console.trace()}},{key:"_shouldLog",value:function(t){return this.isEnabled()&&this.getLevel()>=$l(t)}},{key:"_getLogFunction",value:function(t,e,r,n,i){if(this._shouldLog(t)){var o;i=tf({logLevel:t,message:e,args:n,opts:i}),Hl(r=r||i.method),i.total=this.getTotal(),i.delta=this.getDelta(),this._deltaTs=Kl();var a=i.tag||i.message;if(i.once){if(Xl[a])return Ql;Xl[a]=Kl()}return e=function(t,e,r){if("string"==typeof e){var n=r.time?function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8,r=Math.max(e-t.length,0);return"".concat(" ".repeat(r)).concat(t)}((s=r.total)<10?"".concat(s.toFixed(2),"ms"):s<100?"".concat(s.toFixed(1),"ms"):s<1e3?"".concat(s.toFixed(0),"ms"):"".concat((s/1e3).toFixed(2),"s")):"";e=r.time?"".concat(t,": ").concat(n," ").concat(e):"".concat(t,": ").concat(e),i=e,o=r.color,a=r.background,Rl||"string"!=typeof i||(o&&(o=jl(o),i="[".concat(o,"m").concat(i,"")),a&&(o=jl(a),i="[".concat(a+10,"m").concat(i,""))),e=i}var i,o,a;var s;return e}(this.id,i.message,i),(o=r).bind.apply(o,[console,e].concat(Mu()(i.args)))}return Ql}}]),t}();function $l(t){if(!t)return 0;var e;switch(Ns()(t)){case"number":e=t;break;case"object":e=t.logLevel||t.priority||0;break;default:return 0}return Hl(Number.isFinite(e)&&e>=0),e}function tf(t){var e=t.logLevel,r=t.message;t.logLevel=$l(e);for(var n=t.args?Array.from(t.args):[];n.length&&n.shift()!==r;);switch(Ns()(e)){case"string":case"function":void 0!==r&&n.unshift(r),t.message=e;break;case"object":Object.assign(t,e)}"function"==typeof t.message&&(t.message=t.message());var i=Ns()(t.message);return Hl("string"===i||"object"===i),Object.assign(t,{args:n},t.opts)}function ef(t){for(var e in t)for(var r in t[e])return r||"untitled";return"empty"}Tu(Zl,"VERSION","8.8.16");var rf=new Zl({id:"loaders.gl"});var nf=function(){var t=pc();return t.loaderRegistry=t.loaderRegistry||[],t.loaderRegistry};function of(){return nf()}function af(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function sf(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?af(Object(r),!0).forEach((function(e){Ys()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):af(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function uf(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return cf(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return cf(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function cf(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var lf=/\.([^.]+)$/;function ff(t){return hf.apply(this,arguments)}function hf(){return(hf=Ds()(js.a.mark((function t(e){var r,n,i,o,a=arguments;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=a.length>1&&void 0!==a[1]?a[1]:[],n=a.length>2?a[2]:void 0,i=a.length>3?a[3]:void 0,vf(e)){t.next=5;break}return t.abrupt("return",null);case 5:if(!(o=df(e,r,sf(sf({},n),{},{nothrow:!0}),i))){t.next=8;break}return t.abrupt("return",o);case 8:if(!Ws(e)){t.next=13;break}return t.next=11,e.slice(0,10).arrayBuffer();case 11:e=t.sent,o=df(e,r,n,i);case 13:if(o||null!=n&&n.nothrow){t.next=15;break}throw new Error(yf(e));case 15:return t.abrupt("return",o);case 16:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function df(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0;if(!vf(t))return null;if(e&&!Array.isArray(e))return ru(e);var i,o=[];(e&&(o=o.concat(e)),null!=r&&r.ignoreRegisteredLoaders)||(i=o).push.apply(i,Mu()(of()));gf(o);var a=pf(t,o,r,n);if(!(a||null!=r&&r.nothrow))throw new Error(yf(t));return a}function pf(t,e,r,n){var i,o=fu(t),a=o.url,s=o.type,u=a||(null==n?void 0:n.url),c=null,l="";(null!=r&&r.mimeType&&(c=mf(e,null==r?void 0:r.mimeType),l="match forced by supplied MIME type ".concat(null==r?void 0:r.mimeType)),c=c||function(t,e){var r=e&&lf.exec(e),n=r&&r[1];return n?function(t,e){e=e.toLowerCase();var r,n=uf(t);try{for(n.s();!(r=n.n()).done;){var i,o=r.value,a=uf(o.extensions);try{for(a.s();!(i=a.n()).done;){if(i.value.toLowerCase()===e)return o}}catch(t){a.e(t)}finally{a.f()}}}catch(t){n.e(t)}finally{n.f()}return null}(t,n):null}(e,u),l=l||(c?"matched url ".concat(u):""),c=c||mf(e,s),l=l||(c?"matched MIME type ".concat(s):""),c=c||function(t,e){if(!e)return null;var r,n=uf(t);try{for(n.s();!(r=n.n()).done;){var i=r.value;if("string"==typeof e){if(bf(e,i))return i}else if(ArrayBuffer.isView(e)){if(Af(e.buffer,e.byteOffset,i))return i}else if(e instanceof ArrayBuffer){if(Af(e,0,i))return i}}}catch(t){n.e(t)}finally{n.f()}return null}(e,t),l=l||(c?"matched initial data ".concat(wf(t)):""),c=c||mf(e,null==r?void 0:r.fallbackMimeType),l=l||(c?"matched fallback MIME type ".concat(s):""))&&rf.log(1,"selectLoader selected ".concat(null===(i=c)||void 0===i?void 0:i.name,": ").concat(l,"."));return c}function vf(t){return!(t instanceof Response&&204===t.status)}function yf(t){var e=fu(t),r=e.url,i=e.type,o="No valid loader found (";o+=r?"".concat(n.filename(r),", "):"no url provided, ",o+="MIME type: ".concat(i?'"'.concat(i,'"'):"not provided",", ");var a=t?wf(t):"";return o+=a?' first bytes: "'.concat(a,'"'):"first bytes: not available",o+=")"}function gf(t){var e,r=uf(t);try{for(r.s();!(e=r.n()).done;){ru(e.value)}}catch(t){r.e(t)}finally{r.f()}}function mf(t,e){var r,n=uf(t);try{for(n.s();!(r=n.n()).done;){var i=r.value;if(i.mimeTypes&&i.mimeTypes.includes(e))return i;if(e==="application/x.".concat(i.id))return i}}catch(t){n.e(t)}finally{n.f()}return null}function bf(t,e){return e.testText?e.testText(t):(Array.isArray(e.tests)?e.tests:[e.tests]).some((function(e){return t.startsWith(e)}))}function Af(t,e,r){return(Array.isArray(r.tests)?r.tests:[r.tests]).some((function(n){return function(t,e,r,n){if(n instanceof ArrayBuffer)return function(t,e,r){if(r=r||t.byteLength,t.byteLength<r||e.byteLength<r)return!1;for(var n=new Uint8Array(t),i=new Uint8Array(e),o=0;o<n.length;++o)if(n[o]!==i[o])return!1;return!0}(n,t,n.byteLength);switch(Ns()(n)){case"function":return n(t,r);case"string":var i=Bf(t,e,n.length);return n===i;default:return!1}}(t,e,r,n)}))}function wf(t){var 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 Bf(t.buffer,t.byteOffset,e);if(t instanceof ArrayBuffer){var r=0;return Bf(t,r,e)}return""}function Bf(t,e,r){if(t.byteLength<e+r)return"";for(var n=new DataView(t),i="",o=0;o<r;o++)i+=String.fromCharCode(n.getUint8(e+o));return i}function _f(t,e,r,n){return xf.apply(this,arguments)}function xf(){return(xf=Ds()(js.a.mark((function t(e,r,n,i){var o,a,s,u;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return Bc(!i||"object"===Ns()(i)),!r||Array.isArray(r)||eu(r)||(i=void 0,n=r,r=void 0),t.next=4,e;case 4:return e=t.sent,n=n||{},o=fu(e),a=o.url,s=Tl(r,i),t.next=11,ff(e,s,n);case 11:if(u=t.sent){t.next=14;break}return t.abrupt("return",null);case 14:return n=yc(n,u,s,a),i=Ol({url:a,parse:_f,loaders:s},n,i),t.next=18,Cf(u,e,n,i);case 18:return t.abrupt("return",t.sent);case 19:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Cf(t,e,r,n){return kf.apply(this,arguments)}function kf(){return(kf=Ds()(js.a.mark((function t(e,r,n,i){var o,a,s,u,c,l,f,h;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return _c(e),qs(r)&&(a=(o=r).ok,s=o.redirected,u=o.status,c=o.statusText,l=o.type,f=o.url,h=Object.fromEntries(o.headers.entries()),i.response={headers:h,ok:a,redirected:s,status:u,statusText:c,type:l,url:f}),t.next=4,xl(r,e,n);case 4:if(r=t.sent,!e.parseTextSync||"string"!=typeof r){t.next=8;break}return n.dataType="text",t.abrupt("return",e.parseTextSync(r,n,i,e));case 8:if(!Wc(e,n)){t.next=12;break}return t.next=11,Qc(e,r,n,i,_f);case 11:return t.abrupt("return",t.sent);case 12:if(!e.parseText||"string"!=typeof r){t.next=16;break}return t.next=15,e.parseText(r,n,i,e);case 15:return t.abrupt("return",t.sent);case 16:if(!e.parse){t.next=20;break}return t.next=19,e.parse(r,n,i,e);case 19:return t.abrupt("return",t.sent);case 20:throw Bc(!e.parseSync),new Error("".concat(e.id," loader - no parser found and worker is disabled"));case 22:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Ef(t,e,r,n){return Of.apply(this,arguments)}function Of(){return(Of=Ds()(js.a.mark((function t(e,r,n,i){var o,a;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(Array.isArray(r)||eu(r)||(void 0,n=r,r=void 0),o=gc(n),a=e,"string"!=typeof e){t.next=7;break}return t.next=6,o(e);case 6:a=t.sent;case 7:if(!Ws(e)){t.next=11;break}return t.next=10,o(e);case 10:a=t.sent;case 11:return t.next=13,_f(a,r,n);case 13:return t.abrupt("return",t.sent);case 14:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var Tf=r(19),Sf=r.n(Tf),Mf=r(11),If=r.n(Mf),Rf=r(21),Pf=r.n(Rf),Ff=r(17),Df=r.n(Ff);r(72);function Lf(t,e){if(!t)throw new Error("math.gl assertion ".concat(e))}var jf=1/Math.PI*180,Gf=1/180*Math.PI,Nf={};function Uf(t){return Math.round(t/Nf.EPSILON)*Nf.EPSILON}function Hf(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.precision,n=void 0===r?Nf.precision||4:r;return t=Uf(t),"".concat(parseFloat(t.toPrecision(n)))}function Vf(t){return Array.isArray(t)||ArrayBuffer.isView(t)&&!(t instanceof DataView)}function Jf(t,e,r){if(Vf(t)){r=r||((i=t).clone?i.clone():new Array(i.length));for(var n=0;n<r.length&&n<t.length;++n)r[n]=e(t[n],n,r);return r}var i;return e(t)}function zf(t){return function(t,e){return Jf(t,(function(t){return t*Gf}),e)}(t)}function Kf(t){return qf(t)}function qf(t,e){return Jf(t,(function(t){return t*jf}),e)}function Wf(t,e,r){return Jf(t,(function(t){return Math.max(e,Math.min(r,t))}))}function Qf(t,e,r){var n=Nf.EPSILON;r&&(Nf.EPSILON=r);try{if(t===e)return!0;if(Vf(t)&&Vf(e)){if(t.length!==e.length)return!1;for(var i=0;i<t.length;++i)if(!Qf(t[i],e[i]))return!1;return!0}return t&&t.equals?t.equals(e):e&&e.equals?e.equals(t):!(!Number.isFinite(t)||!Number.isFinite(e))&&Math.abs(t-e)<=Nf.EPSILON*Math.max(1,Math.abs(t),Math.abs(e))}finally{Nf.EPSILON=n}}function Xf(t,e){if(t.length!==e)return!1;for(var r=0;r<t.length;++r)if(!Number.isFinite(t[r]))return!1;return!0}function Yf(t){if(!Number.isFinite(t))throw new Error("Invalid number ".concat(t));return t}function Zf(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(Nf.debug&&!Xf(t,e))throw new Error("math.gl: ".concat(r," some fields set to invalid numbers'"));return t}Nf.EPSILON=1e-12,Nf.debug=!1,Nf.precision=4,Nf.printTypes=!1,Nf.printDegrees=!1,Nf.printRowMajor=!0;var $f={};function th(t,e){$f[t]||($f[t]=!0,console.warn("".concat(t," has been removed in version ").concat(e,", see upgrade guide for more information")))}function eh(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Df()(t);if(e){var i=Df()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Pf()(this,r)}}var rh=function(t){If()(r,t);var e=eh(r);function r(){return ku()(this,r),e.apply(this,arguments)}return Ou()(r,[{key:"ELEMENTS",get:function(){return Lf(!1),0}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"from",value:function(t){return Array.isArray(t)?this.copy(t):this.fromObject(t)}},{key:"fromArray",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=0;r<this.ELEMENTS;++r)this[r]=t[r+e];return this.check()}},{key:"to",value:function(t){return t===this?this:Vf(t)?this.toArray(t):this.toObject(t)}},{key:"toTarget",value:function(t){return t?this.to(t):this}},{key:"toArray",value:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=0;r<this.ELEMENTS;++r)t[e+r]=this[r];return t}},{key:"toFloat32Array",value:function(){return new Float32Array(this)}},{key:"toString",value:function(){return this.formatString(Nf)}},{key:"formatString",value:function(t){for(var e="",r=0;r<this.ELEMENTS;++r)e+=(r>0?", ":"")+Hf(this[r],t);return"".concat(t.printTypes?this.constructor.name:"","[").concat(e,"]")}},{key:"equals",value:function(t){if(!t||this.length!==t.length)return!1;for(var e=0;e<this.ELEMENTS;++e)if(!Qf(this[e],t[e]))return!1;return!0}},{key:"exactEquals",value:function(t){if(!t||this.length!==t.length)return!1;for(var e=0;e<this.ELEMENTS;++e)if(this[e]!==t[e])return!1;return!0}},{key:"negate",value:function(){for(var t=0;t<this.ELEMENTS;++t)this[t]=-this[t];return this.check()}},{key:"lerp",value:function(t,e,r){void 0===r&&(r=e,e=t,t=this);for(var n=0;n<this.ELEMENTS;++n){var i=t[n];this[n]=i+r*(e[n]-i)}return this.check()}},{key:"min",value:function(t){for(var e=0;e<this.ELEMENTS;++e)this[e]=Math.min(t[e],this[e]);return this.check()}},{key:"max",value:function(t){for(var e=0;e<this.ELEMENTS;++e)this[e]=Math.max(t[e],this[e]);return this.check()}},{key:"clamp",value:function(t,e){for(var r=0;r<this.ELEMENTS;++r)this[r]=Math.min(Math.max(this[r],t[r]),e[r]);return this.check()}},{key:"add",value:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];for(var n=0,i=e;n<i.length;n++)for(var o=i[n],a=0;a<this.ELEMENTS;++a)this[a]+=o[a];return this.check()}},{key:"subtract",value:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];for(var n=0,i=e;n<i.length;n++)for(var o=i[n],a=0;a<this.ELEMENTS;++a)this[a]-=o[a];return this.check()}},{key:"scale",value:function(t){if(Array.isArray(t))return this.multiply(t);for(var e=0;e<this.ELEMENTS;++e)this[e]*=t;return this.check()}},{key:"sub",value:function(t){return this.subtract(t)}},{key:"setScalar",value:function(t){for(var e=0;e<this.ELEMENTS;++e)this[e]=t;return this.check()}},{key:"addScalar",value:function(t){for(var e=0;e<this.ELEMENTS;++e)this[e]+=t;return this.check()}},{key:"subScalar",value:function(t){return this.addScalar(-t)}},{key:"multiplyScalar",value:function(t){for(var e=0;e<this.ELEMENTS;++e)this[e]*=t;return this.check()}},{key:"divideScalar",value:function(t){return this.scale(1/t)}},{key:"clampScalar",value:function(t,e){for(var r=0;r<this.ELEMENTS;++r)this[r]=Math.min(Math.max(this[r],t),e);return this.check()}},{key:"multiplyByScalar",value:function(t){return this.scale(t)}},{key:"elements",get:function(){return this}},{key:"check",value:function(){if(Nf.debug&&!this.validate())throw new Error("math.gl: ".concat(this.constructor.name," some fields set to invalid numbers'"));return this}},{key:"validate",value:function(){for(var t=this.length===this.ELEMENTS,e=0;e<this.ELEMENTS;++e)t=t&&Number.isFinite(this[e]);return t}}]),r}(function(t){function e(){var e=Reflect.construct(t,Array.from(arguments));return Object.setPrototypeOf(e,Object.getPrototypeOf(this)),e}return e.prototype=Object.create(t.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t,e}(Array));function nh(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Df()(t);if(e){var i=Df()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Pf()(this,r)}}var ih=function(t){If()(r,t);var e=nh(r);function r(){return ku()(this,r),e.apply(this,arguments)}return Ou()(r,[{key:"ELEMENTS",get:function(){return Lf(!1),0}},{key:"RANK",get:function(){return Lf(!1),0}},{key:"toString",value:function(){var t="[";if(Nf.printRowMajor){t+="row-major:";for(var e=0;e<this.RANK;++e)for(var r=0;r<this.RANK;++r)t+=" ".concat(this[r*this.RANK+e])}else{t+="column-major:";for(var n=0;n<this.ELEMENTS;++n)t+=" ".concat(this[n])}return t+="]"}},{key:"getElementIndex",value:function(t,e){return e*this.RANK+t}},{key:"getElement",value:function(t,e){return this[e*this.RANK+t]}},{key:"setElement",value:function(t,e,r){return this[e*this.RANK+t]=Yf(r),this}},{key:"getColumn",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Array(this.RANK).fill(-0),r=t*this.RANK,n=0;n<this.RANK;++n)e[n]=this[r+n];return e}},{key:"setColumn",value:function(t,e){for(var r=t*this.RANK,n=0;n<this.RANK;++n)this[r+n]=e[n];return this}}]),r}(rh);function oh(t,e,r){var n=e[0],i=e[1],o=r[3]*n+r[7]*i||1;return t[0]=(r[0]*n+r[4]*i)/o,t[1]=(r[1]*n+r[5]*i)/o,t}function ah(t,e,r){var n=e[0],i=e[1],o=e[2],a=r[3]*n+r[7]*i+r[11]*o||1;return t[0]=(r[0]*n+r[4]*i+r[8]*o)/a,t[1]=(r[1]*n+r[5]*i+r[9]*o)/a,t[2]=(r[2]*n+r[6]*i+r[10]*o)/a,t}var sh="undefined"!=typeof Float32Array?Float32Array:Array;Math.random;Math.PI;function uh(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=e[6],l=e[7],f=e[8],h=e[9],d=e[10],p=e[11],v=e[12],y=e[13],g=e[14],m=e[15],b=r[0],A=r[1],w=r[2],B=r[3];return t[0]=b*n+A*s+w*f+B*v,t[1]=b*i+A*u+w*h+B*y,t[2]=b*o+A*c+w*d+B*g,t[3]=b*a+A*l+w*p+B*m,b=r[4],A=r[5],w=r[6],B=r[7],t[4]=b*n+A*s+w*f+B*v,t[5]=b*i+A*u+w*h+B*y,t[6]=b*o+A*c+w*d+B*g,t[7]=b*a+A*l+w*p+B*m,b=r[8],A=r[9],w=r[10],B=r[11],t[8]=b*n+A*s+w*f+B*v,t[9]=b*i+A*u+w*h+B*y,t[10]=b*o+A*c+w*d+B*g,t[11]=b*a+A*l+w*p+B*m,b=r[12],A=r[13],w=r[14],B=r[15],t[12]=b*n+A*s+w*f+B*v,t[13]=b*i+A*u+w*h+B*y,t[14]=b*o+A*c+w*d+B*g,t[15]=b*a+A*l+w*p+B*m,t}function ch(t,e,r){var n=r[0],i=r[1],o=r[2];return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,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 lh(t,e){var r=e[0],n=e[1],i=e[2],o=e[4],a=e[5],s=e[6],u=e[8],c=e[9],l=e[10];return t[0]=Math.hypot(r,n,i),t[1]=Math.hypot(o,a,s),t[2]=Math.hypot(u,c,l),t}function fh(t,e,r,n,i){var o,a=1/Math.tan(e/2);return t[0]=a/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,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!=i&&i!==1/0?(o=1/(n-i),t[10]=(i+n)*o,t[14]=2*i*n*o):(t[10]=-1,t[14]=-2*n),t}function hh(t,e,r,n){var i,o,a,s,u,c,l,f,h,d,p=e[0],v=e[1],y=e[2],g=n[0],m=n[1],b=n[2],A=r[0],w=r[1],B=r[2];return Math.abs(p-A)<1e-6&&Math.abs(v-w)<1e-6&&Math.abs(y-B)<1e-6?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):(l=p-A,f=v-w,h=y-B,i=m*(h*=d=1/Math.hypot(l,f,h))-b*(f*=d),o=b*(l*=d)-g*h,a=g*f-m*l,(d=Math.hypot(i,o,a))?(i*=d=1/d,o*=d,a*=d):(i=0,o=0,a=0),s=f*a-h*o,u=h*i-l*a,c=l*o-f*i,(d=Math.hypot(s,u,c))?(s*=d=1/d,u*=d,c*=d):(s=0,u=0,c=0),t[0]=i,t[1]=s,t[2]=l,t[3]=0,t[4]=o,t[5]=u,t[6]=f,t[7]=0,t[8]=a,t[9]=c,t[10]=h,t[11]=0,t[12]=-(i*p+o*v+a*y),t[13]=-(s*p+u*v+c*y),t[14]=-(l*p+f*v+h*y),t[15]=1,t)}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});function dh(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[3]*i+r[6],t[1]=r[1]*n+r[4]*i+r[7],t}function ph(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[4]*i+r[12],t[1]=r[1]*n+r[5]*i+r[13],t}!function(){var t=function(){var t=new sh(2);return sh!=Float32Array&&(t[0]=0,t[1]=0),t}()}();function vh(){var t=new sh(3);return sh!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function yh(t){var e=t[0],r=t[1],n=t[2];return Math.hypot(e,r,n)}function gh(t,e,r){var n=new sh(3);return n[0]=t,n[1]=e,n[2]=r,n}function mh(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function bh(t,e,r){var n=e[0],i=e[1],o=e[2],a=r[0],s=r[1],u=r[2];return t[0]=i*u-o*s,t[1]=o*a-n*u,t[2]=n*s-i*a,t}function Ah(t,e,r){var n=e[0],i=e[1],o=e[2],a=r[3]*n+r[7]*i+r[11]*o+r[15];return a=a||1,t[0]=(r[0]*n+r[4]*i+r[8]*o+r[12])/a,t[1]=(r[1]*n+r[5]*i+r[9]*o+r[13])/a,t[2]=(r[2]*n+r[6]*i+r[10]*o+r[14])/a,t}function wh(t,e,r){var n=e[0],i=e[1],o=e[2];return t[0]=n*r[0]+i*r[3]+o*r[6],t[1]=n*r[1]+i*r[4]+o*r[7],t[2]=n*r[2]+i*r[5]+o*r[8],t}var Bh=yh;!function(){var t=vh()}();function _h(t){var e=t[0],r=t[1],n=t[2],i=t[3];return Math.hypot(e,r,n,i)}function xh(t){var e=t[0],r=t[1],n=t[2],i=t[3];return e*e+r*r+n*n+i*i}function Ch(t,e,r){var n=e[0],i=e[1],o=e[2],a=r[0],s=r[1],u=r[2],c=r[3],l=c*n+s*o-u*i,f=c*i+u*n-a*o,h=c*o+a*i-s*n,d=-a*n-s*i-u*o;return t[0]=l*c+d*-a+f*-u-h*-s,t[1]=f*c+d*-s+h*-a-l*-u,t[2]=h*c+d*-u+l*-s-f*-a,t[3]=e[3],t}!function(){var t=function(){var t=new sh(4);return sh!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}()}();function kh(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Df()(t);if(e){var i=Df()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Pf()(this,r)}}var Eh=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),Oh=Object.freeze([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Th=Object.freeze({COL0ROW0:0,COL0ROW1:1,COL0ROW2:2,COL0ROW3:3,COL1ROW0:4,COL1ROW1:5,COL1ROW2:6,COL1ROW3:7,COL2ROW0:8,COL2ROW1:9,COL2ROW2:10,COL2ROW3:11,COL3ROW0:12,COL3ROW1:13,COL3ROW2:14,COL3ROW3:15}),Sh={},Mh=function(t){If()(r,t);var e=kh(r);function r(t){var n;return ku()(this,r),n=e.call(this,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0),1===arguments.length&&Array.isArray(t)?n.copy(t):n.identity(),n}return Ou()(r,[{key:"INDICES",get:function(){return Th}},{key:"ELEMENTS",get:function(){return 16}},{key:"RANK",get:function(){return 4}},{key:"copy",value:function(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()}},{key:"set",value:function(t,e,r,n,i,o,a,s,u,c,l,f,h,d,p,v){return this[0]=t,this[1]=e,this[2]=r,this[3]=n,this[4]=i,this[5]=o,this[6]=a,this[7]=s,this[8]=u,this[9]=c,this[10]=l,this[11]=f,this[12]=h,this[13]=d,this[14]=p,this[15]=v,this.check()}},{key:"setRowMajor",value:function(t,e,r,n,i,o,a,s,u,c,l,f,h,d,p,v){return this[0]=t,this[1]=i,this[2]=u,this[3]=h,this[4]=e,this[5]=o,this[6]=c,this[7]=d,this[8]=r,this[9]=a,this[10]=l,this[11]=p,this[12]=n,this[13]=s,this[14]=f,this[15]=v,this.check()}},{key:"toRowMajor",value:function(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}},{key:"identity",value:function(){return this.copy(Eh)}},{key:"fromQuaternion",value:function(t){return function(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=r+r,s=n+n,u=i+i,c=r*a,l=n*a,f=n*s,h=i*a,d=i*s,p=i*u,v=o*a,y=o*s,g=o*u;t[0]=1-f-p,t[1]=l+g,t[2]=h-y,t[3]=0,t[4]=l-g,t[5]=1-c-p,t[6]=d+v,t[7]=0,t[8]=h+y,t[9]=d-v,t[10]=1-c-f,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1}(this,t),this.check()}},{key:"frustum",value:function(t){var e=t.left,n=t.right,i=t.bottom,o=t.top,a=t.near,s=t.far;return s===1/0?r._computeInfinitePerspectiveOffCenter(this,e,n,i,o,a):function(t,e,r,n,i,o,a){var s=1/(r-e),u=1/(i-n),c=1/(o-a);t[0]=2*o*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*o*u,t[6]=0,t[7]=0,t[8]=(r+e)*s,t[9]=(i+n)*u,t[10]=(a+o)*c,t[11]=-1,t[12]=0,t[13]=0,t[14]=a*o*2*c,t[15]=0}(this,e,n,i,o,a,s),this.check()}},{key:"lookAt",value:function(t,e,r){if(1===arguments.length){var n=t;t=n.eye,e=n.center,r=n.up}return hh(this,t,e=e||[0,0,0],r=r||[0,1,0]),this.check()}},{key:"ortho",value:function(t){var e=t.left,r=t.right,n=t.bottom,i=t.top,o=t.near,a=void 0===o?.1:o,s=t.far;return function(t,e,r,n,i,o,a){var s=1/(e-r),u=1/(n-i),c=1/(o-a);t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(e+r)*s,t[13]=(i+n)*u,t[14]=(a+o)*c,t[15]=1}(this,e,r,n,i,a,void 0===s?500:s),this.check()}},{key:"orthographic",value:function(t){var e=t.fovy,n=void 0===e?45*Math.PI/180:e,i=t.aspect,o=void 0===i?1:i,a=t.focalDistance,s=void 0===a?1:a,u=t.near,c=void 0===u?.1:u,l=t.far,f=void 0===l?500:l;if(n>2*Math.PI)throw Error("radians");var h=n/2,d=s*Math.tan(h),p=d*o;return(new r).ortho({left:-p,right:p,bottom:-d,top:d,near:c,far:f})}},{key:"perspective",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.fovy,r=void 0===e?void 0:e,n=t.fov,i=void 0===n?45*Math.PI/180:n,o=t.aspect,a=void 0===o?1:o,s=t.near,u=void 0===s?.1:s,c=t.far,l=void 0===c?500:c;if((r=r||i)>2*Math.PI)throw Error("radians");return fh(this,r,a,u,l),this.check()}},{key:"determinant",value:function(){return e=(t=this)[0],r=t[1],n=t[2],i=t[3],o=t[4],a=t[5],s=t[6],u=t[7],c=t[8],l=t[9],f=t[10],h=t[11],d=t[12],p=t[13],v=t[14],y=t[15],(e*a-r*o)*(f*y-h*v)-(e*s-n*o)*(l*y-h*p)+(e*u-i*o)*(l*v-f*p)+(r*s-n*a)*(c*y-h*d)-(r*u-i*a)*(c*v-f*d)+(n*u-i*s)*(c*p-l*d);var t,e,r,n,i,o,a,s,u,c,l,f,h,d,p,v,y}},{key:"getScale",value:function(){var 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}},{key:"getTranslation",value:function(){var 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}},{key:"getRotation",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=this.getScale(e||[-0,-0,-0]),n=1/r[0],i=1/r[1],o=1/r[2];return t[0]=this[0]*n,t[1]=this[1]*i,t[2]=this[2]*o,t[3]=0,t[4]=this[4]*n,t[5]=this[5]*i,t[6]=this[6]*o,t[7]=0,t[8]=this[8]*n,t[9]=this[9]*i,t[10]=this[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}},{key:"getRotationMatrix3",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[-0,-0,-0,-0,-0,-0,-0,-0,-0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=this.getScale(e||[-0,-0,-0]),n=1/r[0],i=1/r[1],o=1/r[2];return t[0]=this[0]*n,t[1]=this[1]*i,t[2]=this[2]*o,t[3]=this[4]*n,t[4]=this[5]*i,t[5]=this[6]*o,t[6]=this[8]*n,t[7]=this[9]*i,t[8]=this[10]*o,t}},{key:"transpose",value:function(){return function(t,e){if(t===e){var r=e[1],n=e[2],i=e[3],o=e[6],a=e[7],s=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=r,t[6]=e[9],t[7]=e[13],t[8]=n,t[9]=o,t[11]=e[14],t[12]=i,t[13]=a,t[14]=s}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]}(this,this),this.check()}},{key:"invert",value:function(){return function(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],c=e[7],l=e[8],f=e[9],h=e[10],d=e[11],p=e[12],v=e[13],y=e[14],g=e[15],m=r*s-n*a,b=r*u-i*a,A=r*c-o*a,w=n*u-i*s,B=n*c-o*s,_=i*c-o*u,x=l*v-f*p,C=l*y-h*p,k=l*g-d*p,E=f*y-h*v,O=f*g-d*v,T=h*g-d*y,S=m*T-b*O+A*E+w*k-B*C+_*x;S&&(S=1/S,t[0]=(s*T-u*O+c*E)*S,t[1]=(i*O-n*T-o*E)*S,t[2]=(v*_-y*B+g*w)*S,t[3]=(h*B-f*_-d*w)*S,t[4]=(u*k-a*T-c*C)*S,t[5]=(r*T-i*k+o*C)*S,t[6]=(y*A-p*_-g*b)*S,t[7]=(l*_-h*A+d*b)*S,t[8]=(a*O-s*k+c*x)*S,t[9]=(n*k-r*O-o*x)*S,t[10]=(p*B-v*A+g*m)*S,t[11]=(f*A-l*B-d*m)*S,t[12]=(s*C-a*E-u*x)*S,t[13]=(r*E-n*C+i*x)*S,t[14]=(v*b-p*w-y*m)*S,t[15]=(l*w-f*b+h*m)*S)}(this,this),this.check()}},{key:"multiplyLeft",value:function(t){return uh(this,t,this),this.check()}},{key:"multiplyRight",value:function(t){return uh(this,this,t),this.check()}},{key:"rotateX",value:function(t){return function(t,e,r){var n=Math.sin(r),i=Math.cos(r),o=e[4],a=e[5],s=e[6],u=e[7],c=e[8],l=e[9],f=e[10],h=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*i+c*n,t[5]=a*i+l*n,t[6]=s*i+f*n,t[7]=u*i+h*n,t[8]=c*i-o*n,t[9]=l*i-a*n,t[10]=f*i-s*n,t[11]=h*i-u*n}(this,this,t),this.check()}},{key:"rotateY",value:function(t){return function(t,e,r){var n=Math.sin(r),i=Math.cos(r),o=e[0],a=e[1],s=e[2],u=e[3],c=e[8],l=e[9],f=e[10],h=e[11];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*i-c*n,t[1]=a*i-l*n,t[2]=s*i-f*n,t[3]=u*i-h*n,t[8]=o*n+c*i,t[9]=a*n+l*i,t[10]=s*n+f*i,t[11]=u*n+h*i}(this,this,t),this.check()}},{key:"rotateZ",value:function(t){return function(t,e,r){var n=Math.sin(r),i=Math.cos(r),o=e[0],a=e[1],s=e[2],u=e[3],c=e[4],l=e[5],f=e[6],h=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*i+c*n,t[1]=a*i+l*n,t[2]=s*i+f*n,t[3]=u*i+h*n,t[4]=c*i-o*n,t[5]=l*i-a*n,t[6]=f*i-s*n,t[7]=h*i-u*n}(this,this,t),this.check()}},{key:"rotateXYZ",value:function(t){var e=Sf()(t,3),r=e[0],n=e[1],i=e[2];return this.rotateX(r).rotateY(n).rotateZ(i)}},{key:"rotateAxis",value:function(t,e){return function(t,e,r,n){var i,o,a,s,u,c,l,f,h,d,p,v,y,g,m,b,A,w,B,_,x,C,k,E,O=n[0],T=n[1],S=n[2],M=Math.hypot(O,T,S);M<1e-6||(O*=M=1/M,T*=M,S*=M,i=Math.sin(r),a=1-(o=Math.cos(r)),s=e[0],u=e[1],c=e[2],l=e[3],f=e[4],h=e[5],d=e[6],p=e[7],v=e[8],y=e[9],g=e[10],m=e[11],b=O*O*a+o,A=T*O*a+S*i,w=S*O*a-T*i,B=O*T*a-S*i,_=T*T*a+o,x=S*T*a+O*i,C=O*S*a+T*i,k=T*S*a-O*i,E=S*S*a+o,t[0]=s*b+f*A+v*w,t[1]=u*b+h*A+y*w,t[2]=c*b+d*A+g*w,t[3]=l*b+p*A+m*w,t[4]=s*B+f*_+v*x,t[5]=u*B+h*_+y*x,t[6]=c*B+d*_+g*x,t[7]=l*B+p*_+m*x,t[8]=s*C+f*k+v*E,t[9]=u*C+h*k+y*E,t[10]=c*C+d*k+g*E,t[11]=l*C+p*k+m*E,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]))}(this,this,t,e),this.check()}},{key:"scale",value:function(t){return Array.isArray(t)?ch(this,this,t):ch(this,this,[t,t,t]),this.check()}},{key:"translate",value:function(t){return function(t,e,r){var n,i,o,a,s,u,c,l,f,h,d,p,v=r[0],y=r[1],g=r[2];e===t?(t[12]=e[0]*v+e[4]*y+e[8]*g+e[12],t[13]=e[1]*v+e[5]*y+e[9]*g+e[13],t[14]=e[2]*v+e[6]*y+e[10]*g+e[14],t[15]=e[3]*v+e[7]*y+e[11]*g+e[15]):(n=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=e[6],l=e[7],f=e[8],h=e[9],d=e[10],p=e[11],t[0]=n,t[1]=i,t[2]=o,t[3]=a,t[4]=s,t[5]=u,t[6]=c,t[7]=l,t[8]=f,t[9]=h,t[10]=d,t[11]=p,t[12]=n*v+s*y+f*g+e[12],t[13]=i*v+u*y+h*g+e[13],t[14]=o*v+c*y+d*g+e[14],t[15]=a*v+l*y+p*g+e[15])}(this,this,t),this.check()}},{key:"transform",value:function(t,e){return 4===t.length?(Zf(e=function(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*o+r[12]*a,t[1]=r[1]*n+r[5]*i+r[9]*o+r[13]*a,t[2]=r[2]*n+r[6]*i+r[10]*o+r[14]*a,t[3]=r[3]*n+r[7]*i+r[11]*o+r[15]*a,t}(e||[-0,-0,-0,-0],t,this),4),e):this.transformAsPoint(t,e)}},{key:"transformAsPoint",value:function(t,e){switch(t.length){case 2:e=ph(e||[-0,-0],t,this);break;case 3:e=Ah(e||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return Zf(e,t.length),e}},{key:"transformAsVector",value:function(t,e){switch(t.length){case 2:e=oh(e||[-0,-0],t,this);break;case 3:e=ah(e||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return Zf(e,t.length),e}},{key:"makeRotationX",value:function(t){return this.identity().rotateX(t)}},{key:"makeTranslation",value:function(t,e,r){return this.identity().translate([t,e,r])}},{key:"transformPoint",value:function(t,e){return th("Matrix4.transformPoint","3.0"),this.transformAsPoint(t,e)}},{key:"transformVector",value:function(t,e){return th("Matrix4.transformVector","3.0"),this.transformAsPoint(t,e)}},{key:"transformDirection",value:function(t,e){return th("Matrix4.transformDirection","3.0"),this.transformAsVector(t,e)}}],[{key:"IDENTITY",get:function(){return Sh.IDENTITY=Sh.IDENTITY||Object.freeze(new r(Eh)),Sh.IDENTITY}},{key:"ZERO",get:function(){return Sh.ZERO=Sh.ZERO||Object.freeze(new r(Oh)),Sh.ZERO}},{key:"_computeInfinitePerspectiveOffCenter",value:function(t,e,r,n,i,o){var a=2*o/(r-e),s=2*o/(i-n),u=(r+e)/(r-e),c=(i+n)/(i-n),l=-2*o;return t[0]=a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=s,t[6]=0,t[7]=0,t[8]=u,t[9]=c,t[10]=-1,t[11]=-1,t[12]=0,t[13]=0,t[14]=l,t[15]=0,t}}]),r}(ih);function Ih(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Df()(t);if(e){var i=Df()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Pf()(this,r)}}var Rh=function(t){If()(r,t);var e=Ih(r);function r(){return ku()(this,r),e.apply(this,arguments)}return Ou()(r,[{key:"ELEMENTS",get:function(){return Lf(!1),0}},{key:"copy",value:function(t){return Lf(!1),this}},{key:"x",get:function(){return this[0]},set:function(t){this[0]=Yf(t)}},{key:"y",get:function(){return this[1]},set:function(t){this[1]=Yf(t)}},{key:"len",value:function(){return Math.sqrt(this.lengthSquared())}},{key:"magnitude",value:function(){return this.len()}},{key:"lengthSquared",value:function(){for(var t=0,e=0;e<this.ELEMENTS;++e)t+=this[e]*this[e];return t}},{key:"magnitudeSquared",value:function(){return this.lengthSquared()}},{key:"distance",value:function(t){return Math.sqrt(this.distanceSquared(t))}},{key:"distanceSquared",value:function(t){for(var e=0,r=0;r<this.ELEMENTS;++r){var n=this[r]-t[r];e+=n*n}return Yf(e)}},{key:"dot",value:function(t){for(var e=0,r=0;r<this.ELEMENTS;++r)e+=this[r]*t[r];return Yf(e)}},{key:"normalize",value:function(){var t=this.magnitude();if(0!==t)for(var e=0;e<this.ELEMENTS;++e)this[e]/=t;return this.check()}},{key:"multiply",value:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];for(var n=0,i=e;n<i.length;n++)for(var o=i[n],a=0;a<this.ELEMENTS;++a)this[a]*=o[a];return this.check()}},{key:"divide",value:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];for(var n=0,i=e;n<i.length;n++)for(var o=i[n],a=0;a<this.ELEMENTS;++a)this[a]/=o[a];return this.check()}},{key:"lengthSq",value:function(){return this.lengthSquared()}},{key:"distanceTo",value:function(t){return this.distance(t)}},{key:"distanceToSquared",value:function(t){return this.distanceSquared(t)}},{key:"getComponent",value:function(t){return Lf(t>=0&&t<this.ELEMENTS,"index is out of range"),Yf(this[t])}},{key:"setComponent",value:function(t,e){return Lf(t>=0&&t<this.ELEMENTS,"index is out of range"),this[t]=e,this.check()}},{key:"addVectors",value:function(t,e){return this.copy(t).add(e)}},{key:"subVectors",value:function(t,e){return this.copy(t).subtract(e)}},{key:"multiplyVectors",value:function(t,e){return this.copy(t).multiply(e)}},{key:"addScaledVector",value:function(t,e){return this.add(new this.constructor(t).multiplyScalar(e))}}]),r}(rh);function Ph(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Df()(t);if(e){var i=Df()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Pf()(this,r)}}var Fh=[0,0,0],Dh={},Lh=function(t){If()(r,t);var e=Ph(r);function r(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return ku()(this,r),t=e.call(this,-0,-0,-0),1===arguments.length&&Vf(n)?t.copy(n):(Nf.debug&&(Yf(n),Yf(i),Yf(o)),t[0]=n,t[1]=i,t[2]=o),t}return Ou()(r,[{key:"set",value:function(t,e,r){return this[0]=t,this[1]=e,this[2]=r,this.check()}},{key:"copy",value:function(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this.check()}},{key:"fromObject",value:function(t){return Nf.debug&&(Yf(t.x),Yf(t.y),Yf(t.z)),this[0]=t.x,this[1]=t.y,this[2]=t.z,this.check()}},{key:"toObject",value:function(t){return t.x=this[0],t.y=this[1],t.z=this[2],t}},{key:"ELEMENTS",get:function(){return 3}},{key:"z",get:function(){return this[2]},set:function(t){this[2]=Yf(t)}},{key:"angle",value:function(t){return r=t,n=(e=this)[0],i=e[1],o=e[2],a=r[0],s=r[1],u=r[2],c=Math.sqrt(n*n+i*i+o*o)*Math.sqrt(a*a+s*s+u*u),l=c&&mh(e,r)/c,Math.acos(Math.min(Math.max(l,-1),1));var e,r,n,i,o,a,s,u,c,l}},{key:"cross",value:function(t){return bh(this,this,t),this.check()}},{key:"rotateX",value:function(t){var e=t.radians,r=t.origin;return function(t,e,r,n){var i=[],o=[];i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],o[0]=i[0],o[1]=i[1]*Math.cos(n)-i[2]*Math.sin(n),o[2]=i[1]*Math.sin(n)+i[2]*Math.cos(n),t[0]=o[0]+r[0],t[1]=o[1]+r[1],t[2]=o[2]+r[2]}(this,this,void 0===r?Fh:r,e),this.check()}},{key:"rotateY",value:function(t){var e=t.radians,r=t.origin;return function(t,e,r,n){var i=[],o=[];i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],o[0]=i[2]*Math.sin(n)+i[0]*Math.cos(n),o[1]=i[1],o[2]=i[2]*Math.cos(n)-i[0]*Math.sin(n),t[0]=o[0]+r[0],t[1]=o[1]+r[1],t[2]=o[2]+r[2]}(this,this,void 0===r?Fh:r,e),this.check()}},{key:"rotateZ",value:function(t){var e=t.radians,r=t.origin;return function(t,e,r,n){var i=[],o=[];i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],o[0]=i[0]*Math.cos(n)-i[1]*Math.sin(n),o[1]=i[0]*Math.sin(n)+i[1]*Math.cos(n),o[2]=i[2],t[0]=o[0]+r[0],t[1]=o[1]+r[1],t[2]=o[2]+r[2]}(this,this,void 0===r?Fh:r,e),this.check()}},{key:"transform",value:function(t){return this.transformAsPoint(t)}},{key:"transformAsPoint",value:function(t){return Ah(this,this,t),this.check()}},{key:"transformAsVector",value:function(t){return ah(this,this,t),this.check()}},{key:"transformByMatrix3",value:function(t){return wh(this,this,t),this.check()}},{key:"transformByMatrix2",value:function(t){return function(t,e,r){var n=e[0],i=e[1];t[0]=r[0]*n+r[2]*i,t[1]=r[1]*n+r[3]*i,t[2]=e[2]}(this,this,t),this.check()}},{key:"transformByQuaternion",value:function(t){return function(t,e,r){var n=r[0],i=r[1],o=r[2],a=r[3],s=e[0],u=e[1],c=e[2],l=i*c-o*u,f=o*s-n*c,h=n*u-i*s,d=i*h-o*f,p=o*l-n*h,v=n*f-i*l,y=2*a;l*=y,f*=y,h*=y,d*=2,p*=2,v*=2,t[0]=s+l+d,t[1]=u+f+p,t[2]=c+h+v}(this,this,t),this.check()}}],[{key:"ZERO",get:function(){return Dh.ZERO=Dh.ZERO||Object.freeze(new r(0,0,0,0))}}]),r}(Rh),jh=.1,Gh=1e-12,Nh=1e-15,Uh=(Math.PI,Math.PI,Math.PI,Math.PI,Math.max(6378137,6378137,6356752.314245179),function(t){return t}),Hh=new Lh;function Vh(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Uh;return Vf(t)?(e[0]=r(t[0]),e[1]=r(t[1]),e[2]=t[2]):"longitude"in t?(e[0]=r(t.longitude),e[1]=r(t.latitude),e[2]=t.height):(e[0]=r(t.x),e[1]=r(t.y),e[2]=t.z),e}function Jh(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Hh;return Vh(t,e,Nf._cartographicRadians?Uh:zf)}function zh(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Uh;return Vf(e)?(e[0]=r(t[0]),e[1]=r(t[1]),e[2]=t[2]):"longitude"in e?(e.longitude=r(t[0]),e.latitude=r(t[1]),e.height=t[2]):(e.x=r(t[0]),e.y=r(t[1]),e.z=t[2]),e}function Kh(t,e){return zh(t,e,Nf._cartographicRadians?Uh:Kf)}var qh=new Lh,Wh=new Lh,Qh=new Lh;var Xh=new Lh,Yh={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"}},Zh={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},$h={east:new Lh,north:new Lh,up:new Lh,west:new Lh,south:new Lh,down:new Lh},td=new Lh,ed=new Lh,rd=new Lh;function nd(t,e,r,n,i,o){var a,s,u,c=Yh[e]&&Yh[e][r];Lf(c&&(!n||n===c));var l=Xh.copy(i);if(Qf(l.x,0,1e-14)&&Qf(l.y,0,1e-14)){var f=Math.sign(l.z);a=td.fromArray(Zh[e]),"east"!==e&&"west"!==e&&a.scale(f),s=ed.fromArray(Zh[r]),"east"!==r&&"west"!==r&&s.scale(f),u=rd.fromArray(Zh[n]),"east"!==n&&"west"!==n&&u.scale(f)}else{var h=$h.up,d=$h.east,p=$h.north;d.set(-l.y,l.x,0).normalize(),t.geodeticSurfaceNormal(l,h),p.copy(h).cross(d);var v=$h.west,y=$h.south;$h.down.copy(h).scale(-1),v.copy(d).scale(-1),y.copy(p).scale(-1),a=$h[e],s=$h[r],u=$h[n]}return o[0]=a.x,o[1]=a.y,o[2]=a.z,o[3]=0,o[4]=s.x,o[5]=s.y,o[6]=s.z,o[7]=0,o[8]=u.x,o[9]=u.y,o[10]=u.z,o[11]=0,o[12]=l.x,o[13]=l.y,o[14]=l.z,o[15]=1,o}var id,od=new Lh,ad=new Lh,sd=new Lh,ud=new Lh,cd=new Lh,ld=new Lh,fd=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;ku()(this,t),Lf(e>=0),Lf(r>=0),Lf(n>=0),this.radii=new Lh(e,r,n),this.radiiSquared=new Lh(e*e,r*r,n*n),this.radiiToTheFourth=new Lh(e*e*e*e,r*r*r*r,n*n*n*n),this.oneOverRadii=new Lh(0===e?0:1/e,0===r?0:1/r,0===n?0:1/n),this.oneOverRadiiSquared=new Lh(0===e?0:1/(e*e),0===r?0:1/(r*r),0===n?0:1/(n*n)),this.minimumRadius=Math.min(e,r,n),this.maximumRadius=Math.max(e,r,n),this.centerToleranceSquared=jh,0!==this.radiiSquared.z&&(this.squaredXOverSquaredZ=this.radiiSquared.x/this.radiiSquared.z),Object.freeze(this)}return Ou()(t,[{key:"equals",value:function(t){return this===t||Boolean(t&&this.radii.equals(t.radii))}},{key:"toString",value:function(){return this.radii.toString()}},{key:"cartographicToCartesian",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0],r=ad,n=sd,i=Sf()(t,3),o=i[2];this.geodeticSurfaceNormalCartographic(t,r),n.copy(this.radiiSquared).scale(r);var a=Math.sqrt(r.dot(n));return n.scale(1/a),r.scale(o),n.add(r),n.to(e)}},{key:"cartesianToCartographic",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];ld.from(t);var r=this.scaleToGeodeticSurface(ld,ud);if(r){var n=this.geodeticSurfaceNormal(r,ad),i=cd;i.copy(ld).subtract(r);var o=Math.atan2(n.y,n.x),a=Math.asin(n.z),s=Math.sign(mh(i,ld))*yh(i);return Kh([o,a,s],e)}}},{key:"eastNorthUpToFixedFrame",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Mh;return nd(this,"east","north","up",t,e)}},{key:"localFrameToFixedFrame",value:function(t,e,r,n){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:new Mh;return nd(this,t,e,r,n,i)}},{key:"geocentricSurfaceNormal",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];return od.from(t).normalize().to(e)}},{key:"geodeticSurfaceNormalCartographic",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0],r=Jh(t),n=r[0],i=r[1],o=Math.cos(i);return od.set(o*Math.cos(n),o*Math.sin(n),Math.sin(i)).normalize(),od.to(e)}},{key:"geodeticSurfaceNormal",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];return od.from(t).scale(this.oneOverRadiiSquared).normalize().to(e)}},{key:"scaleToGeodeticSurface",value:function(t,e){return function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Lh,n=e.oneOverRadii,i=e.oneOverRadiiSquared,o=e.centerToleranceSquared;qh.from(t);var a=t.x,s=t.y,u=t.z,c=n.x,l=n.y,f=n.z,h=a*a*c*c,d=s*s*l*l,p=u*u*f*f,v=h+d+p,y=Math.sqrt(1/v);if(Number.isFinite(y)){var g=Wh;if(g.copy(t).scale(y),v<o)return g.to(r);var m=i.x,b=i.y,A=i.z,w=Qh;w.set(g.x*m*2,g.y*b*2,g.z*A*2);var B,_,x,C,k=(1-y)*t.len()/(.5*w.len()),E=0;do{var O=(B=1/(1+(k-=E)*m))*B,T=(_=1/(1+k*b))*_,S=(x=1/(1+k*A))*x,M=O*B,I=T*_,R=S*x,P=h*M*m+d*I*b+p*R*A,F=-2*P;E=(C=h*O+d*T+p*S-1)/F}while(Math.abs(C)>Gh);return qh.scale([B,_,x]).to(r)}}(t,this,e)}},{key:"scaleToGeocentricSurface",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];ud.from(t);var r=ud.x,n=ud.y,i=ud.z,o=this.oneOverRadiiSquared,a=1/Math.sqrt(r*r*o.x+n*n*o.y+i*i*o.z);return ud.multiplyScalar(a).to(e)}},{key:"transformPositionToScaledSpace",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];return ud.from(t).scale(this.oneOverRadii).to(e)}},{key:"transformPositionFromScaledSpace",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];return ud.from(t).scale(this.radii).to(e)}},{key:"getSurfaceNormalIntersectionWithZAxis",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[0,0,0];Lf(Qf(this.radii.x,this.radii.y,Nh)),Lf(this.radii.z>0),ud.from(t);var n=ud.z*(1-this.squaredXOverSquaredZ);if(!(Math.abs(n)>=this.radii.z-e))return ud.set(0,0,n).to(r)}}],[{key:"WGS84",get:function(){return id=id||new t(6378137,6378137,6356752.314245179)}}]),t}();function hd(){var t;if("undefined"!=typeof window&&window.performance)t=window.performance.now();else if("undefined"!=typeof process&&process.hrtime){var e=process.hrtime();t=1e3*e[0]+e[1]/1e6}else t=Date.now();return t}var dd=function(){function t(e,r){ku()(this,t),Tu(this,"name",void 0),Tu(this,"type",void 0),Tu(this,"sampleSize",1),Tu(this,"time",void 0),Tu(this,"count",void 0),Tu(this,"samples",void 0),Tu(this,"lastTiming",void 0),Tu(this,"lastSampleTime",void 0),Tu(this,"lastSampleCount",void 0),Tu(this,"_count",0),Tu(this,"_time",0),Tu(this,"_samples",0),Tu(this,"_startTime",0),Tu(this,"_timerPending",!1),this.name=e,this.type=r,this.reset()}return Ou()(t,[{key:"setSampleSize",value:function(t){return this.sampleSize=t,this}},{key:"incrementCount",value:function(){return this.addCount(1),this}},{key:"decrementCount",value:function(){return this.subtractCount(1),this}},{key:"addCount",value:function(t){return this._count+=t,this._samples++,this._checkSampling(),this}},{key:"subtractCount",value:function(t){return this._count-=t,this._samples++,this._checkSampling(),this}},{key:"addTime",value:function(t){return this._time+=t,this.lastTiming=t,this._samples++,this._checkSampling(),this}},{key:"timeStart",value:function(){return this._startTime=hd(),this._timerPending=!0,this}},{key:"timeEnd",value:function(){return this._timerPending?(this.addTime(hd()-this._startTime),this._timerPending=!1,this._checkSampling(),this):this}},{key:"getSampleAverageCount",value:function(){return this.sampleSize>0?this.lastSampleCount/this.sampleSize:0}},{key:"getSampleAverageTime",value:function(){return this.sampleSize>0?this.lastSampleTime/this.sampleSize:0}},{key:"getSampleHz",value:function(){return this.lastSampleTime>0?this.sampleSize/(this.lastSampleTime/1e3):0}},{key:"getAverageCount",value:function(){return this.samples>0?this.count/this.samples:0}},{key:"getAverageTime",value:function(){return this.samples>0?this.time/this.samples:0}},{key:"getHz",value:function(){return this.time>0?this.samples/(this.time/1e3):0}},{key:"reset",value:function(){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}},{key:"_checkSampling",value:function(){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)}}]),t}(),pd=function(){function t(e){ku()(this,t),Tu(this,"id",void 0),Tu(this,"stats",{}),this.id=e.id,this.stats={},this._initializeStats(e.stats),Object.seal(this)}return Ou()(t,[{key:"get",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"count";return this._getOrCreate({name:t,type:e})}},{key:"size",get:function(){return Object.keys(this.stats).length}},{key:"reset",value:function(){for(var t in this.stats)this.stats[t].reset();return this}},{key:"forEach",value:function(t){for(var e in this.stats)t(this.stats[e])}},{key:"getTable",value:function(){var t={};return this.forEach((function(e){t[e.name]={time:e.time||0,count:e.count||0,average:e.getAverageTime()||0,hz:e.getHz()||0}})),t}},{key:"_initializeStats",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];e.forEach((function(e){return t._getOrCreate(e)}))}},{key:"_getOrCreate",value:function(t){if(!t||!t.name)return null;var e=t.name,r=t.type;return this.stats[e]||(this.stats[e]=t instanceof dd?t:new dd(e,r)),this.stats[e]}}]),t}();function vd(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function yd(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?vd(Object(r),!0).forEach((function(e){Ys()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):vd(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var gd={id:"request-scheduler",throttleRequests:!0,maxRequests:6},md=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};ku()(this,t),Tu(this,"props",void 0),Tu(this,"stats",void 0),Tu(this,"activeRequestCount",0),Tu(this,"requestQueue",[]),Tu(this,"requestMap",new Map),Tu(this,"deferredUpdate",null),this.props=yd(yd({},gd),e),this.stats=new pd({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")}return Ou()(t,[{key:"scheduleRequest",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){return 0};if(!this.props.throttleRequests)return Promise.resolve({done:function(){}});if(this.requestMap.has(t))return this.requestMap.get(t);var r={handle:t,priority:0,getPriority:e},n=new Promise((function(t){return r.resolve=t,r}));return this.requestQueue.push(r),this.requestMap.set(t,n),this._issueNewRequests(),n}},{key:"_issueRequest",value:function(t){var e=this,r=t.handle,n=t.resolve,i=!1,o=function(){i||(i=!0,e.requestMap.delete(r),e.activeRequestCount--,e._issueNewRequests())};return this.activeRequestCount++,n?n({done:o}):Promise.resolve({done:o})}},{key:"_issueNewRequests",value:function(){var t=this;this.deferredUpdate||(this.deferredUpdate=setTimeout((function(){return t._issueNewRequestsAsync()}),0))}},{key:"_issueNewRequestsAsync",value:function(){this.deferredUpdate=null;var t=Math.max(this.props.maxRequests-this.activeRequestCount,0);if(0!==t){this._updateAllRequests();for(var e=0;e<t;++e){var r=this.requestQueue.shift();r&&this._issueRequest(r)}}}},{key:"_updateAllRequests",value:function(){for(var t=this.requestQueue,e=0;e<t.length;++e){var r=t[e];this._updateRequest(r)||(t.splice(e,1),this.requestMap.delete(r.handle),e--)}t.sort((function(t,e){return t.priority-e.priority}))}},{key:"_updateRequest",value:function(t){return t.priority=t.getPriority(t.handle),!(t.priority<0)||(t.resolve(null),!1)}}]),t}(),bd=function t(e,r,n){ku()(this,t),Tu(this,"item",void 0),Tu(this,"previous",void 0),Tu(this,"next",void 0),this.item=e,this.previous=r,this.next=n},Ad=function(){function t(){ku()(this,t),Tu(this,"head",null),Tu(this,"tail",null),Tu(this,"_length",0)}return Ou()(t,[{key:"length",get:function(){return this._length}},{key:"add",value:function(t){var e=new bd(t,this.tail,null);return this.tail?(this.tail.next=e,this.tail=e):(this.head=e,this.tail=e),++this._length,e}},{key:"remove",value:function(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)}},{key:"splice",value:function(t,e){t!==e&&(this.remove(e),this._insert(t,e))}},{key:"_insert",value:function(t,e){var r=t.next;t.next=e,this.tail===t?this.tail=e:r.previous=e,e.next=r,e.previous=t,++this._length}}]),t}();function wd(t){return null!=t}var Bd=function(){function t(){ku()(this,t),Tu(this,"_list",void 0),Tu(this,"_sentinel",void 0),Tu(this,"_trimTiles",void 0),this._list=new Ad,this._sentinel=this._list.add("sentinel"),this._trimTiles=!1}return Ou()(t,[{key:"reset",value:function(){this._list.splice(this._list.tail,this._sentinel)}},{key:"touch",value:function(t){var e=t._cacheNode;wd(e)&&this._list.splice(this._sentinel,e)}},{key:"add",value:function(t,e,r){wd(e._cacheNode)||(e._cacheNode=this._list.add(e),r&&r(t,e))}},{key:"unloadTile",value:function(t,e,r){var n=e._cacheNode;wd(n)&&(this._list.remove(n),e._cacheNode=void 0,r&&r(t,e))}},{key:"unloadTiles",value:function(t,e){var r=this._trimTiles;this._trimTiles=!1;for(var n=this._list,i=1024*t.maximumMemoryUsage*1024,o=this._sentinel,a=n.head;a!==o&&(t.gpuMemoryUsageInBytes>i||r);){var s=a.item;a=a.next,this.unloadTile(t,s,e)}}},{key:"trim",value:function(){this._trimTiles=!0}}]),t}();var _d=Object.freeze({OUTSIDE:-1,INTERSECTING:0,INSIDE:1}),xd=(new Lh,new Lh,new Lh),Cd=new Lh,kd=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[0,0,0],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;ku()(this,t),this.radius=-0,this.center=new Lh,this.fromCenterRadius(e,r)}return Ou()(t,[{key:"fromCenterRadius",value:function(t,e){return this.center.from(t),this.radius=e,this}},{key:"fromCornerPoints",value:function(t,e){return e=xd.from(e),this.center=(new Lh).from(t).add(e).scale(.5),this.radius=this.center.distance(e),this}},{key:"equals",value:function(t){return this===t||Boolean(t)&&this.center.equals(t.center)&&this.radius===t.radius}},{key:"clone",value:function(){return new t(this.center,this.radius)}},{key:"union",value:function(t){var e=this.center,r=this.radius,n=t.center,i=t.radius,o=xd.copy(n).subtract(e),a=o.magnitude();if(r>=a+i)return this.clone();if(i>=a+r)return t.clone();var s=.5*(r+a+i);return Cd.copy(o).scale((-r+s)/a).add(e),this.center.copy(Cd),this.radius=s,this}},{key:"expand",value:function(t){var e=(t=xd.from(t)).subtract(this.center).magnitude();return e>this.radius&&(this.radius=e),this}},{key:"transform",value:function(t){this.center.transform(t);var e=lh(xd,t);return this.radius=Math.max(e[0],Math.max(e[1],e[2]))*this.radius,this}},{key:"distanceSquaredTo",value:function(t){return(t=xd.from(t)).subtract(this.center).lengthSquared()-this.radius*this.radius}},{key:"distanceTo",value:function(t){return Math.sqrt(this.distanceSquaredTo(t))}},{key:"intersectPlane",value:function(t){var e=this.center,r=this.radius,n=t.normal.dot(e)+t.distance;return n<-r?_d.OUTSIDE:n<r?_d.INTERSECTING:_d.INSIDE}}]),t}();function Ed(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=e[6],l=e[7],f=e[8],h=r[0],d=r[1],p=r[2],v=r[3],y=r[4],g=r[5],m=r[6],b=r[7],A=r[8];return t[0]=h*n+d*a+p*c,t[1]=h*i+d*s+p*l,t[2]=h*o+d*u+p*f,t[3]=v*n+y*a+g*c,t[4]=v*i+y*s+g*l,t[5]=v*o+y*u+g*f,t[6]=m*n+b*a+A*c,t[7]=m*i+b*s+A*l,t[8]=m*o+b*u+A*f,t}function Od(t,e,r){var n=r[0],i=r[1];return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=i*e[3],t[4]=i*e[4],t[5]=i*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function Td(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Df()(t);if(e){var i=Df()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Pf()(this,r)}}var Sd=Object.freeze([1,0,0,0,1,0,0,0,1]),Md=Object.freeze([0,0,0,0,0,0,0,0,0]),Id=Object.freeze({COL0ROW0:0,COL0ROW1:1,COL0ROW2:2,COL1ROW0:3,COL1ROW1:4,COL1ROW2:5,COL2ROW0:6,COL2ROW1:7,COL2ROW2:8}),Rd={},Pd=function(t){If()(r,t);var e=Td(r);function r(t){var n;return ku()(this,r),n=e.call(this,-0,-0,-0,-0,-0,-0,-0,-0,-0),1===arguments.length&&Array.isArray(t)?n.copy(t):n.identity(),n}return Ou()(r,[{key:"ELEMENTS",get:function(){return 9}},{key:"RANK",get:function(){return 3}},{key:"INDICES",get:function(){return Id}},{key:"copy",value:function(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()}},{key:"set",value:function(t,e,r,n,i,o,a,s,u){return this[0]=t,this[1]=e,this[2]=r,this[3]=n,this[4]=i,this[5]=o,this[6]=a,this[7]=s,this[8]=u,this.check()}},{key:"setRowMajor",value:function(t,e,r,n,i,o,a,s,u){return this[0]=t,this[1]=n,this[2]=a,this[3]=e,this[4]=i,this[5]=s,this[6]=r,this[7]=o,this[8]=u,this.check()}},{key:"determinant",value:function(){return e=(t=this)[0],r=t[1],n=t[2],i=t[3],o=t[4],a=t[5],s=t[6],u=t[7],c=t[8],e*(c*o-a*u)+r*(-c*i+a*s)+n*(u*i-o*s);var t,e,r,n,i,o,a,s,u,c}},{key:"identity",value:function(){return this.copy(Sd)}},{key:"fromQuaternion",value:function(t){return function(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=r+r,s=n+n,u=i+i,c=r*a,l=n*a,f=n*s,h=i*a,d=i*s,p=i*u,v=o*a,y=o*s,g=o*u;t[0]=1-f-p,t[3]=l-g,t[6]=h+y,t[1]=l+g,t[4]=1-c-p,t[7]=d-v,t[2]=h-y,t[5]=d+v,t[8]=1-c-f}(this,t),this.check()}},{key:"transpose",value:function(){return function(t,e){if(t===e){var r=e[1],n=e[2],i=e[5];t[1]=e[3],t[2]=e[6],t[3]=r,t[5]=e[7],t[6]=n,t[7]=i}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]}(this,this),this.check()}},{key:"invert",value:function(){return function(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],c=e[7],l=e[8],f=l*a-s*c,h=-l*o+s*u,d=c*o-a*u,p=r*f+n*h+i*d;p&&(p=1/p,t[0]=f*p,t[1]=(-l*n+i*c)*p,t[2]=(s*n-i*a)*p,t[3]=h*p,t[4]=(l*r-i*u)*p,t[5]=(-s*r+i*o)*p,t[6]=d*p,t[7]=(-c*r+n*u)*p,t[8]=(a*r-n*o)*p)}(this,this),this.check()}},{key:"multiplyLeft",value:function(t){return Ed(this,t,this),this.check()}},{key:"multiplyRight",value:function(t){return Ed(this,this,t),this.check()}},{key:"rotate",value:function(t){return function(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=e[6],l=e[7],f=e[8],h=Math.sin(r),d=Math.cos(r);t[0]=d*n+h*a,t[1]=d*i+h*s,t[2]=d*o+h*u,t[3]=d*a-h*n,t[4]=d*s-h*i,t[5]=d*u-h*o,t[6]=c,t[7]=l,t[8]=f}(this,this,t),this.check()}},{key:"scale",value:function(t){return Array.isArray(t)?Od(this,this,t):Od(this,this,[t,t,t]),this.check()}},{key:"translate",value:function(t){return function(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=e[6],l=e[7],f=e[8],h=r[0],d=r[1];t[0]=n,t[1]=i,t[2]=o,t[3]=a,t[4]=s,t[5]=u,t[6]=h*n+d*a+c,t[7]=h*i+d*s+l,t[8]=h*o+d*u+f}(this,this,t),this.check()}},{key:"transform",value:function(t,e){switch(t.length){case 2:e=dh(e||[-0,-0],t,this);break;case 3:e=wh(e||[-0,-0,-0],t,this);break;case 4:e=function(t,e,r){var n=e[0],i=e[1],o=e[2];return t[0]=r[0]*n+r[3]*i+r[6]*o,t[1]=r[1]*n+r[4]*i+r[7]*o,t[2]=r[2]*n+r[5]*i+r[8]*o,t[3]=e[3],t}(e||[-0,-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return Zf(e,t.length),e}},{key:"transformVector",value:function(t,e){return th("Matrix3.transformVector"),this.transform(t,e)}},{key:"transformVector2",value:function(t,e){return th("Matrix3.transformVector"),this.transform(t,e)}},{key:"transformVector3",value:function(t,e){return th("Matrix3.transformVector"),this.transform(t,e)}}],[{key:"IDENTITY",get:function(){return Rd.IDENTITY=Rd.IDENTITY||Object.freeze(new r(Sd)),Rd.IDENTITY}},{key:"ZERO",get:function(){return Rd.ZERO=Rd.ZERO||Object.freeze(new r(Md)),Rd.ZERO}}]),r}(ih);function Fd(){var t=new sh(4);return sh!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function Dd(t,e,r){r*=.5;var n=Math.sin(r);return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=Math.cos(r),t}function Ld(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=r[0],u=r[1],c=r[2],l=r[3];return t[0]=n*l+a*s+i*c-o*u,t[1]=i*l+a*u+o*s-n*c,t[2]=o*l+a*c+n*u-i*s,t[3]=a*l-n*s-i*u-o*c,t}function jd(t,e,r,n){var i,o,a,s,u,c=e[0],l=e[1],f=e[2],h=e[3],d=r[0],p=r[1],v=r[2],y=r[3];return(o=c*d+l*p+f*v+h*y)<0&&(o=-o,d=-d,p=-p,v=-v,y=-y),1-o>1e-6?(i=Math.acos(o),a=Math.sin(i),s=Math.sin((1-n)*i)/a,u=Math.sin(n*i)/a):(s=1-n,u=n),t[0]=s*c+u*d,t[1]=s*l+u*p,t[2]=s*f+u*v,t[3]=s*h+u*y,t}function Gd(t,e){var r,n=e[0]+e[4]+e[8];if(n>0)r=Math.sqrt(n+1),t[3]=.5*r,r=.5/r,t[0]=(e[5]-e[7])*r,t[1]=(e[6]-e[2])*r,t[2]=(e[1]-e[3])*r;else{var i=0;e[4]>e[0]&&(i=1),e[8]>e[3*i+i]&&(i=2);var o=(i+1)%3,a=(i+2)%3;r=Math.sqrt(e[3*i+i]-e[3*o+o]-e[3*a+a]+1),t[i]=.5*r,r=.5/r,t[3]=(e[3*o+a]-e[3*a+o])*r,t[o]=(e[3*o+i]+e[3*i+o])*r,t[a]=(e[3*a+i]+e[3*i+a])*r}return t}var Nd=function(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t},Ud=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t},Hd=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]},Vd=function(t,e,r,n){var i=e[0],o=e[1],a=e[2],s=e[3];return t[0]=i+n*(r[0]-i),t[1]=o+n*(r[1]-o),t[2]=a+n*(r[2]-a),t[3]=s+n*(r[3]-s),t},Jd=_h,zd=xh,Kd=function(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=r*r+n*n+i*i+o*o;return a>0&&(a=1/Math.sqrt(a)),t[0]=r*a,t[1]=n*a,t[2]=i*a,t[3]=o*a,t},qd=function(){var t=vh(),e=gh(1,0,0),r=gh(0,1,0);return function(n,i,o){var a=mh(i,o);return a<-.999999?(bh(t,e,i),Bh(t)<1e-6&&bh(t,r,i),function(t,e){var r=e[0],n=e[1],i=e[2],o=r*r+n*n+i*i;o>0&&(o=1/Math.sqrt(o)),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o}(t,t),Dd(n,t,Math.PI),n):a>.999999?(n[0]=0,n[1]=0,n[2]=0,n[3]=1,n):(bh(t,i,o),n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=1+a,Kd(n,n))}}();(function(){var t=Fd(),e=Fd()})(),function(){var t=function(){var t=new sh(9);return sh!=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 Wd(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Df()(t);if(e){var i=Df()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Pf()(this,r)}}var Qd=[0,0,0,1],Xd=function(t){If()(r,t);var e=Wd(r);function r(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;return ku()(this,r),t=e.call(this,-0,-0,-0,-0),Array.isArray(n)&&1===arguments.length?t.copy(n):t.set(n,i,o,a),t}return Ou()(r,[{key:"copy",value:function(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this.check()}},{key:"set",value:function(t,e,r,n){return this[0]=t,this[1]=e,this[2]=r,this[3]=n,this.check()}},{key:"fromMatrix3",value:function(t){return Gd(this,t),this.check()}},{key:"identity",value:function(){return function(t){t[0]=0,t[1]=0,t[2]=0,t[3]=1}(this),this.check()}},{key:"fromAxisRotation",value:function(t,e){return Dd(this,t,e),this.check()}},{key:"setAxisAngle",value:function(t,e){return this.fromAxisRotation(t,e)}},{key:"ELEMENTS",get:function(){return 4}},{key:"x",get:function(){return this[0]},set:function(t){this[0]=Yf(t)}},{key:"y",get:function(){return this[1]},set:function(t){this[1]=Yf(t)}},{key:"z",get:function(){return this[2]},set:function(t){this[2]=Yf(t)}},{key:"w",get:function(){return this[3]},set:function(t){this[3]=Yf(t)}},{key:"len",value:function(){return Jd(this)}},{key:"lengthSquared",value:function(){return zd(this)}},{key:"dot",value:function(t,e){if(void 0!==e)throw new Error("Quaternion.dot only takes one argument");return Hd(this,t)}},{key:"rotationTo",value:function(t,e){return qd(this,t,e),this.check()}},{key:"add",value:function(t,e){if(void 0!==e)throw new Error("Quaternion.add only takes one argument");return Nd(this,this,t),this.check()}},{key:"calculateW",value:function(){return function(t,e){var r=e[0],n=e[1],i=e[2];t[0]=r,t[1]=n,t[2]=i,t[3]=Math.sqrt(Math.abs(1-r*r-n*n-i*i))}(this,this),this.check()}},{key:"conjugate",value:function(){return function(t,e){t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3]}(this,this),this.check()}},{key:"invert",value:function(){return function(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=r*r+n*n+i*i+o*o,s=a?1/a:0;t[0]=-r*s,t[1]=-n*s,t[2]=-i*s,t[3]=o*s}(this,this),this.check()}},{key:"lerp",value:function(t,e,r){return Vd(this,t,e,r),this.check()}},{key:"multiplyRight",value:function(t,e){return Lf(!e),Ld(this,this,t),this.check()}},{key:"multiplyLeft",value:function(t,e){return Lf(!e),Ld(this,t,this),this.check()}},{key:"normalize",value:function(){var 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()}},{key:"rotateX",value:function(t){return function(t,e,r){r*=.5;var n=e[0],i=e[1],o=e[2],a=e[3],s=Math.sin(r),u=Math.cos(r);t[0]=n*u+a*s,t[1]=i*u+o*s,t[2]=o*u-i*s,t[3]=a*u-n*s}(this,this,t),this.check()}},{key:"rotateY",value:function(t){return function(t,e,r){r*=.5;var n=e[0],i=e[1],o=e[2],a=e[3],s=Math.sin(r),u=Math.cos(r);t[0]=n*u-o*s,t[1]=i*u+a*s,t[2]=o*u+n*s,t[3]=a*u-i*s}(this,this,t),this.check()}},{key:"rotateZ",value:function(t){return function(t,e,r){r*=.5;var n=e[0],i=e[1],o=e[2],a=e[3],s=Math.sin(r),u=Math.cos(r);t[0]=n*u+i*s,t[1]=i*u-n*s,t[2]=o*u+a*s,t[3]=a*u-o*s}(this,this,t),this.check()}},{key:"scale",value:function(t){return Ud(this,this,t),this.check()}},{key:"slerp",value:function(t,e,r){switch(arguments.length){case 1:var n=arguments[0],i=n.start;t=void 0===i?Qd:i,e=n.target,r=n.ratio;break;case 2:var o=Array.prototype.slice.call(arguments);e=o[0],r=o[1],t=this}return jd(this,t,e,r),this.check()}},{key:"transformVector4",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;return Ch(e,t,this),Zf(e,4)}},{key:"lengthSq",value:function(){return this.lengthSquared()}},{key:"setFromAxisAngle",value:function(t,e){return this.setAxisAngle(t,e)}},{key:"premultiply",value:function(t,e){return this.multiplyLeft(t,e)}},{key:"multiply",value:function(t,e){return this.multiplyRight(t,e)}}]),r}(rh),Yd=new Lh,Zd=new Lh,$d=new Lh,tp=new Lh,ep=new Lh,rp=new Lh,np=new Lh,ip=0,op=1,ap=2,sp=3,up=4,cp=5,lp=6,fp=7,hp=8,dp=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[0,0,0],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0,0,0,0,0,0,0];ku()(this,t),this.center=(new Lh).from(e),this.halfAxes=new Pd(r)}return Ou()(t,[{key:"halfSize",get:function(){var t=this.halfAxes.getColumn(0),e=this.halfAxes.getColumn(1),r=this.halfAxes.getColumn(2);return[new Lh(t).len(),new Lh(e).len(),new Lh(r).len()]}},{key:"quaternion",get:function(){var t=this.halfAxes.getColumn(0),e=this.halfAxes.getColumn(1),r=this.halfAxes.getColumn(2),n=new Lh(t).normalize(),i=new Lh(e).normalize(),o=new Lh(r).normalize();return(new Xd).fromMatrix3(new Pd([].concat(Mu()(n),Mu()(i),Mu()(o))))}},{key:"fromCenterHalfSizeQuaternion",value:function(t,e,r){var n=new Xd(r),i=(new Pd).fromQuaternion(n);return i[0]=i[0]*e[0],i[1]=i[1]*e[0],i[2]=i[2]*e[0],i[3]=i[3]*e[1],i[4]=i[4]*e[1],i[5]=i[5]*e[1],i[6]=i[6]*e[2],i[7]=i[7]*e[2],i[8]=i[8]*e[2],this.center=(new Lh).from(t),this.halfAxes=i,this}},{key:"clone",value:function(){return new t(this.center,this.halfAxes)}},{key:"equals",value:function(t){return this===t||Boolean(t)&&this.center.equals(t.center)&&this.halfAxes.equals(t.halfAxes)}},{key:"getBoundingSphere",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new kd,e=this.halfAxes,r=e.getColumn(0,$d),n=e.getColumn(1,tp),i=e.getColumn(2,ep),o=Yd.copy(r).add(n).add(i);return t.center.copy(this.center),t.radius=o.magnitude(),t}},{key:"intersectPlane",value:function(t){var e=this.center,r=t.normal,n=this.halfAxes,i=r.x,o=r.y,a=r.z,s=Math.abs(i*n[ip]+o*n[op]+a*n[ap])+Math.abs(i*n[sp]+o*n[up]+a*n[cp])+Math.abs(i*n[lp]+o*n[fp]+a*n[hp]),u=r.dot(e)+t.distance;return u<=-s?_d.OUTSIDE:u>=s?_d.INSIDE:_d.INTERSECTING}},{key:"distanceTo",value:function(t){return Math.sqrt(this.distanceSquaredTo(t))}},{key:"distanceSquaredTo",value:function(t){var e=Zd.from(t).subtract(this.center),r=this.halfAxes,n=r.getColumn(0,$d),i=r.getColumn(1,tp),o=r.getColumn(2,ep),a=n.magnitude(),s=i.magnitude(),u=o.magnitude();n.normalize(),i.normalize(),o.normalize();var c,l=0;return(c=Math.abs(e.dot(n))-a)>0&&(l+=c*c),(c=Math.abs(e.dot(i))-s)>0&&(l+=c*c),(c=Math.abs(e.dot(o))-u)>0&&(l+=c*c),l}},{key:"computePlaneDistances",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[-0,-0],n=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY,o=this.center,a=this.halfAxes,s=a.getColumn(0,$d),u=a.getColumn(1,tp),c=a.getColumn(2,ep),l=rp.copy(s).add(u).add(c).add(o),f=np.copy(l).subtract(t),h=e.dot(f);return n=Math.min(h,n),i=Math.max(h,i),l.copy(o).add(s).add(u).subtract(c),f.copy(l).subtract(t),h=e.dot(f),n=Math.min(h,n),i=Math.max(h,i),l.copy(o).add(s).subtract(u).add(c),f.copy(l).subtract(t),h=e.dot(f),n=Math.min(h,n),i=Math.max(h,i),l.copy(o).add(s).subtract(u).subtract(c),f.copy(l).subtract(t),h=e.dot(f),n=Math.min(h,n),i=Math.max(h,i),o.copy(l).subtract(s).add(u).add(c),f.copy(l).subtract(t),h=e.dot(f),n=Math.min(h,n),i=Math.max(h,i),o.copy(l).subtract(s).add(u).subtract(c),f.copy(l).subtract(t),h=e.dot(f),n=Math.min(h,n),i=Math.max(h,i),o.copy(l).subtract(s).subtract(u).add(c),f.copy(l).subtract(t),h=e.dot(f),n=Math.min(h,n),i=Math.max(h,i),o.copy(l).subtract(s).subtract(u).subtract(c),f.copy(l).subtract(t),h=e.dot(f),n=Math.min(h,n),i=Math.max(h,i),r[0]=n,r[1]=i,r}},{key:"transform",value:function(t){this.center.transformAsPoint(t);var e=this.halfAxes.getColumn(0,$d);e.transformAsPoint(t);var r=this.halfAxes.getColumn(1,tp);r.transformAsPoint(t);var n=this.halfAxes.getColumn(2,ep);return n.transformAsPoint(t),this.halfAxes=new Pd([].concat(Mu()(e),Mu()(r),Mu()(n))),this}},{key:"getTransform",value:function(){throw new Error("not implemented")}}]),t}(),pp=new Lh,vp=new Lh,yp=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[0,0,1],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;ku()(this,t),this.normal=new Lh,this.distance=-0,this.fromNormalDistance(e,r)}return Ou()(t,[{key:"fromNormalDistance",value:function(t,e){return Lf(Number.isFinite(e)),this.normal.from(t).normalize(),this.distance=e,this}},{key:"fromPointNormal",value:function(t,e){t=pp.from(t),this.normal.from(e).normalize();var r=-this.normal.dot(t);return this.distance=r,this}},{key:"fromCoefficients",value:function(t,e,r,n){return this.normal.set(t,e,r),Lf(Qf(this.normal.len(),1)),this.distance=n,this}},{key:"clone",value:function(e){return new t(this.normal,this.distance)}},{key:"equals",value:function(t){return Qf(this.distance,t.distance)&&Qf(this.normal,t.normal)}},{key:"getPointDistance",value:function(t){return this.normal.dot(t)+this.distance}},{key:"transform",value:function(t){var e=vp.copy(this.normal).transformAsVector(t).normalize(),r=this.normal.scale(-this.distance).transform(t);return this.fromPointNormal(r,e)}},{key:"projectPointOntoPlane",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];t=pp.from(t);var r=this.getPointDistance(t),n=vp.copy(this.normal).scale(r);return t.subtract(n).to(e)}}]),t}();function gp(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return mp(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return mp(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function mp(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var bp=[new Lh([1,0,0]),new Lh([0,1,0]),new Lh([0,0,1])],Ap=new Lh,wp=new Lh,Bp=(new yp(new Lh(1,0,0),0),function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];ku()(this,t),this.planes=e,Lf(this.planes.every((function(t){return t instanceof yp})))}return Ou()(t,[{key:"fromBoundingSphere",value:function(t){this.planes.length=2*bp.length;var e,r=t.center,n=t.radius,i=0,o=gp(bp);try{for(o.s();!(e=o.n()).done;){var a=e.value,s=this.planes[i],u=this.planes[i+1];s||(s=this.planes[i]=new yp),u||(u=this.planes[i+1]=new yp);var c=Ap.copy(a).scale(-n).add(r);a.dot(c);s.fromPointNormal(c,a);var l=Ap.copy(a).scale(n).add(r),f=wp.copy(a).negate();f.dot(l);u.fromPointNormal(l,f),i+=2}}catch(t){o.e(t)}finally{o.f()}return this}},{key:"computeVisibility",value:function(t){Lf(t);var e,r=_d.INSIDE,n=gp(this.planes);try{for(n.s();!(e=n.n()).done;){var i=e.value;switch(t.intersectPlane(i)){case _d.OUTSIDE:return _d.OUTSIDE;case _d.INTERSECTING:r=_d.INTERSECTING}}}catch(t){n.e(t)}finally{n.f()}return r}},{key:"computeVisibilityWithPlaneMask",value:function(e,r){if(Lf(e,"boundingVolume is required."),Lf(Number.isFinite(r),"parentPlaneMask is required."),r===t.MASK_OUTSIDE||r===t.MASK_INSIDE)return r;for(var n=t.MASK_INSIDE,i=this.planes,o=0;o<this.planes.length;++o){var a=o<31?1<<o:0;if(!(o<31&&0==(r&a))){var s=i[o],u=e.intersectPlane(s);if(u===_d.OUTSIDE)return t.MASK_OUTSIDE;u===_d.INTERSECTING&&(n|=a)}}return n}}],[{key:"MASK_OUTSIDE",get:function(){return 4294967295}},{key:"MASK_INSIDE",get:function(){return 0}},{key:"MASK_INDETERMINATE",get:function(){return 2147483647}}]),t}());new Lh,new Lh,new Lh,new Lh,new Lh;new Lh,new Lh,new Lh,new Lh,new Lh,new Lh,new Lh,new Lh,new Lh,new Lh,new Lh,new Lh,Math.PI;new Pd,new Pd,new Pd,new Pd,new Pd;new Lh,new Lh,new Lh,new Lh,new Lh,new Pd,new Pd,new Pd;function _p(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return xp(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return xp(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function xp(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var Cp=new Lh,kp=new Lh,Ep=new Bp([new yp,new yp,new yp,new yp,new yp,new yp]);function Op(t,e){var r=t.cameraDirection,n=t.cameraUp,i=t.height,o=t.distanceScales.metersPerUnit,a=Sp(t,t.center),s=fd.WGS84.eastNorthUpToFixedFrame(a),u=t.unprojectPosition(t.cameraPosition),c=fd.WGS84.cartographicToCartesian(u,new Lh),l=new Lh(s.transformAsVector(new Lh(r).scale(o))).normalize(),f=new Lh(s.transformAsVector(new Lh(n).scale(o))).normalize();return function(t){var e=t.getFrustumPlanes(),r=Tp(e.near,t.cameraPosition),n=Sp(t,r),i=Sp(t,t.cameraPosition,kp),o=0;for(var a in Ep.planes[o++].fromPointNormal(n,Cp.copy(n).subtract(i)),e)if("near"!==a){var s=Tp(e[a],r,kp),u=Sp(t,s,kp);Ep.planes[o++].fromPointNormal(u,Cp.copy(n).subtract(u))}}(t),{camera:{position:c,direction:l,up:f},viewport:t,topDownViewport:new(0,t.constructor)({longitude:t.longitude,latitude:t.latitude,height:i,width:t.width,bearing:t.bearing,zoom:t.zoom,pitch:0}),height:i,cullingVolume:Ep,frameNumber:e,sseDenominator:1.15}}function Tp(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Lh,n=t.normal.dot(e);return r.copy(t.normal).scale(t.distance-n).add(e),r}function Sp(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Lh,n=t.unprojectPosition(e);return fd.WGS84.cartographicToCartesian(n,r)}var Mp=new Lh;function Ip(t,e){if(t instanceof dp){var r=function(t){t.getColumn(0,Mp);var e=t.getColumn(1),r=t.getColumn(2);return Mp.add(e).add(r).len()}(t.halfAxes);return Math.log2(6356752.314245179/(r+e[2]))}if(t instanceof kd){var n=t.radius;return Math.log2(6356752.314245179/(n+e[2]))}if(t.width&&t.height){var i=t.width,o=t.height;return(Math.log2(6378137/i)+Math.log2(6378137/o))/2}return 1}function Rp(t,e,r){var n=fd.WGS84.cartographicToCartesian([t.xmax,t.ymax,t.zmax],new Lh),i=Math.sqrt(Math.pow(n[0]-r[0],2)+Math.pow(n[1]-r[1],2)+Math.pow(n[2]-r[2],2));return Math.log2(6356752.314245179/(i+e[2]))}var Pp=0,Fp=1,Dp=3,Lp=4,jp=5,Gp=1,Np=2,Up="empty",Hp="scenegraph",Vp="pointcloud",Jp="mesh",zp="I3S",Kp="TILES3D",qp="geometricError",Wp=1;function Qp(t){return null!=t}var Xp=new Lh,Yp=new Lh,Zp=new Lh;function $p(t,e,r){if(Zs(t,"3D Tile: boundingVolume must be defined"),t.box)return function(t,e,r){var n=new Lh(t[0],t[1],t[2]);e.transform(n,n);var i=[];if(10===t.length){var o=t.slice(3,6),a=new Xd;a.fromArray(t,6);var s=new Lh([1,0,0]),u=new Lh([0,1,0]),c=new Lh([0,0,1]);s.transformByQuaternion(a),s.scale(o[0]),u.transformByQuaternion(a),u.scale(o[1]),c.transformByQuaternion(a),c.scale(o[2]),i=[].concat(Mu()(s.toArray()),Mu()(u.toArray()),Mu()(c.toArray()))}else i=[].concat(Mu()(t.slice(3,6)),Mu()(t.slice(6,9)),Mu()(t.slice(9,12)));var l=e.transformAsVector(i.slice(0,3)),f=e.transformAsVector(i.slice(3,6)),h=e.transformAsVector(i.slice(6,9)),d=new Pd([l[0],l[1],l[2],f[0],f[1],f[2],h[0],h[1],h[2]]);if(Qp(r))return r.center=n,r.halfAxes=d,r;return new dp(n,d)}(t.box,e,r);if(t.region){var n=Sf()(t.region,6),i=n[0],o=n[1],a=n[2],s=n[3],u=n[4],c=n[5],l=fd.WGS84.cartographicToCartesian([qf(i),qf(s),u],Yp),f=fd.WGS84.cartographicToCartesian([qf(a),qf(o),c],Zp),h=(new Lh).addVectors(l,f).multiplyScalar(.5),d=(new Lh).subVectors(l,f).len()/2;return tv([h[0],h[1],h[2],d],new Mh)}if(t.sphere)return tv(t.sphere,e,r);throw new Error("3D Tile: boundingVolume must contain a sphere, region, or box")}function tv(t,e,r){var n=new Lh(t[0],t[1],t[2]);e.transform(n,n);var i=e.getScale(Xp),o=Math.max(Math.max(i[0],i[1]),i[2]),a=t[3]*o;return Qp(r)?(r.center=n,r.radius=a,r):new kd(n,a)}new Lh,new Lh,new Mh,new Lh,new Lh,new Lh;function ev(t,e){if(t.dynamicScreenSpaceError&&t.dynamicScreenSpaceErrorComputedDensity){var r=t.dynamicScreenSpaceErrorComputedDensity,n=t.dynamicScreenSpaceErrorFactor;return function(t,e){var r=t*e;return 1-Math.exp(-r*r)}(e,r)*n}return 0}var rv=new Lh,nv=new Lh,iv=new Lh,ov=new Lh,av=new Lh,sv=new Mh,uv=new Mh;function cv(t,e){var r=e.topDownViewport,n=t.header.mbs[1],i=t.header.mbs[0],o=t.header.mbs[2],a=t.header.mbs[3],s=Mu()(t.boundingVolume.center),u=r.unprojectPosition(r.cameraPosition);fd.WGS84.cartographicToCartesian(u,rv),nv.copy(rv).subtract(s).normalize(),fd.WGS84.eastNorthUpToFixedFrame(s,sv),uv.copy(sv).invert(),iv.copy(rv).transform(uv);var c=Math.sqrt(iv[0]*iv[0]+iv[1]*iv[1]),l=c*c/iv[2];ov.copy([iv[0],iv[1],l]);var f=ov.transform(sv).subtract(s).normalize(),h=nv.cross(f).normalize().scale(a).add(s),d=fd.WGS84.cartesianToCartographic(h),p=r.project([i,n,o]),v=r.project(d);return av.copy(p).subtract(v).magnitude()}var lv=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;ku()(this,t),Tu(this,"_map",new Map),Tu(this,"_array",void 0),Tu(this,"_length",void 0),this._array=new Array(e),this._length=e}return Ou()(t,[{key:"length",get:function(){return this._length},set:function(t){this._length=t,t>this._array.length&&(this._array.length=t)}},{key:"values",get:function(){return this._array}},{key:"get",value:function(t){return Zs(t<this._array.length),this._array[t]}},{key:"set",value:function(t,e){Zs(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)}},{key:"delete",value:function(t){var e=this._map.get(t);e>=0&&(this._array.splice(e,1),this._map.delete(t),this.length--)}},{key:"peek",value:function(){return this._array[this._length-1]}},{key:"push",value:function(t){if(!this._map.has(t)){var e=this.length++;this._array[e]=t,this._map.set(t,e)}}},{key:"pop",value:function(){var t=this._array[--this.length];return this._map.delete(t),t}},{key:"reserve",value:function(t){Zs(t>=0),t>this._array.length&&(this._array.length=t)}},{key:"resize",value:function(t){Zs(t>=0),this.length=t}},{key:"trim",value:function(t){null==t&&(t=this.length),this._array.length=t}},{key:"reset",value:function(){this._array=[],this._map=new Map,this._length=0}},{key:"find",value:function(t){return this._map.has(t)}}]),t}();function fv(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return hv(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return hv(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function hv(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function dv(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function pv(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?dv(Object(r),!0).forEach((function(e){Ys()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):dv(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var vv={loadSiblings:!1,skipLevelOfDetail:!1,maximumScreenSpaceError:2,updateTransforms:!0,onTraversalEnd:function(){},viewportTraversersMap:{},basePath:""},yv=function(){function t(e){ku()(this,t),Tu(this,"options",void 0),Tu(this,"root",void 0),Tu(this,"requestedTiles",void 0),Tu(this,"selectedTiles",void 0),Tu(this,"emptyTiles",void 0),Tu(this,"lastUpdate",(new Date).getTime()),Tu(this,"updateDebounceTime",1e3),Tu(this,"_traversalStack",void 0),Tu(this,"_emptyTraversalStack",void 0),Tu(this,"_frameNumber",void 0),this.options=pv(pv({},vv),e),this._traversalStack=new lv,this._emptyTraversalStack=new lv,this._frameNumber=null,this.root=null,this.selectedTiles={},this.requestedTiles={},this.emptyTiles={}}return Ou()(t,[{key:"traversalFinished",value:function(t){return!0}},{key:"traverse",value:function(t,e,r){this.root=t,this.options=pv(pv({},this.options),r),this.reset(),this.updateTile(t,e),this._frameNumber=e.frameNumber,this.executeTraversal(t,e)}},{key:"reset",value:function(){this.requestedTiles={},this.selectedTiles={},this.emptyTiles={},this._traversalStack.reset(),this._emptyTraversalStack.reset()}},{key:"executeTraversal",value:function(t,e){var r=this._traversalStack;for(t._selectionDepth=1,r.push(t);r.length>0;){var n=r.pop(),i=!1;this.canTraverse(n,e)&&(this.updateChildTiles(n,e),i=this.updateAndPushChildren(n,e,r,n.hasRenderContent?n._selectionDepth+1:n._selectionDepth));var o=n.parent,a=Boolean(!o||o._shouldRefine),s=!i;n.hasRenderContent?n.refine===Gp?(this.loadTile(n,e),this.selectTile(n,e)):n.refine===Np&&(this.loadTile(n,e),s&&this.selectTile(n,e)):(this.emptyTiles[n.id]=n,this.loadTile(n,e),s&&this.selectTile(n,e)),this.touchTile(n,e),n._shouldRefine=i&&a}var u=(new Date).getTime();(this.traversalFinished(e)||u-this.lastUpdate>this.updateDebounceTime)&&(this.lastUpdate=u,this.options.onTraversalEnd(e))}},{key:"updateChildTiles",value:function(t,e){var r,n=fv(t.children);try{for(n.s();!(r=n.n()).done;){var i=r.value;this.updateTile(i,e)}}catch(t){n.e(t)}finally{n.f()}return!0}},{key:"updateAndPushChildren",value:function(t,e,r,n){var i=this.options,o=i.loadSiblings,a=i.skipLevelOfDetail,s=t.children;s.sort(this.compareDistanceToCamera.bind(this));var u,c=t.refine===Np&&t.hasRenderContent&&!a,l=!1,f=!0,h=fv(s);try{for(h.s();!(u=h.n()).done;){var d=u.value;if(d._selectionDepth=n,d.isVisibleAndInRequestVolume?(r.find(d)&&r.delete(d),r.push(d),l=!0):(c||o)&&(this.loadTile(d,e),this.touchTile(d,e)),c){var p=void 0;if(p=!!d._inRequestVolume&&(d.hasRenderContent?d.contentAvailable:this.executeEmptyTraversal(d,e)),!(f=f&&p))return!1}}}catch(t){h.e(t)}finally{h.f()}return l||(f=!1),f}},{key:"updateTile",value:function(t,e){this.updateTileVisibility(t,e)}},{key:"selectTile",value:function(t,e){this.shouldSelectTile(t)&&(t._selectedFrame=e.frameNumber,this.selectedTiles[t.id]=t)}},{key:"loadTile",value:function(t,e){this.shouldLoadTile(t)&&(t._requestedFrame=e.frameNumber,t._priority=t._getPriority(),this.requestedTiles[t.id]=t)}},{key:"touchTile",value:function(t,e){t.tileset._cache.touch(t),t._touchedFrame=e.frameNumber}},{key:"canTraverse",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return!!t.hasChildren&&(t.hasTilesetContent?!t.contentExpired:!(!n&&!t.isVisibleAndInRequestVolume)&&this.shouldRefine(t,e,r))}},{key:"shouldLoadTile",value:function(t){return t.hasUnloadedContent||t.contentExpired}},{key:"shouldSelectTile",value:function(t){return t.contentAvailable&&!this.options.skipLevelOfDetail}},{key:"shouldRefine",value:function(t,e,r){var n=t._screenSpaceError;return r&&(n=t.getScreenSpaceError(e,!0)),n>this.options.maximumScreenSpaceError}},{key:"updateTileVisibility",value:function(t,e){var r=[];if(this.options.viewportTraversersMap)for(var n in this.options.viewportTraversersMap){this.options.viewportTraversersMap[n]===e.viewport.id&&r.push(n)}else r.push(e.viewport.id);t.updateVisibility(e,r)}},{key:"compareDistanceToCamera",value:function(t,e){return t._distanceToCamera-e._distanceToCamera}},{key:"anyChildrenVisible",value:function(t,e){var r,n=!1,i=fv(t.children);try{for(i.s();!(r=i.n()).done;){var o=r.value;o.updateVisibility(e),n=n||o.isVisibleAndInRequestVolume}}catch(t){i.e(t)}finally{i.f()}return n}},{key:"executeEmptyTraversal",value:function(t,e){var r=!0,n=this._emptyTraversalStack;for(n.push(t);n.length>0&&r;){var i=n.pop();if(this.updateTile(i,e),i.isVisibleAndInRequestVolume||this.loadTile(i,e),this.touchTile(i,e),!i.hasRenderContent&&this.canTraverse(i,e,!1,!0)){var o,a=fv(i.children);try{for(a.s();!(o=a.n()).done;){var s=o.value;n.find(s)&&n.delete(s),n.push(s)}}catch(t){a.e(t)}finally{a.f()}}else i.contentAvailable||(r=!1)}return r}}]),t}();function gv(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function mv(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?gv(Object(r),!0).forEach((function(e){Ys()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):gv(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var bv=new Lh;var Av=function(){function t(e,r,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";ku()(this,t),Tu(this,"tileset",void 0),Tu(this,"header",void 0),Tu(this,"id",void 0),Tu(this,"url",void 0),Tu(this,"parent",void 0),Tu(this,"refine",void 0),Tu(this,"type",void 0),Tu(this,"contentUrl",void 0),Tu(this,"lodMetricType",void 0),Tu(this,"lodMetricValue",void 0),Tu(this,"boundingVolume",void 0),Tu(this,"content",void 0),Tu(this,"contentState",void 0),Tu(this,"gpuMemoryUsageInBytes",void 0),Tu(this,"children",void 0),Tu(this,"depth",void 0),Tu(this,"viewportIds",void 0),Tu(this,"transform",void 0),Tu(this,"extensions",void 0),Tu(this,"implicitTiling",void 0),Tu(this,"userData",void 0),Tu(this,"computedTransform",void 0),Tu(this,"hasEmptyContent",void 0),Tu(this,"hasTilesetContent",void 0),Tu(this,"traverser",void 0),Tu(this,"_cacheNode",void 0),Tu(this,"_frameNumber",void 0),Tu(this,"_lodJudge",void 0),Tu(this,"_expireDate",void 0),Tu(this,"_expiredContent",void 0),Tu(this,"_shouldRefine",void 0),Tu(this,"_distanceToCamera",void 0),Tu(this,"_centerZDepth",void 0),Tu(this,"_screenSpaceError",void 0),Tu(this,"_visibilityPlaneMask",void 0),Tu(this,"_visible",void 0),Tu(this,"_inRequestVolume",void 0),Tu(this,"_stackLength",void 0),Tu(this,"_selectionDepth",void 0),Tu(this,"_touchedFrame",void 0),Tu(this,"_visitedFrame",void 0),Tu(this,"_selectedFrame",void 0),Tu(this,"_requestedFrame",void 0),Tu(this,"_priority",void 0),Tu(this,"_contentBoundingVolume",void 0),Tu(this,"_viewerRequestVolume",void 0),Tu(this,"_initialTransform",void 0),this.header=r,this.tileset=e,this.id=i||r.id,this.url=r.url,this.parent=n,this.refine=this._getRefine(r.refine),this.type=r.type,this.contentUrl=r.contentUrl,this.lodMetricType="geometricError",this.lodMetricValue=0,this.boundingVolume=null,this.content=null,this.contentState=Pp,this.gpuMemoryUsageInBytes=0,this.children=[],this.hasEmptyContent=!1,this.hasTilesetContent=!1,this.depth=0,this.viewportIds=[],this.userData={},this.extensions=null,this._priority=0,this._touchedFrame=0,this._visitedFrame=0,this._selectedFrame=0,this._requestedFrame=0,this._screenSpaceError=0,this._cacheNode=null,this._frameNumber=null,this._cacheNode=null,this.traverser=new yv({}),this._shouldRefine=!1,this._distanceToCamera=0,this._centerZDepth=0,this._visible=void 0,this._inRequestVolume=!1,this._stackLength=0,this._selectionDepth=0,this._initialTransform=new Mh,this.transform=new Mh,this._initializeLodMetric(r),this._initializeTransforms(r),this._initializeBoundingVolumes(r),this._initializeContent(r),this._initializeRenderingState(r),this._lodJudge=null,this._expireDate=null,this._expiredContent=null,this.implicitTiling=null,Object.seal(this)}var e;return Ou()(t,[{key:"destroy",value:function(){this.header=null}},{key:"isDestroyed",value:function(){return null===this.header}},{key:"selected",get:function(){return this._selectedFrame===this.tileset._frameNumber}},{key:"isVisible",get:function(){return this._visible}},{key:"isVisibleAndInRequestVolume",get:function(){return this._visible&&this._inRequestVolume}},{key:"hasRenderContent",get:function(){return!this.hasEmptyContent&&!this.hasTilesetContent}},{key:"hasChildren",get:function(){return this.children.length>0||this.header.children&&this.header.children.length>0}},{key:"contentReady",get:function(){return this.contentState===Dp||this.hasEmptyContent}},{key:"contentAvailable",get:function(){return Boolean(this.contentReady&&this.hasRenderContent||this._expiredContent&&!this.contentFailed)}},{key:"hasUnloadedContent",get:function(){return this.hasRenderContent&&this.contentUnloaded}},{key:"contentUnloaded",get:function(){return this.contentState===Pp}},{key:"contentExpired",get:function(){return this.contentState===Lp}},{key:"contentFailed",get:function(){return this.contentState===jp}},{key:"distanceToCamera",get:function(){return this._distanceToCamera}},{key:"screenSpaceError",get:function(){return this._screenSpaceError}},{key:"getScreenSpaceError",value:function(t,e){switch(this.tileset.type){case zp:return cv(this,t);case Kp:return function(t,e,r){var n=t.tileset,i=t.parent&&t.parent.lodMetricValue||t.lodMetricValue,o=r?i:t.lodMetricValue;if(0===o)return 0;var a=Math.max(t._distanceToCamera,1e-7),s=e.height,u=e.sseDenominator,c=o*s*(n.options.viewDistanceScale||1)/(a*u);return c-=ev(n,a)}(this,t,e);default:throw new Error("Unsupported tileset type")}}},{key:"unselect",value:function(){this._selectedFrame=0}},{key:"_getPriority",value:function(){var t=this.tileset._traverser,e=t.options.skipLevelOfDetail,r=this.refine===Gp||e;if(r&&!this.isVisible&&void 0!==this._visible)return-1;if(this.tileset._frameNumber-this._touchedFrame>=1)return-1;if(this.contentState===Pp)return-1;var n=this.parent,i=n&&(!r||0===this._screenSpaceError||n.hasTilesetContent)?n._screenSpaceError:this._screenSpaceError,o=t.root?t.root._screenSpaceError:0;return Math.max(o-i,0)}},{key:"loadContent",value:(e=Ds()(js.a.mark((function t(){var e,r,n,i;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.hasEmptyContent){t.next=2;break}return t.abrupt("return",!1);case 2:if(!this.content){t.next=4;break}return t.abrupt("return",!0);case 4:return this.contentExpired&&(this._expireDate=null),this.contentState=Fp,t.next=9,this.tileset._requestScheduler.scheduleRequest(this.id,this._getPriority.bind(this));case 9:if(e=t.sent){t.next=13;break}return this.contentState=Pp,t.abrupt("return",!1);case 13:return t.prev=13,r=this.tileset.getTileUrl(this.contentUrl),n=this.tileset.loader,i=mv(mv({},this.tileset.loadOptions),{},Ys()({},n.id,mv(mv({},this.tileset.loadOptions[n.id]),{},{isTileset:"json"===this.type},this._getLoaderSpecificOptions(n.id)))),t.next=19,Ef(r,n,i);case 19:if(this.content=t.sent,!this.tileset.options.contentLoader){t.next=23;break}return t.next=23,this.tileset.options.contentLoader(this);case 23:return this._isTileset()&&this.tileset._initializeTileHeaders(this.content,this),this.contentState=Dp,this._onContentLoaded(),t.abrupt("return",!0);case 29:throw t.prev=29,t.t0=t.catch(13),this.contentState=jp,t.t0;case 33:return t.prev=33,e.done(),t.finish(33);case 36:case"end":return t.stop()}}),t,this,[[13,29,33,36]])}))),function(){return e.apply(this,arguments)})},{key:"unloadContent",value:function(){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=Pp,!0}},{key:"updateVisibility",value:function(t,e){if(this._frameNumber!==t.frameNumber){var r=this.parent,n=r?r._visibilityPlaneMask:Bp.MASK_INDETERMINATE;if(this.tileset._traverser.options.updateTransforms){var i=r?r.computedTransform:this.tileset.modelMatrix;this._updateTransform(i)}this._distanceToCamera=this.distanceToTile(t),this._screenSpaceError=this.getScreenSpaceError(t,!1),this._visibilityPlaneMask=this.visibility(t,n),this._visible=this._visibilityPlaneMask!==Bp.MASK_OUTSIDE,this._inRequestVolume=this.insideViewerRequestVolume(t),this._frameNumber=t.frameNumber,this.viewportIds=e}}},{key:"visibility",value:function(t,e){var r=t.cullingVolume,n=this.boundingVolume;return r.computeVisibilityWithPlaneMask(n,e)}},{key:"contentVisibility",value:function(){return!0}},{key:"distanceToTile",value:function(t){var e=this.boundingVolume;return Math.sqrt(Math.max(e.distanceSquaredTo(t.camera.position),0))}},{key:"cameraSpaceZDepth",value:function(t){var e=t.camera,r=this.boundingVolume;return bv.subVectors(r.center,e.position),e.direction.dot(bv)}},{key:"insideViewerRequestVolume",value:function(t){var e=this._viewerRequestVolume;return!e||e.distanceSquaredTo(t.camera.position)<=0}},{key:"updateExpiration",value:function(){if(null!=this._expireDate&&this.contentReady&&!this.hasEmptyContent){var t=Date.now();Date.lessThan(this._expireDate,t)&&(this.contentState=Lp,this._expiredContent=this.content)}}},{key:"extras",get:function(){return this.header.extras}},{key:"_initializeLodMetric",value:function(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"))}},{key:"_initializeTransforms",value:function(t){this.transform=t.transform?new Mh(t.transform):new Mh;var e=this.parent,r=this.tileset,n=e&&e.computedTransform?e.computedTransform.clone():r.modelMatrix.clone();this.computedTransform=new Mh(n).multiplyRight(this.transform);var i=e&&e._initialTransform?e._initialTransform.clone():new Mh;this._initialTransform=new Mh(i).multiplyRight(this.transform)}},{key:"_initializeBoundingVolumes",value:function(t){this._contentBoundingVolume=null,this._viewerRequestVolume=null,this._updateBoundingVolume(t)}},{key:"_initializeContent",value:function(t){this.content={_tileset:this.tileset,_tile:this},this.hasEmptyContent=!0,this.contentState=Pp,this.hasTilesetContent=!1,t.contentUrl&&(this.content=null,this.hasEmptyContent=!1)}},{key:"_initializeRenderingState",value:function(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=Bp.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}},{key:"_getRefine",value:function(t){return t||this.parent&&this.parent.refine||Np}},{key:"_isTileset",value:function(){return-1!==this.contentUrl.indexOf(".json")}},{key:"_onContentLoaded",value:function(){switch(this.content&&this.content.type){case"vctr":case"geom":this.tileset._traverser.disableSkipLevelOfDetail=!0}this._isTileset()&&(this.hasTilesetContent=!0)}},{key:"_updateBoundingVolume",value:function(t){this.boundingVolume=$p(t.boundingVolume,this.computedTransform,this.boundingVolume);var e=t.content;e&&(e.boundingVolume&&(this._contentBoundingVolume=$p(e.boundingVolume,this.computedTransform,this._contentBoundingVolume)),t.viewerRequestVolume&&(this._viewerRequestVolume=$p(t.viewerRequestVolume,this.computedTransform,this._viewerRequestVolume)))}},{key:"_updateTransform",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Mh,e=t.clone().multiplyRight(this.transform),r=!e.equals(this.computedTransform);r&&(this.computedTransform=e,this._updateBoundingVolume(this.header))}},{key:"_getLoaderSpecificOptions",value:function(t){switch(t){case"i3s":return mv(mv({},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});case"3d-tiles":case"cesium-ion":default:return{assetGltfUpAxis:(e=this.tileset.tileset).asset&&e.asset.gltfUpAxis||"Y"}}var e}}]),t}(),wv=r(73),Bv=r.n(wv);function _v(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Df()(t);if(e){var i=Df()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Pf()(this,r)}}var xv=function(t){If()(r,t);var e=_v(r);function r(){return ku()(this,r),e.apply(this,arguments)}return Ou()(r,[{key:"compareDistanceToCamera",value:function(t,e){return 0===e._distanceToCamera&&0===t._distanceToCamera?e._centerZDepth-t._centerZDepth:e._distanceToCamera-t._distanceToCamera}},{key:"updateTileVisibility",value:function(t,e){if(Bv()(Df()(r.prototype),"updateTileVisibility",this).call(this,t,e),t.isVisibleAndInRequestVolume){var n=t.children.length>0;if(t.hasTilesetContent&&n){var i=t.children[0];return this.updateTileVisibility(i,e),void(t._visible=i._visible)}if(this.meetsScreenSpaceErrorEarly(t,e))t._visible=!1;else{var o=t.refine===Np,a=t._optimChildrenWithinParent===Wp;o&&a&&n&&!this.anyChildrenVisible(t,e)&&(t._visible=!1)}}}},{key:"meetsScreenSpaceErrorEarly",value:function(t,e){var r=t.parent;return!(!r||r.hasTilesetContent||r.refine!==Gp)&&!this.shouldRefine(t,e,!0)}}]),r}(yv),Cv=r(29),kv=r.n(Cv),Ev=function(){function t(){ku()(this,t),Tu(this,"frameNumberMap",new Map)}return Ou()(t,[{key:"register",value:function(t,e){var r=this.frameNumberMap.get(t)||new Map,n=r.get(e)||0;r.set(e,n+1),this.frameNumberMap.set(t,r)}},{key:"deregister",value:function(t,e){var r=this.frameNumberMap.get(t);if(r){var n=r.get(e)||1;r.set(e,n-1)}}},{key:"isZero",value:function(t,e){var r;return 0===((null===(r=this.frameNumberMap.get(t))||void 0===r?void 0:r.get(e))||0)}}]),t}(),Ov="REQUESTED",Tv="COMPLETED",Sv="ERROR",Mv=function(){function t(){ku()(this,t),Tu(this,"_statusMap",void 0),Tu(this,"pendingTilesRegister",new Ev),this._statusMap={}}return Ou()(t,[{key:"add",value:function(t,e,r,n){var i=this;if(!this._statusMap[e]){var o=n.frameNumber,a=n.viewport.id;this._statusMap[e]={request:t,callback:r,key:e,frameState:n,status:Ov},this.pendingTilesRegister.register(a,o),t().then((function(t){i._statusMap[e].status=Tv;var r=i._statusMap[e].frameState,o=r.frameNumber,a=r.viewport.id;i.pendingTilesRegister.deregister(a,o),i._statusMap[e].callback(t,n)})).catch((function(t){i._statusMap[e].status=Sv;var n=i._statusMap[e].frameState,o=n.frameNumber,a=n.viewport.id;i.pendingTilesRegister.deregister(a,o),r(t)}))}}},{key:"update",value:function(t,e){if(this._statusMap[t]){var r=this._statusMap[t].frameState,n=r.frameNumber,i=r.viewport.id;this.pendingTilesRegister.deregister(i,n);var o=e.frameNumber,a=e.viewport.id;this.pendingTilesRegister.register(a,o),this._statusMap[t].frameState=e}}},{key:"find",value:function(t){return this._statusMap[t]}},{key:"hasPendingTiles",value:function(t,e){return!this.pendingTilesRegister.isZero(t,e)}}]),t}();function Iv(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Rv(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Iv(Object(r),!0).forEach((function(e){Ys()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Iv(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Pv(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return Fv(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Fv(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function Fv(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Dv(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Df()(t);if(e){var i=Df()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Pf()(this,r)}}var Lv=function(t){If()(n,t);var e,r=Dv(n);function n(t){var e;return ku()(this,n),e=r.call(this,t),Tu(kv()(e),"_tileManager",void 0),e._tileManager=new Mv,e}return Ou()(n,[{key:"traversalFinished",value:function(t){return!this._tileManager.hasPendingTiles(t.viewport.id,this._frameNumber||0)}},{key:"shouldRefine",value:function(t,e){return t._lodJudge=function(t,e){if(0===t.lodMetricValue||isNaN(t.lodMetricValue))return"DIG";var r=2*cv(t,e);return r<2?"OUT":!t.header.children||r<=t.lodMetricValue?"DRAW":t.header.children?"DIG":"OUT"}(t,e),"DIG"===t._lodJudge}},{key:"updateChildTiles",value:function(t,e){var r,n=this,i=t.header.children||[],o=t.children,a=t.tileset,s=Pv(i);try{var u=function(){var i=r.value,s="".concat(i.id,"-").concat(e.viewport.id),u=o&&o.find((function(t){return t.id===s}));if(u)u&&n.updateTile(u,e);else{var c=function(){return n._loadTile(i.id,a)};n._tileManager.find(s)?n._tileManager.update(s,e):(a.tileset.nodePages&&(c=function(){return a.tileset.nodePagesTile.formTileFromNodePages(i.id)}),n._tileManager.add(c,s,(function(e){return n._onTileLoad(e,t,s)}),e))}};for(s.s();!(r=s.n()).done;)u()}catch(t){s.e(t)}finally{s.f()}return!1}},{key:"_loadTile",value:(e=Ds()(js.a.mark((function t(e,r){var n,i,o;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=r.loader,i=r.getTileUrl("".concat(r.url,"/nodes/").concat(e)),o=Rv(Rv({},r.loadOptions),{},{i3s:Rv(Rv({},r.loadOptions.i3s),{},{isTileHeader:!0})}),t.next=5,Ef(i,n,o);case 5:return t.abrupt("return",t.sent);case 6:case"end":return t.stop()}}),t)}))),function(t,r){return e.apply(this,arguments)})},{key:"_onTileLoad",value:function(t,e,r){var n=new Av(e.tileset,t,e,r);e.children.push(n);var i=this._tileManager.find(n.id).frameState;this.updateTile(n,i),this._frameNumber===i.frameNumber&&(this.traversalFinished(i)||(new Date).getTime()-this.lastUpdate>this.updateDebounceTime)&&this.executeTraversal(n,i)}}]),n}(yv);function jv(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return Gv(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Gv(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function Gv(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Nv(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Uv(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Nv(Object(r),!0).forEach((function(e){Ys()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Nv(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var Hv={description:"",ellipsoid:fd.WGS84,modelMatrix:new Mh,throttleRequests:!0,maxRequests:64,maximumMemoryUsage:32,maximumTilesSelected:0,debounceTime:0,onTileLoad:function(){},onTileUnload:function(){},onTileError:function(){},onTraversalComplete:function(t){return t},contentLoader:void 0,viewDistanceScale:1,maximumScreenSpaceError:8,loadTiles:!0,updateTransforms:!0,viewportTraversersMap:null,loadOptions:{fetch:{}},attributions:[],basePath:"",i3s:{}},Vv="Tiles In Tileset(s)",Jv=function(){function t(e,r){ku()(this,t),Tu(this,"options",void 0),Tu(this,"loadOptions",void 0),Tu(this,"type",void 0),Tu(this,"tileset",void 0),Tu(this,"loader",void 0),Tu(this,"url",void 0),Tu(this,"basePath",void 0),Tu(this,"modelMatrix",void 0),Tu(this,"ellipsoid",void 0),Tu(this,"lodMetricType",void 0),Tu(this,"lodMetricValue",void 0),Tu(this,"refine",void 0),Tu(this,"root",void 0),Tu(this,"roots",void 0),Tu(this,"asset",void 0),Tu(this,"description",void 0),Tu(this,"properties",void 0),Tu(this,"extras",void 0),Tu(this,"attributions",void 0),Tu(this,"credits",void 0),Tu(this,"stats",void 0),Tu(this,"traverseCounter",void 0),Tu(this,"geometricError",void 0),Tu(this,"selectedTiles",void 0),Tu(this,"updatePromise",null),Tu(this,"tilesetInitializationPromise",void 0),Tu(this,"cartographicCenter",void 0),Tu(this,"cartesianCenter",void 0),Tu(this,"zoom",void 0),Tu(this,"boundingVolume",void 0),Tu(this,"gpuMemoryUsageInBytes",void 0),Tu(this,"dynamicScreenSpaceErrorComputedDensity",void 0),Tu(this,"_traverser",void 0),Tu(this,"_cache",void 0),Tu(this,"_requestScheduler",void 0),Tu(this,"_frameNumber",void 0),Tu(this,"_queryParamsString",void 0),Tu(this,"_queryParams",void 0),Tu(this,"_extensionsUsed",void 0),Tu(this,"_tiles",void 0),Tu(this,"_pendingCount",void 0),Tu(this,"lastUpdatedVieports",void 0),Tu(this,"_requestedTiles",void 0),Tu(this,"_emptyTiles",void 0),Tu(this,"frameStateData",void 0),Tu(this,"maximumMemoryUsage",void 0),Zs(e),this.options=Uv(Uv({},Hv),r),this.tileset=e,this.loader=e.loader,this.type=e.type,this.url=e.url,this.basePath=e.basePath||n.dirname(this.url),this.modelMatrix=this.options.modelMatrix,this.ellipsoid=this.options.ellipsoid,this.lodMetricType=e.lodMetricType,this.lodMetricValue=e.lodMetricValue,this.refine=e.root.refine,this.loadOptions=this.options.loadOptions||{},this.root=null,this.roots={},this.cartographicCenter=null,this.cartesianCenter=null,this.zoom=1,this.boundingVolume=null,this.traverseCounter=0,this.geometricError=0,this._traverser=this._initializeTraverser(),this._cache=new Bd,this._requestScheduler=new md({throttleRequests:this.options.throttleRequests,maxRequests:this.options.maxRequests}),this._frameNumber=0,this._pendingCount=0,this._tiles={},this.selectedTiles=[],this._emptyTiles=[],this._requestedTiles=[],this.frameStateData={},this.lastUpdatedVieports=null,this._queryParams={},this._queryParamsString="",this.maximumMemoryUsage=this.options.maximumMemoryUsage||32,this.gpuMemoryUsageInBytes=0,this.stats=new pd({id:this.url}),this._initializeStats(),this._extensionsUsed=void 0,this.dynamicScreenSpaceErrorComputedDensity=0,this.extras=null,this.asset={},this.credits={},this.description=this.options.description||"",this.tilesetInitializationPromise=this._initializeTileSet(e)}var e,r,i;return Ou()(t,[{key:"destroy",value:function(){this._destroy()}},{key:"isLoaded",value:function(){return 0===this._pendingCount&&0!==this._frameNumber&&0===this._requestedTiles.length}},{key:"tiles",get:function(){return Object.values(this._tiles)}},{key:"frameNumber",get:function(){return this._frameNumber}},{key:"queryParams",get:function(){return this._queryParamsString||(this._queryParamsString=function(t){for(var e=[],r=0,n=Object.keys(t);r<n.length;r++){var i=n[r];e.push("".concat(i,"=").concat(t[i]))}switch(e.length){case 0:return"";case 1:return"?".concat(e[0]);default:return"?".concat(e.join("&"))}}(this._queryParams)),this._queryParamsString}},{key:"setProps",value:function(t){this.options=Uv(Uv({},this.options),t)}},{key:"setOptions",value:function(t){this.options=Uv(Uv({},this.options),t)}},{key:"getTileUrl",value:function(t){return t.startsWith("data:")?t:"".concat(t).concat(this.queryParams)}},{key:"hasExtension",value:function(t){return Boolean(this._extensionsUsed&&this._extensionsUsed.indexOf(t)>-1)}},{key:"update",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this.tilesetInitializationPromise.then((function(){!e&&t.lastUpdatedVieports?e=t.lastUpdatedVieports:t.lastUpdatedVieports=e,e&&t.doUpdate(e)}))}},{key:"selectTiles",value:(i=Ds()(js.a.mark((function t(){var e,r=this,n=arguments;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=n.length>0&&void 0!==n[0]?n[0]:null,t.next=3,this.tilesetInitializationPromise;case 3:return e&&(this.lastUpdatedVieports=e),this.updatePromise||(this.updatePromise=new Promise((function(t){setTimeout((function(){r.lastUpdatedVieports&&r.doUpdate(r.lastUpdatedVieports),t(r._frameNumber),r.updatePromise=null}),r.options.debounceTime)}))),t.abrupt("return",this.updatePromise);case 6:case"end":return t.stop()}}),t,this)}))),function(){return i.apply(this,arguments)})},{key:"doUpdate",value:function(t){if((!("loadTiles"in this.options)||this.options.loadTiles)&&!(this.traverseCounter>0)){var e=t instanceof Array?t:[t];this._cache.reset(),this._frameNumber++,this.traverseCounter=e.length;var r,n=[],i=jv(e);try{for(i.s();!(r=i.n()).done;){var o=r.value.id;this._needTraverse(o)?n.push(o):this.traverseCounter--}}catch(t){i.e(t)}finally{i.f()}var a,s=jv(e);try{for(s.s();!(a=s.n()).done;){var u=a.value,c=u.id;if(this.roots[c]||(this.roots[c]=this._initializeTileHeaders(this.tileset,null)),n.includes(c)){var l=Op(u,this._frameNumber);this._traverser.traverse(this.roots[c],l,this.options)}}}catch(t){s.e(t)}finally{s.f()}}}},{key:"_needTraverse",value:function(t){var e=t;return this.options.viewportTraversersMap&&(e=this.options.viewportTraversersMap[t]),e===t}},{key:"_onTraversalEnd",value:function(t){var e=t.viewport.id;this.frameStateData[e]||(this.frameStateData[e]={selectedTiles:[],_requestedTiles:[],_emptyTiles:[]});var r=this.frameStateData[e],n=function(t,e,r){if(0===r||t.length<=r)return[t,[]];var n,i=[],o=e.viewport,a=o.longitude,s=o.latitude,u=_p(t.entries());try{for(u.s();!(n=u.n()).done;){var c=Sf()(n.value,2),l=c[0],f=c[1],h=Sf()(f.header.mbs,2),d=h[0],p=h[1],v=Math.abs(a-d),y=Math.abs(s-p),g=Math.sqrt(y*y+v*v);i.push([l,g])}}catch(t){u.e(t)}finally{u.f()}for(var m=i.sort((function(t,e){return t[1]-e[1]})),b=[],A=0;A<r;A++)b.push(t[m[A][0]]);for(var w=[],B=r;B<m.length;B++)w.push(t[m[B][0]]);return[b,w]}(Object.values(this._traverser.selectedTiles),t,this.options.maximumTilesSelected),i=Sf()(n,2),o=i[0],a=i[1];r.selectedTiles=o;var s,u=jv(a);try{for(u.s();!(s=u.n()).done;){s.value.unselect()}}catch(t){u.e(t)}finally{u.f()}r._requestedTiles=Object.values(this._traverser.requestedTiles),r._emptyTiles=Object.values(this._traverser.emptyTiles),this.traverseCounter--,this.traverseCounter>0||this._updateTiles()}},{key:"_updateTiles",value:function(){for(var t in this.selectedTiles=[],this._requestedTiles=[],this._emptyTiles=[],this.frameStateData){var 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);var r,n=jv(this.selectedTiles);try{for(n.s();!(r=n.n()).done;){var i=r.value;this._tiles[i.id]=i}}catch(t){n.e(t)}finally{n.f()}this._loadTiles(),this._unloadTiles(),this._updateStats()}},{key:"_tilesChanged",value:function(t,e){if(t.length!==e.length)return!0;var r=new Set(t.map((function(t){return t.id}))),n=new Set(e.map((function(t){return t.id}))),i=t.filter((function(t){return!n.has(t.id)})).length>0;return i=i||e.filter((function(t){return!r.has(t.id)})).length>0}},{key:"_loadTiles",value:function(){var t,e=jv(this._requestedTiles);try{for(e.s();!(t=e.n()).done;){var r=t.value;r.contentUnloaded&&this._loadTile(r)}}catch(t){e.e(t)}finally{e.f()}}},{key:"_unloadTiles",value:function(){this._cache.unloadTiles(this,(function(t,e){return t._unloadTile(e)}))}},{key:"_updateStats",value:function(){var t,e=0,r=0,n=jv(this.selectedTiles);try{for(n.s();!(t=n.n()).done;){var i=t.value;i.contentAvailable&&i.content&&(e++,i.content.pointCount?r+=i.content.pointCount:r+=i.content.vertexCount)}}catch(t){n.e(t)}finally{n.f()}this.stats.get("Tiles In View").count=this.selectedTiles.length,this.stats.get("Tiles To Render").count=e,this.stats.get("Points/Vertices").count=r}},{key:"_initializeTileSet",value:(r=Ds()(js.a.mark((function t(e){return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.type!==zp){t.next=5;break}return this.calculateViewPropsI3S(),t.next=4,e.root;case 4:e.root=t.sent;case 5:this.root=this._initializeTileHeaders(e,null),this.type===Kp&&(this._initializeTiles3DTileset(e),this.calculateViewPropsTiles3D()),this.type===zp&&this._initializeI3STileset();case 8:case"end":return t.stop()}}),t,this)}))),function(t){return r.apply(this,arguments)})},{key:"calculateViewPropsI3S",value:function(){var t,e=this.tileset.fullExtent;if(e){var r=e.xmin,n=e.xmax,i=e.ymin,o=e.ymax,a=e.zmin,s=e.zmax;return this.cartographicCenter=new Lh(r+(n-r)/2,i+(o-i)/2,a+(s-a)/2),this.cartesianCenter=fd.WGS84.cartographicToCartesian(this.cartographicCenter,new Lh),void(this.zoom=Rp(e,this.cartographicCenter,this.cartesianCenter))}var u=null===(t=this.tileset.store)||void 0===t?void 0:t.extent;if(u){var c=Sf()(u,4),l=c[0],f=c[1],h=c[2],d=c[3];return this.cartographicCenter=new Lh(l+(h-l)/2,f+(d-f)/2,0),this.cartesianCenter=fd.WGS84.cartographicToCartesian(this.cartographicCenter,new Lh),void(this.zoom=function(t,e,r){var n=Sf()(t,4),i=n[0],o=n[1];return Rp({xmin:i,xmax:n[2],ymin:o,ymax:n[3],zmin:0,zmax:0},e,r)}(u,this.cartographicCenter,this.cartesianCenter))}console.warn("Extent is not defined in the tileset header"),this.cartographicCenter=new Lh,this.zoom=1}},{key:"calculateViewPropsTiles3D",value:function(){var t=this.root;Zs(t);var e=t.boundingVolume.center;if(!e)return console.warn("center was not pre-calculated for the root tile"),this.cartographicCenter=new Lh,void(this.zoom=1);0!==e[0]||0!==e[1]||0!==e[2]?this.cartographicCenter=fd.WGS84.cartesianToCartographic(e,new Lh):this.cartographicCenter=new Lh(0,0,-fd.WGS84.radii[0]),this.cartesianCenter=e,this.zoom=Ip(t.boundingVolume,this.cartographicCenter)}},{key:"_initializeStats",value:function(){this.stats.get(Vv),this.stats.get("Tiles Loading"),this.stats.get("Tiles In Memory"),this.stats.get("Tiles In View"),this.stats.get("Tiles To Render"),this.stats.get("Tiles Loaded"),this.stats.get("Tiles Unloaded"),this.stats.get("Failed Tile Loads"),this.stats.get("Points/Vertices","memory"),this.stats.get("Tile Memory Use","memory")}},{key:"_initializeTileHeaders",value:function(t,e){var r=new Av(this,t.root,e);if(e&&(e.children.push(r),r.depth=e.depth+1),this.type===Kp){var n=[];for(n.push(r);n.length>0;){var i=n.pop();this.stats.get(Vv).incrementCount();var o,a=jv(i.header.children||[]);try{for(a.s();!(o=a.n()).done;){var s=o.value,u=new Av(this,s,i);i.children.push(u),u.depth=i.depth+1,n.push(u)}}catch(t){a.e(t)}finally{a.f()}}}return r}},{key:"_initializeTraverser",value:function(){var t;switch(this.type){case Kp:t=xv;break;case zp:t=Lv;break;default:t=yv}return new t({basePath:this.basePath,onTraversalEnd:this._onTraversalEnd.bind(this)})}},{key:"_destroyTileHeaders",value:function(t){this._destroySubtree(t)}},{key:"_loadTile",value:(e=Ds()(js.a.mark((function t(e){var r;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,this._onStartTileLoading(),t.next=4,e.loadContent();case 4:r=t.sent,t.next=10;break;case 7:t.prev=7,t.t0=t.catch(0),this._onTileLoadError(e,t.t0);case 10:return t.prev=10,this._onEndTileLoading(),this._onTileLoad(e,r),t.finish(10);case 14:case"end":return t.stop()}}),t,this,[[0,7,10,14]])}))),function(t){return e.apply(this,arguments)})},{key:"_onTileLoadError",value:function(t,e){this.stats.get("Failed Tile Loads").incrementCount();var r=e.message||e.toString(),n=t.url;console.error("A 3D tile failed to load: ".concat(t.url," ").concat(r)),this.options.onTileError(t,r,n)}},{key:"_onTileLoad",value:function(t,e){if(e){if(this.type===zp){var r,n,i=(null===(r=this.tileset)||void 0===r?void 0:null===(n=r.nodePagesTile)||void 0===n?void 0:n.nodesInNodePages)||0;this.stats.get(Vv).reset(),this.stats.get(Vv).addCount(i)}t&&t.content&&function(t,e){Zs(t),Zs(e);var r=e.rtcCenter,n=e.gltfUpAxis,i=t.computedTransform,o=t.boundingVolume.center,a=new Mh(i);switch(r&&a.translate(r),n){case"Z":break;case"Y":var s=(new Mh).rotateX(Math.PI/2);a=a.multiplyRight(s);break;case"X":var u=(new Mh).rotateY(-Math.PI/2);a=a.multiplyRight(u)}e.isQuantized&&a.translate(e.quantizedVolumeOffset).scale(e.quantizedVolumeScale);var c=new Lh(o);e.cartesianModelMatrix=a,e.cartesianOrigin=c;var l=fd.WGS84.cartesianToCartographic(c,new Lh),f=fd.WGS84.eastNorthUpToFixedFrame(c).invert();e.cartographicModelMatrix=f.multiplyRight(a),e.cartographicOrigin=l,e.coordinateSystem||(e.modelMatrix=e.cartographicModelMatrix)}(t,t.content),this._addTileToCache(t),this.options.onTileLoad(t)}}},{key:"_onStartTileLoading",value:function(){this._pendingCount++,this.stats.get("Tiles Loading").incrementCount()}},{key:"_onEndTileLoading",value:function(){this._pendingCount--,this.stats.get("Tiles Loading").decrementCount()}},{key:"_addTileToCache",value:function(t){this._cache.add(this,t,(function(e){return e._updateCacheStats(t)}))}},{key:"_updateCacheStats",value:function(t){this.stats.get("Tiles Loaded").incrementCount(),this.stats.get("Tiles In Memory").incrementCount(),this.gpuMemoryUsageInBytes+=t.content.byteLength||0,this.stats.get("Tile Memory Use").count=this.gpuMemoryUsageInBytes}},{key:"_unloadTile",value:function(t){this.gpuMemoryUsageInBytes-=t.content&&t.content.byteLength||0,this.stats.get("Tiles In Memory").decrementCount(),this.stats.get("Tiles Unloaded").incrementCount(),this.stats.get("Tile Memory Use").count=this.gpuMemoryUsageInBytes,this.options.onTileUnload(t),t.unloadContent()}},{key:"_destroy",value:function(){var t=[];for(this.root&&t.push(this.root);t.length>0;){var e,r=t.pop(),n=jv(r.children);try{for(n.s();!(e=n.n()).done;){var i=e.value;t.push(i)}}catch(t){n.e(t)}finally{n.f()}this._destroyTile(r)}this.root=null}},{key:"_destroySubtree",value:function(t){var e=t,r=[];for(r.push(e);r.length>0;){var n,i=jv((t=r.pop()).children);try{for(i.s();!(n=i.n()).done;){var o=n.value;r.push(o)}}catch(t){i.e(t)}finally{i.f()}t!==e&&this._destroyTile(t)}e.children=[]}},{key:"_destroyTile",value:function(t){this._cache.unloadTile(this,t),this._unloadTile(t),t.destroy()}},{key:"_initializeTiles3DTileset",value:function(t){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)throw new Error("The tileset must be 3D Tiles version 0.0 or 1.0.");"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}},{key:"_initializeI3STileset",value:function(){this.loadOptions.i3s&&"token"in this.loadOptions.i3s&&(this._queryParams.token=this.loadOptions.i3s.token)}}]),t}();var zv={COMPOSITE:"cmpt",POINT_CLOUD:"pnts",BATCHED_3D_MODEL:"b3dm",INSTANCED_3D_MODEL:"i3dm",GEOMETRY:"geom",VECTOR:"vect",GLTF:"glTF"};Object.keys(zv);function Kv(t,e,r){Zs(t instanceof ArrayBuffer);var n=new TextDecoder("utf8"),i=new Uint8Array(t,e,r);return n.decode(i)}function qv(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=new DataView(t);return"".concat(String.fromCharCode(r.getUint8(e+0))).concat(String.fromCharCode(r.getUint8(e+1))).concat(String.fromCharCode(r.getUint8(e+2))).concat(String.fromCharCode(r.getUint8(e+3)))}var Wv={draco:{decoderType:"object"===("undefined"==typeof WebAssembly?"undefined":Ns()(WebAssembly))?"wasm":"js",libraryPath:"libs/",extraAttributes:{},attributeNameEntry:void 0}},Qv={name:"Draco",id:kc?"draco":"draco-nodejs",module:"draco",shapes:["mesh"],version:"3.3.0-alpha.5",worker:!0,extensions:["drc"],mimeTypes:["application/octet-stream"],binary:!0,tests:["DRACO"],options:Wv};function Xv(t){for(var e=1/0,r=1/0,n=1/0,i=-1/0,o=-1/0,a=-1/0,s=t.POSITION?t.POSITION.value:[],u=s&&s.length,c=0;c<u;c+=3){var l=s[c],f=s[c+1],h=s[c+2];e=l<e?l:e,r=f<r?f:r,n=h<n?h:n,i=l>i?l:i,o=f>o?f:o,a=h>a?h:a}return[[e,r,n],[i,o,a]]}function Yv(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return Zv(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Zv(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function Zv(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var $v=function(){function t(e,r){ku()(this,t),Tu(this,"fields",void 0),Tu(this,"metadata",void 0),function(t,e){if(!t)throw new Error(e||"loader assertion failed.")}(Array.isArray(e)),function(t){var e,r={},n=Yv(t);try{for(n.s();!(e=n.n()).done;){var i=e.value;r[i.name]&&console.warn("Schema: duplicated field name",i.name,i),r[i.name]=!0}}catch(t){n.e(t)}finally{n.f()}}(e),this.fields=e,this.metadata=r||new Map}return Ou()(t,[{key:"compareTo",value:function(t){if(this.metadata!==t.metadata)return!1;if(this.fields.length!==t.fields.length)return!1;for(var e=0;e<this.fields.length;++e)if(!this.fields[e].compareTo(t.fields[e]))return!1;return!0}},{key:"select",value:function(){for(var e=Object.create(null),r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];for(var o=0,a=n;o<a.length;o++){var s=a[o];e[s]=!0}var u=this.fields.filter((function(t){return e[t.name]}));return new t(u,this.metadata)}},{key:"selectAt",value:function(){for(var e=this,r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];var o=n.map((function(t){return e.fields[t]})).filter(Boolean);return new t(o,this.metadata)}},{key:"assign",value:function(e){var r,n=this.metadata;if(e instanceof t){var i=e;r=i.fields,n=ty(ty(new Map,this.metadata),i.metadata)}else r=e;var o,a=Object.create(null),s=Yv(this.fields);try{for(s.s();!(o=s.n()).done;){var u=o.value;a[u.name]=u}}catch(t){s.e(t)}finally{s.f()}var c,l=Yv(r);try{for(l.s();!(c=l.n()).done;){var f=c.value;a[f.name]=f}}catch(t){l.e(t)}finally{l.f()}return new t(Object.values(a),n)}}]),t}();function ty(t,e){return new Map([].concat(Mu()(t||new Map),Mu()(e||new Map)))}var ey,ry=function(){function t(e,r){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new Map;ku()(this,t),Tu(this,"name",void 0),Tu(this,"type",void 0),Tu(this,"nullable",void 0),Tu(this,"metadata",void 0),this.name=e,this.type=r,this.nullable=n,this.metadata=i}return Ou()(t,[{key:"typeId",get:function(){return this.type&&this.type.typeId}},{key:"clone",value:function(){return new t(this.name,this.type,this.nullable,this.metadata)}},{key:"compareTo",value:function(t){return this.name===t.name&&this.type===t.type&&this.nullable===t.nullable&&this.metadata===t.metadata}},{key:"toString",value:function(){return"".concat(this.type).concat(this.nullable?", nullable":"").concat(this.metadata?", metadata: ".concat(this.metadata):"")}}]),t}();function ny(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Df()(t);if(e){var i=Df()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Pf()(this,r)}}!function(t){t[t.NONE=0]="NONE",t[t.Null=1]="Null",t[t.Int=2]="Int",t[t.Float=3]="Float",t[t.Binary=4]="Binary",t[t.Utf8=5]="Utf8",t[t.Bool=6]="Bool",t[t.Decimal=7]="Decimal",t[t.Date=8]="Date",t[t.Time=9]="Time",t[t.Timestamp=10]="Timestamp",t[t.Interval=11]="Interval",t[t.List=12]="List",t[t.Struct=13]="Struct",t[t.Union=14]="Union",t[t.FixedSizeBinary=15]="FixedSizeBinary",t[t.FixedSizeList=16]="FixedSizeList",t[t.Map=17]="Map",t[t.Dictionary=-1]="Dictionary",t[t.Int8=-2]="Int8",t[t.Int16=-3]="Int16",t[t.Int32=-4]="Int32",t[t.Int64=-5]="Int64",t[t.Uint8=-6]="Uint8",t[t.Uint16=-7]="Uint16",t[t.Uint32=-8]="Uint32",t[t.Uint64=-9]="Uint64",t[t.Float16=-10]="Float16",t[t.Float32=-11]="Float32",t[t.Float64=-12]="Float64",t[t.DateDay=-13]="DateDay",t[t.DateMillisecond=-14]="DateMillisecond",t[t.TimestampSecond=-15]="TimestampSecond",t[t.TimestampMillisecond=-16]="TimestampMillisecond",t[t.TimestampMicrosecond=-17]="TimestampMicrosecond",t[t.TimestampNanosecond=-18]="TimestampNanosecond",t[t.TimeSecond=-19]="TimeSecond",t[t.TimeMillisecond=-20]="TimeMillisecond",t[t.TimeMicrosecond=-21]="TimeMicrosecond",t[t.TimeNanosecond=-22]="TimeNanosecond",t[t.DenseUnion=-23]="DenseUnion",t[t.SparseUnion=-24]="SparseUnion",t[t.IntervalDayTime=-25]="IntervalDayTime",t[t.IntervalYearMonth=-26]="IntervalYearMonth"}(ey||(ey={}));var iy=function(){function t(){ku()(this,t)}return Ou()(t,[{key:"typeId",get:function(){return ey.NONE}},{key:"compareTo",value:function(t){return this===t}}],[{key:"isNull",value:function(t){return t&&t.typeId===ey.Null}},{key:"isInt",value:function(t){return t&&t.typeId===ey.Int}},{key:"isFloat",value:function(t){return t&&t.typeId===ey.Float}},{key:"isBinary",value:function(t){return t&&t.typeId===ey.Binary}},{key:"isUtf8",value:function(t){return t&&t.typeId===ey.Utf8}},{key:"isBool",value:function(t){return t&&t.typeId===ey.Bool}},{key:"isDecimal",value:function(t){return t&&t.typeId===ey.Decimal}},{key:"isDate",value:function(t){return t&&t.typeId===ey.Date}},{key:"isTime",value:function(t){return t&&t.typeId===ey.Time}},{key:"isTimestamp",value:function(t){return t&&t.typeId===ey.Timestamp}},{key:"isInterval",value:function(t){return t&&t.typeId===ey.Interval}},{key:"isList",value:function(t){return t&&t.typeId===ey.List}},{key:"isStruct",value:function(t){return t&&t.typeId===ey.Struct}},{key:"isUnion",value:function(t){return t&&t.typeId===ey.Union}},{key:"isFixedSizeBinary",value:function(t){return t&&t.typeId===ey.FixedSizeBinary}},{key:"isFixedSizeList",value:function(t){return t&&t.typeId===ey.FixedSizeList}},{key:"isMap",value:function(t){return t&&t.typeId===ey.Map}},{key:"isDictionary",value:function(t){return t&&t.typeId===ey.Dictionary}}]),t}(),oy=(Symbol.toStringTag,Symbol.toStringTag,function(t,e){If()(n,t);var r=ny(n);function n(t,e){var i;return ku()(this,n),i=r.call(this),Tu(kv()(i),"isSigned",void 0),Tu(kv()(i),"bitWidth",void 0),i.isSigned=t,i.bitWidth=e,i}return Ou()(n,[{key:"typeId",get:function(){return ey.Int}},{key:e,get:function(){return"Int"}},{key:"toString",value:function(){return"".concat(this.isSigned?"I":"Ui","nt").concat(this.bitWidth)}}]),n}(iy,Symbol.toStringTag)),ay=function(t){If()(r,t);var e=ny(r);function r(){return ku()(this,r),e.call(this,!0,8)}return r}(oy),sy=function(t){If()(r,t);var e=ny(r);function r(){return ku()(this,r),e.call(this,!0,16)}return r}(oy),uy=function(t){If()(r,t);var e=ny(r);function r(){return ku()(this,r),e.call(this,!0,32)}return r}(oy),cy=function(t){If()(r,t);var e=ny(r);function r(){return ku()(this,r),e.call(this,!1,8)}return r}(oy),ly=function(t){If()(r,t);var e=ny(r);function r(){return ku()(this,r),e.call(this,!1,16)}return r}(oy),fy=function(t){If()(r,t);var e=ny(r);function r(){return ku()(this,r),e.call(this,!1,32)}return r}(oy),hy=32,dy=64,py=function(t,e){If()(n,t);var r=ny(n);function n(t){var e;return ku()(this,n),e=r.call(this),Tu(kv()(e),"precision",void 0),e.precision=t,e}return Ou()(n,[{key:"typeId",get:function(){return ey.Float}},{key:e,get:function(){return"Float"}},{key:"toString",value:function(){return"Float".concat(this.precision)}}]),n}(iy,Symbol.toStringTag),vy=function(t){If()(r,t);var e=ny(r);function r(){return ku()(this,r),e.call(this,hy)}return r}(py),yy=function(t){If()(r,t);var e=ny(r);function r(){return ku()(this,r),e.call(this,dy)}return r}(py),gy=(Symbol.toStringTag,Symbol.toStringTag,{DAY:0,MILLISECOND:1}),my=(Symbol.toStringTag,{SECOND:1,MILLISECOND:1e3,MICROSECOND:1e6,NANOSECOND:1e9}),by=(Symbol.toStringTag,Symbol.toStringTag,{DAY_TIME:0,YEAR_MONTH:1}),Ay=(Symbol.toStringTag,function(t,e){If()(n,t);var r=ny(n);function n(t,e){var i;return ku()(this,n),i=r.call(this),Tu(kv()(i),"listSize",void 0),Tu(kv()(i),"children",void 0),i.listSize=t,i.children=[e],i}return Ou()(n,[{key:"typeId",get:function(){return ey.FixedSizeList}},{key:"valueType",get:function(){return this.children[0].type}},{key:"valueField",get:function(){return this.children[0]}},{key:e,get:function(){return"FixedSizeList"}},{key:"toString",value:function(){return"FixedSizeList[".concat(this.listSize,"]<").concat(this.valueType,">")}}]),n}(iy,Symbol.toStringTag));Symbol.toStringTag;function wy(t,e,r){var n=function(t){switch(t.constructor){case Int8Array:return new ay;case Uint8Array:return new cy;case Int16Array:return new sy;case Uint16Array:return new ly;case Int32Array:return new uy;case Uint32Array:return new fy;case Float32Array:return new vy;case Float64Array:return new yy;default:throw new Error("array type not supported")}}(e.value),i=r||function(t){var e=new Map;"byteOffset"in t&&e.set("byteOffset",t.byteOffset.toString(10));"byteStride"in t&&e.set("byteStride",t.byteStride.toString(10));"normalized"in t&&e.set("normalized",t.normalized.toString());return e}(e);return new ry(t,new Ay(e.size,new ry("value",n)),!1,i)}function By(t,e,r){var n=xy(e.metadata),i=[],o=function(t){var e={};for(var r in t){var n=t[r];e[n.name||"undefined"]=n}return e}(e.attributes);for(var a in t){var s=_y(a,t[a],o[a]);i.push(s)}if(r){var u=_y("indices",r);i.push(u)}return new $v(i,n)}function _y(t,e,r){return wy(t,e,r?xy(r.metadata):void 0)}function xy(t){var e=new Map;for(var r in t)e.set("".concat(r,".string"),JSON.stringify(t[r]));return e}function Cy(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return ky(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ky(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function ky(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Ey(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Oy(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Ey(Object(r),!0).forEach((function(e){Ys()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ey(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var Ty={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},Sy={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array},My=function(){function t(e){ku()(this,t),Tu(this,"draco",void 0),Tu(this,"decoder",void 0),Tu(this,"metadataQuerier",void 0),this.draco=e,this.decoder=new this.draco.Decoder,this.metadataQuerier=new this.draco.MetadataQuerier}return Ou()(t,[{key:"destroy",value:function(){this.draco.destroy(this.decoder),this.draco.destroy(this.metadataQuerier)}},{key:"parseSync",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=new this.draco.DecoderBuffer;r.Init(new Int8Array(t),t.byteLength),this._disableAttributeTransforms(e);var n=this.decoder.GetEncodedGeometryType(r),i=n===this.draco.TRIANGULAR_MESH?new this.draco.Mesh:new this.draco.PointCloud;try{var o;switch(n){case this.draco.TRIANGULAR_MESH:o=this.decoder.DecodeBufferToMesh(r,i);break;case this.draco.POINT_CLOUD:o=this.decoder.DecodeBufferToPointCloud(r,i);break;default:throw new Error("DRACO: Unknown geometry type.")}if(!o.ok()||!i.ptr){var a="DRACO decompression failed: ".concat(o.error_msg());throw new Error(a)}var s=this._getDracoLoaderData(i,n,e),u=this._getMeshData(i,s,e),c=Xv(u.attributes),l=By(u.attributes,s,u.indices),f=Oy(Oy({loader:"draco",loaderData:s,header:{vertexCount:i.num_points(),boundingBox:c}},u),{},{schema:l});return f}finally{this.draco.destroy(r),i&&this.draco.destroy(i)}}},{key:"_getDracoLoaderData",value:function(t,e,r){var n=this._getTopLevelMetadata(t),i=this._getDracoAttributes(t,r);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:n,attributes:i}}},{key:"_getDracoAttributes",value:function(t,e){for(var r={},n=0;n<t.num_attributes();n++){var i=this.decoder.GetAttribute(t,n),o=this._getAttributeMetadata(t,n);r[i.unique_id()]={unique_id:i.unique_id(),attribute_type:i.attribute_type(),data_type:i.data_type(),num_components:i.num_components(),byte_offset:i.byte_offset(),byte_stride:i.byte_stride(),normalized:i.normalized(),attribute_index:n,metadata:o};var a=this._getQuantizationTransform(i,e);a&&(r[i.unique_id()].quantization_transform=a);var s=this._getOctahedronTransform(i,e);s&&(r[i.unique_id()].octahedron_transform=s)}return r}},{key:"_getMeshData",value:function(t,e,r){var n=this._getMeshAttributes(e,t,r);if(!n.POSITION)throw new Error("DRACO: No position attribute found.");if(t instanceof this.draco.Mesh)switch(r.topology){case"triangle-strip":return{topology:"triangle-strip",mode:4,attributes:n,indices:{value:this._getTriangleStripIndices(t),size:1}};case"triangle-list":default:return{topology:"triangle-list",mode:5,attributes:n,indices:{value:this._getTriangleListIndices(t),size:1}}}return{topology:"point-list",mode:0,attributes:n}}},{key:"_getMeshAttributes",value:function(t,e,r){for(var n={},i=0,o=Object.values(t.attributes);i<o.length;i++){var a=o[i],s=this._deduceAttributeName(a,r);a.name=s;var u=this._getAttributeValues(e,a),c=u.value,l=u.size;n[s]={value:c,size:l,byteOffset:a.byte_offset,byteStride:a.byte_stride,normalized:a.normalized}}return n}},{key:"_getTriangleListIndices",value:function(t){var e=3*t.num_faces(),r=4*e,n=this.draco._malloc(r);try{return this.decoder.GetTrianglesUInt32Array(t,r,n),new Uint32Array(this.draco.HEAPF32.buffer,n,e).slice()}finally{this.draco._free(n)}}},{key:"_getTriangleStripIndices",value:function(t){var e=new this.draco.DracoInt32Array;try{return this.decoder.GetTriangleStripsFromMesh(t,e),function(t){for(var e=t.size(),r=new Int32Array(e),n=0;n<e;n++)r[n]=t.GetValue(n);return r}(e)}finally{this.draco.destroy(e)}}},{key:"_getAttributeValues",value:function(t,e){var r,n=Sy[e.data_type],i=e.num_components,o=t.num_points()*i,a=o*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),u=this.draco._malloc(a);try{var c=this.decoder.GetAttribute(t,e.attribute_index);this.decoder.GetAttributeDataArrayForAllPoints(t,c,s,a,u),r=new n(this.draco.HEAPF32.buffer,u,o).slice()}finally{this.draco._free(u)}return{value:r,size:i}}},{key:"_deduceAttributeName",value:function(t,e){for(var r=t.unique_id,n=0,i=Object.entries(e.extraAttributes||{});n<i.length;n++){var o=Sf()(i[n],2),a=o[0];if(o[1]===r)return a}var s=t.attribute_type;for(var u in Ty){if(this.draco[u]===s)return Ty[u]}var c=e.attributeNameEntry||"name";return t.metadata[c]?t.metadata[c].string:"CUSTOM_ATTRIBUTE_".concat(r)}},{key:"_getTopLevelMetadata",value:function(t){var e=this.decoder.GetMetadata(t);return this._getDracoMetadata(e)}},{key:"_getAttributeMetadata",value:function(t,e){var r=this.decoder.GetAttributeMetadata(t,e);return this._getDracoMetadata(r)}},{key:"_getDracoMetadata",value:function(t){if(!t||!t.ptr)return{};for(var e={},r=this.metadataQuerier.NumEntries(t),n=0;n<r;n++){var i=this.metadataQuerier.GetEntryName(t,n);e[i]=this._getDracoMetadataField(t,i)}return e}},{key:"_getDracoMetadataField",value:function(t,e){var r=new this.draco.DracoInt32Array;try{this.metadataQuerier.GetIntEntryArray(t,e,r);var n=function(t){for(var e=t.size(),r=new Int32Array(e),n=0;n<e;n++)r[n]=t.GetValue(n);return r}(r);return{int:this.metadataQuerier.GetIntEntry(t,e),string:this.metadataQuerier.GetStringEntry(t,e),double:this.metadataQuerier.GetDoubleEntry(t,e),intArray:n}}finally{this.draco.destroy(r)}}},{key:"_disableAttributeTransforms",value:function(t){var e,r=t.quantizedAttributes,n=void 0===r?[]:r,i=t.octahedronAttributes,o=void 0===i?[]:i,a=Cy([].concat(Mu()(n),Mu()(o)));try{for(a.s();!(e=a.n()).done;){var s=e.value;this.decoder.SkipAttributeTransform(this.draco[s])}}catch(t){a.e(t)}finally{a.f()}}},{key:"_getQuantizationTransform",value:function(t,e){var r=this,n=e.quantizedAttributes,i=void 0===n?[]:n,o=t.attribute_type();if(i.map((function(t){return r.decoder[t]})).includes(o)){var a=new this.draco.AttributeQuantizationTransform;try{if(a.InitFromAttribute(t))return{quantization_bits:a.quantization_bits(),range:a.range(),min_values:new Float32Array([1,2,3]).map((function(t){return a.min_value(t)}))}}finally{this.draco.destroy(a)}}return null}},{key:"_getOctahedronTransform",value:function(t,e){var r=this,n=e.octahedronAttributes,i=void 0===n?[]:n,o=t.attribute_type();if(i.map((function(t){return r.decoder[t]})).includes(o)){var a=new this.draco.AttributeQuantizationTransform;try{if(a.InitFromAttribute(t))return{quantization_bits:a.quantization_bits()}}finally{this.draco.destroy(a)}}return null}}]),t}();var Iy=r(42),Ry={};function Py(t){return Fy.apply(this,arguments)}function Fy(){return(Fy=Ds()(js.a.mark((function t(e){var r,n,i=arguments;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=i.length>1&&void 0!==i[1]?i[1]:null,n=i.length>2&&void 0!==i[2]?i[2]:{},r&&(e=Dy(e,r,n)),Ry[e]=Ry[e]||Ly(e),t.next=6,Ry[e];case 6:return t.abrupt("return",t.sent);case 7:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Dy(t,e,r){if(t.startsWith("http"))return t;var n=r.modules||{};return n[t]?n[t]:kc?r.CDN?(Bc(r.CDN.startsWith("http")),"".concat(r.CDN,"/").concat(e,"@").concat("3.3.0-alpha.5","/dist/libs/").concat(t)):Ec?"../src/libs/".concat(t):"modules/".concat(e,"/src/libs/").concat(t):"modules/".concat(e,"/dist/libs/").concat(t)}function Ly(t){return jy.apply(this,arguments)}function jy(){return(jy=Ds()(js.a.mark((function t(e){var r,n,i;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e.endsWith("wasm")){t.next=7;break}return t.next=3,fetch(e);case 3:return r=t.sent,t.next=6,r.arrayBuffer();case 6:return t.abrupt("return",t.sent);case 7:if(kc){t.next=20;break}if(t.prev=8,t.t0=Iy&&Iy.requireFromFile,!t.t0){t.next=14;break}return t.next=13,Iy.requireFromFile(e);case 13:t.t0=t.sent;case 14:return t.abrupt("return",t.t0);case 17:return t.prev=17,t.t1=t.catch(8),t.abrupt("return",null);case 20:if(!Ec){t.next=22;break}return t.abrupt("return",importScripts(e));case 22:return t.next=24,fetch(e);case 24:return n=t.sent,t.next=27,n.text();case 27:return i=t.sent,t.abrupt("return",Gy(i,e));case 29:case"end":return t.stop()}}),t,null,[[8,17]])})))).apply(this,arguments)}function Gy(t,e){if(!kc)return Iy.requireFromString&&Iy.requireFromString(t,e);if(Ec)return eval.call(Cc,t),null;var r=document.createElement("script");r.id=e;try{r.appendChild(document.createTextNode(t))}catch(e){r.text=t}return document.body.appendChild(r),null}function Ny(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Uy(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Ny(Object(r),!0).forEach((function(e){Ys()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ny(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var Hy,Vy="https://www.gstatic.com/draco/versioned/decoders/".concat("1.4.1","/draco_decoder.js"),Jy="https://www.gstatic.com/draco/versioned/decoders/".concat("1.4.1","/draco_wasm_wrapper.js"),zy="https://www.gstatic.com/draco/versioned/decoders/".concat("1.4.1","/draco_decoder.wasm");"https://raw.githubusercontent.com/google/draco/".concat("1.4.1","/javascript/draco_encoder.js");function Ky(t){return qy.apply(this,arguments)}function qy(){return(qy=Ds()(js.a.mark((function t(e){var r;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.modules||{},Hy=r.draco3d?Hy||r.draco3d.createDecoderModule({}).then((function(t){return{draco:t}})):Hy||Wy(e),t.next=4,Hy;case 4:return t.abrupt("return",t.sent);case 5:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Wy(t){return Qy.apply(this,arguments)}function Qy(){return(Qy=Ds()(js.a.mark((function t(e){var r,n,i,o;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:t.t0=e.draco&&e.draco.decoderType,t.next="js"===t.t0?3:(t.t0,7);break;case 3:return t.next=5,Py(Vy,"draco",e);case 5:return r=t.sent,t.abrupt("break",21);case 7:return t.t1=Promise,t.next=10,Py(Jy,"draco",e);case 10:return t.t2=t.sent,t.next=13,Py(zy,"draco",e);case 13:return t.t3=t.sent,t.t4=[t.t2,t.t3],t.next=17,t.t1.all.call(t.t1,t.t4);case 17:i=t.sent,o=Sf()(i,2),r=o[0],n=o[1];case 21:return r=r||globalThis.DracoDecoderModule,t.next=24,Xy(r,n);case 24:return t.abrupt("return",t.sent);case 25:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Xy(t,e){var r={};return e&&(r.wasmBinary=e),new Promise((function(e){t(Uy(Uy({},r),{},{onModuleLoaded:function(t){return e({draco:t})}}))}))}function Yy(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Zy(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Yy(Object(r),!0).forEach((function(e){Ys()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Yy(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var $y=Zy(Zy({},Qv),{},{parse:function(t,e){return tg.apply(this,arguments)}});function tg(){return(tg=Ds()(js.a.mark((function t(e,r){var n,i,o;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Ky(r);case 2:return n=t.sent,i=n.draco,o=new My(i),t.prev=5,t.abrupt("return",o.parseSync(e,null==r?void 0:r.draco));case 7:return t.prev=7,o.destroy(),t.finish(7);case 10:case"end":return t.stop()}}),t,null,[[5,,7,10]])})))).apply(this,arguments)}var eg,rg=(eg={},Ys()(eg,5130,Float64Array),Ys()(eg,5126,Float32Array),Ys()(eg,5123,Uint16Array),Ys()(eg,5125,Uint32Array),Ys()(eg,5121,Uint8Array),Ys()(eg,5120,Int8Array),Ys()(eg,5122,Int16Array),Ys()(eg,5124,Int32Array),eg),ng={DOUBLE:5130,FLOAT:5126,UNSIGNED_SHORT:5123,UNSIGNED_INT:5125,UNSIGNED_BYTE:5121,BYTE:5120,SHORT:5122,INT:5124},ig=function(){function t(){ku()(this,t)}return Ou()(t,null,[{key:"fromTypedArray",value:function(t){for(var e in t=ArrayBuffer.isView(t)?t.constructor:t,rg){if(rg[e]===t)return e}throw new Error("Failed to convert GL type")}},{key:"fromName",value:function(t){var e=ng[t];if(!e)throw new Error("Failed to convert GL type");return e}},{key:"getArrayType",value:function(t){switch(t){case 33635:case 32819:case 32820:return Uint16Array;default:var e=rg[t];if(!e)throw new Error("Failed to convert GL type");return e}}},{key:"getByteSize",value:function(e){return t.getArrayType(e).BYTES_PER_ELEMENT}},{key:"validate",value:function(e){return Boolean(t.getArrayType(e))}},{key:"createTypedArray",value:function(e,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3?arguments[3]:void 0;void 0===i&&(i=(r.byteLength-n)/t.getByteSize(e));var o=t.getArrayType(e);return new o(r,n,i)}}]),t}(),og=function(){function t(e,r){ku()(this,t),Tu(this,"json",void 0),Tu(this,"buffer",void 0),Tu(this,"featuresLength",0),Tu(this,"_cachedTypedArrays",{}),this.json=e,this.buffer=r}return Ou()(t,[{key:"getExtension",value:function(t){return this.json.extensions&&this.json.extensions[t]}},{key:"hasProperty",value:function(t){return Boolean(this.json[t])}},{key:"getGlobalProperty",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5125,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,n=this.json[t];return n&&Number.isFinite(n.byteOffset)?this._getTypedArrayFromBinary(t,e,r,1,n.byteOffset):n}},{key:"getPropertyArray",value:function(t,e,r){var n=this.json[t];return n&&Number.isFinite(n.byteOffset)?("componentType"in n&&(e=ig.fromName(n.componentType)),this._getTypedArrayFromBinary(t,e,r,this.featuresLength,n.byteOffset)):this._getTypedArrayFromArray(t,e,n)}},{key:"getProperty",value:function(t,e,r,n,i){var o=this.json[t];if(!o)return o;var a=this.getPropertyArray(t,e,r);if(1===r)return a[n];for(var s=0;s<r;++s)i[s]=a[r*n+s];return i}},{key:"_getTypedArrayFromBinary",value:function(t,e,r,n,i){var o=this._cachedTypedArrays,a=o[t];return a||(a=ig.createTypedArray(e,this.buffer.buffer,this.buffer.byteOffset+i,n*r),o[t]=a),a}},{key:"_getTypedArrayFromArray",value:function(t,e,r){var n=this._cachedTypedArrays,i=n[t];return i||(i=ig.createTypedArray(e,r),n[t]=i),i}}]),t}(),ag={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},sg={SCALAR:function(t,e){return t[e]},VEC2:function(t,e){return[t[2*e+0],t[2*e+1]]},VEC3:function(t,e){return[t[3*e+0],t[3*e+1],t[3*e+2]]},VEC4:function(t,e){return[t[4*e+0],t[4*e+1],t[4*e+2],t[4*e+3]]},MAT2:function(t,e){return[t[4*e+0],t[4*e+1],t[4*e+2],t[4*e+3]]},MAT3:function(t,e){return[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:function(t,e){return[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]]}},ug={SCALAR:function(t,e,r){e[r]=t},VEC2:function(t,e,r){e[2*r+0]=t[0],e[2*r+1]=t[1]},VEC3:function(t,e,r){e[3*r+0]=t[0],e[3*r+1]=t[1],e[3*r+2]=t[2]},VEC4:function(t,e,r){e[4*r+0]=t[0],e[4*r+1]=t[1],e[4*r+2]=t[2],e[4*r+3]=t[3]},MAT2:function(t,e,r){e[4*r+0]=t[0],e[4*r+1]=t[1],e[4*r+2]=t[2],e[4*r+3]=t[3]},MAT3:function(t,e,r){e[9*r+0]=t[0],e[9*r+1]=t[1],e[9*r+2]=t[2],e[9*r+3]=t[3],e[9*r+4]=t[4],e[9*r+5]=t[5],e[9*r+6]=t[6],e[9*r+7]=t[7],e[9*r+8]=t[8],e[9*r+9]=t[9]},MAT4:function(t,e,r){e[16*r+0]=t[0],e[16*r+1]=t[1],e[16*r+2]=t[2],e[16*r+3]=t[3],e[16*r+4]=t[4],e[16*r+5]=t[5],e[16*r+6]=t[6],e[16*r+7]=t[7],e[16*r+8]=t[8],e[16*r+9]=t[9],e[16*r+10]=t[10],e[16*r+11]=t[11],e[16*r+12]=t[12],e[16*r+13]=t[13],e[16*r+14]=t[14],e[16*r+15]=t[15]}};var cg=function(t){return void 0!==t};function lg(t,e,r){if(!e)return null;var n=t.getExtension("3DTILES_batch_table_hierarchy"),i=e.HIERARCHY;return i&&(console.warn("3D Tile Parser: HIERARCHY is deprecated. Use 3DTILES_batch_table_hierarchy."),e.extensions=e.extensions||{},e.extensions["3DTILES_batch_table_hierarchy"]=i,n=i),n?function(t,e){var r,n,i,o,a=t.instancesLength,s=t.classes,u=t.classIds,c=t.parentCounts,l=t.parentIds,f=a;cg(u.byteOffset)&&(u.componentType=defaultValue(u.componentType,5123),u.type=AttributeType.SCALAR,i=getBinaryAccessor(u),u=i.createArrayBufferView(e.buffer,e.byteOffset+u.byteOffset,a));if(cg(c))for(cg(c.byteOffset)&&(c.componentType=defaultValue(c.componentType,5123),c.type=AttributeType.SCALAR,i=getBinaryAccessor(c),c=i.createArrayBufferView(e.buffer,e.byteOffset+c.byteOffset,a)),o=new Uint16Array(a),f=0,r=0;r<a;++r)o[r]=f,f+=c[r];cg(l)&&cg(l.byteOffset)&&(l.componentType=defaultValue(l.componentType,5123),l.type=AttributeType.SCALAR,i=getBinaryAccessor(l),l=i.createArrayBufferView(e.buffer,e.byteOffset+l.byteOffset,f));var h=s.length;for(r=0;r<h;++r){var d=s[r].length,p=s[r].instances,v=getBinaryProperties(d,p,e);s[r].instances=combine(v,p)}var y=new Array(h).fill(0),g=new Uint16Array(a);for(r=0;r<a;++r)n=u[r],g[r]=y[n],++y[n];var m={classes:s,classIds:u,classIndexes:g,parentCounts:c,parentIndexes:o,parentIds:l};return function(t){for(var e=t.classIds.length,r=0;r<e;++r)hg(t,r,stack)}(m),m}(n,r):null}function fg(t,e,r){if(t){var n=t.parentCounts;return t.parentIds?r(t,e):n>0?function(t,e,r){var n=t.classIds,i=t.parentCounts,o=t.parentIds,a=t.parentIndexes,s=n.length,u=scratchVisited;u.length=Math.max(u.length,s);var c=++marker,l=scratchStack;l.length=0,l.push(e);for(;l.length>0;)if(e=l.pop(),u[e]!==c){u[e]=c;var f=r(t,e);if(cg(f))return f;for(var h=i[e],d=a[e],p=0;p<h;++p){var v=o[d+p];v!==e&&l.push(v)}}return null}(t,e,r):function(t,e,r){var n=!0;for(;n;){var i=r(t,e);if(cg(i))return i;var o=t.parentIds[e];n=o!==e,e=o}throw new Error("traverseHierarchySingleParent")}(t,e,r)}}function hg(t,e,r){var n=t.parentCounts,i=t.parentIds,o=t.parentIndexes,a=t.classIds.length;if(cg(i)){assert(e<a,"Parent index ".concat(e," exceeds the total number of instances: ").concat(a)),assert(-1===r.indexOf(e),"Circular dependency detected in the batch table hierarchy."),r.push(e);for(var s=cg(n)?n[e]:1,u=cg(n)?o[e]:e,c=0;c<s;++c){var l=i[u+c];l!==e&&hg(t,l,r)}r.pop(e)}}function dg(t){return null!=t}var pg=function(t,e){return t},vg={HIERARCHY:!0,extensions:!0,extras:!0},yg=function(){function t(e,r,n){var i,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};for(var a in ku()(this,t),Tu(this,"json",void 0),Tu(this,"binary",void 0),Tu(this,"featureCount",void 0),Tu(this,"_extensions",void 0),Tu(this,"_properties",void 0),Tu(this,"_binaryProperties",void 0),Tu(this,"_hierarchy",void 0),Zs(n>=0),this.json=e||{},this.binary=r,this.featureCount=n,this._extensions=(null===(i=this.json)||void 0===i?void 0:i.extensions)||{},this._properties={},this.json)vg[a]||(this._properties[a]=this.json[a]);this._binaryProperties=this._initializeBinaryProperties(),o["3DTILES_batch_table_hierarchy"]&&(this._hierarchy=lg(this,this.json,this.binary))}return Ou()(t,[{key:"getExtension",value:function(t){return this.json&&this.json.extensions&&this.json.extensions[t]}},{key:"memorySizeInBytes",value:function(){return 0}},{key:"isClass",value:function(t,e){return this._checkBatchId(t),Zs("string"==typeof e,e),!!this._hierarchy&&dg(fg(this._hierarchy,t,(function(t,r){var n=t.classIds[r];return t.classes[n].name===e})))}},{key:"isExactClass",value:function(t,e){return Zs("string"==typeof e,e),this.getExactClassName(t)===e}},{key:"getExactClassName",value:function(t){if(this._checkBatchId(t),this._hierarchy){var e=this._hierarchy.classIds[t];return this._hierarchy.classes[e].name}}},{key:"hasProperty",value:function(t,e){return this._checkBatchId(t),Zs("string"==typeof e,e),dg(this._properties[e])||this._hasPropertyInHierarchy(t,e)}},{key:"getPropertyNames",value:function(t,e){var r;this._checkBatchId(t),(e=dg(e)?e:[]).length=0;var n=Object.keys(this._properties);return(r=e).push.apply(r,Mu()(n)),this._hierarchy&&this._getPropertyNamesInHierarchy(t,e),e}},{key:"getProperty",value:function(t,e){if(this._checkBatchId(t),Zs("string"==typeof e,e),this._binaryProperties){var r=this._binaryProperties[e];if(dg(r))return this._getBinaryProperty(r,t)}var n=this._properties[e];if(dg(n))return pg(n[t]);if(this._hierarchy){var i=this._getHierarchyProperty(t,e);if(dg(i))return i}}},{key:"setProperty",value:function(t,e,r){var n=this.featureCount;if(this._checkBatchId(t),Zs("string"==typeof e,e),this._binaryProperties){var i=this._binaryProperties[e];if(i)return void this._setBinaryProperty(i,t,r)}if(!this._hierarchy||!this._setHierarchyProperty(this,t,e,r)){var o=this._properties[e];dg(o)||(this._properties[e]=new Array(n),o=this._properties[e]),o[t]=pg(r)}}},{key:"_checkBatchId",value:function(t){if(!(t>=0&&t<this.featureCount))throw new Error("batchId not in range [0, featureCount - 1].")}},{key:"_getBinaryProperty",value:function(t,e){return t.unpack(t.typedArray,e)}},{key:"_setBinaryProperty",value:function(t,e,r){t.pack(r,t.typedArray,e)}},{key:"_initializeBinaryProperties",value:function(){var t=null;for(var e in this._properties){var r=this._properties[e],n=this._initializeBinaryProperty(e,r);n&&((t=t||{})[e]=n)}return t}},{key:"_initializeBinaryProperty",value:function(t,e){if("byteOffset"in e){var r=e;Zs(this.binary,"Property ".concat(t," requires a batch table binary.")),Zs(r.type,"Property ".concat(t," requires a type."));var n=function(t,e,r,n){var i=t.componentType;Zs(t.componentType);var o="string"==typeof i?ig.fromName(i):i,a=ag[t.type],s=sg[t.type],u=ug[t.type];return r+=t.byteOffset,{values:ig.createTypedArray(o,e,r,a*n),type:o,size:a,unpacker:s,packer:u}}(r,this.binary.buffer,0|this.binary.byteOffset,this.featureCount);return{typedArray:n.values,componentCount:n.size,unpack:n.unpacker,pack:n.packer}}return null}},{key:"_hasPropertyInHierarchy",value:function(t,e){if(!this._hierarchy)return!1;var r=fg(this._hierarchy,t,(function(t,r){var n=t.classIds[r];return dg(t.classes[n].instances[e])}));return dg(r)}},{key:"_getPropertyNamesInHierarchy",value:function(t,e){fg(this._hierarchy,t,(function(t,r){var n=t.classIds[r],i=t.classes[n].instances;for(var o in i)i.hasOwnProperty(o)&&-1===e.indexOf(o)&&e.push(o)}))}},{key:"_getHierarchyProperty",value:function(t,e){var r=this;return fg(this._hierarchy,t,(function(t,n){var i=t.classIds[n],o=t.classes[i],a=t.classIndexes[n],s=o.instances[e];return dg(s)?dg(s.typedArray)?r._getBinaryProperty(s,a):pg(s[a]):null}))}},{key:"_setHierarchyProperty",value:function(t,e,r,n){var i=this,o=fg(this._hierarchy,e,(function(t,o){var a=t.classIds[o],s=t.classes[a],u=t.classIndexes[o],c=s.instances[r];return!!dg(c)&&(Zs(o===e,'Inherited property "'.concat(r,'" is read-only.')),dg(c.typedArray)?i._setBinaryProperty(c,u,n):c[u]=pg(n),!0)}));return dg(o)}}]),t}();function gg(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=new DataView(e);if(t.magic=n.getUint32(r,!0),r+=4,t.version=n.getUint32(r,!0),r+=4,t.byteLength=n.getUint32(r,!0),r+=4,1!==t.version)throw new Error("3D Tile Version ".concat(t.version," not supported"));return r}function mg(t,e,r){var n,i=new DataView(e);t.header=t.header||{};var o=i.getUint32(r,!0);r+=4;var a=i.getUint32(r,!0);r+=4;var s=i.getUint32(r,!0);r+=4;var u=i.getUint32(r,!0);return r+=4,s>=570425344?(r-=8,n=o,s=a,u=0,o=0,a=0,console.warn("b3dm tile in legacy format.")):u>=570425344&&(r-=4,n=s,s=o,u=a,o=0,a=0,console.warn("b3dm tile in legacy format.")),t.header.featureTableJsonByteLength=o,t.header.featureTableBinaryByteLength=a,t.header.batchTableJsonByteLength=s,t.header.batchTableBinaryByteLength=u,t.header.batchLength=n,r}function bg(t,e,r,n){return r=function(t,e,r,n){var i=t.header,o=i.featureTableJsonByteLength,a=i.featureTableBinaryByteLength,s=i.batchLength;if(t.featureTableJson={BATCH_LENGTH:s||0},o>0){var u=Kv(e,r,o);t.featureTableJson=JSON.parse(u)}return r+=o,t.featureTableBinary=new Uint8Array(e,r,a),r+=a}(t,e,r),r=function(t,e,r,n){var i=t.header,o=i.batchTableJsonByteLength,a=i.batchTableBinaryByteLength;if(o>0){var s=Kv(e,r,o);t.batchTableJson=JSON.parse(s),r+=o,a>0&&(t.batchTableBinary=new Uint8Array(e,r,a),t.batchTableBinary=new Uint8Array(t.batchTableBinary),r+=a)}return r}(t,e,r)}function Ag(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0],r=t>>11&31,n=t>>5&63,i=31&t;return e[0]=r<<3,e[1]=n<<2,e[2]=i<<3,e}function wg(t,e,r){if(!(e||t&&t.batchIds&&r))return null;var n=t.batchIds,i=t.isRGB565,o=t.pointCount;if(n&&r){for(var a=new Uint8ClampedArray(3*o),s=0;s<o;s++){var u=n[s],c=r.getProperty(u,"dimensions").map((function(t){return 255*t}));a[3*s]=c[0],a[3*s+1]=c[1],a[3*s+2]=c[2]}return{type:5121,value:a,size:3,normalized:!0}}if(i){for(var l=new Uint8ClampedArray(3*o),f=0;f<o;f++){var h=Ag(e[f]);l[3*f]=h[0],l[3*f+1]=h[1],l[3*f+2]=h[2]}return{type:5121,value:l,size:3,normalized:!0}}return e&&e.length===3*o?{type:5121,value:e,size:3,normalized:!0}:{type:5121,value:e,size:4,normalized:!0}}function Bg(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Df()(t);if(e){var i=Df()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Pf()(this,r)}}var _g=function(t){If()(r,t);var e=Bg(r);function r(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return ku()(this,r),t=e.call(this,2),Vf(n)&&1===arguments.length?t.copy(n):(Nf.debug&&(Yf(n),Yf(i)),t[0]=n,t[1]=i),t}return Ou()(r,[{key:"set",value:function(t,e){return this[0]=t,this[1]=e,this.check()}},{key:"copy",value:function(t){return this[0]=t[0],this[1]=t[1],this.check()}},{key:"fromObject",value:function(t){return Nf.debug&&(Yf(t.x),Yf(t.y)),this[0]=t.x,this[1]=t.y,this.check()}},{key:"toObject",value:function(t){return t.x=this[0],t.y=this[1],t}},{key:"ELEMENTS",get:function(){return 2}},{key:"horizontalAngle",value:function(){return Math.atan2(this.y,this.x)}},{key:"verticalAngle",value:function(){return Math.atan2(this.x,this.y)}},{key:"transform",value:function(t){return this.transformAsPoint(t)}},{key:"transformAsPoint",value:function(t){return ph(this,this,t),this.check()}},{key:"transformAsVector",value:function(t){return oh(this,this,t),this.check()}},{key:"transformByMatrix3",value:function(t){return dh(this,this,t),this.check()}},{key:"transformByMatrix2x3",value:function(t){return function(t,e,r){var n=e[0],i=e[1];t[0]=r[0]*n+r[2]*i+r[4],t[1]=r[1]*n+r[3]*i+r[5]}(this,this,t),this.check()}},{key:"transformByMatrix2",value:function(t){return function(t,e,r){var n=e[0],i=e[1];t[0]=r[0]*n+r[2]*i,t[1]=r[1]*n+r[3]*i}(this,this,t),this.check()}}]),r}(Rh);function xg(t,e){if(!t)throw new Error("math.gl assertion failed. ".concat(e))}new _g,new Lh,new _g,new _g,new Uint8Array(1);function Cg(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:255;return Wf(t,0,e)/e*2-1}function kg(t){return t<0?-1:1}function Eg(t,e,r,n){if(xg(n),t<0||t>r||e<0||e>r)throw new Error("x and y must be unsigned normalized integers between 0 and ".concat(r));if(n.x=Cg(t,r),n.y=Cg(e,r),n.z=1-(Math.abs(n.x)+Math.abs(n.y)),n.z<0){var i=n.x;n.x=(1-Math.abs(n.y))*kg(i),n.y=(1-Math.abs(i))*kg(n.y)}return n.normalize()}function Og(t,e,r){return Eg(t,e,255,r)}var Tg=new Lh;function Sg(t,e,r){return t.isQuantized?r["3d-tiles"]&&r["3d-tiles"].decodeQuantizedPositions?(t.isQuantized=!1,function(t,e){for(var r=new Lh,n=new Float32Array(3*t.pointCount),i=0;i<t.pointCount;i++)r.set(e[3*i],e[3*i+1],e[3*i+2]).scale(1/t.quantizedRange).multiply(t.quantizedVolumeScale).add(t.quantizedVolumeOffset).toArray(n,3*i);return n}(t,e)):{type:5123,value:e,size:3,normalized:!0}:e}function Mg(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Ig(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Mg(Object(r),!0).forEach((function(e){Ys()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Mg(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Rg(t,e,r,n,i){return Pg.apply(this,arguments)}function Pg(){return(Pg=Ds()(js.a.mark((function t(e,r,n,i,o){var a,s,u;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=gg(e,r,n),n=mg(e,r,n),n=bg(e,r,n),Fg(e),a=Dg(e),s=a.featureTable,u=a.batchTable,t.next=7,Ng(e,s,u,i,o);case 7:return Lg(e,s,i),jg(e,s,u),Gg(e,s),t.abrupt("return",n);case 11:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Fg(t){t.attributes={positions:null,colors:null,normals:null,batchIds:null},t.isQuantized=!1,t.isTranslucent=!1,t.isRGB565=!1,t.isOctEncoded16P=!1}function Dg(t){var e=new og(t.featureTableJson,t.featureTableBinary),r=e.getGlobalProperty("POINTS_LENGTH");if(!Number.isFinite(r))throw new Error("POINTS_LENGTH must be defined");e.featuresLength=r,t.featuresLength=r,t.pointsLength=r,t.pointCount=r,t.rtcCenter=e.getGlobalProperty("RTC_CENTER",5126,3);var n=function(t,e){var r=null;if(!t.batchIds&&e.hasProperty("BATCH_ID")&&(t.batchIds=e.getPropertyArray("BATCH_ID",5123,1),t.batchIds)){var n=e.getGlobalProperty("BATCH_LENGTH");if(!n)throw new Error("Global property: BATCH_LENGTH must be defined when BATCH_ID is defined.");var i=t.batchTableJson,o=t.batchTableBinary;r=new yg(i,o,n)}return r}(t,e);return{featureTable:e,batchTable:n}}function Lg(t,e,r){if(!t.attributes.positions)if(e.hasProperty("POSITION"))t.attributes.positions=e.getPropertyArray("POSITION",5126,3);else if(e.hasProperty("POSITION_QUANTIZED")){var n=e.getPropertyArray("POSITION_QUANTIZED",5123,3);if(t.isQuantized=!0,t.quantizedRange=65535,t.quantizedVolumeScale=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",5126,3),!t.quantizedVolumeScale)throw new Error("QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");if(t.quantizedVolumeOffset=e.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",5126,3),!t.quantizedVolumeOffset)throw new Error("QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");t.attributes.positions=Sg(t,n,r)}if(!t.attributes.positions)throw new Error("Either POSITION or POSITION_QUANTIZED must be defined.")}function jg(t,e,r){if(!t.attributes.colors){var n=null;e.hasProperty("RGBA")?(n=e.getPropertyArray("RGBA",5121,4),t.isTranslucent=!0):e.hasProperty("RGB")?n=e.getPropertyArray("RGB",5121,3):e.hasProperty("RGB565")&&(n=e.getPropertyArray("RGB565",5123,1),t.isRGB565=!0),t.attributes.colors=wg(t,n,r)}e.hasProperty("CONSTANT_RGBA")&&(t.constantRGBA=e.getGlobalProperty("CONSTANT_RGBA",5121,4))}function Gg(t,e){if(!t.attributes.normals){var r=null;e.hasProperty("NORMAL")?r=e.getPropertyArray("NORMAL",5126,3):e.hasProperty("NORMAL_OCT16P")&&(r=e.getPropertyArray("NORMAL_OCT16P",5121,2),t.isOctEncoded16P=!0),t.attributes.normals=function(t,e){if(!e)return null;if(t.isOctEncoded16P){for(var r=new Float32Array(3*t.pointsLength),n=0;n<t.pointsLength;n++)Og(e[2*n],e[2*n+1],Tg),Tg.toArray(r,3*n);return{type:5126,size:2,value:r}}return{type:5126,size:2,value:e}}(t,r)}}function Ng(t,e,r,n,i){return Ug.apply(this,arguments)}function Ug(){return(Ug=Ds()(js.a.mark((function t(e,r,n,i,o){var a,s,u,c,l,f,h,d;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if((c=e.batchTableJson&&e.batchTableJson.extensions&&e.batchTableJson.extensions["3DTILES_draco_point_compression"])&&(u=c.properties),!(l=r.getExtension("3DTILES_draco_point_compression"))){t.next=15;break}if(s=l.properties,f=l.byteOffset,h=l.byteLength,s&&Number.isFinite(f)&&h){t.next=9;break}throw new Error("Draco properties, byteOffset, and byteLength must be defined");case 9:a=e.featureTableBinary.slice(f,f+h),e.hasPositions=Number.isFinite(s.POSITION),e.hasColors=Number.isFinite(s.RGB)||Number.isFinite(s.RGBA),e.hasNormals=Number.isFinite(s.NORMAL),e.hasBatchIds=Number.isFinite(s.BATCH_ID),e.isTranslucent=Number.isFinite(s.RGBA);case 15:if(a){t.next=17;break}return t.abrupt("return",!0);case 17:return d={buffer:a,properties:Ig(Ig({},s),u),featureTableProperties:s,batchTableProperties:u,dequantizeInShader:!1},t.next=20,Hg(e,d,i,o);case 20:return t.abrupt("return",t.sent);case 21:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Hg(t,e,r,n){return Vg.apply(this,arguments)}function Vg(){return(Vg=Ds()(js.a.mark((function t(e,r,n,i){var o,a,s,u,c,l,f,h,d,p,v,y,g,m,b;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=i.parse,delete(a=Ig(Ig({},n),{},{draco:Ig(Ig({},n.draco),{},{extraAttributes:r.batchTableProperties||{}})}))["3d-tiles"],t.next=5,o(r.buffer,$y,a);case 5:if(s=t.sent,u=s.attributes.POSITION&&s.attributes.POSITION.value,c=s.attributes.COLOR_0&&s.attributes.COLOR_0.value,l=s.attributes.NORMAL&&s.attributes.NORMAL.value,f=s.attributes.BATCH_ID&&s.attributes.BATCH_ID.value,h=u&&s.attributes.POSITION.value.quantization,d=l&&s.attributes.NORMAL.value.quantization,h&&(p=s.POSITION.data.quantization,v=p.range,e.quantizedVolumeScale=new Lh(v,v,v),e.quantizedVolumeOffset=new Lh(p.minValues),e.quantizedRange=(1<<p.quantizationBits)-1,e.isQuantizedDraco=!0),d&&(e.octEncodedRange=(1<<s.NORMAL.data.quantization.quantizationBits)-1,e.isOctEncodedDraco=!0),y={},r.batchTableProperties)for(g=0,m=Object.keys(r.batchTableProperties);g<m.length;g++)b=m[g],s.attributes[b]&&s.attributes[b].value&&(y[b.toLowerCase()]=s.attributes[b].value);e.attributes=Ig({positions:u,colors:wg(e,c,void 0),normals:l,batchIds:f},y);case 17:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var Jg,zg,Kg="https://unpkg.com/@loaders.gl/textures@".concat("3.3.0-alpha.5","/dist/libs/basis_encoder.wasm"),qg="https://unpkg.com/@loaders.gl/textures@".concat("3.3.0-alpha.5","/dist/libs/basis_encoder.js");function Wg(t){return Qg.apply(this,arguments)}function Qg(){return(Qg=Ds()(js.a.mark((function t(e){var r;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(r=e.modules||{}).basis){t.next=3;break}return t.abrupt("return",r.basis);case 3:return Jg=Jg||Xg(e),t.next=6,Jg;case 6:return t.abrupt("return",t.sent);case 7:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Xg(t){return Yg.apply(this,arguments)}function Yg(){return(Yg=Ds()(js.a.mark((function t(e){var r,n,i,o;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=null,n=null,t.t0=Promise,t.next=5,Py("basis_transcoder.js","textures",e);case 5:return t.t1=t.sent,t.next=8,Py("basis_transcoder.wasm","textures",e);case 8:return t.t2=t.sent,t.t3=[t.t1,t.t2],t.next=12,t.t0.all.call(t.t0,t.t3);case 12:return i=t.sent,o=Sf()(i,2),r=o[0],n=o[1],r=r||globalThis.BASIS,t.next=19,Zg(r,n);case 19:return t.abrupt("return",t.sent);case 20:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Zg(t,e){var r={};return e&&(r.wasmBinary=e),new Promise((function(e){t(r).then((function(t){var r=t.BasisFile;(0,t.initializeBasis)(),e({BasisFile:r})}))}))}function $g(t){return tm.apply(this,arguments)}function tm(){return(tm=Ds()(js.a.mark((function t(e){var r;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(r=e.modules||{}).basisEncoder){t.next=3;break}return t.abrupt("return",r.basisEncoder);case 3:return zg=zg||em(e),t.next=6,zg;case 6:return t.abrupt("return",t.sent);case 7:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function em(t){return rm.apply(this,arguments)}function rm(){return(rm=Ds()(js.a.mark((function t(e){var r,n,i,o;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=null,n=null,t.t0=Promise,t.next=5,Py(qg,"textures",e);case 5:return t.t1=t.sent,t.next=8,Py(Kg,"textures",e);case 8:return t.t2=t.sent,t.t3=[t.t1,t.t2],t.next=12,t.t0.all.call(t.t0,t.t3);case 12:return i=t.sent,o=Sf()(i,2),r=o[0],n=o[1],r=r||globalThis.BASIS,t.next=19,nm(r,n);case 19:return t.abrupt("return",t.sent);case 20:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function nm(t,e){var r={};return e&&(r.wasmBinary=e),new Promise((function(e){t(r).then((function(t){var r=t.BasisFile,n=t.KTX2File,i=t.initializeBasis,o=t.BasisEncoder;i(),e({BasisFile:r,KTX2File:n,BasisEncoder:o})}))}))}var im={COMPRESSED_RGB_S3TC_DXT1_EXT:33776,COMPRESSED_RGBA_S3TC_DXT1_EXT:33777,COMPRESSED_RGBA_S3TC_DXT3_EXT:33778,COMPRESSED_RGBA_S3TC_DXT5_EXT:33779,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_RGBA8_ETC2_EAC:37493,COMPRESSED_SRGB8_ETC2:37494,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37495,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37496,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37497,COMPRESSED_RGB_PVRTC_4BPPV1_IMG:35840,COMPRESSED_RGBA_PVRTC_4BPPV1_IMG:35842,COMPRESSED_RGB_PVRTC_2BPPV1_IMG:35841,COMPRESSED_RGBA_PVRTC_2BPPV1_IMG:35843,COMPRESSED_RGB_ETC1_WEBGL:36196,COMPRESSED_RGB_ATC_WEBGL:35986,COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL:35987,COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL:34798,COMPRESSED_RGBA_ASTC_4X4_KHR:37808,COMPRESSED_RGBA_ASTC_5X4_KHR:37809,COMPRESSED_RGBA_ASTC_5X5_KHR:37810,COMPRESSED_RGBA_ASTC_6X5_KHR:37811,COMPRESSED_RGBA_ASTC_6X6_KHR:37812,COMPRESSED_RGBA_ASTC_8X5_KHR:37813,COMPRESSED_RGBA_ASTC_8X6_KHR:37814,COMPRESSED_RGBA_ASTC_8X8_KHR:37815,COMPRESSED_RGBA_ASTC_10X5_KHR:37816,COMPRESSED_RGBA_ASTC_10X6_KHR:37817,COMPRESSED_RGBA_ASTC_10X8_KHR:37818,COMPRESSED_RGBA_ASTC_10X10_KHR:37819,COMPRESSED_RGBA_ASTC_12X10_KHR:37820,COMPRESSED_RGBA_ASTC_12X12_KHR:37821,COMPRESSED_SRGB8_ALPHA8_ASTC_4X4_KHR:37840,COMPRESSED_SRGB8_ALPHA8_ASTC_5X4_KHR:37841,COMPRESSED_SRGB8_ALPHA8_ASTC_5X5_KHR:37842,COMPRESSED_SRGB8_ALPHA8_ASTC_6X5_KHR:37843,COMPRESSED_SRGB8_ALPHA8_ASTC_6X6_KHR:37844,COMPRESSED_SRGB8_ALPHA8_ASTC_8X5_KHR:37845,COMPRESSED_SRGB8_ALPHA8_ASTC_8X6_KHR:37846,COMPRESSED_SRGB8_ALPHA8_ASTC_8X8_KHR:37847,COMPRESSED_SRGB8_ALPHA8_ASTC_10X5_KHR:37848,COMPRESSED_SRGB8_ALPHA8_ASTC_10X6_KHR:37849,COMPRESSED_SRGB8_ALPHA8_ASTC_10X8_KHR:37850,COMPRESSED_SRGB8_ALPHA8_ASTC_10X10_KHR:37851,COMPRESSED_SRGB8_ALPHA8_ASTC_12X10_KHR:37852,COMPRESSED_SRGB8_ALPHA8_ASTC_12X12_KHR:37853,COMPRESSED_RED_RGTC1_EXT:36283,COMPRESSED_SIGNED_RED_RGTC1_EXT:36284,COMPRESSED_RED_GREEN_RGTC2_EXT:36285,COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT:36286,COMPRESSED_SRGB_S3TC_DXT1_EXT:35916,COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT:35917,COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT:35918,COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT:35919};function om(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return am(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return am(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function am(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var sm=["","WEBKIT_","MOZ_"],um={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"},cm=null;function lm(t){if(!cm){t=t||function(){try{return document.createElement("canvas").getContext("webgl")}catch(t){return null}}()||void 0,cm=new Set;var e,r=om(sm);try{for(r.s();!(e=r.n()).done;){var n=e.value;for(var i in um)if(t&&t.getExtension("".concat(n).concat(i))){var o=um[i];cm.add(o)}}}catch(t){r.e(t)}finally{r.f()}}return cm}new Uint8Array([0]);var fm,hm,dm,pm,vm,ym,gm,mm,bm;(bm=fm||(fm={}))[bm.NONE=0]="NONE",bm[bm.BASISLZ=1]="BASISLZ",bm[bm.ZSTD=2]="ZSTD",bm[bm.ZLIB=3]="ZLIB",function(t){t[t.BASICFORMAT=0]="BASICFORMAT"}(hm||(hm={})),function(t){t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.ETC1S=163]="ETC1S",t[t.UASTC=166]="UASTC"}(dm||(dm={})),function(t){t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.SRGB=1]="SRGB"}(pm||(pm={})),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"}(vm||(vm={})),function(t){t[t.ALPHA_STRAIGHT=0]="ALPHA_STRAIGHT",t[t.ALPHA_PREMULTIPLIED=1]="ALPHA_PREMULTIPLIED"}(ym||(ym={})),function(t){t[t.RGB=0]="RGB",t[t.RRR=3]="RRR",t[t.GGG=4]="GGG",t[t.AAA=15]="AAA"}(gm||(gm={})),function(t){t[t.RGB=0]="RGB",t[t.RGBA=3]="RGBA",t[t.RRR=4]="RRR",t[t.RRRG=5]="RRRG"}(mm||(mm={}));var Am=[171,75,84,88,32,50,48,187,13,10,26,10];function wm(t){var e=new Uint8Array(t);return!(e.byteLength<Am.length||e[0]!==Am[0]||e[1]!==Am[1]||e[2]!==Am[2]||e[3]!==Am[3]||e[4]!==Am[4]||e[5]!==Am[5]||e[6]!==Am[6]||e[7]!==Am[7]||e[8]!==Am[8]||e[9]!==Am[9]||e[10]!==Am[10]||e[11]!==Am[11])}var Bm={etc1:{basisFormat:0,compressed:!0,format:im.COMPRESSED_RGB_ETC1_WEBGL},etc2:{basisFormat:1,compressed:!0},bc1:{basisFormat:2,compressed:!0,format:im.COMPRESSED_RGB_S3TC_DXT1_EXT},bc3:{basisFormat:3,compressed:!0,format:im.COMPRESSED_RGBA_S3TC_DXT5_EXT},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:im.COMPRESSED_RGB_PVRTC_4BPPV1_IMG},"pvrtc1-4-rgba":{basisFormat:9,compressed:!0,format:im.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG},"astc-4x4":{basisFormat:10,compressed:!0,format:im.COMPRESSED_RGBA_ASTC_4X4_KHR},"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 _m(){return(_m=Ds()(js.a.mark((function t(e,r){var n,i,o,a,s,u;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("auto"!==r.basis.containerFormat){t.next=11;break}if(!wm(e)){t.next=6;break}return t.next=4,$g(r);case 4:return n=t.sent,t.abrupt("return",km(n.KTX2File,e,r));case 6:return t.next=8,Wg(r);case 8:return i=t.sent,o=i.BasisFile,t.abrupt("return",xm(o,e,r));case 11:t.t0=r.basis.module,t.next="encoder"===t.t0?14:(t.t0,22);break;case 14:return t.next=16,$g(r);case 16:a=t.sent,t.t1=r.basis.containerFormat,t.next="ktx2"===t.t1?20:(t.t1,21);break;case 20:return t.abrupt("return",km(a.KTX2File,e,r));case 21:return t.abrupt("return",xm(a.BasisFile,e,r));case 22:return t.next=24,Wg(r);case 24:return s=t.sent,u=s.BasisFile,t.abrupt("return",xm(u,e,r));case 27:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function xm(t,e,r){var n=new t(new Uint8Array(e));try{if(!n.startTranscoding())throw new Error("Failed to start basis transcoding");for(var i=n.getNumImages(),o=[],a=0;a<i;a++){for(var s=n.getNumLevels(a),u=[],c=0;c<s;c++)u.push(Cm(n,a,c,r));o.push(u)}return o}finally{n.close(),n.delete()}}function Cm(t,e,r,n){var i=t.getImageWidth(e,r),o=t.getImageHeight(e,r),a=t.getHasAlpha(),s=Om(n,a),u=s.compressed,c=s.format,l=s.basisFormat,f=t.getImageTranscodedSizeInBytes(e,r,l),h=new Uint8Array(f);if(!t.transcodeImage(h,e,r,l,0,0))throw new Error("failed to start Basis transcoding");return{width:i,height:o,data:h,compressed:u,format:c,hasAlpha:a}}function km(t,e,r){var n=new t(new Uint8Array(e));try{if(!n.startTranscoding())throw new Error("failed to start KTX2 transcoding");for(var i=n.getLevels(),o=[],a=0;a<i;a++){o.push(Em(n,a,r));break}return[o]}finally{n.close(),n.delete()}}function Em(t,e,r){var n=t.getImageLevelInfo(e,0,0),i=n.alphaFlag,o=n.height,a=n.width,s=Om(r,i),u=s.compressed,c=s.format,l=s.basisFormat,f=t.getImageTranscodedSizeInBytes(e,0,0,l),h=new Uint8Array(f);if(!t.transcodeImage(h,e,0,0,l,0,-1,-1))throw new Error("Failed to transcode KTX2 image");return{width:a,height:o,data:h,compressed:u,hasAlpha:i,format:c}}function Om(t,e){var r=t&&t.basis&&t.basis.format;return"auto"===r&&(r=Tm()),"object"===Ns()(r)&&(r=e?r.alpha:r.noAlpha),r=r.toLowerCase(),Bm[r]}function Tm(){var t=lm();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"}function Sm(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Mm(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Sm(Object(r),!0).forEach((function(e){Ys()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Sm(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var Im={name:"Basis",id:kc?"basis":"basis-nodejs",module:"textures",version:"3.3.0-alpha.5",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"}}},Rm=Mm(Mm({},Im),{},{parse:function(t,e){return _m.apply(this,arguments)}}),Pm=globalThis._parseImageNode,Fm="undefined"!=typeof Image,Dm="undefined"!=typeof ImageBitmap,Lm=Boolean(Pm),jm=!!ac||Lm;function Gm(t){var e=Um(t);if(!e)throw new Error("Not an image");return e}function Nm(t){switch(Gm(t)){case"data":return t;case"image":case"imagebitmap":var e=document.createElement("canvas"),r=e.getContext("2d");if(!r)throw new Error("getImageData");return e.width=t.width,e.height=t.height,r.drawImage(t,0,0),r.getImageData(0,0,t.width,t.height);default:throw new Error("getImageData")}}function Um(t){return"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap?"imagebitmap":"undefined"!=typeof Image&&t instanceof Image?"image":t&&"object"===Ns()(t)&&t.data&&t.width&&t.height?"data":null}var Hm=/^data:image\/svg\+xml/,Vm=/\.svg((\?|#).*)?$/;function Jm(t){return t&&(Hm.test(t)||Vm.test(t))}function zm(t,e){if(Jm(e)){var r=(new TextDecoder).decode(t);try{"function"==typeof unescape&&"function"==typeof encodeURIComponent&&(r=unescape(encodeURIComponent(r)))}catch(t){throw new Error(t.message)}return"data:image/svg+xml;base64,".concat(btoa(r))}return Km(t,e)}function Km(t,e){if(Jm(e))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(t)])}function qm(t,e,r){return Wm.apply(this,arguments)}function Wm(){return(Wm=Ds()(js.a.mark((function t(e,r,n){var i,o,a;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=zm(e,n),o=self.URL||self.webkitURL,a="string"!=typeof i&&o.createObjectURL(i),t.prev=3,t.next=6,Qm(a||i,r);case 6:return t.abrupt("return",t.sent);case 7:return t.prev=7,a&&o.revokeObjectURL(a),t.finish(7);case 10:case"end":return t.stop()}}),t,null,[[3,,7,10]])})))).apply(this,arguments)}function Qm(t,e){return Xm.apply(this,arguments)}function Xm(){return(Xm=Ds()(js.a.mark((function t(e,r){var n;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if((n=new Image).src=e,!(r.image&&r.image.decode&&n.decode)){t.next=6;break}return t.next=5,n.decode();case 5:return t.abrupt("return",n);case 6:return t.next=8,new Promise((function(t,r){try{n.onload=function(){return t(n)},n.onerror=function(t){return r(new Error("Could not load image ".concat(e,": ").concat(t)))}}catch(t){r(t)}}));case 8:return t.abrupt("return",t.sent);case 9:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var Ym={},Zm=!0;function $m(t,e,r){return tb.apply(this,arguments)}function tb(){return(tb=Ds()(js.a.mark((function t(e,r,n){var i,o,a;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!Jm(n)){t.next=7;break}return t.next=3,qm(e,r,n);case 3:o=t.sent,i=o,t.next=8;break;case 7:i=Km(e,n);case 8:return a=r&&r.imagebitmap,t.next=11,eb(i,a);case 11:return t.abrupt("return",t.sent);case 12:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function eb(t){return rb.apply(this,arguments)}function rb(){return(rb=Ds()(js.a.mark((function t(e){var r,n=arguments;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!nb(r=n.length>1&&void 0!==n[1]?n[1]:null)&&Zm||(r=null),!r){t.next=13;break}return t.prev=3,t.next=6,createImageBitmap(e,r);case 6:return t.abrupt("return",t.sent);case 9:t.prev=9,t.t0=t.catch(3),console.warn(t.t0),Zm=!1;case 13:return t.next=15,createImageBitmap(e);case 15:return t.abrupt("return",t.sent);case 16:case"end":return t.stop()}}),t,null,[[3,9]])})))).apply(this,arguments)}function nb(t){for(var e in t||Ym)return!1;return!0}function ib(t){var e=ob(t);return function(t){var e=ob(t);if(!(e.byteLength>=24&&2303741511===e.getUint32(0,!1)))return null;return{mimeType:"image/png",width:e.getUint32(16,!1),height:e.getUint32(20,!1)}}(e)||function(t){var e=ob(t);if(!(e.byteLength>=3&&65496===e.getUint16(0,!1)&&255===e.getUint8(2)))return null;var r=function(){for(var t=new Set([65499,65476,65484,65501,65534]),e=65504;e<65520;++e)t.add(e);var r=new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502]);return{tableMarkers:t,sofMarkers:r}}(),n=r.tableMarkers,i=r.sofMarkers,o=2;for(;o+9<e.byteLength;){var a=e.getUint16(o,!1);if(i.has(a))return{mimeType:"image/jpeg",height:e.getUint16(o+5,!1),width:e.getUint16(o+7,!1)};if(!n.has(a))return null;o+=2,o+=e.getUint16(o,!1)}return null}(e)||function(t){var e=ob(t);if(!(e.byteLength>=10&&1195984440===e.getUint32(0,!1)))return null;return{mimeType:"image/gif",width:e.getUint16(6,!0),height:e.getUint16(8,!0)}}(e)||function(t){var e=ob(t);if(!(e.byteLength>=14&&16973===e.getUint16(0,!1)&&e.getUint32(2,!0)===e.byteLength))return null;return{mimeType:"image/bmp",width:e.getUint32(18,!0),height:e.getUint32(22,!0)}}(e)}function ob(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")}function ab(t,e){return sb.apply(this,arguments)}function sb(){return(sb=Ds()(js.a.mark((function t(e,r){var n,i,o;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=ib(e)||{},i=n.mimeType,Zs(o=globalThis._parseImageNode),t.next=5,o(e,i);case 5:return t.abrupt("return",t.sent);case 6:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function ub(){return(ub=Ds()(js.a.mark((function t(e,r,n){var i,o,a,s,u;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:i=(r=r||{}).image||{},o=i.type||"auto",a=(n||{}).url,s=cb(o),t.t0=s,t.next="imagebitmap"===t.t0?8:"image"===t.t0?12:"data"===t.t0?16:20;break;case 8:return t.next=10,$m(e,r,a);case 10:return u=t.sent,t.abrupt("break",21);case 12:return t.next=14,qm(e,r,a);case 14:return u=t.sent,t.abrupt("break",21);case 16:return t.next=18,ab(e,r);case 18:return u=t.sent,t.abrupt("break",21);case 20:Zs(!1);case 21:return"data"===o&&(u=Nm(u)),t.abrupt("return",u);case 23:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function cb(t){switch(t){case"auto":case"data":return function(){if(Dm)return"imagebitmap";if(Fm)return"image";if(jm)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}();default:return function(t){switch(t){case"auto":return Dm||Fm||jm;case"imagebitmap":return Dm;case"image":return Fm;case"data":return jm;default:throw new Error("@loaders.gl/images: image ".concat(t," not supported in this environment"))}}(t),t}}var lb={id:"image",module:"images",name:"Images",version:"3.3.0-alpha.5",mimeTypes:["image/png","image/jpeg","image/gif","image/webp","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],extensions:["png","jpg","jpeg","gif","webp","bmp","ico","svg"],parse:function(t,e,r){return ub.apply(this,arguments)},tests:[function(t){return Boolean(ib(new DataView(t)))}],options:{image:{type:"auto",decode:!0}}};function fb(t,e,r){if(t.byteLength<=e+r)return"";for(var n=new DataView(t),i="",o=0;o<r;o++)i+=String.fromCharCode(n.getUint8(e+o));return i}function hb(t){try{return JSON.parse(t)}catch(e){throw new Error('Failed to parse JSON from data starting with "'.concat(function(t){var 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 fb(t.buffer,t.byteOffset,e);if(t instanceof ArrayBuffer){var r=0;return fb(t,r,e)}return""}(t),'"'))}}function db(t,e){if(!t)throw new Error(e||"assert failed: gltf")}function pb(t,e){if(t.startsWith("data:")||t.startsWith("http:")||t.startsWith("https:"))return t;var r=e.baseUri||e.uri;if(!r)throw new Error("'baseUri' must be provided to resolve relative url ".concat(t));return r.substr(0,r.lastIndexOf("/")+1)+t}function vb(t,e,r){var n=t.bufferViews[r];db(n);var i=e[n.buffer];db(i);var o=(n.byteOffset||0)+i.byteOffset;return new Uint8Array(i.arrayBuffer,o,n.byteLength)}function yb(t,e){return Zs(t>=0),Zs(e>0),t+(e-1)&~(e-1)}function gb(t,e,r){var n;if(t instanceof ArrayBuffer)n=new Uint8Array(t);else{var i=t.byteOffset,o=t.byteLength;n=new Uint8Array(t.buffer||t.arrayBuffer,i,o)}return e.set(n,r),r+yb(n.byteLength,4)}var mb=["SCALAR","VEC2","VEC3","VEC4"],bb=[[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Uint32Array,5125],[Float32Array,5126],[Float64Array,5130]],Ab=new Map(bb),wb={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Bb={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},_b={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function xb(t){return mb[t-1]||mb[0]}function Cb(t){var e=Ab.get(t.constructor);if(!e)throw new Error("Illegal typed array");return e}function kb(t,e){var r=_b[t.componentType],n=wb[t.type],i=Bb[t.componentType],o=t.count*n,a=t.count*n*i;return db(a>=0&&a<=e.byteLength),{ArrayType:r,length:o,byteLength:a}}function Eb(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return Ob(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ob(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function Ob(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Tb(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Sb(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Tb(Object(r),!0).forEach((function(e){Ys()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Tb(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var Mb,Ib={asset:{version:"2.0",generator:"loaders.gl"},buffers:[]},Rb=function(){function t(e){ku()(this,t),Tu(this,"gltf",void 0),Tu(this,"sourceBuffers",void 0),Tu(this,"byteLength",void 0),this.gltf=e||{json:Sb({},Ib),buffers:[]},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]])}return Ou()(t,[{key:"json",get:function(){return this.gltf.json}},{key:"getApplicationData",value:function(t){return this.json[t]}},{key:"getExtraData",value:function(t){return(this.json.extras||{})[t]}},{key:"getExtension",value:function(t){var e=this.getUsedExtensions().find((function(e){return e===t})),r=this.json.extensions||{};return e?r[t]||!0:null}},{key:"getRequiredExtension",value:function(t){return this.getRequiredExtensions().find((function(e){return e===t}))?this.getExtension(t):null}},{key:"getRequiredExtensions",value:function(){return this.json.extensionsRequired||[]}},{key:"getUsedExtensions",value:function(){return this.json.extensionsUsed||[]}},{key:"getObjectExtension",value:function(t,e){return(t.extensions||{})[e]}},{key:"getScene",value:function(t){return this.getObject("scenes",t)}},{key:"getNode",value:function(t){return this.getObject("nodes",t)}},{key:"getSkin",value:function(t){return this.getObject("skins",t)}},{key:"getMesh",value:function(t){return this.getObject("meshes",t)}},{key:"getMaterial",value:function(t){return this.getObject("materials",t)}},{key:"getAccessor",value:function(t){return this.getObject("accessors",t)}},{key:"getTexture",value:function(t){return this.getObject("textures",t)}},{key:"getSampler",value:function(t){return this.getObject("samplers",t)}},{key:"getImage",value:function(t){return this.getObject("images",t)}},{key:"getBufferView",value:function(t){return this.getObject("bufferViews",t)}},{key:"getBuffer",value:function(t){return this.getObject("buffers",t)}},{key:"getObject",value:function(t,e){if("object"===Ns()(e))return e;var r=this.json[t]&&this.json[t][e];if(!r)throw new Error("glTF file error: Could not find ".concat(t,"[").concat(e,"]"));return r}},{key:"getTypedArrayForBufferView",value:function(t){var e=(t=this.getBufferView(t)).buffer,r=this.gltf.buffers[e];db(r);var n=(t.byteOffset||0)+r.byteOffset;return new Uint8Array(r.arrayBuffer,n,t.byteLength)}},{key:"getTypedArrayForAccessor",value:function(t){t=this.getAccessor(t);var e=this.getBufferView(t.bufferView),r=this.getBuffer(e.buffer).data,n=kb(t,e),i=n.ArrayType,o=n.length;return new i(r,e.byteOffset+t.byteOffset,o)}},{key:"getTypedArrayForImageData",value:function(t){t=this.getAccessor(t);var e=this.getBufferView(t.bufferView),r=this.getBuffer(e.buffer).data,n=e.byteOffset||0;return new Uint8Array(r,n,e.byteLength)}},{key:"addApplicationData",value:function(t,e){return this.json[t]=e,this}},{key:"addExtraData",value:function(t,e){return this.json.extras=this.json.extras||{},this.json.extras[t]=e,this}},{key:"addObjectExtension",value:function(t,e,r){return t.extensions=t.extensions||{},t.extensions[e]=r,this.registerUsedExtension(e),this}},{key:"setObjectExtension",value:function(t,e,r){(t.extensions||{})[e]=r}},{key:"removeObjectExtension",value:function(t,e){var r=t.extensions||{},n=r[e];return delete r[e],n}},{key:"addExtension",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return db(e),this.json.extensions=this.json.extensions||{},this.json.extensions[t]=e,this.registerUsedExtension(t),e}},{key:"addRequiredExtension",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return db(e),this.addExtension(t,e),this.registerRequiredExtension(t),e}},{key:"registerUsedExtension",value:function(t){this.json.extensionsUsed=this.json.extensionsUsed||[],this.json.extensionsUsed.find((function(e){return e===t}))||this.json.extensionsUsed.push(t)}},{key:"registerRequiredExtension",value:function(t){this.registerUsedExtension(t),this.json.extensionsRequired=this.json.extensionsRequired||[],this.json.extensionsRequired.find((function(e){return e===t}))||this.json.extensionsRequired.push(t)}},{key:"removeExtension",value:function(t){this.json.extensionsRequired&&this._removeStringFromArray(this.json.extensionsRequired,t),this.json.extensionsUsed&&this._removeStringFromArray(this.json.extensionsUsed,t),this.json.extensions&&delete this.json.extensions[t]}},{key:"setDefaultScene",value:function(t){this.json.scene=t}},{key:"addScene",value:function(t){var e=t.nodeIndices;return this.json.scenes=this.json.scenes||[],this.json.scenes.push({nodes:e}),this.json.scenes.length-1}},{key:"addNode",value:function(t){var e=t.meshIndex,r=t.matrix;this.json.nodes=this.json.nodes||[];var n={mesh:e};return r&&(n.matrix=r),this.json.nodes.push(n),this.json.nodes.length-1}},{key:"addMesh",value:function(t){var e=t.attributes,r=t.indices,n=t.material,i=t.mode,o=void 0===i?4:i,a={primitives:[{attributes:this._addAttributes(e),mode:o}]};if(r){var s=this._addIndices(r);a.primitives[0].indices=s}return Number.isFinite(n)&&(a.primitives[0].material=n),this.json.meshes=this.json.meshes||[],this.json.meshes.push(a),this.json.meshes.length-1}},{key:"addPointCloud",value:function(t){var 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}},{key:"addImage",value:function(t,e){var r=ib(t),n=e||(null==r?void 0:r.mimeType),i={bufferView:this.addBufferView(t),mimeType:n};return this.json.images=this.json.images||[],this.json.images.push(i),this.json.images.length-1}},{key:"addBufferView",value:function(t){var e=t.byteLength;db(Number.isFinite(e)),this.sourceBuffers=this.sourceBuffers||[],this.sourceBuffers.push(t);var r={buffer:0,byteOffset:this.byteLength,byteLength:e};return this.byteLength+=yb(e,4),this.json.bufferViews=this.json.bufferViews||[],this.json.bufferViews.push(r),this.json.bufferViews.length-1}},{key:"addAccessor",value:function(t,e){var r={bufferView:t,type:xb(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(r),this.json.accessors.length-1}},{key:"addBinaryBuffer",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{size:3},r=this.addBufferView(t),n={min:e.min,max:e.max};n.min&&n.max||(n=this._getAccessorMinMax(t,e.size));var i={size:e.size,componentType:Cb(t),count:Math.round(t.length/e.size),min:n.min,max:n.max};return this.addAccessor(r,Object.assign(i,e))}},{key:"addTexture",value:function(t){var e={source:t.imageIndex};return this.json.textures=this.json.textures||[],this.json.textures.push(e),this.json.textures.length-1}},{key:"addMaterial",value:function(t){return this.json.materials=this.json.materials||[],this.json.materials.push(t),this.json.materials.length-1}},{key:"createBinaryChunk",value:function(){var t,e;this.gltf.buffers=[];var r,n=this.byteLength,i=new ArrayBuffer(n),o=new Uint8Array(i),a=0,s=Eb(this.sourceBuffers||[]);try{for(s.s();!(r=s.n()).done;){a=gb(r.value,o,a)}}catch(t){s.e(t)}finally{s.f()}null!==(t=this.json)&&void 0!==t&&null!==(e=t.buffers)&&void 0!==e&&e[0]?this.json.buffers[0].byteLength=n:this.json.buffers=[{byteLength:n}],this.gltf.binary=i,this.sourceBuffers=[i]}},{key:"_removeStringFromArray",value:function(t,e){for(var r=!0;r;){var n=t.indexOf(e);n>-1?t.splice(n,1):r=!1}}},{key:"_addAttributes",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e={};for(var r in t){var n=t[r],i=this._getGltfAttributeName(r),o=this.addBinaryBuffer(n.value,n);e[i]=o}return e}},{key:"_addIndices",value:function(t){return this.addBinaryBuffer(t,{size:1})}},{key:"_getGltfAttributeName",value:function(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}}},{key:"_getAccessorMinMax",value:function(t,e){var r={min:null,max:null};if(t.length<e)return r;r.min=[],r.max=[];var n,i=Eb(t.subarray(0,e));try{for(i.s();!(n=i.n()).done;){var o=n.value;r.min.push(o),r.max.push(o)}}catch(t){i.e(t)}finally{i.f()}for(var a=e;a<t.length;a+=e)for(var s=0;s<e;s++)r.min[0+s]=Math.min(r.min[0+s],t[a+s]),r.max[0+s]=Math.max(r.max[0+s],t[a+s]);return r}}]),t}(),Pb=("undefined"==typeof WebAssembly||Ns()(WebAssembly),"B9h9z9tFBBBF8fL9gBB9gLaaaaaFa9gEaaaB9gFaFa9gEaaaFaEMcBFFFGGGEIIILF9wFFFLEFBFKNFaFCx/IFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBF8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBGy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBEn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBIi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBKI9z9iqlBOc+x8ycGBM/qQFTa8jUUUUBCU/EBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAGTkUUUBRNCUoBAG9uC/wgBZHKCUGAKCUG9JyRVAECFJRICBRcGXEXAcAF9PQFAVAFAclAcAVJAF9JyRMGXGXAG9FQBAMCbJHKC9wZRSAKCIrCEJCGrRQANCUGJRfCBRbAIRTEXGXAOATlAQ9PQBCBRISEMATAQJRIGXAS9FQBCBRtCBREEXGXAOAIlCi9PQBCBRISLMANCU/CBJAEJRKGXGXGXGXGXATAECKrJ2BBAtCKZrCEZfIBFGEBMAKhB83EBAKCNJhB83EBSEMAKAI2BIAI2BBHmCKrHYAYCE6HYy86BBAKCFJAICIJAYJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCGJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCEJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCIJAYAmJHY2BBAI2BFHmCKrHPAPCE6HPy86BBAKCLJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCKJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCOJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCNJAYAmJHY2BBAI2BGHmCKrHPAPCE6HPy86BBAKCVJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCcJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCMJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCSJAYAmJHm2BBAI2BEHICKrHYAYCE6HYy86BBAKCQJAmAYJHm2BBAICIrCEZHYAYCE6HYy86BBAKCfJAmAYJHm2BBAICGrCEZHYAYCE6HYy86BBAKCbJAmAYJHK2BBAICEZHIAICE6HIy86BBAKAIJRISGMAKAI2BNAI2BBHmCIrHYAYCb6HYy86BBAKCFJAICNJAYJHY2BBAmCbZHmAmCb6Hmy86BBAKCGJAYAmJHm2BBAI2BFHYCIrHPAPCb6HPy86BBAKCEJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCIJAmAYJHm2BBAI2BGHYCIrHPAPCb6HPy86BBAKCLJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCKJAmAYJHm2BBAI2BEHYCIrHPAPCb6HPy86BBAKCOJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCNJAmAYJHm2BBAI2BIHYCIrHPAPCb6HPy86BBAKCVJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCcJAmAYJHm2BBAI2BLHYCIrHPAPCb6HPy86BBAKCMJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCSJAmAYJHm2BBAI2BKHYCIrHPAPCb6HPy86BBAKCQJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCfJAmAYJHm2BBAI2BOHICIrHYAYCb6HYy86BBAKCbJAmAYJHK2BBAICbZHIAICb6HIy86BBAKAIJRISFMAKAI8pBB83BBAKCNJAICNJ8pBB83BBAICTJRIMAtCGJRtAECTJHEAS9JQBMMGXAIQBCBRISEMGXAM9FQBANAbJ2BBRtCBRKAfREEXAEANCU/CBJAKJ2BBHTCFrCBATCFZl9zAtJHt86BBAEAGJREAKCFJHKAM9HQBMMAfCFJRfAIRTAbCFJHbAG9HQBMMABAcAG9sJANCUGJAMAG9sTkUUUBpANANCUGJAMCaJAG9sJAGTkUUUBpMAMCBAIyAcJRcAIQBMC9+RKSFMCBC99AOAIlAGCAAGCA9Ly6yRKMALCU/EBJ8kUUUUBAKM+OmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUFT+JUUUBpALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+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"),Fb="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",Db=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]),Lb=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]),jb={0:"",1:"meshopt_decodeFilterOct",2:"meshopt_decodeFilterQuat",3:"meshopt_decodeFilterExp",NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},Gb={0:"meshopt_decodeVertexBuffer",1:"meshopt_decodeIndexBuffer",2:"meshopt_decodeIndexSequence",ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"};function Nb(t,e,r,n,i){return Ub.apply(this,arguments)}function Ub(){return(Ub=Ds()(js.a.mark((function t(e,r,n,i,o){var a,s,u=arguments;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a=u.length>5&&void 0!==u[5]?u[5]:"NONE",t.next=3,Hb();case 3:qb(s=t.sent,s.exports[Gb[o]],e,r,n,i,s.exports[jb[a||"NONE"]]);case 5:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Hb(){return Vb.apply(this,arguments)}function Vb(){return(Vb=Ds()(js.a.mark((function t(){return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return Mb||(Mb=Jb()),t.abrupt("return",Mb);case 2:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Jb(){return zb.apply(this,arguments)}function zb(){return(zb=Ds()(js.a.mark((function t(){var e,r;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=Pb,WebAssembly.validate(Db)&&(e=Fb,console.log("Warning: meshopt_decoder is using experimental SIMD support")),t.next=4,WebAssembly.instantiate(Kb(e),{});case 4:return r=t.sent,t.next=7,r.instance.exports.__wasm_call_ctors();case 7:return t.abrupt("return",r.instance);case 8:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Kb(t){for(var e=new Uint8Array(t.length),r=0;r<t.length;++r){var n=t.charCodeAt(r);e[r]=n>96?n-71:n>64?n-65:n>47?n+4:n>46?63:62}for(var i=0,o=0;o<t.length;++o)e[i++]=e[o]<60?Lb[e[o]]:64*(e[o]-60)+e[++o];return e.buffer.slice(0,i)}function qb(t,e,r,n,i,o,a){var s=t.exports.sbrk,u=n+3&-4,c=s(u*i),l=s(o.length),f=new Uint8Array(t.exports.memory.buffer);f.set(o,l);var h=e(c,n,i,l,o.length);if(0===h&&a&&a(c,u,i),r.set(f.subarray(c,c+n*i)),s(c-s(0)),0!==h)throw new Error("Malformed buffer data: ".concat(h))}function Wb(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return Qb(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Qb(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function Qb(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var Xb="EXT_meshopt_compression";function Yb(t,e){return Zb.apply(this,arguments)}function Zb(){return(Zb=Ds()(js.a.mark((function t(e,r){var n,i,o,a,s,u;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i=new Rb(e),null!=r&&null!==(n=r.gltf)&&void 0!==n&&n.decompressMeshes){t.next=3;break}return t.abrupt("return");case 3:o=[],a=Wb(e.json.bufferViews||[]);try{for(a.s();!(s=a.n()).done;)u=s.value,o.push($b(i,u))}catch(t){a.e(t)}finally{a.f()}return t.next=8,Promise.all(o);case 8:i.removeExtension("EXT_meshopt_compression");case 9:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function $b(t,e){return tA.apply(this,arguments)}function tA(){return(tA=Ds()(js.a.mark((function t(e,r){var n,i,o,a,s,u,c,l,f,h,d,p,v,y;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(n=e.getObjectExtension(r,"EXT_meshopt_compression"))){t.next=9;break}return i=n.byteOffset,o=void 0===i?0:i,a=n.byteLength,s=void 0===a?0:a,u=n.byteStride,c=n.count,l=n.mode,f=n.filter,h=void 0===f?"NONE":f,d=n.buffer,p=e.gltf.buffers[d],v=new Uint8Array(p.arrayBuffer,p.byteOffset+o,s),y=new Uint8Array(e.gltf.buffers[r.buffer].arrayBuffer,r.byteOffset,r.byteLength),t.next=8,Nb(y,c,u,v,l,h);case 8:return t.abrupt("return",y);case 9:return t.abrupt("return",null);case 10:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var eA=["image/png","image/jpeg","image/gif"],rA={};function nA(t){return void 0===rA[t]&&(rA[t]=function(t){switch(t){case"image/webp":return function(){if(!ac)return!1;try{return 0===document.createElement("canvas").toDataURL("image/webp").indexOf("data:image/webp")}catch(t){return!1}}();case"image/svg":return ac;default:if(!ac){var e=globalThis._parseImageNode;return Boolean(e)&&eA.includes(t)}return!0}}(t)),rA[t]}function iA(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return oA(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return oA(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function oA(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var aA="EXT_texture_webp";function sA(t,e){var r=new Rb(t);if(nA("image/webp")){var n,i=iA(r.json.textures||[]);try{for(i.s();!(n=i.n()).done;){var o=n.value,a=r.getObjectExtension(o,"EXT_texture_webp");a&&(o.source=a.source),r.removeObjectExtension(o,"EXT_texture_webp")}}catch(t){i.e(t)}finally{i.f()}r.removeExtension("EXT_texture_webp")}else if(r.getRequiredExtensions().includes("EXT_texture_webp"))throw new Error("gltf: Required extension ".concat("EXT_texture_webp"," not supported by browser"))}function uA(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return cA(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return cA(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function cA(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var lA="KHR_texture_basisu";function fA(t,e){var r,n=new Rb(t),i=uA(n.json.textures||[]);try{for(i.s();!(r=i.n()).done;){var o=r.value,a=n.getObjectExtension(o,"KHR_texture_basisu");a&&(o.source=a.source),n.removeObjectExtension(o,"KHR_texture_basisu")}}catch(t){i.e(t)}finally{i.f()}n.removeExtension("KHR_texture_basisu")}function hA(t){var e={};for(var r in t){var n=t[r];if("indices"!==r){var i=dA(n);e[r]=i}}return e}function dA(t){var e=function(t){var e=t,r=1,n=0;t&&t.value&&(e=t.value,r=t.size||1);e&&(ArrayBuffer.isView(e)||(e=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!t)return null;if(Array.isArray(t))return new e(t);if(r&&!(t instanceof e))return new e(t);return t}(e,Float32Array)),n=e.length/r);return{buffer:e,size:r,count:n}}(t),r=e.buffer,n=e.size;return{value:r,size:n,byteOffset:0,count:e.count,type:xb(n),componentType:Cb(r)}}function pA(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function vA(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?pA(Object(r),!0).forEach((function(e){Ys()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):pA(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var yA=js.a.mark(OA);function gA(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return mA(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return mA(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function mA(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var bA="KHR_draco_mesh_compression";function AA(t,e,r){var n,i=new Rb(t),o=gA(OA(i));try{for(o.s();!(n=o.n()).done;){var a=n.value;i.getObjectExtension(a,"KHR_draco_mesh_compression")}}catch(t){o.e(t)}finally{o.f()}}function wA(t,e,r){return BA.apply(this,arguments)}function BA(){return(BA=Ds()(js.a.mark((function t(e,r,n){var i,o,a,s,u,c;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(null!=r&&null!==(i=r.gltf)&&void 0!==i&&i.decompressMeshes){t.next=2;break}return t.abrupt("return");case 2:o=new Rb(e),a=[],s=gA(OA(o));try{for(s.s();!(u=s.n()).done;)c=u.value,o.getObjectExtension(c,"KHR_draco_mesh_compression")&&a.push(xA(o,c,r,n))}catch(t){s.e(t)}finally{s.f()}return t.next=8,Promise.all(a);case 8:o.removeExtension("KHR_draco_mesh_compression");case 9:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function _A(t){var e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=new Rb(t),i=gA(n.json.meshes||[]);try{for(i.s();!(e=i.n()).done;){var o=e.value;kA(o,r),n.addRequiredExtension("KHR_draco_mesh_compression")}}catch(t){i.e(t)}finally{i.f()}}function xA(t,e,r,n){return CA.apply(this,arguments)}function CA(){return(CA=Ds()(js.a.mark((function t(e,r,n,i){var o,a,s,u,c,l,f,h,d,p,v,y,g,m;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(o=e.getObjectExtension(r,"KHR_draco_mesh_compression")){t.next=3;break}return t.abrupt("return");case 3:return a=e.getTypedArrayForBufferView(o.bufferView),s=al(a.buffer,a.byteOffset),u=i.parse,delete(c=vA({},n))["3d-tiles"],t.next=10,u(s,$y,c,i);case 10:for(l=t.sent,f=hA(l.attributes),h=0,d=Object.entries(f);h<d.length;h++)p=Sf()(d[h],2),v=p[0],y=p[1],v in r.attributes&&(g=r.attributes[v],null!=(m=e.getAccessor(g))&&m.min&&null!=m&&m.max&&(y.min=m.min,y.max=m.max));r.attributes=f,l.indices&&(r.indices=dA(l.indices)),EA(r);case 16:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function kA(t,e){var r,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:4,i=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0;if(!i.DracoWriter)throw new Error("options.gltf.DracoWriter not provided");var a=i.DracoWriter.encodeSync({attributes:t}),s=null==o?void 0:null===(r=o.parseSync)||void 0===r?void 0:r.call(o,{attributes:t}),u=i._addFauxAttributes(s.attributes),c=i.addBufferView(a),l={primitives:[{attributes:u,mode:n,extensions:Ys()({},"KHR_draco_mesh_compression",{bufferView:c,attributes:u})}]};return l}function EA(t){if(!t.attributes&&Object.keys(t.attributes).length>0)throw new Error("glTF: Empty primitive detected: Draco decompression failure?")}function OA(t){var e,r,n,i,o,a;return js.a.wrap((function(s){for(;;)switch(s.prev=s.next){case 0:e=gA(t.json.meshes||[]),s.prev=1,e.s();case 3:if((r=e.n()).done){s.next=24;break}n=r.value,i=gA(n.primitives),s.prev=6,i.s();case 8:if((o=i.n()).done){s.next=14;break}return a=o.value,s.next=12,a;case 12:s.next=8;break;case 14:s.next=19;break;case 16:s.prev=16,s.t0=s.catch(6),i.e(s.t0);case 19:return s.prev=19,i.f(),s.finish(19);case 22:s.next=3;break;case 24:s.next=29;break;case 26:s.prev=26,s.t1=s.catch(1),e.e(s.t1);case 29:return s.prev=29,e.f(),s.finish(29);case 32:case"end":return s.stop()}}),yA,null,[[1,26,29,32],[6,16,19,22]])}var TA={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},SA={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4};function MA(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return IA(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return IA(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function IA(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var RA="KHR_texture_transform",PA=new Lh,FA=new Pd,DA=new Pd;function LA(t,e){return jA.apply(this,arguments)}function jA(){return(jA=Ds()(js.a.mark((function t(e,r){var n,i,o;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=new Rb(e),n.getExtension("KHR_texture_transform")){t.next=4;break}return t.abrupt("return");case 4:for(i=e.json.materials||[],o=0;o<i.length;o++)GA(o,e);case 6:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function GA(t,e){var r,n,i,o=[],a=null===(r=e.json.materials)||void 0===r?void 0:r[t],s=null==a?void 0:null===(n=a.pbrMetallicRoughness)||void 0===n?void 0:n.baseColorTexture;s&&NA(e,t,s,o);var u=null==a?void 0:a.emissiveTexture;u&&NA(e,t,u,o);var c=null==a?void 0:a.normalTexture;c&&NA(e,t,c,o);var l=null==a?void 0:a.occlusionTexture;l&&NA(e,t,l,o);var f=null==a?void 0:null===(i=a.pbrMetallicRoughness)||void 0===i?void 0:i.metallicRoughnessTexture;f&&NA(e,t,f,o)}function NA(t,e,r,n){var i=function(t,e){var r,n=null===(r=t.extensions)||void 0===r?void 0:r.KHR_texture_transform,i=t.texCoord,o=void 0===i?0:i,a=n.texCoord,s=void 0===a?o:a;if(-1===e.findIndex((function(t){var e=Sf()(t,2),r=e[0],n=e[1];return r===o&&n===s}))){var u=(l=(c=n).offset,f=void 0===l?[0,0]:l,h=c.rotation,d=void 0===h?0:h,p=c.scale,v=void 0===p?[1,1]:p,y=(new Pd).set(1,0,0,0,1,0,f[0],f[1],1),g=FA.set(Math.cos(d),Math.sin(d),0,-Math.sin(d),Math.cos(d),0,0,0,1),m=DA.set(v[0],0,0,0,v[1],0,0,0,1),y.multiplyRight(g).multiplyRight(m));return o!==s&&(t.texCoord=s),e.push([o,s]),{originalTexCoord:o,texCoord:s,matrix:u}}var c,l,f,h,d,p,v,y,g,m;return null}(r,n);if(i){var o,a=MA(t.json.meshes||[]);try{for(a.s();!(o=a.n()).done;){var s,u=MA(o.value.primitives);try{for(u.s();!(s=u.n()).done;){var c=s.value,l=c.material;Number.isFinite(l)&&e===l&&UA(t,c,i)}}catch(t){u.e(t)}finally{u.f()}}}catch(t){a.e(t)}finally{a.f()}}}function UA(t,e,r){var n=r.originalTexCoord,i=r.texCoord,o=r.matrix,a=e.attributes["TEXCOORD_".concat(n)];if(Number.isFinite(a)){var s,u=null===(s=t.json.accessors)||void 0===s?void 0:s[a];if(u&&u.bufferView){var c,l=null===(c=t.json.bufferViews)||void 0===c?void 0:c[u.bufferView];if(l){for(var f=t.buffers[l.buffer],h=f.arrayBuffer,d=(f.byteOffset||0)+(u.byteOffset||0)+(l.byteOffset||0),p=kb(u,l),v=p.ArrayType,y=p.length,g=SA[u.componentType],m=TA[u.type],b=l.byteStride||g*m,A=new Float32Array(y),w=0;w<u.count;w++){var B=new v(h,d+w*b,2);PA.set(B[0],B[1],1),PA.transformByMatrix3(o),A.set([PA[0],PA[1]],w*m)}n===i?function(t,e,r,n){t.componentType=5126,r.push({arrayBuffer:n.buffer,byteOffset:0,byteLength:n.buffer.byteLength}),e.buffer=r.length-1,e.byteLength=n.buffer.byteLength,e.byteOffset=0,delete e.byteStride}(u,l,t.buffers,A):function(t,e,r,n,i){n.buffers.push({arrayBuffer:i.buffer,byteOffset:0,byteLength:i.buffer.byteLength});var o=n.json.bufferViews;if(!o)return;o.push({buffer:n.buffers.length-1,byteLength:i.buffer.byteLength,byteOffset:0});var a=n.json.accessors;if(!a)return;a.push({bufferView:(null==o?void 0:o.length)-1,byteOffset:0,componentType:5126,count:e.count,type:"VEC2"}),r.attributes["TEXCOORD_".concat(t)]=a.length-1}(i,u,e,t,A)}}}}function HA(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return VA(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return VA(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function VA(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var JA="KHR_lights_punctual";function zA(t){return KA.apply(this,arguments)}function KA(){return(KA=Ds()(js.a.mark((function t(e){var r,n,i,o,a,s,u;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=new Rb(e),n=r.json,(i=r.getExtension("KHR_lights_punctual"))&&(r.json.lights=i.lights,r.removeExtension("KHR_lights_punctual")),o=HA(n.nodes||[]);try{for(o.s();!(a=o.n()).done;)s=a.value,(u=r.getObjectExtension(s,"KHR_lights_punctual"))&&(s.light=u.light),r.removeObjectExtension(s,"KHR_lights_punctual")}catch(t){o.e(t)}finally{o.f()}case 6:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function qA(t){return WA.apply(this,arguments)}function WA(){return(WA=Ds()(js.a.mark((function t(e){var r,n,i,o,a,s,u;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=new Rb(e),(n=r.json).lights&&(db(!(i=r.addExtension("KHR_lights_punctual")).lights),i.lights=n.lights,delete n.lights),r.json.lights){o=HA(r.json.lights);try{for(o.s();!(a=o.n()).done;)s=a.value,u=s.node,r.addObjectExtension(u,"KHR_lights_punctual",s)}catch(t){o.e(t)}finally{o.f()}delete r.json.lights}case 4:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function QA(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return XA(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return XA(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function XA(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var YA="KHR_materials_unlit";function ZA(t){return $A.apply(this,arguments)}function $A(){return($A=Ds()(js.a.mark((function t(e){var r,n,i,o,a;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=new Rb(e),n=r.json,r.removeExtension("KHR_materials_unlit"),i=QA(n.materials||[]);try{for(i.s();!(o=i.n()).done;)a=o.value,a.extensions&&a.extensions.KHR_materials_unlit&&(a.unlit=!0),r.removeObjectExtension(a,"KHR_materials_unlit")}catch(t){i.e(t)}finally{i.f()}case 5:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function tw(t){var e=new Rb(t),r=e.json;if(e.materials){var n,i=QA(r.materials||[]);try{for(i.s();!(n=i.n()).done;){var o=n.value;o.unlit&&(delete o.unlit,e.addObjectExtension(o,"KHR_materials_unlit",{}),e.addExtension("KHR_materials_unlit"))}}catch(t){i.e(t)}finally{i.f()}}}function ew(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return rw(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return rw(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function rw(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var nw="KHR_techniques_webgl";function iw(t){return ow.apply(this,arguments)}function ow(){return(ow=Ds()(js.a.mark((function t(e){var r,n,i,o,a,s,u,c;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=new Rb(e),n=r.json,i=r.getExtension("KHR_techniques_webgl")){o=uw(i,r),a=ew(n.materials||[]);try{for(a.s();!(s=a.n()).done;)u=s.value,(c=r.getObjectExtension(u,"KHR_techniques_webgl"))&&(u.technique=Object.assign({},c,o[c.technique]),u.technique.values=cw(u.technique,r)),r.removeObjectExtension(u,"KHR_techniques_webgl")}catch(t){a.e(t)}finally{a.f()}r.removeExtension("KHR_techniques_webgl")}case 4:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function aw(t,e){return sw.apply(this,arguments)}function sw(){return(sw=Ds()(js.a.mark((function t(e,r){return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function uw(t,e){var r=t.programs,n=void 0===r?[]:r,i=t.shaders,o=void 0===i?[]:i,a=t.techniques,s=void 0===a?[]:a,u=new TextDecoder;return o.forEach((function(t){if(!Number.isFinite(t.bufferView))throw new Error("KHR_techniques_webgl: no shader code");t.code=u.decode(e.getTypedArrayForBufferView(t.bufferView))})),n.forEach((function(t){t.fragmentShader=o[t.fragmentShader],t.vertexShader=o[t.vertexShader]})),s.forEach((function(t){t.program=n[t.program]})),s}function cw(t,e){var r=Object.assign({},t.values);return Object.keys(t.uniforms||{}).forEach((function(e){!t.uniforms[e].value||e in r||(r[e]=t.uniforms[e].value)})),Object.keys(r).forEach((function(t){"object"===Ns()(r[t])&&void 0!==r[t].index&&(r[t].texture=e.getTexture(r[t].index))})),r}var lw="EXT_feature_metadata";function fw(t){return hw.apply(this,arguments)}function hw(){return(hw=Ds()(js.a.mark((function t(e){return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:dw(new Rb(e));case 2:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function dw(t){var e,r=t.getExtension("EXT_feature_metadata"),n=null==r?void 0:null===(e=r.schema)||void 0===e?void 0:e.classes,i=null==r?void 0:r.featureTables;if((null==r?void 0:r.featureTextures)&&console.warn('featureTextures is not yet supported in the "EXT_feature_metadata" extension.'),n&&i)for(var o in n){var a=n[o],s=yw(i,o);s&&pw(t,s,a)}}function pw(t,e,r){for(var n in r.properties){var i,o=r.properties[n],a=null==e?void 0:null===(i=e.properties)||void 0===i?void 0:i[n],s=e.count;if(a){var u=vw(t,o,s,a);a.data=u}}}function vw(t,e,r,n){var i=n.bufferView,o=t.getTypedArrayForBufferView(i);switch(e.type){case"STRING":var a=n.stringOffsetBufferView;o=function(t,e,r){for(var n=[],i=new TextDecoder("utf8"),o=0,a=0;a<r;a++){var s=e[4*(a+1)]-e[4*a],u=t.subarray(o,s+o),c=i.decode(u);n.push(c),o+=s}return n}(o,t.getTypedArrayForBufferView(a),r)}return o}function yw(t,e){for(var r in t){var n=t[r];if(n.class===e)return n}return null}function gw(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return mw(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return mw(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function mw(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var bw=[i,o,a,s,c,l,f,u,h];function Aw(t){var e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,i=bw.filter((function(t){return _w(t.name,r)})),o=gw(i);try{for(o.s();!(e=o.n()).done;){var a,s=e.value;null===(a=s.preprocess)||void 0===a||a.call(s,t,r,n)}}catch(t){o.e(t)}finally{o.f()}}function ww(t){return Bw.apply(this,arguments)}function Bw(){return(Bw=Ds()(js.a.mark((function t(e){var r,n,i,o,a,s,u,c=arguments;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=c.length>1&&void 0!==c[1]?c[1]:{},n=c.length>2?c[2]:void 0,i=bw.filter((function(t){return _w(t.name,r)})),o=gw(i),t.prev=4,o.s();case 6:if((a=o.n()).done){t.next=12;break}return s=a.value,t.next=10,null===(u=s.decode)||void 0===u?void 0:u.call(s,e,r,n);case 10:t.next=6;break;case 12:t.next=17;break;case 14:t.prev=14,t.t0=t.catch(4),o.e(t.t0);case 17:return t.prev=17,o.f(),t.finish(17);case 20:case"end":return t.stop()}}),t,null,[[4,14,17,20]])})))).apply(this,arguments)}function _w(t,e){var r,n=(null==e?void 0:null===(r=e.gltf)||void 0===r?void 0:r.excludeExtensions)||{};return!(t in n&&!n[t])}function xw(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return Cw(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Cw(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function Cw(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function kw(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return Ew(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ew(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function Ew(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var Ow,Tw={accessors:"accessor",animations:"animation",buffers:"buffer",bufferViews:"bufferView",images:"image",materials:"material",meshes:"mesh",nodes:"node",samplers:"sampler",scenes:"scene",skins:"skin",textures:"texture"},Sw={accessor:"accessors",animations:"animation",buffer:"buffers",bufferView:"bufferViews",image:"images",material:"materials",mesh:"meshes",node:"nodes",sampler:"samplers",scene:"scenes",skin:"skins",texture:"textures"},Mw=function(){function t(){ku()(this,t),Tu(this,"idToIndexMap",{animations:{},accessors:{},buffers:{},bufferViews:{},images:{},materials:{},meshes:{},nodes:{},samplers:{},scenes:{},skins:{},textures:{}}),Tu(this,"json",void 0)}return Ou()(t,[{key:"normalize",value:function(t,e){this.json=t.json;var r=t.json;switch(r.asset&&r.asset.version){case"2.0":return;case void 0:case"1.0":break;default:return void console.warn("glTF: Unknown version ".concat(r.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(r),this._convertTopLevelObjectsToArrays(r),function(t){var e,r=new Rb(t),n=r.json,i=xw(n.images||[]);try{for(i.s();!(e=i.n()).done;){var o=e.value,a=r.getObjectExtension(o,"KHR_binary_glTF");a&&Object.assign(o,a),r.removeObjectExtension(o,"KHR_binary_glTF")}}catch(t){i.e(t)}finally{i.f()}n.buffers&&n.buffers[0]&&delete n.buffers[0].uri,r.removeExtension("KHR_binary_glTF")}(t),this._convertObjectIdsToArrayIndices(r),this._updateObjects(r),this._updateMaterial(r)}},{key:"_addAsset",value:function(t){t.asset=t.asset||{},t.asset.version="2.0",t.asset.generator=t.asset.generator||"Normalized to glTF 2.0 by loaders.gl"}},{key:"_convertTopLevelObjectsToArrays",value:function(t){for(var e in Tw)this._convertTopLevelObjectToArray(t,e)}},{key:"_convertTopLevelObjectToArray",value:function(t,e){var r=t[e];if(r&&!Array.isArray(r))for(var n in t[e]=[],r){var i=r[n];i.id=i.id||n;var o=t[e].length;t[e].push(i),this.idToIndexMap[e][n]=o}}},{key:"_convertObjectIdsToArrayIndices",value:function(t){for(var e in Tw)this._convertIdsToIndices(t,e);"scene"in t&&(t.scene=this._convertIdToIndex(t.scene,"scene"));var r,n=kw(t.textures);try{for(n.s();!(r=n.n()).done;){var i=r.value;this._convertTextureIds(i)}}catch(t){n.e(t)}finally{n.f()}var o,a=kw(t.meshes);try{for(a.s();!(o=a.n()).done;){var s=o.value;this._convertMeshIds(s)}}catch(t){a.e(t)}finally{a.f()}var u,c=kw(t.nodes);try{for(c.s();!(u=c.n()).done;){var l=u.value;this._convertNodeIds(l)}}catch(t){c.e(t)}finally{c.f()}var f,h=kw(t.scenes);try{for(h.s();!(f=h.n()).done;){var d=f.value;this._convertSceneIds(d)}}catch(t){h.e(t)}finally{h.f()}}},{key:"_convertTextureIds",value:function(t){t.source&&(t.source=this._convertIdToIndex(t.source,"image"))}},{key:"_convertMeshIds",value:function(t){var e,r=kw(t.primitives);try{for(r.s();!(e=r.n()).done;){var n=e.value,i=n.attributes,o=n.indices,a=n.material;for(var s in i)i[s]=this._convertIdToIndex(i[s],"accessor");o&&(n.indices=this._convertIdToIndex(o,"accessor")),a&&(n.material=this._convertIdToIndex(a,"material"))}}catch(t){r.e(t)}finally{r.f()}}},{key:"_convertNodeIds",value:function(t){var e=this;t.children&&(t.children=t.children.map((function(t){return e._convertIdToIndex(t,"node")}))),t.meshes&&(t.meshes=t.meshes.map((function(t){return e._convertIdToIndex(t,"mesh")})))}},{key:"_convertSceneIds",value:function(t){var e=this;t.nodes&&(t.nodes=t.nodes.map((function(t){return e._convertIdToIndex(t,"node")})))}},{key:"_convertIdsToIndices",value:function(t,e){t[e]||(console.warn("gltf v1: json doesn't contain attribute ".concat(e)),t[e]=[]);var r,n=kw(t[e]);try{for(n.s();!(r=n.n()).done;){var i=r.value;for(var o in i){var a=i[o],s=this._convertIdToIndex(a,o);i[o]=s}}}catch(t){n.e(t)}finally{n.f()}}},{key:"_convertIdToIndex",value:function(t,e){var r=Sw[e];if(r in this.idToIndexMap){var n=this.idToIndexMap[r][t];if(!Number.isFinite(n))throw new Error("gltf v1: failed to resolve ".concat(e," with id ").concat(t));return n}return t}},{key:"_updateObjects",value:function(t){var e,r=kw(this.json.buffers);try{for(r.s();!(e=r.n()).done;){delete e.value.type}}catch(t){r.e(t)}finally{r.f()}}},{key:"_updateMaterial",value:function(t){var e,r=kw(t.materials);try{var n=function(){var r=e.value;r.pbrMetallicRoughness={baseColorFactor:[1,1,1,1],metallicFactor:1,roughnessFactor:1};var n=(null===(i=r.values)||void 0===i?void 0:i.tex)||(null===(o=r.values)||void 0===o?void 0:o.texture2d_0)||(null===(a=r.values)||void 0===a?void 0:a.diffuseTex),s=t.textures.findIndex((function(t){return t.id===n}));-1!==s&&(r.pbrMetallicRoughness.baseColorTexture={index:s})};for(r.s();!(e=r.n()).done;){var i,o,a;n()}}catch(t){r.e(t)}finally{r.f()}}}]),t}();function Iw(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(new Mw).normalize(t,e)}function Rw(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Pw(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Rw(Object(r),!0).forEach((function(e){Ys()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Rw(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var Fw={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Dw={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},Lw=10240,jw=10241,Gw=10242,Nw=10243,Uw=10497,Hw=9729,Vw=9986,Jw={magFilter:Lw,minFilter:jw,wrapS:Gw,wrapT:Nw},zw=(Ow={},Ys()(Ow,Lw,Hw),Ys()(Ow,jw,Vw),Ys()(Ow,Gw,Uw),Ys()(Ow,Nw,Uw),Ow);var Kw=function(){function t(){ku()(this,t),Tu(this,"baseUri",""),Tu(this,"json",{}),Tu(this,"buffers",[]),Tu(this,"images",[])}return Ou()(t,[{key:"postProcess",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.json,n=t.buffers,i=void 0===n?[]:n,o=t.images,a=void 0===o?[]:o,s=t.baseUri,u=void 0===s?"":s;return db(r),this.baseUri=u,this.json=r,this.buffers=i,this.images=a,this._resolveTree(this.json,e),this.json}},{key:"_resolveTree",value:function(t){var e=this;arguments.length>1&&void 0!==arguments[1]&&arguments[1];t.bufferViews&&(t.bufferViews=t.bufferViews.map((function(t,r){return e._resolveBufferView(t,r)}))),t.images&&(t.images=t.images.map((function(t,r){return e._resolveImage(t,r)}))),t.samplers&&(t.samplers=t.samplers.map((function(t,r){return e._resolveSampler(t,r)}))),t.textures&&(t.textures=t.textures.map((function(t,r){return e._resolveTexture(t,r)}))),t.accessors&&(t.accessors=t.accessors.map((function(t,r){return e._resolveAccessor(t,r)}))),t.materials&&(t.materials=t.materials.map((function(t,r){return e._resolveMaterial(t,r)}))),t.meshes&&(t.meshes=t.meshes.map((function(t,r){return e._resolveMesh(t,r)}))),t.nodes&&(t.nodes=t.nodes.map((function(t,r){return e._resolveNode(t,r)}))),t.skins&&(t.skins=t.skins.map((function(t,r){return e._resolveSkin(t,r)}))),t.scenes&&(t.scenes=t.scenes.map((function(t,r){return e._resolveScene(t,r)}))),void 0!==t.scene&&(t.scene=t.scenes[this.json.scene])}},{key:"getScene",value:function(t){return this._get("scenes",t)}},{key:"getNode",value:function(t){return this._get("nodes",t)}},{key:"getSkin",value:function(t){return this._get("skins",t)}},{key:"getMesh",value:function(t){return this._get("meshes",t)}},{key:"getMaterial",value:function(t){return this._get("materials",t)}},{key:"getAccessor",value:function(t){return this._get("accessors",t)}},{key:"getCamera",value:function(t){return null}},{key:"getTexture",value:function(t){return this._get("textures",t)}},{key:"getSampler",value:function(t){return this._get("samplers",t)}},{key:"getImage",value:function(t){return this._get("images",t)}},{key:"getBufferView",value:function(t){return this._get("bufferViews",t)}},{key:"getBuffer",value:function(t){return this._get("buffers",t)}},{key:"_get",value:function(t,e){if("object"===Ns()(e))return e;var r=this.json[t]&&this.json[t][e];return r||console.warn("glTF file error: Could not find ".concat(t,"[").concat(e,"]")),r}},{key:"_resolveScene",value:function(t,e){var r=this;return t.id=t.id||"scene-".concat(e),t.nodes=(t.nodes||[]).map((function(t){return r.getNode(t)})),t}},{key:"_resolveNode",value:function(t,e){var r=this;return t.id=t.id||"node-".concat(e),t.children&&(t.children=t.children.map((function(t){return r.getNode(t)}))),void 0!==t.mesh?t.mesh=this.getMesh(t.mesh):void 0!==t.meshes&&t.meshes.length&&(t.mesh=t.meshes.reduce((function(t,e){var n=r.getMesh(e);return t.id=n.id,t.primitives=t.primitives.concat(n.primitives),t}),{primitives:[]})),void 0!==t.camera&&(t.camera=this.getCamera(t.camera)),void 0!==t.skin&&(t.skin=this.getSkin(t.skin)),t}},{key:"_resolveSkin",value:function(t,e){return t.id=t.id||"skin-".concat(e),t.inverseBindMatrices=this.getAccessor(t.inverseBindMatrices),t}},{key:"_resolveMesh",value:function(t,e){var r=this;return t.id=t.id||"mesh-".concat(e),t.primitives&&(t.primitives=t.primitives.map((function(t){var e=(t=Pw({},t)).attributes;for(var n in t.attributes={},e)t.attributes[n]=r.getAccessor(e[n]);return void 0!==t.indices&&(t.indices=r.getAccessor(t.indices)),void 0!==t.material&&(t.material=r.getMaterial(t.material)),t}))),t}},{key:"_resolveMaterial",value:function(t,e){if(t.id=t.id||"material-".concat(e),t.normalTexture&&(t.normalTexture=Pw({},t.normalTexture),t.normalTexture.texture=this.getTexture(t.normalTexture.index)),t.occlusionTexture&&(t.occlustionTexture=Pw({},t.occlustionTexture),t.occlusionTexture.texture=this.getTexture(t.occlusionTexture.index)),t.emissiveTexture&&(t.emmisiveTexture=Pw({},t.emmisiveTexture),t.emissiveTexture.texture=this.getTexture(t.emissiveTexture.index)),t.emissiveFactor||(t.emissiveFactor=t.emmisiveTexture?[1,1,1]:[0,0,0]),t.pbrMetallicRoughness){t.pbrMetallicRoughness=Pw({},t.pbrMetallicRoughness);var r=t.pbrMetallicRoughness;r.baseColorTexture&&(r.baseColorTexture=Pw({},r.baseColorTexture),r.baseColorTexture.texture=this.getTexture(r.baseColorTexture.index)),r.metallicRoughnessTexture&&(r.metallicRoughnessTexture=Pw({},r.metallicRoughnessTexture),r.metallicRoughnessTexture.texture=this.getTexture(r.metallicRoughnessTexture.index))}return t}},{key:"_resolveAccessor",value:function(t,e){var r,n;if(t.id=t.id||"accessor-".concat(e),void 0!==t.bufferView&&(t.bufferView=this.getBufferView(t.bufferView)),t.bytesPerComponent=(r=t.componentType,Dw[r]),t.components=(n=t.type,Fw[n]),t.bytesPerElement=t.bytesPerComponent*t.components,t.bufferView){var i=t.bufferView.buffer,o=kb(t,t.bufferView),a=o.ArrayType,s=o.byteLength,u=(t.bufferView.byteOffset||0)+(t.byteOffset||0)+i.byteOffset,c=i.arrayBuffer.slice(u,u+s);t.bufferView.byteStride&&(c=this._getValueFromInterleavedBuffer(i,u,t.bufferView.byteStride,t.bytesPerElement,t.count)),t.value=new a(c)}return t}},{key:"_getValueFromInterleavedBuffer",value:function(t,e,r,n,i){for(var o=new Uint8Array(i*n),a=0;a<i;a++){var s=e+a*r;o.set(new Uint8Array(t.arrayBuffer.slice(s,s+n)),a*n)}return o.buffer}},{key:"_resolveTexture",value:function(t,e){return t.id=t.id||"texture-".concat(e),t.sampler="sampler"in t?this.getSampler(t.sampler):zw,t.source=this.getImage(t.source),t}},{key:"_resolveSampler",value:function(t,e){for(var r in t.id=t.id||"sampler-".concat(e),t.parameters={},t){var n=this._enumSamplerParameter(r);void 0!==n&&(t.parameters[n]=t[r])}return t}},{key:"_enumSamplerParameter",value:function(t){return Jw[t]}},{key:"_resolveImage",value:function(t,e){t.id=t.id||"image-".concat(e),void 0!==t.bufferView&&(t.bufferView=this.getBufferView(t.bufferView));var r=this.images[e];return r&&(t.image=r),t}},{key:"_resolveBufferView",value:function(t,e){var r=t.buffer,n=Pw(Pw({id:"bufferView-".concat(e)},t),{},{buffer:this.buffers[r]}),i=this.buffers[r].arrayBuffer,o=this.buffers[r].byteOffset||0;return"byteOffset"in t&&(o+=t.byteOffset),n.data=new Uint8Array(i,o,t.byteLength),n}},{key:"_resolveCamera",value:function(t,e){return t.id=t.id||"camera-".concat(e),t.perspective,t.orthographic,t}}]),t}();function qw(t,e){return(new Kw).postProcess(t,e)}function Ww(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return"".concat(String.fromCharCode(t.getUint8(e+0))).concat(String.fromCharCode(t.getUint8(e+1))).concat(String.fromCharCode(t.getUint8(e+2))).concat(String.fromCharCode(t.getUint8(e+3)))}function Qw(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=new DataView(t),i=r.magic,o=void 0===i?1735152710:i,a=n.getUint32(e,!1);return a===o||1735152710===a}function Xw(t,e,r){Zs(t.header.byteLength>20);var n=e.getUint32(r+0,!0),i=e.getUint32(r+4,!0);return r+=8,Zs(0===i),Zw(t,e,r,n),r+=n,r+=$w(t,e,r,t.header.byteLength)}function Yw(t,e,r,n){return Zs(t.header.byteLength>20),function(t,e,r,n){for(;r+8<=t.header.byteLength;){var i=e.getUint32(r+0,!0),o=e.getUint32(r+4,!0);switch(r+=8,o){case 1313821514:Zw(t,e,r,i);break;case 5130562:$w(t,e,r,i);break;case 0:n.strict||Zw(t,e,r,i);break;case 1:n.strict||$w(t,e,r,i)}r+=yb(i,4)}}(t,e,r,n),r+t.header.byteLength}function Zw(t,e,r,n){var i=new Uint8Array(e.buffer,r,n),o=new TextDecoder("utf8").decode(i);return t.json=JSON.parse(o),yb(n,4)}function $w(t,e,r,n){return t.header.hasBinChunk=!0,t.binChunks.push({byteOffset:r,byteLength:n,arrayBuffer:e.buffer}),yb(n,4)}function tB(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return eB(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return eB(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function eB(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function rB(t,e){return nB.apply(this,arguments)}function nB(){return(nB=Ds()(js.a.mark((function t(e,r){var n,i,o,a,s,u,c,l,f,h,d=arguments;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=d.length>2&&void 0!==d[2]?d[2]:0,i=d.length>3?d[3]:void 0,o=d.length>4?d[4]:void 0,iB(e,r,n,i),Iw(e,{normalize:null==i?void 0:null===(a=i.gltf)||void 0===a?void 0:a.normalize}),Aw(e,i,o),l=[],null==i||null===(s=i.gltf)||void 0===s||!s.loadBuffers||!e.json.buffers){t.next=10;break}return t.next=10,oB(e,i,o);case 10:return null!=i&&null!==(u=i.gltf)&&void 0!==u&&u.loadImages&&(f=sB(e,i,o),l.push(f)),h=ww(e,i,o),l.push(h),t.next=15,Promise.all(l);case 15:return t.abrupt("return",null!=i&&null!==(c=i.gltf)&&void 0!==c&&c.postProcess?qw(e,i):e);case 16:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function iB(t,e,r,n){(n.uri&&(t.baseUri=n.uri),e instanceof ArrayBuffer&&!Qw(e,r,n))&&(e=(new TextDecoder).decode(e));if("string"==typeof e)t.json=hb(e);else if(e instanceof ArrayBuffer){var i={};r=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=(arguments.length>3&&void 0!==arguments[3]&&arguments[3],new DataView(e)),i=Ww(n,r+0),o=n.getUint32(r+4,!0),a=n.getUint32(r+8,!0);switch(Object.assign(t,{header:{byteOffset:r,byteLength:a,hasBinChunk:!1},type:i,version:o,json:{},binChunks:[]}),r+=12,t.version){case 1:return Xw(t,n,r);case 2:return Yw(t,n,r,{});default:throw new Error("Invalid GLB version ".concat(t.version,". Only supports v1 and v2."))}}(i,e,r,n.glb),db("glTF"===i.type,"Invalid GLB magic string ".concat(i.type)),t._glb=i,t.json=i.json}else db(!1,"GLTF: must be ArrayBuffer or string");var o=t.json.buffers||[];if(t.buffers=new Array(o.length).fill(null),t._glb&&t._glb.header.hasBinChunk){var a=t._glb.binChunks;t.buffers[0]={arrayBuffer:a[0].arrayBuffer,byteOffset:a[0].byteOffset,byteLength:a[0].byteLength}}var s=t.json.images||[];t.images=new Array(s.length).fill({})}function oB(t,e,r){return aB.apply(this,arguments)}function aB(){return(aB=Ds()(js.a.mark((function t(e,r,n){var i,o,a,s,u,c,l,f;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:i=e.json.buffers||[],o=0;case 2:if(!(o<i.length)){t.next=22;break}if(!(a=i[o]).uri){t.next=18;break}return db(n.fetch),c=pb(a.uri,r),t.next=10,null==n?void 0:null===(s=n.fetch)||void 0===s?void 0:s.call(n,c);case 10:return l=t.sent,t.next=13,null==l?void 0:null===(u=l.arrayBuffer)||void 0===u?void 0:u.call(l);case 13:f=t.sent,e.buffers[o]={arrayBuffer:f,byteOffset:0,byteLength:f.byteLength},delete a.uri,t.next=19;break;case 18:null===e.buffers[o]&&(e.buffers[o]={arrayBuffer:new ArrayBuffer(a.byteLength),byteOffset:0,byteLength:a.byteLength});case 19:++o,t.next=2;break;case 22:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function sB(t,e,r){return uB.apply(this,arguments)}function uB(){return(uB=Ds()(js.a.mark((function t(e,r,n){var i,o,a,s,u,c;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:i=cB(e),o=e.json.images||[],a=[],s=tB(i);try{for(s.s();!(u=s.n()).done;)c=u.value,a.push(lB(e,o[c],c,r,n))}catch(t){s.e(t)}finally{s.f()}return t.next=7,Promise.all(a);case 7:return t.abrupt("return",t.sent);case 8:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function cB(t){var e,r=new Set,n=tB(t.json.textures||[]);try{for(n.s();!(e=n.n()).done;){var i=e.value;void 0!==i.source&&r.add(i.source)}}catch(t){n.e(t)}finally{n.f()}return Array.from(r).sort()}function lB(t,e,r,n,i){return fB.apply(this,arguments)}function fB(){return(fB=Ds()(js.a.mark((function t(e,r,n,i,o){var a,s,u,c,l,f,h;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(a=o.fetch,s=o.parse,!r.uri||r.hasOwnProperty("bufferView")){t.next=10;break}return c=pb(r.uri,i),t.next=5,a(c);case 5:return l=t.sent,t.next=8,l.arrayBuffer();case 8:u=t.sent,r.bufferView={data:u};case 10:return Number.isFinite(r.bufferView)&&(f=vb(e.json,e.buffers,r.bufferView),u=al(f.buffer,f.byteOffset,f.byteLength)),db(u,"glTF image has no data"),t.next=14,s(u,[lb,Rm],{mimeType:r.mimeType,basis:i.basis||{format:Tm()}},o);case 14:(h=t.sent)&&h[0]&&(h={compressed:!0,mipmaps:!1,width:h[0].width,height:h[0].height,data:h[0]}),e.images=e.images||[],e.images[n]=h;case 18:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function hB(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function dB(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?hB(Object(r),!0).forEach((function(e){Ys()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):hB(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var pB={name:"glTF",id:"gltf",module:"gltf",version:"3.3.0-alpha.5",extensions:["gltf","glb"],mimeTypes:["model/gltf+json","model/gltf-binary"],text:!0,binary:!0,tests:["glTF"],parse:function(t){return vB.apply(this,arguments)},options:{gltf:{normalize:!0,loadBuffers:!0,loadImages:!0,decompressMeshes:!0,postProcess:!0},log:console},deprecatedOptions:{fetchImages:"gltf.loadImages",createImages:"gltf.loadImages",decompress:"gltf.decompressMeshes",postProcess:"gltf.postProcess",gltf:{decompress:"gltf.decompressMeshes"}}};function vB(){return(vB=Ds()(js.a.mark((function t(e){var r,n,i,o,a,s=arguments;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=s.length>1&&void 0!==s[1]?s[1]:{},n=s.length>2?s[2]:void 0,(r=dB(dB({},pB.options),r)).gltf=dB(dB({},pB.options.gltf),r.gltf),i=r.byteOffset,o=void 0===i?0:i,a={},t.next=8,rB(a,e,o,r,n);case 8:return t.abrupt("return",t.sent);case 9:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var yB=0,gB=1;function mB(t,e,r,n){t.rotateYtoZ=!0;var i=t.byteOffset+t.byteLength-r;if(0===i)throw new Error("glTF byte length must be greater than 0.");return t.gltfUpAxis=n["3d-tiles"]&&n["3d-tiles"].assetGltfUpAxis?n["3d-tiles"].assetGltfUpAxis:"Y",t.gltfArrayBuffer=al(e,r,i),t.gltfByteOffset=0,t.gltfByteLength=i,r%4==0||console.warn("".concat(t.type,": embedded glb is not aligned to a 4-byte boundary.")),t.byteOffset+t.byteLength}function bB(t,e,r,n){return AB.apply(this,arguments)}function AB(){return(AB=Ds()(js.a.mark((function t(e,r,n,i){var o,a,s;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(o=n["3d-tiles"]||{},wB(e,r,n),!o.loadGLTF){t.next=16;break}if(a=i.parse,s=i.fetch,!e.gltfUrl){t.next=9;break}return t.next=7,s(e.gltfUrl,n);case 7:e.gltfArrayBuffer=t.sent,e.gltfByteOffset=0;case 9:if(!e.gltfArrayBuffer){t.next=16;break}return t.next=12,a(e.gltfArrayBuffer,pB,n,i);case 12:e.gltf=t.sent,delete e.gltfArrayBuffer,delete e.gltfByteOffset,delete e.gltfByteLength;case 16:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function wB(t,e,r){switch(e){case yB:var n=new Uint8Array(t.gltfArrayBuffer,t.gltfByteOffset),i=(new TextDecoder).decode(n);t.gltfUrl=i.replace(/[\s\0]+$/,""),delete t.gltfArrayBuffer,delete t.gltfByteOffset,delete t.gltfByteLength;break;case gB:break;default:throw new Error("b3dm: Illegal glTF format field")}}function BB(t,e,r,n,i){return _B.apply(this,arguments)}function _B(){return(_B=Ds()(js.a.mark((function t(e,r,n,i,o){var a,s;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=xB(e,r,n,i,o),t.next=3,bB(e,gB,i,o);case 3:return(s=null==e?void 0:null===(a=e.gltf)||void 0===a?void 0:a.extensions)&&s.CESIUM_RTC&&(e.rtcCenter=s.CESIUM_RTC.center),t.abrupt("return",n);case 6:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function xB(t,e,r,n,i){r=mB(t,e,r=bg(t,e,r=mg(t,e,r=gg(t,e,r))),n);var o=new og(t.featureTableJson,t.featureTableBinary);return t.rtcCenter=o.getGlobalProperty("RTC_CENTER",5126,3),r}function CB(t,e,r,n,i){return kB.apply(this,arguments)}function kB(){return(kB=Ds()(js.a.mark((function t(e,r,n,i,o){return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=EB(e,r,n,i,o),t.next=3,bB(e,e.gltfFormat,i,o);case 3:return t.abrupt("return",n);case 4:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function EB(t,e,r,n,i){if(r=gg(t,e,r),1!==t.version)throw new Error("Instanced 3D Model version ".concat(t.version," is not supported"));r=mg(t,e,r);var o=new DataView(e);if(t.gltfFormat=o.getUint32(r,!0),r=mB(t,e,r=bg(t,e,r+=4),n),0===t.featureTableJsonByteLength)throw new Error("i3dm parser: featureTableJsonByteLength is zero.");var a=new og(t.featureTableJson,t.featureTableBinary),s=a.getGlobalProperty("INSTANCES_LENGTH");if(a.featuresLength=s,!Number.isFinite(s))throw new Error("i3dm parser: INSTANCES_LENGTH must be defined");t.eastNorthUp=a.getGlobalProperty("EAST_NORTH_UP"),t.rtcCenter=a.getGlobalProperty("RTC_CENTER",5126,3);new yg(t.batchTableJson,t.batchTableBinary,s);return function(t,e,r,n){for(var i=[new Array(n),t._batchTable][0],o=new Lh,a=(new Lh,new Lh,new Lh,new Pd),s=new Xd,u=new Lh,c={},l=new Mh,f=[],h=[],d=new Lh,p=new Lh,v=0;v<n;v++){var y=void 0;if(e.hasProperty("POSITION"))y=e.getProperty("POSITION",5126,3,v,o);else if(e.hasProperty("POSITION_QUANTIZED")){y=e.getProperty("POSITION_QUANTIZED",5123,3,v,o);var g=e.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",5126,3,d);if(!g)throw new Error("i3dm parser: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");var m=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",5126,3,p);if(!m)throw new Error("i3dm parser: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");for(var b=0;b<3;b++)y[b]=y[b]/65535*m[b]+g[b]}if(!y)throw new Error("i3dm: POSITION or POSITION_QUANTIZED must be defined for each instance.");o.copy(y),c.translation=o,t.normalUp=e.getProperty("NORMAL_UP",5126,3,v,f),t.normalRight=e.getProperty("NORMAL_RIGHT",5126,3,v,h);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",5123,2,f),t.octNormalRight=e.getProperty("NORMAL_RIGHT_OCT32P",5123,2,h),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?(fd.WGS84.eastNorthUpToFixedFrame(o,l),l.getRotationMatrix3(a)):a.identity()}!1,s.fromMatrix3(a),c.rotation=s,u.set(1,1,1);var A=e.getProperty("SCALE",5126,1,v);Number.isFinite(A)&&u.multiplyByScalar(A);var w=e.getProperty("SCALE_NON_UNIFORM",5126,3,v,f);w&&u.scale(w),c.scale=u;var B=e.getProperty("BATCH_ID",5123,1,v);void 0===B&&(B=v);var _=(new Mh).fromQuaternion(c.rotation);l.identity(),l.translate(c.translation),l.multiplyRight(_),l.scale(c.scale);var x=l.clone();i[v]={modelMatrix:x,batchId:B}}t.instances=i}(t,a,0,s),r}function OB(t,e,r,n,i,o){return TB.apply(this,arguments)}function TB(){return(TB=Ds()(js.a.mark((function t(e,r,n,i,o,a){var s,u;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=gg(e,r,n),s=new DataView(r),e.tilesLength=s.getUint32(n,!0),n+=4,e.tiles=[];case 5:if(!(e.tiles.length<e.tilesLength&&e.byteLength-n>12)){t.next=13;break}return u={},e.tiles.push(u),t.next=10,a(r,n,i,o,u);case 10:n=t.sent,t.next=5;break;case 13:return t.abrupt("return",n);case 14:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function SB(t,e,r,n){return MB.apply(this,arguments)}function MB(){return(MB=Ds()(js.a.mark((function t(e,r,n,i){var o;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e.rotateYtoZ=!0,e.gltfUpAxis=n["3d-tiles"]&&n["3d-tiles"].assetGltfUpAxis?n["3d-tiles"].assetGltfUpAxis:"Y",o=i.parse,t.next=5,o(r,pB,n,i);case 5:e.gltf=t.sent;case 6:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function IB(t){return RB.apply(this,arguments)}function RB(){return(RB=Ds()(js.a.mark((function t(e){var r,n,i,o,a=arguments;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=a.length>1&&void 0!==a[1]?a[1]:0,n=a.length>2?a[2]:void 0,i=a.length>3?a[3]:void 0,(o=a.length>4&&void 0!==a[4]?a[4]:{}).byteOffset=r,o.type=qv(e,r),t.t0=o.type,t.next=t.t0===zv.COMPOSITE?9:t.t0===zv.BATCHED_3D_MODEL?12:t.t0===zv.GLTF?15:t.t0===zv.INSTANCED_3D_MODEL?18:t.t0===zv.POINT_CLOUD?21:24;break;case 9:return t.next=11,OB(o,e,r,n,i,IB);case 11:return t.abrupt("return",t.sent);case 12:return t.next=14,BB(o,e,r,n,i);case 14:return t.abrupt("return",t.sent);case 15:return t.next=17,SB(o,e,n,i);case 17:return t.abrupt("return",t.sent);case 18:return t.next=20,CB(o,e,r,n,i);case 20:return t.abrupt("return",t.sent);case 21:return t.next=23,Rg(o,e,r,n,i);case 23:return t.abrupt("return",t.sent);case 24:throw new Error("3DTileLoader: unknown type ".concat(o.type));case 25:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function PB(){return(PB=Ds()(js.a.mark((function t(e,r,n){var i,o,a,s,u,c,l;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(1952609651===new Uint32Array(e.slice(0,4))[0]){t.next=3;break}throw new Error("Wrong subtree file magic number");case 3:if(1===new Uint32Array(e.slice(4,8))[0]){t.next=6;break}throw new Error("Wrong subtree file verson, must be 1");case 6:if(i=jB(e.slice(8,16)),o=new Uint8Array(e,24,i),a=new TextDecoder("utf8"),s=a.decode(o),u=JSON.parse(s),c=jB(e.slice(16,24)),l=new ArrayBuffer(0),c&&(l=e.slice(24+i)),!("bufferView"in u.tileAvailability)){t.next=18;break}return t.next=17,DB(u,"tileAvailability",l,n);case 17:u.tileAvailability.explicitBitstream=t.sent;case 18:if(!("bufferView"in u.contentAvailability)){t.next=22;break}return t.next=21,DB(u,"contentAvailability",l,n);case 21:u.contentAvailability.explicitBitstream=t.sent;case 22:if(!("bufferView"in u.childSubtreeAvailability)){t.next=26;break}return t.next=25,DB(u,"childSubtreeAvailability",l,n);case 25:u.childSubtreeAvailability.explicitBitstream=t.sent;case 26:return t.abrupt("return",u);case 27:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function FB(t,e){if(e.startsWith("http")){var r=new URL(t,e);return decodeURI(r.toString())}var n="http://".concat(e),i=new URL(t,n);return"/".concat(i.host).concat(i.pathname)}function DB(t,e,r,n){return LB.apply(this,arguments)}function LB(){return(LB=Ds()(js.a.mark((function t(e,r,n,i){var o,a,s,u,c,l;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(o=e[r].bufferView,a=e.bufferViews[o],s=e.buffers[a.buffer],null!=i&&i.url&&i.fetch){t.next=5;break}throw new Error("Url is not provided");case 5:if(i.fetch){t.next=7;break}throw new Error("fetch is not provided");case 7:if(!s.uri){t.next=16;break}return u=FB(s.uri,null==i?void 0:i.url),t.next=11,i.fetch(u);case 11:return c=t.sent,t.next=14,c.arrayBuffer();case 14:return l=t.sent,t.abrupt("return",new Uint8Array(l,a.byteOffset,a.byteLength));case 16:return t.abrupt("return",new Uint8Array(n,a.byteOffset,a.byteLength));case 17:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function jB(t){var e=new DataView(t),r=e.getUint32(0,!0),n=e.getUint32(4,!0);return r+Math.pow(2,32)*n}var GB={id:"3d-tiles-subtree",name:"3D Tiles Subtree",module:"3d-tiles",version:"3.3.0-alpha.5",extensions:["subtree"],mimeTypes:["application/octet-stream"],tests:["subtree"],parse:function(t,e,r){return PB.apply(this,arguments)},options:{}},NB={QUADTREE:4,OCTREE:8};function UB(t){return HB.apply(this,arguments)}function HB(){return(HB=Ds()(js.a.mark((function t(e){var r,n,i,o,a,s,u,c,l,f,h,d,p,v,y,g,m,b,A,w,B,_,x,C,k,E,O,T,S,M,I,R,P,F,D,L,j,G,N,U;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.options,n=e.parentData,i=void 0===n?{mortonIndex:0,x:0,y:0,z:0}:n,o=e.childIndex,a=void 0===o?0:o,s=e.globalData,u=void 0===s?{level:0,mortonIndex:0,x:0,y:0,z:0}:s,c=e.subtree,l=e.level,f=void 0===l?0:l,h=r.subdivisionScheme,d=r.subtreeLevels,p=r.maximumLevel,v=r.contentUrlTemplate,y=r.subtreesUriTemplate,g=r.basePath,m={children:[],lodMetricValue:0,contentUrl:""},b=NB[h],A=1&a,w=a>>1&1,B=a>>2&1,_=(Math.pow(b,f)-1)/(b-1),x=zB(i.mortonIndex,a),C=_+x,k=zB(i.x,A),E=zB(i.y,w),O=zB(i.z,B),T=!1,f+1>d&&(T=VB(c.childSubtreeAvailability,x)),S=zB(u.x,k),M=zB(u.y,E),I=zB(u.z,O),R=f+u.level,!T){t.next=38;break}return P="".concat(g,"/").concat(y),F=KB(P,R,S,M,I),t.next=25,Ef(F,GB);case 25:D=t.sent,c=D,u.mortonIndex=x,u.x=k,u.y=E,u.z=O,u.level=f,x=0,C=0,k=0,E=0,O=0,f=0;case 38:if(VB(c.tileAvailability,C)&&!(f>p)){t.next=41;break}return t.abrupt("return",m);case 41:VB(c.contentAvailability,C)&&(m.contentUrl=KB(v,R,S,M,I)),L=f+1,j={mortonIndex:x,x:k,y:E,z:O},G=0;case 46:if(!(G<b)){t.next=54;break}return t.next=49,UB({subtree:c,options:r,parentData:j,childIndex:G,level:L,globalData:u});case 49:((N=t.sent).contentUrl||N.children.length)&&(U=JB(N,R+1,{childTileX:k,childTileY:E,childTileZ:O},r),m.children.push(U));case 51:G++,t.next=46;break;case 54:return t.abrupt("return",m);case 55:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function VB(t,e){return"constant"in t?Boolean(t.constant):!!t.explicitBitstream&&(r=e,n=t.explicitBitstream,i=Math.floor(r/8),o=r%8,1==(n[i]>>o&1));var r,n,i,o}function JB(t,e,r,n){var i=n.basePath,o=n.refine,a=n.getRefine,s=n.lodMetricType,u=n.getTileType,c=n.rootLodMetricValue,l=n.rootBoundingVolume,f=t.contentUrl&&t.contentUrl.replace("".concat(i,"/"),""),h=c/Math.pow(2,e),d=function(t,e,r){if(e.region){var n=r.childTileX,i=r.childTileY,o=r.childTileZ,a=Sf()(e.region,6),s=a[0],u=a[1],c=a[2],l=a[3],f=a[4],h=a[5],d=Math.pow(2,t),p=(c-s)/d,v=(l-u)/d,y=(h-f)/d;return{region:[s+p*n,u+v*i,s+p*(n+1),u+v*(i+1),f+y*o,f+y*(o+1)]}}return console.warn("Unsupported bounding volume type: ",e),null}(e,l,r);return{children:t.children,contentUrl:t.contentUrl,content:{uri:f},id:t.contentUrl,refine:a(o),type:u(t),lodMetricType:s,lodMetricValue:h,geometricError:h,transform:t.transform,boundingVolume:d}}function zB(t,e){return parseInt(t.toString(2)+e.toString(2),2)}function KB(t,e,r,n,i){var o=function(t){var e={};for(var r in t)e["{".concat(r,"}")]=t[r];return e}({level:e,x:r,y:n,z:i});return t.replace(/{level}|{x}|{y}|{z}/gi,(function(t){return o[t]}))}function qB(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return WB(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return WB(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function WB(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function QB(t){if(!t.contentUrl)return Up;var e=t.contentUrl.split(".").pop();switch(e){case"pnts":return Vp;case"i3dm":case"b3dm":case"glb":case"gltf":return Hp;default:return e}}function XB(t){switch(t){case"REPLACE":case"replace":return Np;case"ADD":case"add":return Gp;default:return t}}function YB(t,e){if(/^[a-z][0-9a-z+.-]*:/i.test(e)){var r=new URL(t,"".concat(e,"/"));return decodeURI(r.toString())}return t.startsWith("/")?t:"".concat(e,"/").concat(t)}function ZB(t,e){if(!t)return null;if(t.content){var r=t.content.uri||t.content.url;t.contentUrl=YB(r,e.basePath)}return t.id=t.contentUrl,t.lodMetricType=qp,t.lodMetricValue=t.geometricError,t.transformMatrix=t.transform,t.type=QB(t),t.refine=XB(t.refine),t}function $B(t,e){return t_.apply(this,arguments)}function t_(){return(t_=Ds()(js.a.mark((function t(e,r){var n,i,o,a,s,u,c,l,f,h;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=e.basePath,!(o=o_(null==e?void 0:e.root))||!e.root){t.next=8;break}return t.next=5,e_(e.root,e,o,r);case 5:i=t.sent,t.next=9;break;case 8:i=ZB(e.root,e);case 9:(a=[]).push(i);case 11:if(!(a.length>0)){t.next=40;break}s=a.pop()||{},u=s.children||[],c=qB(u),t.prev=15,c.s();case 17:if((l=c.n()).done){t.next=30;break}if(f=l.value,!(h=o_(f))){t.next=26;break}return t.next=23,e_(f,e,h,r);case 23:f=t.sent,t.next=27;break;case 26:ZB(f,{basePath:n});case 27:a.push(f);case 28:t.next=17;break;case 30:t.next=35;break;case 32:t.prev=32,t.t0=t.catch(15),c.e(t.t0);case 35:return t.prev=35,c.f(),t.finish(35);case 38:t.next=11;break;case 40:return t.abrupt("return",i);case 41:case"end":return t.stop()}}),t,null,[[15,32,35,38]])})))).apply(this,arguments)}function e_(t,e,r,n){return r_.apply(this,arguments)}function r_(){return(r_=Ds()(js.a.mark((function t(e,r,n,i){var o,a,s,u,c,l,f,h,d,p,v,y,g,m;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a=r.basePath,s=n.subdivisionScheme,u=n.maximumLevel,c=n.subtreeLevels,l=n.subtrees.uri,f=KB(l,0,0,0,0),h=YB(f,a),t.next=6,Ef(h,GB,i);case 6:return d=t.sent,p=YB(e.content.uri,a),v=null==r?void 0:null===(o=r.root)||void 0===o?void 0:o.refine,y=e.geometricError,g=e.boundingVolume,m={contentUrlTemplate:p,subtreesUriTemplate:l,subdivisionScheme:s,subtreeLevels:c,maximumLevel:u,refine:v,basePath:a,lodMetricType:qp,rootLodMetricValue:y,rootBoundingVolume:g,getTileType:QB,getRefine:XB},t.next=14,n_(e,d,m);case 14:return t.abrupt("return",t.sent);case 15:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function n_(t,e,r){return i_.apply(this,arguments)}function i_(){return(i_=Ds()(js.a.mark((function t(e,r,n){var i,o,a;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e){t.next=2;break}return t.abrupt("return",null);case 2:return e.lodMetricType=qp,e.lodMetricValue=e.geometricError,e.transformMatrix=e.transform,t.next=7,UB({subtree:r,options:n});case 7:return i=t.sent,o=i.children,(a=i.contentUrl)&&(e.contentUrl=a,e.content={uri:a.replace("".concat(n.basePath,"/"),"")}),e.refine=XB(e.refine),e.type=QB(e),e.children=o,e.id=e.contentUrl,t.abrupt("return",e);case 16:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function o_(t){var e;return(null==t?void 0:null===(e=t.extensions)||void 0===e?void 0:e["3DTILES_implicit_tiling"])||(null==t?void 0:t.implicitTiling)}var a_={id:"3d-tiles",name:"3D Tiles",module:"3d-tiles",version:"3.3.0-alpha.5",extensions:["cmpt","pnts","b3dm","i3dm"],mimeTypes:["application/octet-stream"],tests:["cmpt","pnts","b3dm","i3dm"],parse:function(t,e,r){return h_.apply(this,arguments)},options:{"3d-tiles":{loadGLTF:!0,decodeQuantizedPositions:!1,isTileset:"auto",assetGltfUpAxis:null}}};function s_(t){return n.dirname(t.url)}function u_(t,e,r){return c_.apply(this,arguments)}function c_(){return(c_=Ds()(js.a.mark((function t(e,r,n){var i;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i={content:{featureIds:null}},0,t.next=4,IB(e,0,r,n,i.content);case 4:return t.abrupt("return",i.content);case 5:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function l_(t,e,r){return f_.apply(this,arguments)}function f_(){return(f_=Ds()(js.a.mark((function t(e,r,n){var i,o;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return(o=JSON.parse((new TextDecoder).decode(e))).loader=r.loader||a_,o.url=n.url,o.basePath=s_(o),t.next=6,$B(o,r);case 6:return o.root=t.sent,o.type=Kp,o.lodMetricType=qp,o.lodMetricValue=(null===(i=o.root)||void 0===i?void 0:i.lodMetricValue)||0,t.abrupt("return",o);case 11:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function h_(){return(h_=Ds()(js.a.mark((function t(e,r,n){var i;return js.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i=r["3d-tiles"]||{},!("auto"===i.isTileset?n.url&&-1!==n.url.indexOf(".json"):i.isTileset)){t.next=8;break}return t.next=5,l_(e,r,n);case 5:e=t.sent,t.next=11;break;case 8:return t.next=10,u_(e,r,n);case 10:e=t.sent;case 11:return t.abrupt("return",e);case 12:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function d_(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function p_(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?d_(Object(r),!0).forEach((function(e){B()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):d_(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function v_(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=A()(t);if(e){var i=A()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return m()(this,r)}}var y_=[0],g_={getPointColor:{type:"accessor",value:[0,0,0,255]},pointSize:1,data:null,loader:a_,onTilesetLoad:{type:"function",value:function(t){},compare:!1},onTileLoad:{type:"function",value:function(t){},compare:!1},onTileUnload:{type:"function",value:function(t){},compare:!1},onTileError:{type:"function",value:function(t,e,r){},compare:!1},_getMeshColor:{type:"function",value:function(t){return[255,255,255]},compare:!1}},m_=function(t){y()(n,t);var e,r=v_(n);function n(){var t;p()(this,n);for(var e=arguments.length,i=new Array(e),o=0;o<e;o++)i[o]=arguments[o];return t=r.call.apply(r,[this].concat(i)),B()(ai()(t),"state",void 0),t}return E()(n,[{key:"initializeState",value:function(){"onTileLoadFail"in this.props&&_.log.removed("onTileLoadFail","onTileError")(),this.state={layerMap:{},tileset3d:null,activeViewports:{},lastUpdatedViewports:null}}},{key:"isLoaded",get:function(){var t=this.state.tileset3d;return null!==t&&t.isLoaded()}},{key:"shouldUpdateState",value:function(t){return t.changeFlags.somethingChanged}},{key:"updateState",value:function(t){var e=t.props,r=t.oldProps,n=t.changeFlags;if(e.data&&e.data!==r.data&&this._loadTileset(e.data),n.viewportChanged){var i=this.state.activeViewports;Object.keys(i).length&&(this._updateTileset(i),this.state.lastUpdatedViewports=i,this.state.activeViewports={})}if(n.propsChanged){var o=this.state.layerMap;for(var a in o)o[a].needsUpdate=!0}}},{key:"activateViewport",value:function(t){var e=this.state,r=e.activeViewports,n=e.lastUpdatedViewports;this.internalState.viewport=t,r[t.id]=t;var i=null==n?void 0:n[t.id];i&&t.equals(i)||(this.setChangeFlags({viewportChanged:!0}),this.setNeedsUpdate())}},{key:"getPickingInfo",value:function(t){var e=t.info,r=t.sourceLayer,n=this.state.layerMap,i=r&&r.id;if(i){var o=i.substring(this.id.length+1),a=o.substring(o.indexOf("-")+1);e.object=n[a]&&n[a].tile}return e}},{key:"filterSubLayer",value:function(t){var e=t.layer,r=t.viewport,n=e.props.tile,i=r.id;return n.selected&&n.viewportIds.includes(i)}},{key:"_updateAutoHighlight",value:function(t){t.sourceLayer&&t.sourceLayer.updateAutoHighlight(t)}},{key:"_loadTileset",value:(e=It()(Pt.a.mark((function t(e){var r,n,i,o,a,s,u;return Pt.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=this.props.loadOptions,n=void 0===r?{}:r,i=this.props.loader||this.props.loaders,Array.isArray(i)&&(i=i[0]),o={loadOptions:p_({},n)},!i.preload){t.next=10;break}return t.next=7,i.preload(e,n);case 7:(a=t.sent).headers&&(o.loadOptions.fetch=p_(p_({},o.loadOptions.fetch),{},{headers:a.headers})),Object.assign(o,a);case 10:return t.next=12,Ef(e,i,o.loadOptions);case 12:s=t.sent,u=new Jv(s,p_({onTileLoad:this._onTileLoad.bind(this),onTileUnload:this._onTileUnload.bind(this),onTileError:this.props.onTileError},o)),this.setState({tileset3d:u,layerMap:{}}),this._updateTileset(this.state.activeViewports),this.props.onTilesetLoad(u);case 17:case"end":return t.stop()}}),t,this)}))),function(t){return e.apply(this,arguments)})},{key:"_onTileLoad",value:function(t){var e=this.state.lastUpdatedViewports;this.props.onTileLoad(t),this._updateTileset(e),this.setNeedsUpdate()}},{key:"_onTileUnload",value:function(t){delete this.state.layerMap[t.id],this.props.onTileUnload(t)}},{key:"_updateTileset",value:function(t){var e=this;if(t){var r=this.state.tileset3d,n=this.context.timeline,i=Object.keys(t).length;n&&i&&r&&r.selectTiles(Object.values(t)).then((function(t){e.state.frameNumber!==t&&e.setState({frameNumber:t})}))}}},{key:"_getSubLayer",value:function(t,e){if(!t.content)return null;switch(t.type){case Vp:return this._makePointCloudLayer(t,e);case Hp:return this._make3DModelLayer(t);case Jp:return this._makeSimpleMeshLayer(t,e);default:throw new Error("Tile3DLayer: Failed to render layer of type ".concat(t.content.type))}}},{key:"_makePointCloudLayer",value:function(t,e){var r=t.content,n=r.attributes,i=r.pointCount,o=r.constantRGBA,a=r.cartographicOrigin,s=r.modelMatrix,u=n.positions,c=n.normals,l=n.colors;if(!u)return null;var f=e&&e.props.data||{header:{vertexCount:i},attributes:{POSITION:u,NORMAL:c,COLOR_0:l}},h=this.props,d=h.pointSize,p=h.getPointColor;return new(this.getSubLayerClass("pointcloud",_.PointCloudLayer))({pointSize:d},this.getSubLayerProps({id:"pointcloud"}),{id:"".concat(this.id,"-pointcloud-").concat(t.id),tile:t,data:f,coordinateSystem:_.COORDINATE_SYSTEM.METER_OFFSETS,coordinateOrigin:a,modelMatrix:s,getColor:o||p,_offset:0})}},{key:"_make3DModelLayer",value:function(t){var e=t.content,r=e.gltf,n=e.instances,i=e.cartographicOrigin,o=e.modelMatrix;return new(this.getSubLayerClass("scenegraph",_.ScenegraphLayer))({_lighting:"pbr"},this.getSubLayerProps({id:"scenegraph"}),{id:"".concat(this.id,"-scenegraph-").concat(t.id),tile:t,data:n||y_,scenegraph:r,coordinateSystem:_.COORDINATE_SYSTEM.METER_OFFSETS,coordinateOrigin:i,modelMatrix:o,getTransformMatrix:function(t){return t.modelMatrix},getPosition:[0,0,0],_offset:0})}},{key:"_makeSimpleMeshLayer",value:function(t,e){var r=t.content,n=r.attributes,i=r.indices,o=r.modelMatrix,a=r.cartographicOrigin,s=r.coordinateSystem,u=void 0===s?_.COORDINATE_SYSTEM.METER_OFFSETS:s,c=r.material,l=r.featureIds,f=this.props._getMeshColor,h=e&&e.props.mesh||new xi.Geometry({drawMode:4,attributes:b_(n),indices:i});return new(this.getSubLayerClass("mesh",Ps))(this.getSubLayerProps({id:"mesh"}),{id:"".concat(this.id,"-mesh-").concat(t.id),tile:t,mesh:h,data:y_,getColor:f(t),pbrMaterial:c,modelMatrix:o,coordinateOrigin:a,coordinateSystem:u,featureIds:l,_offset:0})}},{key:"renderLayers",value:function(){var t=this,e=this.state,r=e.tileset3d,n=e.layerMap;return r?r.tiles.map((function(e){var r=n[e.id]=n[e.id]||{tile:e},i=r.layer;return e.selected&&(i?r.needsUpdate&&(i=t._getSubLayer(e,i),r.needsUpdate=!1):i=t._getSubLayer(e)),r.layer=i,i})).filter(Boolean):null}}]),n}(_.CompositeLayer);function b_(t){var e={};return e.positions=p_(p_({},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}B()(m_,"defaultProps",g_),B()(m_,"layerName","Tile3DLayer");var A_={name:"Terrain",id:"terrain",module:"terrain",version:"3.2.10",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:null,meshMaxError:10,elevationDecoder:{rScaler:1,gScaler:0,bScaler:0,offset:0},skirtHeight:null}}};function w_(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=A()(t);if(e){var i=A()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return m()(this,r)}}function B_(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function __(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?B_(Object(r),!0).forEach((function(e){B()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):B_(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var x_=[1],C_=__(__({},Yn.defaultProps),{},{elevationData:Bn,texture:__(__({},Bn),{},{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:{type:"string",value:null},wireframe:!1,material:!0,loaders:[A_]});function k_(t){return Array.isArray(t)?t.join(";"):t||""}var E_=function(t){y()(r,t);var e=w_(r);function r(){var t;p()(this,r);for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return t=e.call.apply(e,[this].concat(i)),B()(ai()(t),"state",void 0),t}return E()(r,[{key:"updateState",value:function(t){var e=t.props,r=t.oldProps,n=e.elevationData!==r.elevationData;if(n){var i=e.elevationData,o=i&&(Array.isArray(i)||i.includes("{x}")&&i.includes("{y}"));this.setState({isTiled:o})}var a=n||e.meshMaxError!==r.meshMaxError||e.elevationDecoder!==r.elevationDecoder||e.bounds!==r.bounds;if(!this.state.isTiled&&a){var s=this.loadTerrain(e);this.setState({terrain:s})}e.workerUrl&&_.log.removed("workerUrl","loadOptions.terrain.workerUrl")()}},{key:"loadTerrain",value:function(t){var e,r=t.elevationData,n=t.bounds,i=t.elevationDecoder,o=t.meshMaxError,a=t.signal;if(!r)return null;var s=this.getLoadOptions();return s=__(__({},s),{},{terrain:__(__({skirtHeight:this.state.isTiled?2*o:0},null===(e=s)||void 0===e?void 0:e.terrain),{},{bounds:n,meshMaxError:o,elevationDecoder:i})}),(0,this.props.fetch)(r,{propName:"elevationData",layer:this,loadOptions:s,signal:a})}},{key:"getTiledTerrainData",value:function(t){var e=this.props,r=e.elevationData,n=e.fetch,i=e.texture,o=e.elevationDecoder,a=e.meshMaxError,s=this.context.viewport,u=xn(r,t),c=i&&xn(i,t),l=t.signal,f=[0,0],h=[0,0];if(s.isGeospatial){var d=t.bbox;f=s.projectFlat([d.west,d.south]),h=s.projectFlat([d.east,d.north])}else{var p=t.bbox;f=[p.left,p.bottom],h=[p.right,p.top]}var v=[f[0],f[1],h[0],h[1]],y=this.loadTerrain({elevationData:u,bounds:v,elevationDecoder:o,meshMaxError:a,signal:l}),g=c?n(c,{propName:"texture",layer:this,loaders:[],signal:l}).catch((function(t){return null})):Promise.resolve(null);return Promise.all([y,g])}},{key:"renderSubLayers",value:function(t){var e=this.getSubLayerClass("mesh",_.SimpleMeshLayer),r=this.props,n=r.color,i=r.wireframe,o=r.material,a=t.data;if(!a)return null;var s=R()(a,2),u=s[0],c=s[1];return new e(t,{data:x_,mesh:u,texture:c,_instanced:!1,coordinateSystem:_.COORDINATE_SYSTEM.CARTESIAN,getPosition:function(t){return[0,0,0]},getColor:n,wireframe:i,material:o})}},{key:"onViewportLoad",value:function(t){if(t){var e=this.state.zRange,r=t.map((function(t){return t.content})).filter(Boolean).map((function(t){return t[0].header.boundingBox.map((function(t){return t[2]}))}));if(0!==r.length){var n=Math.min.apply(Math,Lt()(r.map((function(t){return t[0]})))),i=Math.max.apply(Math,Lt()(r.map((function(t){return t[1]}))));(!e||n<e[0]||i>e[1])&&this.setState({zRange:[n,i]})}}}},{key:"renderLayers",value:function(){var t=this.props,e=t.color,r=t.material,n=t.elevationData,i=t.texture,o=t.wireframe,a=t.meshMaxError,s=t.elevationDecoder,u=t.tileSize,c=t.maxZoom,l=t.minZoom,f=t.extent,h=t.maxRequests,d=t.onTileLoad,p=t.onTileUnload,v=t.onTileError,y=t.maxCacheSize,g=t.maxCacheByteSize,m=t.refinementStrategy;return this.state.isTiled?new Yn(this.getSubLayerProps({id:"tiles"}),{getTileData:this.getTiledTerrainData.bind(this),renderSubLayers:this.renderSubLayers.bind(this),updateTriggers:{getTileData:{elevationData:k_(n),texture:k_(i),meshMaxError:a,elevationDecoder:s}},onViewportLoad:this.onViewportLoad.bind(this),zRange:this.state.zRange||null,tileSize:u,maxZoom:c,minZoom:l,extent:f,maxRequests:h,onTileLoad:d,onTileUnload:p,onTileError:v,maxCacheSize:y,maxCacheByteSize:g,refinementStrategy:m}):new(this.getSubLayerClass("mesh",_.SimpleMeshLayer))(this.getSubLayerProps({id:"mesh"}),{data:x_,mesh:this.state.terrain,texture:i,_instanced:!1,getPosition:function(t){return[0,0,0]},getColor:e,material:r,wireframe:o})}}]),r}(_.CompositeLayer);B()(E_,"defaultProps",C_),B()(E_,"layerName","TerrainLayer");function O_(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.start,n=void 0===r?0:r,i=e.end,o=void 0===i?t.length:i,a=e.size||2,s=0,u=n,c=o-a;u<o;u+=a)s+=(t[u]-t[c])*(t[u+1]+t[c+1]),c=u;return s/2}function T_(t,e,r,n,i,o){var a,s;if(void 0===o&&(o=O_(t,{start:e,end:r,size:n})),i===o<0)for(a=e;a<r;a+=n)s=Y_(a,t[a],t[a+1],s);else for(a=r-n;a>=e;a-=n)s=Y_(a,t[a],t[a+1],s);return s&&z_(s,s.next)&&(Z_(s),s=s.next),s}function S_(t,e){if(!t)return t;e||(e=t);var r,n=t;do{if(r=!1,n.steiner||!z_(n,n.next)&&0!==J_(n.prev,n,n.next))n=n.next;else{if(Z_(n),(n=e=n.prev)===n.next)break;r=!0}}while(r||n!==e);return e}function M_(t,e,r,n,i,o,a){if(t){!a&&o&&function(t,e,r,n){var i=t;do{null===i.z&&(i.z=N_(i.x,i.y,e,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,function(t){var e,r,n,i,o,a,s,u,c=1;do{for(i=t,t=null,u=null,n=0;i;){for(n++,a=i,o=0,r=0;r<c&&(o++,a=a.nextZ);r++);for(s=c;o>0||s>0&&a;)0!==o&&(0===s||!a||i.z<=a.z)?(e=i,i=i.nextZ,o--):(e=a,a=a.nextZ,s--),u?u.nextZ=e:t=e,e.prevZ=u,u=e;i=a}u.nextZ=null,c*=2}while(n>1)}(i)}(t,n,i,o);for(var s,u,c=t;t.prev!==t.next;)if(s=t.prev,u=t.next,o?R_(t,n,i,o):I_(t))e.push(s.i/r),e.push(t.i/r),e.push(u.i/r),Z_(t),t=u.next,c=u.next;else if((t=u)===c){a?1===a?M_(t=P_(S_(t),e,r),e,r,n,i,o,2):2===a&&F_(t,e,r,n,i,o):M_(S_(t),e,r,n,i,o,1);break}}}function I_(t){var e=t.prev,r=t,n=t.next;if(J_(e,r,n)>=0)return!1;for(var i=t.next.next;i!==t.prev;){if(H_(e.x,e.y,r.x,r.y,n.x,n.y,i.x,i.y)&&J_(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function R_(t,e,r,n){var i=t.prev,o=t,a=t.next;if(J_(i,o,a)>=0)return!1;for(var s=i.x<o.x?i.x<a.x?i.x:a.x:o.x<a.x?o.x:a.x,u=i.y<o.y?i.y<a.y?i.y:a.y:o.y<a.y?o.y:a.y,c=i.x>o.x?i.x>a.x?i.x:a.x:o.x>a.x?o.x:a.x,l=i.y>o.y?i.y>a.y?i.y:a.y:o.y>a.y?o.y:a.y,f=N_(s,u,e,r,n),h=N_(c,l,e,r,n),d=t.prevZ,p=t.nextZ;d&&d.z>=f&&p&&p.z<=h;){if(d!==t.prev&&d!==t.next&&H_(i.x,i.y,o.x,o.y,a.x,a.y,d.x,d.y)&&J_(d.prev,d,d.next)>=0)return!1;if(d=d.prevZ,p!==t.prev&&p!==t.next&&H_(i.x,i.y,o.x,o.y,a.x,a.y,p.x,p.y)&&J_(p.prev,p,p.next)>=0)return!1;p=p.nextZ}for(;d&&d.z>=f;){if(d!==t.prev&&d!==t.next&&H_(i.x,i.y,o.x,o.y,a.x,a.y,d.x,d.y)&&J_(d.prev,d,d.next)>=0)return!1;d=d.prevZ}for(;p&&p.z<=h;){if(p!==t.prev&&p!==t.next&&H_(i.x,i.y,o.x,o.y,a.x,a.y,p.x,p.y)&&J_(p.prev,p,p.next)>=0)return!1;p=p.nextZ}return!0}function P_(t,e,r){var n=t;do{var i=n.prev,o=n.next.next;!z_(i,o)&&K_(i,n,n.next,o)&&Q_(i,o)&&Q_(o,i)&&(e.push(i.i/r),e.push(n.i/r),e.push(o.i/r),Z_(n),Z_(n.next),n=t=o),n=n.next}while(n!==t);return S_(n)}function F_(t,e,r,n,i,o){var a=t;do{for(var s=a.next.next;s!==a.prev;){if(a.i!==s.i&&V_(a,s)){var u=X_(a,s);return a=S_(a,a.next),u=S_(u,u.next),M_(a,e,r,n,i,o),void M_(u,e,r,n,i,o)}s=s.next}a=a.next}while(a!==t)}function D_(t,e,r,n,i){var o,a,s,u=[];for(o=0,a=e.length;o<a;o++)(s=T_(t,e[o]*n,o<a-1?e[o+1]*n:t.length,n,!1,i&&i[o+1]))===s.next&&(s.steiner=!0),u.push(U_(s));for(u.sort(L_),o=0;o<u.length;o++)j_(u[o],r),r=S_(r,r.next);return r}function L_(t,e){return t.x-e.x}function j_(t,e){if(e=function(t,e){var r,n=e,i=t.x,o=t.y,a=-1/0;do{if(o<=n.y&&o>=n.next.y&&n.next.y!==n.y){var s=n.x+(o-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=i&&s>a){if(a=s,s===i){if(o===n.y)return n;if(o===n.next.y)return n.next}r=n.x<n.next.x?n:n.next}}n=n.next}while(n!==e);if(!r)return null;if(i===a)return r;var u,c=r,l=r.x,f=r.y,h=1/0;n=r;do{i>=n.x&&n.x>=l&&i!==n.x&&H_(o<f?i:a,o,l,f,o<f?a:i,o,n.x,n.y)&&(u=Math.abs(o-n.y)/(i-n.x),Q_(n,t)&&(u<h||u===h&&(n.x>r.x||n.x===r.x&&G_(r,n)))&&(r=n,h=u)),n=n.next}while(n!==c);return r}(t,e)){var r=X_(e,t);S_(e,e.next),S_(r,r.next)}}function G_(t,e){return J_(t.prev,t,e.prev)<0&&J_(e.next,t,t.next)<0}function N_(t,e,r,n,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*i)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*i)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function U_(t){var e=t,r=t;do{(e.x<r.x||e.x===r.x&&e.y<r.y)&&(r=e),e=e.next}while(e!==t);return r}function H_(t,e,r,n,i,o,a,s){return(i-a)*(e-s)-(t-a)*(o-s)>=0&&(t-a)*(n-s)-(r-a)*(e-s)>=0&&(r-a)*(o-s)-(i-a)*(n-s)>=0}function V_(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&K_(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&(Q_(t,e)&&Q_(e,t)&&function(t,e){var r=t,n=!1,i=(t.x+e.x)/2,o=(t.y+e.y)/2;do{r.y>o!=r.next.y>o&&r.next.y!==r.y&&i<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==t);return n}(t,e)&&(J_(t.prev,t,e.prev)||J_(t,e.prev,e))||z_(t,e)&&J_(t.prev,t,t.next)>0&&J_(e.prev,e,e.next)>0)}function J_(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function z_(t,e){return t.x===e.x&&t.y===e.y}function K_(t,e,r,n){var i=W_(J_(t,e,r)),o=W_(J_(t,e,n)),a=W_(J_(r,n,t)),s=W_(J_(r,n,e));return i!==o&&a!==s||(!(0!==i||!q_(t,r,e))||(!(0!==o||!q_(t,n,e))||(!(0!==a||!q_(r,t,n))||!(0!==s||!q_(r,e,n)))))}function q_(t,e,r){return e.x<=Math.max(t.x,r.x)&&e.x>=Math.min(t.x,r.x)&&e.y<=Math.max(t.y,r.y)&&e.y>=Math.min(t.y,r.y)}function W_(t){return t>0?1:t<0?-1:0}function Q_(t,e){return J_(t.prev,t,t.next)<0?J_(t,e,t.next)>=0&&J_(t,t.prev,e)>=0:J_(t,e,t.prev)<0||J_(t,t.next,e)<0}function X_(t,e){var r=new $_(t.i,t.x,t.y),n=new $_(e.i,e.x,e.y),i=t.next,o=e.prev;return t.next=e,e.prev=t,r.next=i,i.prev=r,n.next=r,r.prev=n,o.next=n,n.prev=o,n}function Y_(t,e,r,n){var i=new $_(t,e,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function Z_(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 $_(t,e,r){this.i=t,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function tx(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return ex(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ex(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function ex(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function rx(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function nx(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?rx(Object(r),!0).forEach((function(e){B()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):rx(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function ix(t,e,r){var n=ox(t),i=Object.keys(n).filter((function(t){return n[t]!==Array}));return function(t,e,r){for(var n=e.pointPositionsCount,i=e.pointFeaturesCount,o=e.linePositionsCount,a=e.linePathsCount,s=e.lineFeaturesCount,u=e.polygonPositionsCount,c=e.polygonObjectsCount,l=e.polygonRingsCount,f=e.polygonFeaturesCount,h=e.propArrayTypes,d=e.coordLength,p=r.numericPropKeys,v=void 0===p?[]:p,y=r.PositionDataType,g=void 0===y?Float32Array:y,m=(t[0]&&"id"in t[0]),b=t.length>65535?Uint32Array:Uint16Array,A={type:"Point",positions:new g(n*d),globalFeatureIds:new b(n),featureIds:i>65535?new Uint32Array(n):new Uint16Array(n),numericProps:{},properties:[],fields:[]},w={type:"LineString",pathIndices:o>65535?new Uint32Array(a+1):new Uint16Array(a+1),positions:new g(o*d),globalFeatureIds:new b(o),featureIds:s>65535?new Uint32Array(o):new Uint16Array(o),numericProps:{},properties:[],fields:[]},B={type:"Polygon",polygonIndices:u>65535?new Uint32Array(c+1):new Uint16Array(c+1),primitivePolygonIndices:u>65535?new Uint32Array(l+1):new Uint16Array(l+1),positions:new g(u*d),triangles:[],globalFeatureIds:new b(u),featureIds:f>65535?new Uint32Array(u):new Uint16Array(u),numericProps:{},properties:[],fields:[]},_=0,x=[A,w,B];_<x.length;_++){var C,k=x[_],E=tx(v);try{for(E.s();!(C=E.n()).done;){var O=C.value,T=h[O];k.numericProps[O]=new T(k.positions.length/d)}}catch(t){E.e(t)}finally{E.f()}}w.pathIndices[a]=o,B.polygonIndices[c]=u,B.primitivePolygonIndices[l]=u;var S,M={pointPosition:0,pointFeature:0,linePosition:0,linePath:0,lineFeature:0,polygonPosition:0,polygonObject:0,polygonRing:0,polygonFeature:0,feature:0},I=tx(t);try{for(I.s();!(S=I.n()).done;){var R=S.value,P=R.geometry,F=R.properties||{};switch(P.type){case"Point":ax(P,A,M,d,F),A.properties.push(hx(F,v)),m&&A.fields.push({id:R.id}),M.pointFeature++;break;case"LineString":sx(P,w,M,d,F),w.properties.push(hx(F,v)),m&&w.fields.push({id:R.id}),M.lineFeature++;break;case"Polygon":ux(P,B,M,d,F),B.properties.push(hx(F,v)),m&&B.fields.push({id:R.id}),M.polygonFeature++;break;default:throw new Error("Invalid geometry type")}M.feature++}}catch(t){I.e(t)}finally{I.f()}return function(t,e,r,n){return{points:nx(nx({},t),{},{positions:{value:t.positions,size:n},globalFeatureIds:{value:t.globalFeatureIds,size:1},featureIds:{value:t.featureIds,size:1},numericProps:lx(t.numericProps,1)}),lines:nx(nx({},e),{},{positions:{value:e.positions,size:n},pathIndices:{value:e.pathIndices,size:1},globalFeatureIds:{value:e.globalFeatureIds,size:1},featureIds:{value:e.featureIds,size:1},numericProps:lx(e.numericProps,1)}),polygons:nx(nx({},r),{},{positions:{value:r.positions,size:n},polygonIndices:{value:r.polygonIndices,size:1},primitivePolygonIndices:{value:r.primitivePolygonIndices,size:1},triangles:{value:new Uint32Array(r.triangles),size:1},globalFeatureIds:{value:r.globalFeatureIds,size:1},featureIds:{value:r.featureIds,size:1},numericProps:lx(r.numericProps,1)})}}(A,w,B,d)}(t,nx({propArrayTypes:n},e),{numericPropKeys:r&&r.numericPropKeys||i,PositionDataType:r?r.PositionDataType:Float32Array})}function ox(t){var e,r={},n=tx(t);try{for(n.s();!(e=n.n()).done;){var i=e.value;if(i.properties)for(var o in i.properties){var a=i.properties[o];r[o]=dx(a,r[o])}}}catch(t){n.e(t)}finally{n.f()}return r}function ax(t,e,r,n,i){e.positions.set(t.data,r.pointPosition*n);var o=t.data.length/n;fx(e,i,r.pointPosition,o),e.globalFeatureIds.fill(r.feature,r.pointPosition,r.pointPosition+o),e.featureIds.fill(r.pointFeature,r.pointPosition,r.pointPosition+o),r.pointPosition+=o}function sx(t,e,r,n,i){e.positions.set(t.data,r.linePosition*n);var o=t.data.length/n;fx(e,i,r.linePosition,o),e.globalFeatureIds.fill(r.feature,r.linePosition,r.linePosition+o),e.featureIds.fill(r.lineFeature,r.linePosition,r.linePosition+o);for(var a=0,s=t.indices.length;a<s;++a){var u=t.indices[a],c=a===s-1?t.data.length:t.indices[a+1];e.pathIndices[r.linePath++]=r.linePosition,r.linePosition+=(c-u)/n}}function ux(t,e,r,n,i){e.positions.set(t.data,r.polygonPosition*n);var o=t.data.length/n;fx(e,i,r.polygonPosition,o),e.globalFeatureIds.fill(r.feature,r.polygonPosition,r.polygonPosition+o),e.featureIds.fill(r.polygonFeature,r.polygonPosition,r.polygonPosition+o);for(var a=0,s=t.indices.length;a<s;++a){var u=r.polygonPosition;e.polygonIndices[r.polygonObject++]=u;for(var c=t.areas[a],l=t.indices[a],f=t.indices[a+1],h=0,d=l.length;h<d;++h){var p=l[h],v=h===d-1?void 0===f?t.data.length:f[0]:l[h+1];e.primitivePolygonIndices[r.polygonRing++]=r.polygonPosition,r.polygonPosition+=(v-p)/n}cx(e,c,l,{startPosition:u,endPosition:r.polygonPosition,coordLength:n})}}function cx(t,e,r,n){for(var i=n.startPosition,o=n.endPosition,a=n.coordLength,s=i*a,u=o*a,c=t.positions.subarray(s,u),l=r[0],f=function(t,e){var r,n,i,o,a,s,u,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2,l=arguments.length>3?arguments[3]:void 0,f=e&&e.length,h=f?e[0]*c:t.length,d=T_(t,0,h,c,!0,l&&l[0]),p=[];if(!d||d.next===d.prev)return p;if(f&&(d=D_(t,e,d,c,l)),t.length>80*c){o=n=t[0],a=i=t[1];for(var v=c;v<h;v+=c)(s=t[v])<o&&(o=s),(u=t[v+1])<a&&(a=u),s>n&&(n=s),u>i&&(i=u);r=0!==(r=Math.max(n-o,i-a))?1/r:0}return M_(d,p,c,o,a,r),p}(c,r.slice(1).map((function(t){return(t-l)/a})),a,e),h=0,d=f.length;h<d;++h)t.triangles.push(i+f[h])}function lx(t,e){var r={};for(var n in t)r[n]={value:t[n],size:e};return r}function fx(t,e,r,n){for(var i in t.numericProps)if(i in e){var o=e[i];t.numericProps[i].fill(o,r,r+n)}}function hx(t,e){var r={};for(var n in t)e.includes(n)||(r[n]=t[n]);return r}function dx(t,e){return e!==Array&&Number.isFinite(t)?e===Float64Array||Math.fround(t)!==t?Float64Array:Float32Array:Array}var px=r(54),vx=r.n(px);function yx(t){for(var e,r,n=0,i=0,o=t.length-1;i<t.length;o=i++)e=t[i],n+=((r=t[o])[0]-e[0])*(e[1]+r[1]);return n}function gx(t,e,r){e&&r&&(1===t?e.id=r.readVarint():2===t?function(t,e){var r=t.readVarint()+t.pos;for(;t.pos<r;){var n=e._keys[t.readVarint()],i=e._values[t.readVarint()];e.properties[n]=i}}(r,e):3===t?e.type=r.readVarint():4===t&&(e._geometry=r.pos))}var mx=function(){function t(e,r,n,i,o){p()(this,t),In(this,"properties",void 0),In(this,"extent",void 0),In(this,"type",void 0),In(this,"id",void 0),In(this,"_pbf",void 0),In(this,"_geometry",void 0),In(this,"_keys",void 0),In(this,"_values",void 0),this.properties={},this.extent=n,this.type=0,this.id=null,this._pbf=e,this._geometry=-1,this._keys=i,this._values=o,e.readFields(gx,this,r)}return E()(t,[{key:"loadGeometry",value:function(){var t=this._pbf;t.pos=this._geometry;for(var e,r=t.readVarint()+t.pos,n=1,i=0,o=0,a=0,s=[];t.pos<r;){if(i<=0){var u=t.readVarint();n=7&u,i=u>>3}if(i--,1===n||2===n)o+=t.readSVarint(),a+=t.readSVarint(),1===n&&(e&&s.push(e),e=[]),e&&e.push([o,a]);else{if(7!==n)throw new Error("unknown command ".concat(n));e&&e.push(e[0].slice())}}return e&&s.push(e),s}},{key:"bbox",value:function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,r=1,n=0,i=0,o=0,a=1/0,s=-1/0,u=1/0,c=-1/0;t.pos<e;){if(n<=0){var l=t.readVarint();r=7&l,n=l>>3}if(n--,1===r||2===r)(i+=t.readSVarint())<a&&(a=i),i>s&&(s=i),(o+=t.readSVarint())<u&&(u=o),o>c&&(c=o);else if(7!==r)throw new Error("unknown command ".concat(r))}return[a,u,s,c]}},{key:"_toGeoJSON",value:function(e){var r,n,i=this.loadGeometry(),o=t.types[this.type];switch(this.type){case 1:var a=[];for(r=0;r<i.length;r++)a[r]=i[r][0];e(i=a,this);break;case 2:for(r=0;r<i.length;r++)e(i[r],this);break;case 3:for(i=function(t){var e=t.length;if(e<=1)return[t];for(var r,n,i=[],o=0;o<e;o++){var a=yx(t[o]);0!==a&&(void 0===n&&(n=a<0),n===a<0?(r&&i.push(r),r=[t[o]]):r&&r.push(t[o]))}return r&&i.push(r),i}(i),r=0;r<i.length;r++)for(n=0;n<i[r].length;n++)e(i[r][n],this)}1===i.length?i=i[0]:o="Multi".concat(o);var s={type:"Feature",geometry:{type:o,coordinates:i},properties:this.properties};return null!==this.id&&(s.id=this.id),s}},{key:"toGeoJSON",value:function(t){if("function"==typeof t)return this._toGeoJSON(t);var e=t.x,r=t.y,n=t.z,i=this.extent*Math.pow(2,n),o=this.extent*e,a=this.extent*r;return this._toGeoJSON((function(t){for(var e=0;e<t.length;e++){var r=t[e];r[0]=360*(r[0]+o)/i-180;var n=180-360*(r[1]+a)/i;r[1]=360/Math.PI*Math.atan(Math.exp(n*Math.PI/180))-90}}))}}],[{key:"types",get:function(){return["Unknown","Point","LineString","Polygon"]}}]),t}(),bx=function(){function t(e,r){p()(this,t),In(this,"version",void 0),In(this,"name",void 0),In(this,"extent",void 0),In(this,"length",void 0),In(this,"_pbf",void 0),In(this,"_keys",void 0),In(this,"_values",void 0),In(this,"_features",void 0),this.version=1,this.name="",this.extent=4096,this.length=0,this._pbf=e,this._keys=[],this._values=[],this._features=[],e.readFields(Ax,this,r),this.length=this._features.length}return E()(t,[{key:"feature",value: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 mx(this._pbf,e,this.extent,this._keys,this._values)}}]),t}();function Ax(t,e,r){e&&r&&(15===t?e.version=r.readVarint():1===t?e.name=r.readString():5===t?e.extent=r.readVarint():2===t?e._features.push(r.pos):3===t?e._keys.push(r.readString()):4===t&&e._values.push(function(t){var e=null,r=t.readVarint()+t.pos;for(;t.pos<r;){var 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}(r)))}var wx,Bx,_x,xx,Cx,kx,Ex,Ox=function t(e,r){p()(this,t),In(this,"layers",void 0),this.layers=e.readFields(Tx,{},r)};function Tx(t,e,r){if(3===t&&r){var n=new bx(r,r.readVarint()+r.pos);n.length&&e&&(e[n.name]=n)}}function Sx(t){var e=t.indices.length;if(e<=1)return{type:"Polygon",data:t.data,areas:[[O_(t.data)]],indices:[t.indices]};for(var r,n,i,o=[],a=[],s=[],u=[],c=0,l=0;l<e;l++){i=t.indices[l]-c,n=t.indices[l+1]-c||t.data.length;var f=O_(t.data.slice(i,n));if(0!==f)void 0===r&&(r=f<0),r===f<0?(u.length&&(o.push(s),a.push(u)),u=[i],s=[f]):(s.push(f),u.push(i));else{var h=t.data.slice(0,i),d=t.data.slice(n);t.data=h.concat(d),c+=n-i}}return s&&o.push(s),u.length&&a.push(u),{type:"Polygon",areas:o,indices:a,data:t.data}}function Mx(t,e,r){e&&r&&(1===t?e.id=r.readVarint():2===t?function(t,e){var r=t.readVarint()+t.pos;for(;t.pos<r;){var n=e._keys[t.readVarint()],i=e._values[t.readVarint()];e.properties[n]=i}}(r,e):3===t?e.type=r.readVarint():4===t&&(e._geometry=r.pos))}function Ix(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return Rx(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Rx(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function Rx(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Px(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Fx(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Px(Object(r),!0).forEach((function(e){B()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Px(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var Dx=function(){function t(e,r,n,i,o,a){p()(this,t),In(this,"properties",void 0),In(this,"extent",void 0),In(this,"type",void 0),In(this,"id",void 0),In(this,"_pbf",void 0),In(this,"_geometry",void 0),In(this,"_keys",void 0),In(this,"_values",void 0),In(this,"_geometryInfo",void 0),this.properties={},this.extent=n,this.type=0,this.id=null,this._pbf=e,this._geometry=-1,this._keys=i,this._values=o,this._geometryInfo=a,e.readFields(Mx,this,r)}return E()(t,[{key:"loadGeometry",value:function(){var t=this._pbf;t.pos=this._geometry,wx=t.readVarint()+t.pos,Bx=1,xx=0,Cx=0,kx=0,Ex=0;for(var e=[],r=[];t.pos<wx;)if(xx<=0&&(_x=t.readVarint(),Bx=7&_x,xx=_x>>3),xx--,1===Bx||2===Bx)Cx+=t.readSVarint(),kx+=t.readSVarint(),1===Bx&&e.push(Ex),r.push(Cx,kx),Ex+=2;else{if(7!==Bx)throw new Error("unknown command ".concat(Bx));if(Ex>0){var n=e[e.length-1];r.push(r[n],r[n+1]),Ex+=2}}return{data:r,indices:e}}},{key:"_toBinaryCoordinates",value:function(t){var e,r=this.loadGeometry();t(r.data,this);switch(this.type){case 1:this._geometryInfo.pointFeaturesCount++,this._geometryInfo.pointPositionsCount+=r.indices.length,e=Fx({type:"Point"},r);break;case 2:this._geometryInfo.lineFeaturesCount++,this._geometryInfo.linePathsCount+=r.indices.length,this._geometryInfo.linePositionsCount+=r.data.length/2,e=Fx({type:"LineString"},r);break;case 3:e=Sx(r),this._geometryInfo.polygonFeaturesCount++,this._geometryInfo.polygonObjectsCount+=e.indices.length;var n,i=Ix(e.indices);try{for(i.s();!(n=i.n()).done;){var o=n.value;this._geometryInfo.polygonRingsCount+=o.length}}catch(t){i.e(t)}finally{i.f()}this._geometryInfo.polygonPositionsCount+=e.data.length/2;break;default:throw new Error("Invalid geometry type: ".concat(this.type))}var a={type:"Feature",geometry:e,properties:this.properties};return null!==this.id&&(a.id=this.id),a}},{key:"toBinaryCoordinates",value:function(t){if("function"==typeof t)return this._toBinaryCoordinates(t);var e=t.x,r=t.y,n=t.z,i=this.extent*Math.pow(2,n),o=this.extent*e,a=this.extent*r;return this._toBinaryCoordinates((function(t){return function(t,e,r,n){for(var i=0,o=t.length;i<o;i+=2){t[i]=360*(t[i]+e)/n-180;var a=180-360*(t[i+1]+r)/n;t[i+1]=360/Math.PI*Math.atan(Math.exp(a*Math.PI/180))-90}}(t,o,a,i)}))}}]),t}(),Lx=function(){function t(e,r){p()(this,t),In(this,"version",void 0),In(this,"name",void 0),In(this,"extent",void 0),In(this,"length",void 0),In(this,"_pbf",void 0),In(this,"_keys",void 0),In(this,"_values",void 0),In(this,"_features",void 0),this.version=1,this.name="",this.extent=4096,this.length=0,this._pbf=e,this._keys=[],this._values=[],this._features=[],e.readFields(jx,this,r),this.length=this._features.length}return E()(t,[{key:"feature",value:function(t,e){if(t<0||t>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[t];var r=this._pbf.readVarint()+this._pbf.pos;return new Dx(this._pbf,r,this.extent,this._keys,this._values,e)}}]),t}();function jx(t,e,r){e&&r&&(15===t?e.version=r.readVarint():1===t?e.name=r.readString():5===t?e.extent=r.readVarint():2===t?e._features.push(r.pos):3===t?e._keys.push(r.readString()):4===t&&e._values.push(function(t){var e=null,r=t.readVarint()+t.pos;for(;t.pos<r;){var 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}(r)))}var Gx=function t(e,r){p()(this,t),In(this,"layers",void 0),this.layers=e.readFields(Nx,{},r)};function Nx(t,e,r){if(3===t&&r){var n=new Lx(r,r.readVarint()+r.pos);n.length&&e&&(e[n.name]=n)}}function Ux(t,e){var r,n,i=function(t){var e;if(null==t||!t.mvt)throw new Error("mvt options required");var r="wgs84"===(null===(e=t.mvt)||void 0===e?void 0:e.coordinates),n=t.mvt.tileIndex,i=n&&Number.isFinite(n.x)&&Number.isFinite(n.y)&&Number.isFinite(n.z);if(r&&!i)throw new Error("MVT Loader: WGS84 coordinates need tileIndex property");return t.mvt}(e),o=(null==e?void 0:null===(r=e.gis)||void 0===r?void 0:r.format)||(null==e?void 0:null===(n=e.mvt)||void 0===n?void 0:n.shape);switch(o){case"columnar-table":return{shape:"columnar-table",data:Hx(t,i)};case"geojson-row-table":return{shape:"geojson-row-table",data:Vx(t,i)};case"geojson":return Vx(t,i);case"binary-geometry":case"binary":return Hx(t,i);default:throw new Error(o)}}function Hx(t,e){var r=function(t,e){var r=[],n={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[r,n];var i=new Gx(new vx.a(t));return(e&&Array.isArray(e.layers)?e.layers:Object.keys(i.layers)).forEach((function(t){var o=i.layers[t];if(o)for(var a=0;a<o.length;a++){var s=zx(o.feature(a,n),e,t);r.push(s)}})),[r,n]}(t,e),n=R()(r,2),i=ix(n[0],n[1]);return i.byteLength=t.byteLength,i}function Vx(t,e){if(t.byteLength<=0)return[];var r=[],n=new Ox(new vx.a(t));return(Array.isArray(e.layers)?e.layers:Object.keys(n.layers)).forEach((function(t){var i=n.layers[t];if(i)for(var o=0;o<i.length;o++){var a=Jx(i.feature(o),e,t);r.push(a)}})),r}function Jx(t,e,r){var n=t.toGeoJSON("wgs84"===e.coordinates?e.tileIndex:Kx);return e.layerProperty&&(n.properties[e.layerProperty]=r),n}function zx(t,e,r){var n=t.toBinaryCoordinates("wgs84"===e.coordinates?e.tileIndex:qx);return e.layerProperty&&n.properties&&(n.properties[e.layerProperty]=r),n}function Kx(t,e){for(var r=e.extent,n=0;n<t.length;n++){var i=t[n];i[0]/=r,i[1]/=r}}function qx(t,e){for(var r=e.extent,n=0,i=t.length;n<i;++n)t[n]/=r}function Wx(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Qx(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Wx(Object(r),!0).forEach((function(e){B()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Wx(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var Xx,Yx={name:"Mapbox Vector Tile",id:"mvt",module:"mvt",version:"3.2.10",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}}};Qx(Qx({},Yx),{},{parse:(Xx=It()(Pt.a.mark((function t(e,r){return Pt.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",Ux(e,r));case 1:case"end":return t.stop()}}),t)}))),function(t,e){return Xx.apply(this,arguments)}),parseSync:Ux,binary:!0});function Zx(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function $x(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return tC(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return tC(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function tC(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function eC(t,e){var r=null==e?void 0:e.globalFeatureId;return void 0!==r?function(t,e){var r,n=$x(iC(t));try{for(n.s();!(r=n.n()).done;){for(var i=r.value,o=0,a=i.featureIds.value[0],s=0;s<i.featureIds.value.length;s++){var u=i.featureIds.value[s];if(u!==a){if(e===i.globalFeatureIds.value[o])return oC(i,o,s);o=s,a=u}}if(e===i.globalFeatureIds.value[o])return oC(i,o,i.featureIds.value.length)}}catch(t){n.e(t)}finally{n.f()}throw new Error("featureId:".concat(e," not found"))}(t,r):rC(t,null==e?void 0:e.type)}function rC(t,e){return function(t){var e,r=[],n=$x(t);try{for(n.s();!(e=n.n()).done;){var i=e.value;if(0!==i.featureIds.value.length){for(var o=0,a=i.featureIds.value[0],s=0;s<i.featureIds.value.length;s++){var u=i.featureIds.value[s];u!==a&&(r.push(oC(i,o,s)),o=s,a=u)}r.push(oC(i,o,i.featureIds.value.length))}}}catch(t){n.e(t)}finally{n.f()}return r}(iC(t,e))}function nC(t,e,r){switch(t.type){case"Point":return function(t,e,r){var n=aC(t.positions,e,r);if(n.length>1)return{type:"MultiPoint",coordinates:n};return{type:"Point",coordinates:n[0]}}(t,e,r);case"LineString":return function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1/0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1/0,n=t.positions,i=t.pathIndices.value.filter((function(t){return t>=e&&t<=r})),o=i.length>2;if(!o){var a=aC(n,i[0],i[1]);return{type:"LineString",coordinates:a}}for(var s=[],u=0;u<i.length-1;u++){var c=aC(n,i[u],i[u+1]);s.push(c)}return{type:"MultiLineString",coordinates:s}}(t,e,r);case"Polygon":return function t(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1/0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1/0,i=e.positions,o=e.polygonIndices.value.filter((function(t){return t>=r&&t<=n})),a=e.primitivePolygonIndices.value.filter((function(t){return t>=r&&t<=n})),s=o.length>2;if(!s){for(var u=[],c=0;c<a.length-1;c++){var l=a[c],f=a[c+1],h=aC(i,l,f);u.push(h)}return{type:"Polygon",coordinates:u}}for(var d=[],p=0;p<o.length-1;p++){var v=o[p],y=o[p+1],g=t(e,v,y).coordinates;d.push(g)}return{type:"MultiPolygon",coordinates:d}}(t,e,r);default:var n=t;throw new Error("Unsupported geometry type: ".concat(null==n?void 0:n.type))}}function iC(t,e){if(!Boolean(t.points||t.lines||t.polygons))return t.type=e||function(t){if(t.pathIndices)return"LineString";if(t.polygonIndices)return"Polygon";return"Point"}(t),[t];var r=[];return t.points&&(t.points.type="Point",r.push(t.points)),t.lines&&(t.lines.type="LineString",r.push(t.lines)),t.polygons&&(t.polygons.type="Polygon",r.push(t.polygons)),r}function oC(t,e,r){return function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Zx(Object(r),!0).forEach((function(e){B()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Zx(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}({type:"Feature",geometry:nC(t,e,r),properties:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=(arguments.length>2&&arguments[2],Object.assign({},t.properties[t.featureIds.value[e]]));for(var n in t.numericProps)r[n]=t.numericProps[n].value[e];return r}(t,e,r)},function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;arguments.length>2&&arguments[2];return t.fields&&t.fields[t.featureIds.value[e]]}(t,e,r))}function aC(t,e,r){e=e||0,r=r||t.value.length/t.size;for(var n=[],i=e;i<r;i++){for(var o=Array(),a=i*t.size;a<(i+1)*t.size;a++)o.push(Number(t.value[a]));n.push(o)}return n}function sC(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function uC(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?sC(Object(r),!0).forEach((function(e){B()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):sC(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var cC={Point:lC,MultiPoint:function(t,e,r){return fC(t,e,r)},LineString:hC,MultiLineString:function(t,e,r){return t.map((function(t){return hC(t,e,r)}))},Polygon:dC,MultiPolygon:function(t,e,r){return t.map((function(t){return dC(t,e,r)}))}};function lC(t,e,r){var n=R()(t,2),i=n[0],o=n[1],a=R()(e,2),s=a[0],u=a[1],c=ae(s[0],u[0],i),l=ae(s[1],u[1],o);return r.unprojectFlat([c,l])}function fC(t,e,r){return t.map((function(t){return lC(t,e,r)}))}function hC(t,e,r){return fC(t,e,r)}function dC(t,e,r){return t.map((function(t){return fC(t,e,r)}))}function pC(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return vC(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return vC(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function vC(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var yC=["points","lines","polygons"];function gC(t,e,r,n){var i=t.featureIds.value;if(!i.length)return-1;var o=0,a=i[i.length-1]+1;if(n){var s=function(t,e){if(!t.__layers){for(var r={},n=t.properties,i=0;i<n.length;i++){var o=n[i].layerName;o&&(r[o]?r[o][1]=i:r[o]=[i,i])}t.__layers=r}return t.__layers[e]}(t,n);if(!s)return-1;o=s[0],a=s[1]+1}var u=-1;if(e in t.numericProps){var c=t.numericProps[e].value.findIndex((function(t,e){return t===r&&i[e]>=o&&i[e]<a}));return c>=0?t.globalFeatureIds.value[c]:-1}return e?u=mC(t.properties,(function(t){return t[e]===r}),o,a):t.fields&&(u=mC(t.fields,(function(t){return t.id===r}),o,a)),u>=0?function(t,e){if(!t.__ids){for(var r=[],n=t.featureIds.value,i=t.globalFeatureIds.value,o=0;o<n.length;o++)r[n[o]]=i[o];t.__ids=r}return t.__ids[e]}(t,u):-1}function mC(t,e,r,n){for(var i=r;i<n;i++)if(e(t[i],i))return i;return-1}function bC(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return AC(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return AC(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function AC(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function wC(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=A()(t);if(e){var i=A()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return m()(this,r)}}function BC(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function _C(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?BC(Object(r),!0).forEach((function(e){B()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):BC(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var xC=_C(_C({},_.GeoJsonLayer.defaultProps),{},{onDataLoad:{type:"function",value:null,optional:!0,compare:!1},uniqueIdProperty:"",highlightedFeatureId:null,loaders:[Yx],binary:!0}),CC=function(t){y()(n,t);var e,r=wC(n);function n(){return p()(this,n),r.apply(this,arguments)}return E()(n,[{key:"initializeState",value:function(){$n()(A()(n.prototype),"initializeState",this).call(this);var t=void 0===this.context.viewport.resolution&&this.props.binary;this.setState({binary:t,data:null,tileJSON:null})}},{key:"isLoaded",get:function(){return this.state&&this.state.data&&this.state.tileset&&$n()(A()(n.prototype),"isLoaded",this)}},{key:"updateState",value:function(t){var e,r=t.props,i=t.oldProps,o=t.context,a=t.changeFlags;a.dataChanged&&this._updateTileData(),null!==(e=this.state)&&void 0!==e&&e.data&&($n()(A()(n.prototype),"updateState",this).call(this,{props:r,oldProps:i,context:o,changeFlags:a}),this._setWGS84PropertyForTiles());var s=r.highlightColor;s!==i.highlightColor&&Array.isArray(s)&&this.setState({highlightColor:s})}},{key:"_updateTileData",value:(e=It()(Pt.a.mark((function t(){var e,r,n,i,o;return Pt.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=this.props.data,r=null,"string"!=typeof e||/(?=.*{z})(?=.*{x})(?=.*({y}|{-y}))/.test(e)){t.next=18;break}return n=this.props,i=n.onDataLoad,o=n.fetch,this.setState({data:null,tileJSON:null}),t.prev=5,t.next=8,o(e,{propName:"data",layer:this,loaders:[]});case 8:r=t.sent,t.next=15;break;case 11:t.prev=11,t.t0=t.catch(5),this.raiseError(t.t0,"loading TileJSON"),e=null;case 15:i&&i(r,{propName:"data",layer:this}),t.next=19;break;case 18:e.tilejson&&(r=e);case 19:r&&(e=r.tiles),this.setState({data:e,tileJSON:r});case 21:case"end":return t.stop()}}),t,this,[[5,11]])}))),function(){return e.apply(this,arguments)})},{key:"_getTilesetOptions",value:function(){var t=$n()(A()(n.prototype),"_getTilesetOptions",this).call(this),e=this.state.tileJSON,r=this.props,i=r.minZoom,o=r.maxZoom;return e&&(Number.isFinite(e.minzoom)&&e.minzoom>i&&(t.minZoom=e.minzoom),Number.isFinite(e.maxzoom)&&(!Number.isFinite(o)||e.maxzoom<o)&&(t.maxZoom=e.maxzoom)),t}},{key:"renderLayers",value:function(){var t;return null!==(t=this.state)&&void 0!==t&&t.data?$n()(A()(n.prototype),"renderLayers",this).call(this):null}},{key:"getTileData",value:function(t){var e,r=this.state,n=r.data,i=r.binary,o=t.index,a=t.signal,s=xn(n,t);if(!s)return Promise.reject("Invalid URL");var u=this.getLoadOptions();return(0,this.props.fetch)(s,{propName:"data",layer:this,loadOptions:u=_C(_C({},u),{},{mimeType:"application/x-protobuf",mvt:_C(_C({},null===(e=u)||void 0===e?void 0:e.mvt),{},{coordinates:this.context.viewport.resolution?"wgs84":"local",tileIndex:o}),gis:i?{format:"binary"}:{}}),signal:a})}},{key:"renderSubLayers",value:function(t){var e=t.tile.index,r=e.x,i=e.y,o=e.z,a=Math.pow(2,o),s=512/a,u=-s,c=512*r/a,l=512*(1-i/a),f=(new Jr).scale([s,u,1]);t.autoHighlight=!1,this.context.viewport.resolution||(t.modelMatrix=f,t.coordinateOrigin=[c,l,0],t.coordinateSystem=_.COORDINATE_SYSTEM.CARTESIAN,t.extensions=[].concat(Lt()(t.extensions||[]),[new _.ClipExtension]));var h=$n()(A()(n.prototype),"renderSubLayers",this).call(this,t);return!this.state.binary||h instanceof _.GeoJsonLayer||_.log.warn("renderSubLayers() must return GeoJsonLayer when using binary:true")(),h}},{key:"_updateAutoHighlight",value:function(t){var e,r,n=this.props.uniqueIdProperty,i=this.state,o=i.hoveredFeatureId,a=i.hoveredFeatureLayerName,s=t.object;s&&(e=kC(s,n),r=EC(s));var u=this.props.highlightColor;"function"==typeof u&&(u=u(t)),o===e&&a===r||this.setState({highlightColor:u,hoveredFeatureId:e,hoveredFeatureLayerName:r})}},{key:"getPickingInfo",value:function(t){var e=$n()(A()(n.prototype),"getPickingInfo",this).call(this,t),r=Boolean(this.context.viewport.resolution);if(this.state.binary&&-1!==e.index){var i=t.sourceLayer.props.data;e.object=eC(i,{globalFeatureId:e.index})}return e.object&&!r&&(e.object=TC(e.object,e.tile.bbox,this.context.viewport)),e}},{key:"getSubLayerPropsByTile",value:function(t){return{highlightedObjectIndex:this.getHighlightedObjectIndex(t),highlightColor:this.state.highlightColor}}},{key:"getHighlightedObjectIndex",value:function(t){var e=this.state,r=e.hoveredFeatureId,n=e.hoveredFeatureLayerName,i=e.binary,o=this.props,a=o.uniqueIdProperty,s=o.highlightedFeatureId,u=t.content,c=OC(s);if(!(OC(r)||c))return-1;var l=c?s:r;return Array.isArray(u)?u.findIndex((function(t){var e=kC(t,a)===l,r=c||EC(t)===n;return e&&r})):u&&i?function(t,e,r,n){var i,o=pC(yC);try{for(o.s();!(i=o.n()).done;){var a=i.value,s=t[a]&&gC(t[a],e,r,n);if(s>=0)return s}}catch(t){o.e(t)}finally{o.f()}return-1}(u,a,l,c?"":n):-1}},{key:"_pickObjects",value:function(t){var e=this.context,r=e.deck,n=e.viewport,i=n.width,o=n.height,a=n.x,s=n.y,u=[this.id];return r.pickObjects({x:a,y:s,width:i,height:o,layerIds:u,maxObjects:t})}},{key:"getRenderedFeatures",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,r=this._pickObjects(e),n=new Set,i=[],o=bC(r);try{for(o.s();!(t=o.n()).done;){var a=t.value,s=kC(a.object,this.props.uniqueIdProperty);void 0===s?i.push(a.object):n.has(s)||(n.add(s),i.push(a.object))}}catch(t){o.e(t)}finally{o.f()}return i}},{key:"_setWGS84PropertyForTiles",value:function(){var t=this;this.state.tileset.selectedTiles.forEach((function(e){e.hasOwnProperty("dataInWGS84")||Object.defineProperty(e,"dataInWGS84",{get:function(){if(!e.content)return null;if(t.state.binary&&Array.isArray(e.content)&&!e.content.length)return[];var r,n=e.bbox;if(void 0===e._contentWGS84&&(r=n,Number.isFinite(r.west)&&Number.isFinite(r.north)&&Number.isFinite(r.east)&&Number.isFinite(r.south))){var i=t.state.binary?eC(e.content):e.content;e._contentWGS84=i.map((function(e){return TC(e,n,t.context.viewport)}))}return e._contentWGS84}})}))}}]),n}(Yn);function kC(t,e){return t.properties&&e?t.properties[e]:"id"in t?t.id:void 0}function EC(t){var e;return(null===(e=t.properties)||void 0===e?void 0:e.layerName)||null}function OC(t){return null!=t&&""!==t}function TC(t,e,r){var n=_C(_C({},t),{},{geometry:{type:t.geometry.type}});return Object.defineProperty(n.geometry,"coordinates",{get:function(){return function(t,e,r){var n=[r.projectFlat([e.west,e.north]),r.projectFlat([e.east,e.south])];return uC(uC({},t),{},{coordinates:cC[t.type](t.coordinates,n,r)})}(t.geometry,e,r).coordinates}}),n}B()(CC,"layerName","MVTLayer"),B()(CC,"defaultProps",xC);for(var SC={},MC=0;MC<"0123456789bcdefghjkmnpqrstuvwxyz".length;MC++)SC["0123456789bcdefghjkmnpqrstuvwxyz".charAt(MC)]=MC;function IC(t){var e=function(t){for(var e,r=!0,n=90,i=-90,o=180,a=-180,s=0,u=0,c=t.length;u<c;u++){var l=t[u].toLowerCase();s=SC[l];for(var f=4;f>=0;f--){var h=s>>f&1;r?(e=(o+a)/2,1===h?a=e:o=e):(e=(n+i)/2,1===h?i=e:n=e),r=!r}}return[i,a,n,o]}(t),r=R()(e,4),n=r[0],i=r[1],o=r[2],a=r[3];return[a,o,a,n,i,n,i,o,a,o]}function RC(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=A()(t);if(e){var i=A()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return m()(this,r)}}var PC=function(t){y()(r,t);var e=RC(r);function r(){return p()(this,r),e.apply(this,arguments)}return E()(r,[{key:"indexToBounds",value:function(){var t=this.props,e=t.data,r=t.getGeohash;return{data:e,_normalize:!1,positionFormat:"XY",getPolygon:function(t,e){return IC(r(t,e))}}}}]),r}(M);B()(PC,"layerName","GeohashLayer"),B()(PC,"defaultProps",{getGeohash:{type:"accessor",value:function(t){return t.geohash}}}),r.d(e,"GreatCircleLayer",(function(){return C})),r.d(e,"S2Layer",(function(){return z})),r.d(e,"QuadkeyLayer",(function(){return St})),r.d(e,"TileLayer",(function(){return Yn})),r.d(e,"TripsLayer",(function(){return ni})),r.d(e,"H3ClusterLayer",(function(){return _i})),r.d(e,"H3HexagonLayer",(function(){return bi})),r.d(e,"Tile3DLayer",(function(){return m_})),r.d(e,"TerrainLayer",(function(){return E_})),r.d(e,"MVTLayer",(function(){return CC})),r.d(e,"GeohashLayer",(function(){return PC})),r.d(e,"_GeoCellLayer",(function(){return M})),r.d(e,"_getURLFromTemplate",(function(){return xn})),r.d(e,"_Tileset2D",(function(){return Jn})),r.d(e,"_Tile2DHeader",(function(){return Ft}))}])}));