@deck.gl/geo-layers 8.8.24 → 8.8.25
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/dist.dev.js +18 -18
- package/dist.min.js +1 -1
- package/package.json +2 -2
- package/typed/imagery-layer/imagery-layer.d.ts +47 -0
- package/typed/imagery-layer/imagery-layer.d.ts.map +1 -0
- package/typed/tileset-2d/index.d.ts +1 -0
- package/typed/tileset-2d/index.d.ts.map +1 -1
- package/typed/tileset-2d/tileset-2d.d.ts.map +1 -1
- package/typed/tileset-2d/utils.d.ts +5 -4
- package/typed/tileset-2d/utils.d.ts.map +1 -1
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===(a="function"==typeof(n=function(){"use strict";function e(e,t,r){this.low=0|e,this.high=0|t,this.unsigned=!!r}function t(e){return!0===(e&&e.__isLong__)}e.prototype.__isLong__,Object.defineProperty(e.prototype,"__isLong__",{value:!0,enumerable:!1,configurable:!1}),e.isLong=t;var r={},n={};function i(e,t){var i,a,s;return t?(s=0<=(e>>>=0)&&e<256)&&(a=n[e])?a:(i=o(e,(0|e)<0?-1:0,!0),s&&(n[e]=i),i):(s=-128<=(e|=0)&&e<128)&&(a=r[e])?a:(i=o(e,e<0?-1:0,!1),s&&(r[e]=i),i)}function a(e,t){if(isNaN(e)||!isFinite(e))return t?v:p;if(t){if(e<0)return v;if(e>=f)return A}else{if(e<=-h)return B;if(e+1>=h)return b}return e<0?a(-e,t).neg():o(e%l|0,e/l|0,t)}function o(t,r,n){return new e(t,r,n)}e.fromInt=i,e.fromNumber=a,e.fromBits=o;var s=Math.pow;function u(e,t,r){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return p;if("number"==typeof t?(r=t,t=!1):t=!!t,(r=r||10)<2||36<r)throw RangeError("radix");var n;if((n=e.indexOf("-"))>0)throw Error("interior hyphen");if(0===n)return u(e.substring(1),t,r).neg();for(var i=a(s(r,8)),o=p,c=0;c<e.length;c+=8){var l=Math.min(8,e.length-c),f=parseInt(e.substring(c,c+l),r);if(l<8){var h=a(s(r,l));o=o.mul(h).add(a(f))}else o=(o=o.mul(i)).add(a(f))}return o.unsigned=t,o}function c(t){return t instanceof e?t:"number"==typeof t?a(t):"string"==typeof t?u(t):o(t.low,t.high,t.unsigned)}e.fromString=u,e.fromValue=c;var l=4294967296,f=l*l,h=f/2,d=i(1<<24),p=i(0);e.ZERO=p;var v=i(0,!0);e.UZERO=v;var y=i(1);e.ONE=y;var g=i(1,!0);e.UONE=g;var m=i(-1);e.NEG_ONE=m;var b=o(-1,2147483647,!1);e.MAX_VALUE=b;var A=o(-1,-1,!0);e.MAX_UNSIGNED_VALUE=A;var B=o(0,-2147483648,!1);e.MIN_VALUE=B;var w=e.prototype;return w.toInt=function(){return this.unsigned?this.low>>>0:this.low},w.toNumber=function(){return this.unsigned?(this.high>>>0)*l+(this.low>>>0):this.high*l+(this.low>>>0)},w.toString=function(e){if((e=e||10)<2||36<e)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(B)){var t=a(e),r=this.div(t),n=r.mul(t).sub(this);return r.toString(e)+n.toInt().toString(e)}return"-"+this.neg().toString(e)}for(var i=a(s(e,6),this.unsigned),o=this,u="";;){var c=o.div(i),l=(o.sub(c.mul(i)).toInt()>>>0).toString(e);if((o=c).isZero())return l+u;for(;l.length<6;)l="0"+l;u=""+l+u}},w.getHighBits=function(){return this.high},w.getHighBitsUnsigned=function(){return this.high>>>0},w.getLowBits=function(){return this.low},w.getLowBitsUnsigned=function(){return this.low>>>0},w.getNumBitsAbs=function(){if(this.isNegative())return this.eq(B)?64:this.neg().getNumBitsAbs();for(var e=0!=this.high?this.high:this.low,t=31;t>0&&0==(e&1<<t);t--);return 0!=this.high?t+33:t+1},w.isZero=function(){return 0===this.high&&0===this.low},w.isNegative=function(){return!this.unsigned&&this.high<0},w.isPositive=function(){return this.unsigned||this.high>=0},w.isOdd=function(){return 1==(1&this.low)},w.isEven=function(){return 0==(1&this.low)},w.equals=function(e){return t(e)||(e=c(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&this.high===e.high&&this.low===e.low},w.eq=w.equals,w.notEquals=function(e){return!this.eq(e)},w.neq=w.notEquals,w.lessThan=function(e){return this.comp(e)<0},w.lt=w.lessThan,w.lessThanOrEqual=function(e){return this.comp(e)<=0},w.lte=w.lessThanOrEqual,w.greaterThan=function(e){return this.comp(e)>0},w.gt=w.greaterThan,w.greaterThanOrEqual=function(e){return this.comp(e)>=0},w.gte=w.greaterThanOrEqual,w.compare=function(e){if(t(e)||(e=c(e)),this.eq(e))return 0;var r=this.isNegative(),n=e.isNegative();return r&&!n?-1:!r&&n?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},w.comp=w.compare,w.negate=function(){return!this.unsigned&&this.eq(B)?B:this.not().add(y)},w.neg=w.negate,w.add=function(e){t(e)||(e=c(e));var r=this.high>>>16,n=65535&this.high,i=this.low>>>16,a=65535&this.low,s=e.high>>>16,u=65535&e.high,l=e.low>>>16,f=0,h=0,d=0,p=0;return d+=(p+=a+(65535&e.low))>>>16,h+=(d+=i+l)>>>16,f+=(h+=n+u)>>>16,f+=r+s,o((d&=65535)<<16|(p&=65535),(f&=65535)<<16|(h&=65535),this.unsigned)},w.subtract=function(e){return t(e)||(e=c(e)),this.add(e.neg())},w.sub=w.subtract,w.multiply=function(e){if(this.isZero())return p;if(t(e)||(e=c(e)),e.isZero())return p;if(this.eq(B))return e.isOdd()?B:p;if(e.eq(B))return this.isOdd()?B:p;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(d)&&e.lt(d))return a(this.toNumber()*e.toNumber(),this.unsigned);var r=this.high>>>16,n=65535&this.high,i=this.low>>>16,s=65535&this.low,u=e.high>>>16,l=65535&e.high,f=e.low>>>16,h=65535&e.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,o((g&=65535)<<16|(m&=65535),(v&=65535)<<16|(y&=65535),this.unsigned)},w.mul=w.multiply,w.divide=function(e){if(t(e)||(e=c(e)),e.isZero())throw Error("division by zero");if(this.isZero())return this.unsigned?v:p;var r,n,i;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return v;if(e.gt(this.shru(1)))return g;i=v}else{if(this.eq(B))return e.eq(y)||e.eq(m)?B:e.eq(B)?y:(r=this.shr(1).div(e).shl(1)).eq(p)?e.isNegative()?y:m:(n=this.sub(e.mul(r)),i=r.add(n.div(e)));if(e.eq(B))return this.unsigned?v:p;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();i=p}for(n=this;n.gte(e);){r=Math.max(1,Math.floor(n.toNumber()/e.toNumber()));for(var o=Math.ceil(Math.log(r)/Math.LN2),u=o<=48?1:s(2,o-48),l=a(r),f=l.mul(e);f.isNegative()||f.gt(n);)f=(l=a(r-=u,this.unsigned)).mul(e);l.isZero()&&(l=y),i=i.add(l),n=n.sub(f)}return i},w.div=w.divide,w.modulo=function(e){return t(e)||(e=c(e)),this.sub(this.div(e).mul(e))},w.mod=w.modulo,w.not=function(){return o(~this.low,~this.high,this.unsigned)},w.and=function(e){return t(e)||(e=c(e)),o(this.low&e.low,this.high&e.high,this.unsigned)},w.or=function(e){return t(e)||(e=c(e)),o(this.low|e.low,this.high|e.high,this.unsigned)},w.xor=function(e){return t(e)||(e=c(e)),o(this.low^e.low,this.high^e.high,this.unsigned)},w.shiftLeft=function(e){return t(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?o(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):o(0,this.low<<e-32,this.unsigned)},w.shl=w.shiftLeft,w.shiftRight=function(e){return t(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?o(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):o(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},w.shr=w.shiftRight,w.shiftRightUnsigned=function(e){if(t(e)&&(e=e.toInt()),0==(e&=63))return this;var r=this.high;return e<32?o(this.low>>>e|r<<32-e,r>>>e,this.unsigned):o(32===e?r:r>>>e-32,0,this.unsigned)},w.shru=w.shiftRightUnsigned,w.toSigned=function(){return this.unsigned?o(this.low,this.high,!1):this},w.toUnsigned=function(){return this.unsigned?this:o(this.low,this.high,!0)},w.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},w.toBytesLE=function(){var e=this.high,t=this.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24&255,255&e,e>>>8&255,e>>>16&255,e>>>24&255]},w.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24&255,e>>>16&255,e>>>8&255,255&e,t>>>24&255,t>>>16&255,t>>>8&255,255&t]},e})?n.apply(t,i):n)||(e.exports=a)},function(e,t,r){var n=r(51);e.exports=function(e){return new n(e)}},function(e,t){},,,function(e,t){e.exports=r},function(e,t,r){var n=r(96);e.exports=function(e){return function(){return new n(e.apply(this,arguments))}}},function(e,t){e.exports=function(e){var t;if("undefined"!=typeof Symbol){if(Symbol.asyncIterator&&null!=(t=e[Symbol.asyncIterator]))return t.call(e);if(Symbol.iterator&&null!=(t=e[Symbol.iterator]))return t.call(e)}throw new TypeError("Object is not async iterable")}},function(e,t,r){var n=r(72),i=r(73),a=r(48),o=r(74);e.exports=function(e){return n(e)||i(e)||a(e)||o()},e.exports.default=e.exports,e.exports.__esModule=!0},,,function(e,t){},function(e,t){function r(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(e.exports=r=function(e){return typeof e},e.exports.default=e.exports,e.exports.__esModule=!0):(e.exports=r=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.default=e.exports,e.exports.__esModule=!0),r(t)}e.exports=r,e.exports.default=e.exports,e.exports.__esModule=!0},,function(e,t){},function(e,t,r){"use strict";e.exports=i;var n=r(97);function i(e){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(e)?e:new Uint8Array(e||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 a="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function o(e){return e.type===i.Bytes?e.readVarint()+e.pos:e.pos+1}function s(e,t,r){return r?4294967296*t+(e>>>0):4294967296*(t>>>0)+(e>>>0)}function u(e,t,r){var n=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.floor(Math.log(t)/(7*Math.LN2));r.realloc(n);for(var i=r.pos-1;i>=e;i--)r.buf[i+n]=r.buf[i]}function c(e,t){for(var r=0;r<e.length;r++)t.writeVarint(e[r])}function l(e,t){for(var r=0;r<e.length;r++)t.writeSVarint(e[r])}function f(e,t){for(var r=0;r<e.length;r++)t.writeFloat(e[r])}function h(e,t){for(var r=0;r<e.length;r++)t.writeDouble(e[r])}function d(e,t){for(var r=0;r<e.length;r++)t.writeBoolean(e[r])}function p(e,t){for(var r=0;r<e.length;r++)t.writeFixed32(e[r])}function v(e,t){for(var r=0;r<e.length;r++)t.writeSFixed32(e[r])}function y(e,t){for(var r=0;r<e.length;r++)t.writeFixed64(e[r])}function g(e,t){for(var r=0;r<e.length;r++)t.writeSFixed64(e[r])}function m(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+16777216*e[t+3]}function b(e,t,r){e[r]=t,e[r+1]=t>>>8,e[r+2]=t>>>16,e[r+3]=t>>>24}function A(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+(e[t+3]<<24)}i.prototype={destroy:function(){this.buf=null},readFields:function(e,t,r){for(r=r||this.length;this.pos<r;){var n=this.readVarint(),i=n>>3,a=this.pos;this.type=7&n,e(i,t,this),this.pos===a&&this.skip(n)}return t},readMessage:function(e,t){return this.readFields(e,t,this.readVarint()+this.pos)},readFixed32:function(){var e=m(this.buf,this.pos);return this.pos+=4,e},readSFixed32:function(){var e=A(this.buf,this.pos);return this.pos+=4,e},readFixed64:function(){var e=m(this.buf,this.pos)+4294967296*m(this.buf,this.pos+4);return this.pos+=8,e},readSFixed64:function(){var e=m(this.buf,this.pos)+4294967296*A(this.buf,this.pos+4);return this.pos+=8,e},readFloat:function(){var e=n.read(this.buf,this.pos,!0,23,4);return this.pos+=4,e},readDouble:function(){var e=n.read(this.buf,this.pos,!0,52,8);return this.pos+=8,e},readVarint:function(e){var t,r,n=this.buf;return t=127&(r=n[this.pos++]),r<128?t:(t|=(127&(r=n[this.pos++]))<<7,r<128?t:(t|=(127&(r=n[this.pos++]))<<14,r<128?t:(t|=(127&(r=n[this.pos++]))<<21,r<128?t:function(e,t,r){var n,i,a=r.buf;if(i=a[r.pos++],n=(112&i)>>4,i<128)return s(e,n,t);if(i=a[r.pos++],n|=(127&i)<<3,i<128)return s(e,n,t);if(i=a[r.pos++],n|=(127&i)<<10,i<128)return s(e,n,t);if(i=a[r.pos++],n|=(127&i)<<17,i<128)return s(e,n,t);if(i=a[r.pos++],n|=(127&i)<<24,i<128)return s(e,n,t);if(i=a[r.pos++],n|=(1&i)<<31,i<128)return s(e,n,t);throw new Error("Expected varint not more than 10 bytes")}(t|=(15&(r=n[this.pos]))<<28,e,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var e=this.readVarint();return e%2==1?(e+1)/-2:e/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var e=this.readVarint()+this.pos,t=this.pos;return this.pos=e,e-t>=12&&a?function(e,t,r){return a.decode(e.subarray(t,r))}(this.buf,t,e):function(e,t,r){var n="",i=t;for(;i<r;){var a,o,s,u=e[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&(a=e[i+1]))&&(c=(31&u)<<6|63&a)<=127&&(c=null):3===l?(a=e[i+1],o=e[i+2],128==(192&a)&&128==(192&o)&&((c=(15&u)<<12|(63&a)<<6|63&o)<=2047||c>=55296&&c<=57343)&&(c=null)):4===l&&(a=e[i+1],o=e[i+2],s=e[i+3],128==(192&a)&&128==(192&o)&&128==(192&s)&&((c=(15&u)<<18|(63&a)<<12|(63&o)<<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,t,e)},readBytes:function(){var e=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,e);return this.pos=e,t},readPackedVarint:function(e,t){if(this.type!==i.Bytes)return e.push(this.readVarint(t));var r=o(this);for(e=e||[];this.pos<r;)e.push(this.readVarint(t));return e},readPackedSVarint:function(e){if(this.type!==i.Bytes)return e.push(this.readSVarint());var t=o(this);for(e=e||[];this.pos<t;)e.push(this.readSVarint());return e},readPackedBoolean:function(e){if(this.type!==i.Bytes)return e.push(this.readBoolean());var t=o(this);for(e=e||[];this.pos<t;)e.push(this.readBoolean());return e},readPackedFloat:function(e){if(this.type!==i.Bytes)return e.push(this.readFloat());var t=o(this);for(e=e||[];this.pos<t;)e.push(this.readFloat());return e},readPackedDouble:function(e){if(this.type!==i.Bytes)return e.push(this.readDouble());var t=o(this);for(e=e||[];this.pos<t;)e.push(this.readDouble());return e},readPackedFixed32:function(e){if(this.type!==i.Bytes)return e.push(this.readFixed32());var t=o(this);for(e=e||[];this.pos<t;)e.push(this.readFixed32());return e},readPackedSFixed32:function(e){if(this.type!==i.Bytes)return e.push(this.readSFixed32());var t=o(this);for(e=e||[];this.pos<t;)e.push(this.readSFixed32());return e},readPackedFixed64:function(e){if(this.type!==i.Bytes)return e.push(this.readFixed64());var t=o(this);for(e=e||[];this.pos<t;)e.push(this.readFixed64());return e},readPackedSFixed64:function(e){if(this.type!==i.Bytes)return e.push(this.readSFixed64());var t=o(this);for(e=e||[];this.pos<t;)e.push(this.readSFixed64());return e},skip:function(e){var t=7&e;if(t===i.Varint)for(;this.buf[this.pos++]>127;);else if(t===i.Bytes)this.pos=this.readVarint()+this.pos;else if(t===i.Fixed32)this.pos+=4;else{if(t!==i.Fixed64)throw new Error("Unimplemented type: "+t);this.pos+=8}},writeTag:function(e,t){this.writeVarint(e<<3|t)},realloc:function(e){for(var t=this.length||16;t<this.pos+e;)t*=2;if(t!==this.length){var r=new Uint8Array(t);r.set(this.buf),this.buf=r,this.length=t}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(e){this.realloc(4),b(this.buf,e,this.pos),this.pos+=4},writeSFixed32:function(e){this.realloc(4),b(this.buf,e,this.pos),this.pos+=4},writeFixed64:function(e){this.realloc(8),b(this.buf,-1&e,this.pos),b(this.buf,Math.floor(e*(1/4294967296)),this.pos+4),this.pos+=8},writeSFixed64:function(e){this.realloc(8),b(this.buf,-1&e,this.pos),b(this.buf,Math.floor(e*(1/4294967296)),this.pos+4),this.pos+=8},writeVarint:function(e){(e=+e||0)>268435455||e<0?function(e,t){var r,n;e>=0?(r=e%4294967296|0,n=e/4294967296|0):(n=~(-e/4294967296),4294967295^(r=~(-e%4294967296))?r=r+1|0:(r=0,n=n+1|0));if(e>=0x10000000000000000||e<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");t.realloc(10),function(e,t,r){r.buf[r.pos++]=127&e|128,e>>>=7,r.buf[r.pos++]=127&e|128,e>>>=7,r.buf[r.pos++]=127&e|128,e>>>=7,r.buf[r.pos++]=127&e|128,e>>>=7,r.buf[r.pos]=127&e}(r,0,t),function(e,t){var r=(7&e)<<4;if(t.buf[t.pos++]|=r|((e>>>=3)?128:0),!e)return;if(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),!e)return;if(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),!e)return;if(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),!e)return;if(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),!e)return;t.buf[t.pos++]=127&e}(n,t)}(e,this):(this.realloc(4),this.buf[this.pos++]=127&e|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=e>>>7&127))))},writeSVarint:function(e){this.writeVarint(e<0?2*-e-1:2*e)},writeBoolean:function(e){this.writeVarint(Boolean(e))},writeString:function(e){e=String(e),this.realloc(4*e.length),this.pos++;var t=this.pos;this.pos=function(e,t,r){for(var n,i,a=0;a<t.length;a++){if((n=t.charCodeAt(a))>55295&&n<57344){if(!i){n>56319||a+1===t.length?(e[r++]=239,e[r++]=191,e[r++]=189):i=n;continue}if(n<56320){e[r++]=239,e[r++]=191,e[r++]=189,i=n;continue}n=i-55296<<10|n-56320|65536,i=null}else i&&(e[r++]=239,e[r++]=191,e[r++]=189,i=null);n<128?e[r++]=n:(n<2048?e[r++]=n>>6|192:(n<65536?e[r++]=n>>12|224:(e[r++]=n>>18|240,e[r++]=n>>12&63|128),e[r++]=n>>6&63|128),e[r++]=63&n|128)}return r}(this.buf,e,this.pos);var r=this.pos-t;r>=128&&u(t,r,this),this.pos=t-1,this.writeVarint(r),this.pos+=r},writeFloat:function(e){this.realloc(4),n.write(this.buf,e,this.pos,!0,23,4),this.pos+=4},writeDouble:function(e){this.realloc(8),n.write(this.buf,e,this.pos,!0,52,8),this.pos+=8},writeBytes:function(e){var t=e.length;this.writeVarint(t),this.realloc(t);for(var r=0;r<t;r++)this.buf[this.pos++]=e[r]},writeRawMessage:function(e,t){this.pos++;var r=this.pos;e(t,this);var n=this.pos-r;n>=128&&u(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(e,t,r){this.writeTag(e,i.Bytes),this.writeRawMessage(t,r)},writePackedVarint:function(e,t){t.length&&this.writeMessage(e,c,t)},writePackedSVarint:function(e,t){t.length&&this.writeMessage(e,l,t)},writePackedBoolean:function(e,t){t.length&&this.writeMessage(e,d,t)},writePackedFloat:function(e,t){t.length&&this.writeMessage(e,f,t)},writePackedDouble:function(e,t){t.length&&this.writeMessage(e,h,t)},writePackedFixed32:function(e,t){t.length&&this.writeMessage(e,p,t)},writePackedSFixed32:function(e,t){t.length&&this.writeMessage(e,v,t)},writePackedFixed64:function(e,t){t.length&&this.writeMessage(e,y,t)},writePackedSFixed64:function(e,t){t.length&&this.writeMessage(e,g,t)},writeBytesField:function(e,t){this.writeTag(e,i.Bytes),this.writeBytes(t)},writeFixed32Field:function(e,t){this.writeTag(e,i.Fixed32),this.writeFixed32(t)},writeSFixed32Field:function(e,t){this.writeTag(e,i.Fixed32),this.writeSFixed32(t)},writeFixed64Field:function(e,t){this.writeTag(e,i.Fixed64),this.writeFixed64(t)},writeSFixed64Field:function(e,t){this.writeTag(e,i.Fixed64),this.writeSFixed64(t)},writeVarintField:function(e,t){this.writeTag(e,i.Varint),this.writeVarint(t)},writeSVarintField:function(e,t){this.writeTag(e,i.Varint),this.writeSVarint(t)},writeStringField:function(e,t){this.writeTag(e,i.Bytes),this.writeString(t)},writeFloatField:function(e,t){this.writeTag(e,i.Fixed32),this.writeFloat(t)},writeDoubleField:function(e,t){this.writeTag(e,i.Fixed64),this.writeDouble(t)},writeBooleanField:function(e,t){this.writeVarintField(e,Boolean(t))}}},,,,,function(e,t){function r(t,n){return e.exports=r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},r(t,n)}e.exports=r},function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){var n=r(47);e.exports=function(e,t){if(e){if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){},function(e,t){e.exports=function(e){this.wrapped=e}},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){function r(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}e.exports=function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){var n=r(89),i=r(90),a=r(91),o=r(93);e.exports=function(e,t){return n(e)||i(e,t)||a(e,t)||o()},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){function r(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}e.exports=function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){var n=r(46);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(e){return!1}}function a(t,r,o){return i()?e.exports=a=Reflect.construct:e.exports=a=function(e,t,r){var i=[null];i.push.apply(i,t);var a=new(Function.bind.apply(e,i));return r&&n(a,r.prototype),a},a.apply(null,arguments)}e.exports=a},function(e,t,r){var n=r(98),i=globalThis.deck||{};if(!i.LineLayer)throw new Error("@deck.gl/layers is not found");e.exports=Object.assign(i,n)},,,,,,,,,,function(e,t){e.exports=function(e){if(Array.isArray(e))return e}},function(e,t){e.exports=function(e,t){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)){var r=[],n=!0,i=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(n=(o=s.next()).done)&&(r.push(o.value),!t||r.length!==t);n=!0);}catch(e){i=!0,a=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw a}}return r}}},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}},function(e,t,r){var n=r(47);e.exports=function(e){if(Array.isArray(e))return n(e)},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.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.")},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e){if(Array.isArray(e))return e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,a=[],o=!0,s=!1;try{for(r=r.call(e);!(o=(n=r.next()).done)&&(a.push(n.value),!t||a.length!==t);o=!0);}catch(e){s=!0,i=e}finally{try{o||null==r.return||r.return()}finally{if(s)throw i}}return a}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.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.")},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t<e.length;t++)r[t]=e[t];return r}}},function(e,t){e.exports=function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}},function(e,t){function r(t,n){return e.exports=r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},e.exports.default=e.exports,e.exports.__esModule=!0,r(t,n)}e.exports=r,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){var n=r(49);e.exports=function(e){if(Array.isArray(e))return n(e)},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){var n=r(49);e.exports=function(e,t){if(e){if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.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.")},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){var n=function(e){"use strict";var t=Object.prototype,r=t.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",a=n.asyncIterator||"@@asyncIterator",o=n.toStringTag||"@@toStringTag";function s(e,t,r,n){var i=t&&t.prototype instanceof l?t:l,a=Object.create(i.prototype),o=new w(n||[]);return a._invoke=function(e,t,r){var n="suspendedStart";return function(i,a){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw a;return x()}for(r.method=i,r.arg=a;;){var o=r.delegate;if(o){var s=b(o,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(e,t,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)}}}(e,r,o),a}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.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!==t&&r.call(v,i)&&(d=v);var y=h.prototype=l.prototype=Object.create(d);function g(e){["next","throw","return"].forEach((function(t){e[t]=function(e){return this._invoke(t,e)}}))}function m(e){var t;this._invoke=function(n,i){function a(){return new Promise((function(t,a){!function t(n,i,a,o){var s=u(e[n],e,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(e){t("next",e,a,o)}),(function(e){t("throw",e,a,o)})):Promise.resolve(l).then((function(e){c.value=e,a(c)}),(function(e){return t("throw",e,a,o)}))}o(s.arg)}(n,i,t,a)}))}return t=t?t.then(a,a):a()}}function b(e,t){var r=e.iterator[t.method];if(void 0===r){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,b(e,t),"throw"===t.method))return c;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return c}var n=u(r,e.iterator,t.arg);if("throw"===n.type)return t.method="throw",t.arg=n.arg,t.delegate=null,c;var i=n.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,c):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,c)}function A(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function B(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function w(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(A,this),this.reset(!0)}function _(e){if(e){var t=e[i];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:x}}function x(){return{value:void 0,done:!0}}return f.prototype=y.constructor=h,h.constructor=f,h[o]=f.displayName="GeneratorFunction",e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,o in e||(e[o]="GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},g(m.prototype),m.prototype[a]=function(){return this},e.AsyncIterator=m,e.async=function(t,r,n,i){var a=new m(s(t,r,n,i));return e.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},g(y),y[o]="Generator",y[i]=function(){return this},y.toString=function(){return"[object Generator]"},e.keys=function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function r(){for(;t.length;){var n=t.pop();if(n in e)return r.value=n,r.done=!1,r}return r.done=!0,r}},e.values=_,w.prototype={constructor:w,reset:function(e){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),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return o.type="throw",o.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],o=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var s=r.call(a,"catchLoc"),u=r.call(a,"finallyLoc");if(s&&u){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(e,t){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 a=i;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=e,o.arg=t,a?(this.method="next",this.next=a.finallyLoc,c):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),c},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),B(r),c}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;B(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:_(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),c}},e}(e.exports);try{regeneratorRuntime=n}catch(e){Function("r","regeneratorRuntime = r")(n)}},function(e,t,r){var n=r(5);e.exports=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=n(e)););return e}},function(e,t){e.exports=function(e){if(Array.isArray(e))return e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,a=[],o=!0,s=!1;try{for(r=r.call(e);!(o=(n=r.next()).done)&&(a.push(n.value),!t||a.length!==t);o=!0);}catch(e){s=!0,i=e}finally{try{o||null==r.return||r.return()}finally{if(s)throw i}}return a}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){var n=r(92);e.exports=function(e,t){if(e){if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.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.")},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){},function(e,t){},function(e,t,r){var n=r(51);function i(e){var t,r;function i(t,r){try{var o=e[t](r),s=o.value,u=s instanceof n;Promise.resolve(u?s.wrapped:s).then((function(e){u?i("return"===t?"return":"next",e):a(o.done?"return":"normal",e)}),(function(e){i("throw",e)}))}catch(e){a("throw",e)}}function a(e,n){switch(e){case"return":t.resolve({value:n,done:!0});break;case"throw":t.reject(n);break;default:t.resolve({value:n,done:!1})}(t=t.next)?i(t.key,t.arg):r=null}this._invoke=function(e,n){return new Promise((function(a,o){var s={key:e,arg:n,resolve:a,reject:o,next:null};r?r=r.next=s:(t=r=s,i(e,n))}))},"function"!=typeof e.return&&(this.return=void 0)}"function"==typeof Symbol&&Symbol.asyncIterator&&(i.prototype[Symbol.asyncIterator]=function(){return this}),i.prototype.next=function(e){return this._invoke("next",e)},i.prototype.throw=function(e){return this._invoke("throw",e)},i.prototype.return=function(e){return this._invoke("return",e)},e.exports=i},function(e,t){t.read=function(e,t,r,n,i){var a,o,s=8*i-n-1,u=(1<<s)-1,c=u>>1,l=-7,f=r?i-1:0,h=r?-1:1,d=e[t+f];for(f+=h,a=d&(1<<-l)-1,d>>=-l,l+=s;l>0;a=256*a+e[t+f],f+=h,l-=8);for(o=a&(1<<-l)-1,a>>=-l,l+=n;l>0;o=256*o+e[t+f],f+=h,l-=8);if(0===a)a=1-c;else{if(a===u)return o?NaN:1/0*(d?-1:1);o+=Math.pow(2,n),a-=c}return(d?-1:1)*o*Math.pow(2,a-n)},t.write=function(e,t,r,n,i,a){var o,s,u,c=8*a-i-1,l=(1<<c)-1,f=l>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:a-1,p=n?1:-1,v=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=l):(o=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-o))<1&&(o--,u*=2),(t+=o+f>=1?h/u:h*Math.pow(2,1-f))*u>=2&&(o++,u/=2),o+f>=l?(s=0,o=l):o+f>=1?(s=(t*u-1)*Math.pow(2,i),o+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,i),o=0));i>=8;e[r+d]=255&s,d+=p,s/=256,i-=8);for(o=o<<i|s,c+=i;c>0;e[r+d]=255&o,d+=p,o/=256,c-=8);e[r+d-p]|=128*v}},function(e,t,r){"use strict";r.r(t);var n={};r.r(n),r.d(n,"filename",(function(){return Cl})),r.d(n,"dirname",(function(){return Ol})),r.d(n,"join",(function(){return El}));var i={};r.r(i),r.d(i,"name",(function(){return tg})),r.d(i,"decode",(function(){return rg}));var a={};r.r(a),r.d(a,"name",(function(){return fg})),r.d(a,"preprocess",(function(){return hg}));var o={};r.r(o),r.d(o,"name",(function(){return vg})),r.d(o,"preprocess",(function(){return yg}));var s={};r.r(s),r.d(s,"name",(function(){return xg})),r.d(s,"preprocess",(function(){return Cg})),r.d(s,"decode",(function(){return Og})),r.d(s,"encode",(function(){return Tg}));var u={};r.r(u),r.d(u,"name",(function(){return Dg})),r.d(u,"decode",(function(){return Lg})),r.d(u,"encode",(function(){return Gg}));var c={};r.r(c),r.d(c,"name",(function(){return Jg})),r.d(c,"decode",(function(){return Vg})),r.d(c,"encode",(function(){return Kg}));var l={};r.r(l),r.d(l,"name",(function(){return Qg})),r.d(l,"decode",(function(){return Wg})),r.d(l,"encode",(function(){return Yg}));var f=r(2),h=r.n(f),d=r(6),p=r.n(d),v=r(11),y=r.n(v),g=r(5),m=r.n(g),b=r(0),A=r.n(b),B=r(10);function w(e){var t=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(e){return!1}}();return function(){var r,n=m()(e);if(t){var i=m()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return y()(this,r)}}var _=function(e){p()(r,e);var t=w(r);function r(){return h()(this,r),t.apply(this,arguments)}return r}(B.ArcLayer);A()(_,"layerName","GreatCircleLayer"),A()(_,"defaultProps",{getHeight:{type:"accessor",value:0},greatCircle:!0});var x=r(3),C=r.n(x);function O(e){var t=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(e){return!1}}();return function(){var r,n=m()(e);if(t){var i=m()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return y()(this,r)}}function E(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}var T=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?E(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):E(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},B.PolygonLayer.defaultProps),S=function(e){p()(r,e);var t=O(r);function r(){return h()(this,r),t.apply(this,arguments)}return C()(r,[{key:"indexToBounds",value:function(){return null}},{key:"renderLayers",value:function(){var e=this.props,t=e.elevationScale,r=e.extruded,n=e.wireframe,i=e.filled,a=e.stroked,o=e.lineWidthUnits,s=e.lineWidthScale,u=e.lineWidthMinPixels,c=e.lineWidthMaxPixels,l=e.lineJointRounded,f=e.lineMiterLimit,h=e.lineDashJustified,d=e.getElevation,p=e.getFillColor,v=e.getLineColor,y=e.getLineWidth,g=this.props,m=g.updateTriggers,b=g.material,A=g.transitions;return new(this.getSubLayerClass("cell",B.PolygonLayer))({filled:i,wireframe:n,extruded:r,elevationScale:t,stroked:a,lineWidthUnits:o,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}(B.CompositeLayer);A()(S,"layerName","GeoCellLayer"),A()(S,"defaultProps",T);var k=r(7),M=r.n(k),I=r(26),P=r.n(I),R=180/Math.PI;function F(e,t,r){var n=1<<t;return[(e[0]+r[0])/n,(e[1]+r[1])/n]}function D(e){return e>=.5?1/3*(4*e*e-1):1/3*(1-4*(1-e)*(1-e))}function L(e){return[D(e[0]),D(e[1])]}function j(e,t){var r=M()(t,2),n=r[0],i=r[1];switch(e){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 G(e,t,r,n){if(0===n){1===r&&(t[0]=e-1-t[0],t[1]=e-1-t[1]);var i=t[0];t[0]=t[1],t[1]=i}}function U(e){if("string"==typeof e){if(e.indexOf("/")>0)return e;e=function(e){var t=e.padEnd(16,"0");return P.a.fromString(t,16)}(e)}return function(e){for(var t=P.a.fromString(e,!0,10).toString(2);t.length<64;)t="0"+t;for(var r=t.lastIndexOf("1"),n=t.substring(0,3),i=t.substring(3,r),a=i.length/2,o=P.a.fromString(n,!0,2).toString(10),s=P.a.fromString(i,!0,2).toString(4);s.length<a;)s="0"+s;return"".concat(o,"/").concat(s)}(e.toString())}function N(e){return function(e){for(var t,r,n,i,a,o,s=e.face,u=e.ij,c=e.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 B=j(s,L(F(u,c,y))),w=(t=B,r=void 0,n=void 0,i=void 0,a=void 0,o=void 0,r=M()(t,3),n=r[0],i=r[1],a=r[2],o=Math.atan2(a,Math.sqrt(n*n+i*i)),[Math.atan2(i,n)*R,o*R]);Math.abs(w[1])>89.999&&(w[0]=p);var _=w[0]-p;w[0]+=_>180?-360:_<-180?360:0,h[d++]=w[0],h[d++]=w[1],p=w[0]}return h[d++]=h[0],h[d++]=h[1],h}(function(e){for(var t,r=e.split("/"),n=parseInt(r[0],10),i=r[1],a=i.length,o=[0,0],s=a-1;s>=0;s--){t=a-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,t-1);G(f,o,c,l),o[0]+=f*c,o[1]+=f*l}if(n%2==1){var h=o[0];o[0]=o[1],o[1]=h}return{face:n,ij:o,level:t}}(U(e)))}function H(e){var t=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(e){return!1}}();return function(){var r,n=m()(e);if(t){var i=m()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return y()(this,r)}}var J=function(e){p()(r,e);var t=H(r);function r(){return h()(this,r),t.apply(this,arguments)}return C()(r,[{key:"indexToBounds",value:function(){var e=this.props,t=e.data,r=e.getS2Token;return{data:t,_normalize:!1,positionFormat:"XY",getPolygon:function(e,t){return N(r(e,t))}}}}]),r}(S);A()(J,"layerName","S2Layer"),A()(J,"defaultProps",{getS2Token:{type:"accessor",value:function(e){return e.token}}});r(34);var V=r(20),z=r.n(V);r(52),r(53);var K="undefined"!=typeof Float32Array?Float32Array:Array;Math.random;Math.PI;function q(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e}function X(e){var t=e[0],r=e[1],n=e[2],i=e[3];return Math.hypot(t,r,n,i)}function Q(e){var t=e[0],r=e[1],n=e[2],i=e[3];return t*t+r*r+n*n+i*i}function W(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3];return e[0]=r[0]*n+r[4]*i+r[8]*a+r[12]*o,e[1]=r[1]*n+r[5]*i+r[9]*a+r[13]*o,e[2]=r[2]*n+r[6]*i+r[10]*a+r[14]*o,e[3]=r[3]*n+r[7]*i+r[11]*a+r[15]*o,e}function Z(e,t,r){var n=t[0],i=t[1],a=t[2],o=r[0],s=r[1],u=r[2],c=r[3],l=c*n+s*a-u*i,f=c*i+u*n-o*a,h=c*a+o*i-s*n,d=-o*n-s*i-u*a;return e[0]=l*c+d*-o+f*-u-h*-s,e[1]=f*c+d*-s+h*-o-l*-u,e[2]=h*c+d*-u+l*-s-f*-o,e[3]=t[3],e}Math.hypot||(Math.hypot=function(){for(var e=0,t=arguments.length;t--;)e+=arguments[t]*arguments[t];return Math.sqrt(e)});var Y,$;Y=new K(4),K!=Float32Array&&(Y[0]=0,Y[1]=0,Y[2]=0,Y[3]=0),$=Y;Math.log2;function ee(e,t){var r=t[0],n=t[1],i=t[2],a=t[3],o=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],v=t[13],y=t[14],g=t[15],m=r*s-n*o,b=r*u-i*o,A=r*c-a*o,B=n*u-i*s,w=n*c-a*s,_=i*c-a*u,x=l*v-f*p,C=l*y-h*p,O=l*g-d*p,E=f*y-h*v,T=f*g-d*v,S=h*g-d*y,k=m*S-b*T+A*E+B*O-w*C+_*x;return k?(k=1/k,e[0]=(s*S-u*T+c*E)*k,e[1]=(i*T-n*S-a*E)*k,e[2]=(v*_-y*w+g*B)*k,e[3]=(h*w-f*_-d*B)*k,e[4]=(u*O-o*S-c*C)*k,e[5]=(r*S-i*O+a*C)*k,e[6]=(y*A-p*_-g*b)*k,e[7]=(l*_-h*A+d*b)*k,e[8]=(o*T-s*O+c*x)*k,e[9]=(n*O-r*T-a*x)*k,e[10]=(p*w-v*A+g*m)*k,e[11]=(f*A-l*w-d*m)*k,e[12]=(s*C-o*E-u*x)*k,e[13]=(r*E-n*C+i*x)*k,e[14]=(v*b-p*B-y*m)*k,e[15]=(l*B-f*b+h*m)*k,e):null}function te(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],u=t[5],c=t[6],l=t[7],f=t[8],h=t[9],d=t[10],p=t[11],v=t[12],y=t[13],g=t[14],m=t[15],b=r[0],A=r[1],B=r[2],w=r[3];return e[0]=b*n+A*s+B*f+w*v,e[1]=b*i+A*u+B*h+w*y,e[2]=b*a+A*c+B*d+w*g,e[3]=b*o+A*l+B*p+w*m,b=r[4],A=r[5],B=r[6],w=r[7],e[4]=b*n+A*s+B*f+w*v,e[5]=b*i+A*u+B*h+w*y,e[6]=b*a+A*c+B*d+w*g,e[7]=b*o+A*l+B*p+w*m,b=r[8],A=r[9],B=r[10],w=r[11],e[8]=b*n+A*s+B*f+w*v,e[9]=b*i+A*u+B*h+w*y,e[10]=b*a+A*c+B*d+w*g,e[11]=b*o+A*l+B*p+w*m,b=r[12],A=r[13],B=r[14],w=r[15],e[12]=b*n+A*s+B*f+w*v,e[13]=b*i+A*u+B*h+w*y,e[14]=b*a+A*c+B*d+w*g,e[15]=b*o+A*l+B*p+w*m,e}function re(e,t,r){var n,i,a,o,s,u,c,l,f,h,d,p,v=r[0],y=r[1],g=r[2];return t===e?(e[12]=t[0]*v+t[4]*y+t[8]*g+t[12],e[13]=t[1]*v+t[5]*y+t[9]*g+t[13],e[14]=t[2]*v+t[6]*y+t[10]*g+t[14],e[15]=t[3]*v+t[7]*y+t[11]*g+t[15]):(n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],u=t[5],c=t[6],l=t[7],f=t[8],h=t[9],d=t[10],p=t[11],e[0]=n,e[1]=i,e[2]=a,e[3]=o,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]=n*v+s*y+f*g+t[12],e[13]=i*v+u*y+h*g+t[13],e[14]=a*v+c*y+d*g+t[14],e[15]=o*v+l*y+p*g+t[15]),e}function ne(e,t,r){var n=r[0],i=r[1],a=r[2];return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*i,e[5]=t[5]*i,e[6]=t[6]*i,e[7]=t[7]*i,e[8]=t[8]*a,e[9]=t[9]*a,e[10]=t[10]*a,e[11]=t[11]*a,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function ie(e,t,r){var n=Math.sin(r),i=Math.cos(r),a=t[4],o=t[5],s=t[6],u=t[7],c=t[8],l=t[9],f=t[10],h=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=a*i+c*n,e[5]=o*i+l*n,e[6]=s*i+f*n,e[7]=u*i+h*n,e[8]=c*i-a*n,e[9]=l*i-o*n,e[10]=f*i-s*n,e[11]=h*i-u*n,e}function ae(e,t,r){var n=Math.sin(r),i=Math.cos(r),a=t[0],o=t[1],s=t[2],u=t[3],c=t[4],l=t[5],f=t[6],h=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*i+c*n,e[1]=o*i+l*n,e[2]=s*i+f*n,e[3]=u*i+h*n,e[4]=c*i-a*n,e[5]=l*i-o*n,e[6]=f*i-s*n,e[7]=h*i-u*n,e}function oe(e,t){var r=t[0],n=t[1],i=t[2],a=t[4],o=t[5],s=t[6],u=t[8],c=t[9],l=t[10];return e[0]=Math.hypot(r,n,i),e[1]=Math.hypot(a,o,s),e[2]=Math.hypot(u,c,l),e}var se=function(e,t,r,n,i){var a,o=1/Math.tan(t/2);return e[0]=o/r,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=o,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,null!=i&&i!==1/0?(a=1/(n-i),e[10]=(i+n)*a,e[14]=2*i*n*a):(e[10]=-1,e[14]=-2*n),e};var ue=function(e,t,r,n,i,a,o){var s=1/(t-r),u=1/(n-i),c=1/(a-o);return e[0]=-2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*u,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*c,e[11]=0,e[12]=(t+r)*s,e[13]=(i+n)*u,e[14]=(o+a)*c,e[15]=1,e};function ce(e,t,r){var n=t[0],i=t[1];return e[0]=r[0]*n+r[3]*i+r[6],e[1]=r[1]*n+r[4]*i+r[7],e}function le(e,t,r){var n=t[0],i=t[1];return e[0]=r[0]*n+r[4]*i+r[12],e[1]=r[1]*n+r[5]*i+r[13],e}!function(){var e=function(){var e=new K(2);return K!=Float32Array&&(e[0]=0,e[1]=0),e}()}();function fe(){var e=new K(3);return K!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function he(e){var t=e[0],r=e[1],n=e[2];return Math.hypot(t,r,n)}function de(e,t,r){var n=new K(3);return n[0]=e,n[1]=t,n[2]=r,n}function pe(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function ve(e,t,r){var n=t[0],i=t[1],a=t[2],o=r[0],s=r[1],u=r[2];return e[0]=i*u-a*s,e[1]=a*o-n*u,e[2]=n*s-i*o,e}function ye(e,t,r){var n=t[0],i=t[1],a=t[2],o=r[3]*n+r[7]*i+r[11]*a+r[15];return o=o||1,e[0]=(r[0]*n+r[4]*i+r[8]*a+r[12])/o,e[1]=(r[1]*n+r[5]*i+r[9]*a+r[13])/o,e[2]=(r[2]*n+r[6]*i+r[10]*a+r[14])/o,e}function ge(e,t,r){var n=t[0],i=t[1],a=t[2];return e[0]=n*r[0]+i*r[3]+a*r[6],e[1]=n*r[1]+i*r[4]+a*r[7],e[2]=n*r[2]+i*r[5]+a*r[8],e}function me(e,t,r){var n=r[0],i=r[1],a=r[2],o=r[3],s=t[0],u=t[1],c=t[2],l=i*c-a*u,f=a*s-n*c,h=n*u-i*s,d=i*h-a*f,p=a*l-n*h,v=n*f-i*l,y=2*o;return l*=y,f*=y,h*=y,d*=2,p*=2,v*=2,e[0]=s+l+d,e[1]=u+f+p,e[2]=c+h+v,e}var be=he;!function(){var e=fe()}();function Ae(e,t){if(!e)throw new Error(t||"@math.gl/web-mercator: assertion failed.")}var Be=Math.PI,we=Be/4,_e=Be/180,xe=180/Be;function Ce(e){var t=z()(e,2),r=t[0],n=t[1];Ae(Number.isFinite(r)),Ae(Number.isFinite(n)&&n>=-90&&n<=90,"invalid latitude");var i=n*_e;return[512*(r*_e+Be)/(2*Be),512*(Be+Math.log(Math.tan(we+.5*i)))/(2*Be)]}function Oe(e){var t=z()(e,2),r=t[0],n=t[1],i=r/512*(2*Be)-Be,a=2*(Math.atan(Math.exp(n/512*(2*Be)-Be))-we);return[i*xe,a*xe]}Math.PI;r(54);function Ee(e){var t=function(e){for(var t=0,r=0,n=1<<e.length,i=n/512,a=0;a<e.length;a++){n>>=1;var o=parseInt(e[a]);o%2&&(t|=n),o>1&&(r|=n)}return[[t/i,512-r/i],[(t+.99)/i,512-(r+.99)/i]]}(e),r=M()(t,2),n=r[0],i=r[1],a=Oe(n),o=M()(a,2),s=o[0],u=o[1],c=Oe(i),l=M()(c,2),f=l[0],h=l[1];return[f,u,f,h,s,h,s,u,f,u]}function Te(e){var t=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(e){return!1}}();return function(){var r,n=m()(e);if(t){var i=m()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return y()(this,r)}}var Se=function(e){p()(r,e);var t=Te(r);function r(){return h()(this,r),t.apply(this,arguments)}return C()(r,[{key:"indexToBounds",value:function(){var e=this.props,t=e.data,r=e.getQuadkey;return{data:t,_normalize:!1,positionFormat:"XY",getPolygon:function(e,t){return Ee(r(e,t))}}}}]),r}(S);A()(Se,"layerName","QuadkeyLayer"),A()(Se,"defaultProps",{getQuadkey:{type:"accessor",value:function(e){return e.quadkey}}});var ke=r(4),Me=r.n(ke),Ie=r(1),Pe=r.n(Ie),Re=function(){function e(t){h()(this,e),A()(this,"index",void 0),A()(this,"isVisible",void 0),A()(this,"isSelected",void 0),A()(this,"parent",void 0),A()(this,"children",void 0),A()(this,"content",void 0),A()(this,"state",void 0),A()(this,"layers",void 0),A()(this,"id",void 0),A()(this,"bbox",void 0),A()(this,"zoom",void 0),A()(this,"userData",void 0),A()(this,"_abortController",void 0),A()(this,"_loader",void 0),A()(this,"_loaderId",void 0),A()(this,"_isLoaded",void 0),A()(this,"_isCancelled",void 0),A()(this,"_needsReload",void 0),this.index=t,this.isVisible=!1,this.isSelected=!1,this.parent=null,this.children=[],this.content=null,this._loader=void 0,this._abortController=null,this._loaderId=0,this._isLoaded=!1,this._isCancelled=!1,this._needsReload=!1}var t;return C()(e,[{key:"data",get:function(){var e=this;return this.isLoading&&this._loader?this._loader.then((function(){return e.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 e=this.content?this.content.byteLength:0;return Number.isFinite(e)||B.log.error("byteLength not defined in tile data")(),e}},{key:"_loadData",value:(t=Me()(Pe.a.mark((function e(t){var r,n,i,a,o,s,u,c,l,f,h,d,p,v;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.getData,n=t.requestScheduler,i=t.onLoad,a=t.onError,o=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,e.next=7,n.scheduleRequest(this,(function(e){return e.isSelected?1:-1}));case 7:if(d=e.sent){e.next=11;break}return this._isCancelled=!0,e.abrupt("return");case 11:if(!this._isCancelled){e.next=14;break}return d.done(),e.abrupt("return");case 14:return p=null,e.prev=15,e.next=18,r({index:o,id:s,bbox:u,userData:c,zoom:l,signal:h});case 18:p=e.sent,e.next=24;break;case 21:e.prev=21,e.t0=e.catch(15),v=e.t0||!0;case 24:return e.prev=24,d.done(),e.finish(24);case 27:if(f===this._loaderId){e.next=29;break}return e.abrupt("return");case 29:if(this._loader=void 0,this.content=p,!this._isCancelled||p){e.next=34;break}return this._isLoaded=!1,e.abrupt("return");case 34:this._isLoaded=!0,this._isCancelled=!1,v?a(v,this):i(this);case 37:case"end":return e.stop()}}),e,this,[[15,21,24,27]])}))),function(e){return t.apply(this,arguments)})},{key:"loadData",value:function(e){return this._isLoaded=!1,this._isCancelled=!1,this._needsReload=!1,this._loaderId++,this._loader=this._loadData(e),this._loader}},{key:"setNeedsReload",value:function(){this.isLoading&&(this.abort(),this._loader=void 0),this._needsReload=!0}},{key:"abort",value:function(){var e;this.isLoaded||(this._isCancelled=!0,null===(e=this._abortController)||void 0===e||e.abort())}}]),e}(),Fe=r(8),De=r.n(Fe),Le=-1,je=0,Ge=1,Ue=r(21),Ne=r.n(Ue),He=r(22),Je=r.n(He);function Ve(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var ze=r(16),Ke=r.n(ze),qe=r(17),Xe=r.n(qe),Qe=r(18),We=r.n(Qe),Ze=r(19),Ye=r.n(Ze),$e=r(14),et=r.n($e);r(38);function tt(e,t){if(!e)throw new Error("math.gl assertion ".concat(t))}var rt=1/Math.PI*180,nt=1/180*Math.PI,it={EPSILON:1e-12,debug:!1,precision:4,printTypes:!1,printDegrees:!1,printRowMajor:!0};function at(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.precision,n=void 0===r?it.precision:r;return e=dt(e),"".concat(parseFloat(e.toPrecision(n)))}function ot(e){return Array.isArray(e)||ArrayBuffer.isView(e)&&!(e instanceof DataView)}function st(e){return function(e,t){return pt(e,(function(e){return e*nt}),t)}(e)}function ut(e){return ct(e)}function ct(e,t){return pt(e,(function(e){return e*rt}),t)}function lt(e,t,r){return pt(e,(function(e){return Math.max(t,Math.min(r,e))}))}function ft(e,t,r){return ot(e)?e.map((function(e,n){return ft(e,t[n],r)})):r*t+(1-r)*e}function ht(e,t,r){var n=it.EPSILON;r&&(it.EPSILON=r);try{if(e===t)return!0;if(ot(e)&&ot(t)){if(e.length!==t.length)return!1;for(var i=0;i<e.length;++i)if(!ht(e[i],t[i]))return!1;return!0}return e&&e.equals?e.equals(t):t&&t.equals?t.equals(e):"number"==typeof e&&"number"==typeof t&&Math.abs(e-t)<=it.EPSILON*Math.max(1,Math.abs(e),Math.abs(t))}finally{it.EPSILON=n}}function dt(e){return Math.round(e/it.EPSILON)*it.EPSILON}function pt(e,t,r){if(ot(e)){var n=e;r=r||function(e){return e.clone?e.clone():new Array(e.length)}(n);for(var i=0;i<r.length&&i<n.length;++i)r[i]=t(e[i],i,r);return r}return t(e)}function vt(e){var t=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(e){return!1}}();return function(){var r,n=et()(e);if(t){var i=et()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Ye()(this,r)}}var yt=function(e){We()(r,e);var t=vt(r);function r(){return Ke()(this,r),t.apply(this,arguments)}return Xe()(r,[{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"fromArray",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=0;r<this.ELEMENTS;++r)this[r]=e[r+t];return this.check()}},{key:"toArray",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=0;r<this.ELEMENTS;++r)e[t+r]=this[r];return e}},{key:"from",value:function(e){return Array.isArray(e)?this.copy(e):this.fromObject(e)}},{key:"to",value:function(e){return e===this?this:ot(e)?this.toArray(e):this.toObject(e)}},{key:"toTarget",value:function(e){return e?this.to(e):this}},{key:"toFloat32Array",value:function(){return new Float32Array(this)}},{key:"toString",value:function(){return this.formatString(it)}},{key:"formatString",value:function(e){for(var t="",r=0;r<this.ELEMENTS;++r)t+=(r>0?", ":"")+at(this[r],e);return"".concat(e.printTypes?this.constructor.name:"","[").concat(t,"]")}},{key:"equals",value:function(e){if(!e||this.length!==e.length)return!1;for(var t=0;t<this.ELEMENTS;++t)if(!ht(this[t],e[t]))return!1;return!0}},{key:"exactEquals",value:function(e){if(!e||this.length!==e.length)return!1;for(var t=0;t<this.ELEMENTS;++t)if(this[t]!==e[t])return!1;return!0}},{key:"negate",value:function(){for(var e=0;e<this.ELEMENTS;++e)this[e]=-this[e];return this.check()}},{key:"lerp",value:function(e,t,r){if(void 0===r)return this.lerp(this,e,t);for(var n=0;n<this.ELEMENTS;++n){var i=e[n];this[n]=i+r*(t[n]-i)}return this.check()}},{key:"min",value:function(e){for(var t=0;t<this.ELEMENTS;++t)this[t]=Math.min(e[t],this[t]);return this.check()}},{key:"max",value:function(e){for(var t=0;t<this.ELEMENTS;++t)this[t]=Math.max(e[t],this[t]);return this.check()}},{key:"clamp",value:function(e,t){for(var r=0;r<this.ELEMENTS;++r)this[r]=Math.min(Math.max(this[r],e[r]),t[r]);return this.check()}},{key:"add",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];for(var n=0,i=t;n<i.length;n++)for(var a=i[n],o=0;o<this.ELEMENTS;++o)this[o]+=a[o];return this.check()}},{key:"subtract",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];for(var n=0,i=t;n<i.length;n++)for(var a=i[n],o=0;o<this.ELEMENTS;++o)this[o]-=a[o];return this.check()}},{key:"scale",value:function(e){if("number"==typeof e)for(var t=0;t<this.ELEMENTS;++t)this[t]*=e;else for(var r=0;r<this.ELEMENTS&&r<e.length;++r)this[r]*=e[r];return this.check()}},{key:"multiplyByScalar",value:function(e){for(var t=0;t<this.ELEMENTS;++t)this[t]*=e;return this.check()}},{key:"check",value:function(){if(it.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 e=this.length===this.ELEMENTS,t=0;t<this.ELEMENTS;++t)e=e&&Number.isFinite(this[t]);return e}},{key:"sub",value:function(e){return this.subtract(e)}},{key:"setScalar",value:function(e){for(var t=0;t<this.ELEMENTS;++t)this[t]=e;return this.check()}},{key:"addScalar",value:function(e){for(var t=0;t<this.ELEMENTS;++t)this[t]+=e;return this.check()}},{key:"subScalar",value:function(e){return this.addScalar(-e)}},{key:"multiplyScalar",value:function(e){for(var t=0;t<this.ELEMENTS;++t)this[t]*=e;return this.check()}},{key:"divideScalar",value:function(e){return this.multiplyByScalar(1/e)}},{key:"clampScalar",value:function(e,t){for(var r=0;r<this.ELEMENTS;++r)this[r]=Math.min(Math.max(this[r],e),t);return this.check()}},{key:"elements",get:function(){return this}}]),r}(function(e){function t(){var t=Reflect.construct(e,Array.from(arguments));return Object.setPrototypeOf(t,Object.getPrototypeOf(this)),t}return t.prototype=Object.create(e.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e,t}(Array));function gt(e,t){if(e.length!==t)return!1;for(var r=0;r<e.length;++r)if(!Number.isFinite(e[r]))return!1;return!0}function mt(e){if(!Number.isFinite(e))throw new Error("Invalid number ".concat(e));return e}function bt(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(it.debug&&!gt(e,t))throw new Error("math.gl: ".concat(r," some fields set to invalid numbers'"));return e}function At(e){var t=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(e){return!1}}();return function(){var r,n=et()(e);if(t){var i=et()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Ye()(this,r)}}var Bt=function(e){We()(r,e);var t=At(r);function r(){return Ke()(this,r),t.apply(this,arguments)}return Xe()(r,[{key:"x",get:function(){return this[0]},set:function(e){this[0]=mt(e)}},{key:"y",get:function(){return this[1]},set:function(e){this[1]=mt(e)}},{key:"len",value:function(){return Math.sqrt(this.lengthSquared())}},{key:"magnitude",value:function(){return this.len()}},{key:"lengthSquared",value:function(){for(var e=0,t=0;t<this.ELEMENTS;++t)e+=this[t]*this[t];return e}},{key:"magnitudeSquared",value:function(){return this.lengthSquared()}},{key:"distance",value:function(e){return Math.sqrt(this.distanceSquared(e))}},{key:"distanceSquared",value:function(e){for(var t=0,r=0;r<this.ELEMENTS;++r){var n=this[r]-e[r];t+=n*n}return mt(t)}},{key:"dot",value:function(e){for(var t=0,r=0;r<this.ELEMENTS;++r)t+=this[r]*e[r];return mt(t)}},{key:"normalize",value:function(){var e=this.magnitude();if(0!==e)for(var t=0;t<this.ELEMENTS;++t)this[t]/=e;return this.check()}},{key:"multiply",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];for(var n=0,i=t;n<i.length;n++)for(var a=i[n],o=0;o<this.ELEMENTS;++o)this[o]*=a[o];return this.check()}},{key:"divide",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];for(var n=0,i=t;n<i.length;n++)for(var a=i[n],o=0;o<this.ELEMENTS;++o)this[o]/=a[o];return this.check()}},{key:"lengthSq",value:function(){return this.lengthSquared()}},{key:"distanceTo",value:function(e){return this.distance(e)}},{key:"distanceToSquared",value:function(e){return this.distanceSquared(e)}},{key:"getComponent",value:function(e){return tt(e>=0&&e<this.ELEMENTS,"index is out of range"),mt(this[e])}},{key:"setComponent",value:function(e,t){return tt(e>=0&&e<this.ELEMENTS,"index is out of range"),this[e]=t,this.check()}},{key:"addVectors",value:function(e,t){return this.copy(e).add(t)}},{key:"subVectors",value:function(e,t){return this.copy(e).subtract(t)}},{key:"multiplyVectors",value:function(e,t){return this.copy(e).multiply(t)}},{key:"addScaledVector",value:function(e,t){return this.add(new this.constructor(e).multiplyScalar(t))}}]),r}(yt);function wt(e,t,r){var n=t[0],i=t[1],a=r[3]*n+r[7]*i||1;return e[0]=(r[0]*n+r[4]*i)/a,e[1]=(r[1]*n+r[5]*i)/a,e}function _t(e,t,r){var n=t[0],i=t[1],a=t[2],o=r[3]*n+r[7]*i+r[11]*a||1;return e[0]=(r[0]*n+r[4]*i+r[8]*a)/o,e[1]=(r[1]*n+r[5]*i+r[9]*a)/o,e[2]=(r[2]*n+r[6]*i+r[10]*a)/o,e}function xt(e,t,r){var n=t[0],i=t[1],a=t[2];return e[0]=r[0]*n+r[3]*i+r[6]*a,e[1]=r[1]*n+r[4]*i+r[7]*a,e[2]=r[2]*n+r[5]*i+r[8]*a,e[3]=t[3],e}function Ct(e){var t=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(e){return!1}}();return function(){var r,n=et()(e);if(t){var i=et()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Ye()(this,r)}}var Ot,Et=[0,0,0],Tt=function(e){We()(r,e);var t=Ct(r);function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return Ke()(this,r),e=t.call(this,-0,-0,-0),1===arguments.length&&ot(n)?e.copy(n):(it.debug&&(mt(n),mt(i),mt(a)),e[0]=n,e[1]=i,e[2]=a),e}return Xe()(r,[{key:"set",value:function(e,t,r){return this[0]=e,this[1]=t,this[2]=r,this.check()}},{key:"copy",value:function(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this.check()}},{key:"fromObject",value:function(e){return it.debug&&(mt(e.x),mt(e.y),mt(e.z)),this[0]=e.x,this[1]=e.y,this[2]=e.z,this.check()}},{key:"toObject",value:function(e){return e.x=this[0],e.y=this[1],e.z=this[2],e}},{key:"ELEMENTS",get:function(){return 3}},{key:"z",get:function(){return this[2]},set:function(e){this[2]=mt(e)}},{key:"angle",value:function(e){return r=e,n=(t=this)[0],i=t[1],a=t[2],o=r[0],s=r[1],u=r[2],c=Math.sqrt(n*n+i*i+a*a)*Math.sqrt(o*o+s*s+u*u),l=c&&pe(t,r)/c,Math.acos(Math.min(Math.max(l,-1),1));var t,r,n,i,a,o,s,u,c,l}},{key:"cross",value:function(e){return ve(this,this,e),this.check()}},{key:"rotateX",value:function(e){var t=e.radians,r=e.origin;return function(e,t,r,n){var i=[],a=[];i[0]=t[0]-r[0],i[1]=t[1]-r[1],i[2]=t[2]-r[2],a[0]=i[0],a[1]=i[1]*Math.cos(n)-i[2]*Math.sin(n),a[2]=i[1]*Math.sin(n)+i[2]*Math.cos(n),e[0]=a[0]+r[0],e[1]=a[1]+r[1],e[2]=a[2]+r[2]}(this,this,void 0===r?Et:r,t),this.check()}},{key:"rotateY",value:function(e){var t=e.radians,r=e.origin;return function(e,t,r,n){var i=[],a=[];i[0]=t[0]-r[0],i[1]=t[1]-r[1],i[2]=t[2]-r[2],a[0]=i[2]*Math.sin(n)+i[0]*Math.cos(n),a[1]=i[1],a[2]=i[2]*Math.cos(n)-i[0]*Math.sin(n),e[0]=a[0]+r[0],e[1]=a[1]+r[1],e[2]=a[2]+r[2]}(this,this,void 0===r?Et:r,t),this.check()}},{key:"rotateZ",value:function(e){var t=e.radians,r=e.origin;return function(e,t,r,n){var i=[],a=[];i[0]=t[0]-r[0],i[1]=t[1]-r[1],i[2]=t[2]-r[2],a[0]=i[0]*Math.cos(n)-i[1]*Math.sin(n),a[1]=i[0]*Math.sin(n)+i[1]*Math.cos(n),a[2]=i[2],e[0]=a[0]+r[0],e[1]=a[1]+r[1],e[2]=a[2]+r[2]}(this,this,void 0===r?Et:r,t),this.check()}},{key:"transform",value:function(e){return this.transformAsPoint(e)}},{key:"transformAsPoint",value:function(e){return ye(this,this,e),this.check()}},{key:"transformAsVector",value:function(e){return _t(this,this,e),this.check()}},{key:"transformByMatrix3",value:function(e){return ge(this,this,e),this.check()}},{key:"transformByMatrix2",value:function(e){return function(e,t,r){var n=t[0],i=t[1];e[0]=r[0]*n+r[2]*i,e[1]=r[1]*n+r[3]*i,e[2]=t[2]}(this,this,e),this.check()}},{key:"transformByQuaternion",value:function(e){return me(this,this,e),this.check()}}],[{key:"ZERO",get:function(){return Ot||(Ot=new r(0,0,0),Object.freeze(Ot)),Ot}}]),r}(Bt),St=new Tt,kt=new Tt,Mt=function(){function e(){var t=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;Ne()(this,e),Ve(this,"center",void 0),Ve(this,"halfDiagonal",void 0),Ve(this,"minimum",void 0),Ve(this,"maximum",void 0),n=n||St.copy(t).add(r).scale(.5),this.center=new Tt(n),this.halfDiagonal=new Tt(r).subtract(this.center),this.minimum=new Tt(t),this.maximum=new Tt(r)}return Je()(e,[{key:"clone",value:function(){return new e(this.minimum,this.maximum,this.center)}},{key:"equals",value:function(e){return this===e||Boolean(e)&&this.minimum.equals(e.minimum)&&this.maximum.equals(e.maximum)}},{key:"transform",value:function(e){return this.center.transformAsPoint(e),this.halfDiagonal.transform(e),this.minimum.transform(e),this.maximum.transform(e),this}},{key:"intersectPlane",value:function(e){var t=this.halfDiagonal,r=kt.from(e.normal),n=t.x*Math.abs(r.x)+t.y*Math.abs(r.y)+t.z*Math.abs(r.z),i=this.center.dot(r)+e.distance;return i-n>0?Ge:i+n<0?Le:je}},{key:"distanceTo",value:function(e){return Math.sqrt(this.distanceSquaredTo(e))}},{key:"distanceSquaredTo",value:function(e){var t,r=St.from(e).subtract(this.center),n=this.halfDiagonal,i=0;return(t=Math.abs(r.x)-n.x)>0&&(i+=t*t),(t=Math.abs(r.y)-n.y)>0&&(i+=t*t),(t=Math.abs(r.z)-n.z)>0&&(i+=t*t),i}}]),e}(),It=new Tt,Pt=new Tt,Rt=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[0,0,0],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;Ne()(this,e),Ve(this,"center",void 0),Ve(this,"radius",void 0),this.radius=-0,this.center=new Tt,this.fromCenterRadius(t,r)}return Je()(e,[{key:"fromCenterRadius",value:function(e,t){return this.center.from(e),this.radius=t,this}},{key:"fromCornerPoints",value:function(e,t){return t=It.from(t),this.center=(new Tt).from(e).add(t).scale(.5),this.radius=this.center.distance(t),this}},{key:"equals",value:function(e){return this===e||Boolean(e)&&this.center.equals(e.center)&&this.radius===e.radius}},{key:"clone",value:function(){return new e(this.center,this.radius)}},{key:"union",value:function(e){var t=this.center,r=this.radius,n=e.center,i=e.radius,a=It.copy(n).subtract(t),o=a.magnitude();if(r>=o+i)return this.clone();if(i>=o+r)return e.clone();var s=.5*(r+o+i);return Pt.copy(a).scale((-r+s)/o).add(t),this.center.copy(Pt),this.radius=s,this}},{key:"expand",value:function(e){var t=It.from(e).subtract(this.center).magnitude();return t>this.radius&&(this.radius=t),this}},{key:"transform",value:function(e){this.center.transform(e);var t=oe(It,e);return this.radius=Math.max(t[0],Math.max(t[1],t[2]))*this.radius,this}},{key:"distanceSquaredTo",value:function(e){var t=this.distanceTo(e);return t*t}},{key:"distanceTo",value:function(e){var t=It.from(e).subtract(this.center);return Math.max(0,t.len()-this.radius)}},{key:"intersectPlane",value:function(e){var t=this.center,r=this.radius,n=e.normal.dot(t)+e.distance;return n<-r?Le:n<r?je:Ge}}]),e}(),Ft=r(25),Dt=r.n(Ft);function Lt(e){var t=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(e){return!1}}();return function(){var r,n=et()(e);if(t){var i=et()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Ye()(this,r)}}var jt=function(e){We()(r,e);var t=Lt(r);function r(){return Ke()(this,r),t.apply(this,arguments)}return Xe()(r,[{key:"toString",value:function(){var e="[";if(it.printRowMajor){e+="row-major:";for(var t=0;t<this.RANK;++t)for(var r=0;r<this.RANK;++r)e+=" ".concat(this[r*this.RANK+t])}else{e+="column-major:";for(var n=0;n<this.ELEMENTS;++n)e+=" ".concat(this[n])}return e+="]"}},{key:"getElementIndex",value:function(e,t){return t*this.RANK+e}},{key:"getElement",value:function(e,t){return this[t*this.RANK+e]}},{key:"setElement",value:function(e,t,r){return this[t*this.RANK+e]=mt(r),this}},{key:"getColumn",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Array(this.RANK).fill(-0),r=e*this.RANK,n=0;n<this.RANK;++n)t[n]=this[r+n];return t}},{key:"setColumn",value:function(e,t){for(var r=e*this.RANK,n=0;n<this.RANK;++n)this[r+n]=t[n];return this}}]),r}(yt);function Gt(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],u=t[5],c=t[6],l=t[7],f=t[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 e[0]=h*n+d*o+p*c,e[1]=h*i+d*s+p*l,e[2]=h*a+d*u+p*f,e[3]=v*n+y*o+g*c,e[4]=v*i+y*s+g*l,e[5]=v*a+y*u+g*f,e[6]=m*n+b*o+A*c,e[7]=m*i+b*s+A*l,e[8]=m*a+b*u+A*f,e}function Ut(e,t,r){var n=r[0],i=r[1];return e[0]=n*t[0],e[1]=n*t[1],e[2]=n*t[2],e[3]=i*t[3],e[4]=i*t[4],e[5]=i*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}var Nt;function Ht(e){var t=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(e){return!1}}();return function(){var r,n=et()(e);if(t){var i=et()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Ye()(this,r)}}!function(e){e[e.COL0ROW0=0]="COL0ROW0",e[e.COL0ROW1=1]="COL0ROW1",e[e.COL0ROW2=2]="COL0ROW2",e[e.COL1ROW0=3]="COL1ROW0",e[e.COL1ROW1=4]="COL1ROW1",e[e.COL1ROW2=5]="COL1ROW2",e[e.COL2ROW0=6]="COL2ROW0",e[e.COL2ROW1=7]="COL2ROW1",e[e.COL2ROW2=8]="COL2ROW2"}(Nt||(Nt={}));var Jt,Vt,zt,Kt=Object.freeze([1,0,0,0,1,0,0,0,1]),qt=function(e){We()(r,e);var t=Ht(r);function r(e){for(var n,i=arguments.length,a=new Array(i>1?i-1:0),o=1;o<i;o++)a[o-1]=arguments[o];return Ke()(this,r),n=t.call(this,-0,-0,-0,-0,-0,-0,-0,-0,-0),1===arguments.length&&Array.isArray(e)?n.copy(e):a.length>0?n.copy([e].concat(a)):n.identity(),n}return Xe()(r,[{key:"ELEMENTS",get:function(){return 9}},{key:"RANK",get:function(){return 3}},{key:"INDICES",get:function(){return Nt}},{key:"copy",value:function(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this[4]=e[4],this[5]=e[5],this[6]=e[6],this[7]=e[7],this[8]=e[8],this.check()}},{key:"identity",value:function(){return this.copy(Kt)}},{key:"fromObject",value:function(e){return this.check()}},{key:"fromQuaternion",value:function(e){return function(e,t){var r=t[0],n=t[1],i=t[2],a=t[3],o=r+r,s=n+n,u=i+i,c=r*o,l=n*o,f=n*s,h=i*o,d=i*s,p=i*u,v=a*o,y=a*s,g=a*u;e[0]=1-f-p,e[3]=l-g,e[6]=h+y,e[1]=l+g,e[4]=1-c-p,e[7]=d-v,e[2]=h-y,e[5]=d+v,e[8]=1-c-f}(this,e),this.check()}},{key:"set",value:function(e,t,r,n,i,a,o,s,u){return this[0]=e,this[1]=t,this[2]=r,this[3]=n,this[4]=i,this[5]=a,this[6]=o,this[7]=s,this[8]=u,this.check()}},{key:"setRowMajor",value:function(e,t,r,n,i,a,o,s,u){return this[0]=e,this[1]=n,this[2]=o,this[3]=t,this[4]=i,this[5]=s,this[6]=r,this[7]=a,this[8]=u,this.check()}},{key:"determinant",value:function(){return t=(e=this)[0],r=e[1],n=e[2],i=e[3],a=e[4],o=e[5],s=e[6],u=e[7],c=e[8],t*(c*a-o*u)+r*(-c*i+o*s)+n*(u*i-a*s);var e,t,r,n,i,a,o,s,u,c}},{key:"transpose",value:function(){return function(e,t){if(e===t){var r=t[1],n=t[2],i=t[5];e[1]=t[3],e[2]=t[6],e[3]=r,e[5]=t[7],e[6]=n,e[7]=i}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8]}(this,this),this.check()}},{key:"invert",value:function(){return function(e,t){var r=t[0],n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],u=t[6],c=t[7],l=t[8],f=l*o-s*c,h=-l*a+s*u,d=c*a-o*u,p=r*f+n*h+i*d;p&&(p=1/p,e[0]=f*p,e[1]=(-l*n+i*c)*p,e[2]=(s*n-i*o)*p,e[3]=h*p,e[4]=(l*r-i*u)*p,e[5]=(-s*r+i*a)*p,e[6]=d*p,e[7]=(-c*r+n*u)*p,e[8]=(o*r-n*a)*p)}(this,this),this.check()}},{key:"multiplyLeft",value:function(e){return Gt(this,e,this),this.check()}},{key:"multiplyRight",value:function(e){return Gt(this,this,e),this.check()}},{key:"rotate",value:function(e){return function(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],u=t[5],c=t[6],l=t[7],f=t[8],h=Math.sin(r),d=Math.cos(r);e[0]=d*n+h*o,e[1]=d*i+h*s,e[2]=d*a+h*u,e[3]=d*o-h*n,e[4]=d*s-h*i,e[5]=d*u-h*a,e[6]=c,e[7]=l,e[8]=f}(this,this,e),this.check()}},{key:"scale",value:function(e){return Array.isArray(e)?Ut(this,this,e):Ut(this,this,[e,e]),this.check()}},{key:"translate",value:function(e){return function(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],u=t[5],c=t[6],l=t[7],f=t[8],h=r[0],d=r[1];e[0]=n,e[1]=i,e[2]=a,e[3]=o,e[4]=s,e[5]=u,e[6]=h*n+d*o+c,e[7]=h*i+d*s+l,e[8]=h*a+d*u+f}(this,this,e),this.check()}},{key:"transform",value:function(e,t){var r;switch(e.length){case 2:r=ce(t||[-0,-0],e,this);break;case 3:r=ge(t||[-0,-0,-0],e,this);break;case 4:r=xt(t||[-0,-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return bt(r,e.length),r}},{key:"transformVector",value:function(e,t){return this.transform(e,t)}},{key:"transformVector2",value:function(e,t){return this.transform(e,t)}},{key:"transformVector3",value:function(e,t){return this.transform(e,t)}}],[{key:"IDENTITY",get:function(){return function(){Vt||(Vt=new qt,Object.freeze(Vt));return Vt}()}},{key:"ZERO",get:function(){return function(){Jt||(Jt=new qt([0,0,0,0,0,0,0,0,0]),Object.freeze(Jt));return Jt}()}}]),r}(jt);function Xt(e){var t=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(e){return!1}}();return function(){var r,n=et()(e);if(t){var i=et()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Ye()(this,r)}}var Qt=function(e){We()(r,e);var t=Xt(r);function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return Ke()(this,r),e=t.call(this,-0,-0,-0,-0),ot(n)&&1===arguments.length?e.copy(n):(it.debug&&(mt(n),mt(i),mt(a),mt(o)),e[0]=n,e[1]=i,e[2]=a,e[3]=o),e}return Xe()(r,[{key:"set",value:function(e,t,r,n){return this[0]=e,this[1]=t,this[2]=r,this[3]=n,this.check()}},{key:"copy",value:function(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this.check()}},{key:"fromObject",value:function(e){return it.debug&&(mt(e.x),mt(e.y),mt(e.z),mt(e.w)),this[0]=e.x,this[1]=e.y,this[2]=e.z,this[3]=e.w,this}},{key:"toObject",value:function(e){return e.x=this[0],e.y=this[1],e.z=this[2],e.w=this[3],e}},{key:"ELEMENTS",get:function(){return 4}},{key:"z",get:function(){return this[2]},set:function(e){this[2]=mt(e)}},{key:"w",get:function(){return this[3]},set:function(e){this[3]=mt(e)}},{key:"transform",value:function(e){return ye(this,this,e),this.check()}},{key:"transformByMatrix3",value:function(e){return xt(this,this,e),this.check()}},{key:"transformByMatrix2",value:function(e){return function(e,t,r){var n=t[0],i=t[1];e[0]=r[0]*n+r[2]*i,e[1]=r[1]*n+r[3]*i,e[2]=t[2],e[3]=t[3]}(this,this,e),this.check()}},{key:"transformByQuaternion",value:function(e){return me(this,this,e),this.check()}},{key:"applyMatrix4",value:function(e){return e.transform(this,this),this}}],[{key:"ZERO",get:function(){return zt||(zt=new r(0,0,0,0),Object.freeze(zt)),zt}}]),r}(Bt);function Wt(){var e=new K(4);return K!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e[3]=1,e}function Zt(e,t,r){r*=.5;var n=Math.sin(r);return e[0]=n*t[0],e[1]=n*t[1],e[2]=n*t[2],e[3]=Math.cos(r),e}function Yt(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3],s=r[0],u=r[1],c=r[2],l=r[3];return e[0]=n*l+o*s+i*c-a*u,e[1]=i*l+o*u+a*s-n*c,e[2]=a*l+o*c+n*u-i*s,e[3]=o*l-n*s-i*u-a*c,e}function $t(e,t,r,n){var i,a,o,s,u,c=t[0],l=t[1],f=t[2],h=t[3],d=r[0],p=r[1],v=r[2],y=r[3];return(a=c*d+l*p+f*v+h*y)<0&&(a=-a,d=-d,p=-p,v=-v,y=-y),1-a>1e-6?(i=Math.acos(a),o=Math.sin(i),s=Math.sin((1-n)*i)/o,u=Math.sin(n*i)/o):(s=1-n,u=n),e[0]=s*c+u*d,e[1]=s*l+u*p,e[2]=s*f+u*v,e[3]=s*h+u*y,e}function er(e,t){var r,n=t[0]+t[4]+t[8];if(n>0)r=Math.sqrt(n+1),e[3]=.5*r,r=.5/r,e[0]=(t[5]-t[7])*r,e[1]=(t[6]-t[2])*r,e[2]=(t[1]-t[3])*r;else{var i=0;t[4]>t[0]&&(i=1),t[8]>t[3*i+i]&&(i=2);var a=(i+1)%3,o=(i+2)%3;r=Math.sqrt(t[3*i+i]-t[3*a+a]-t[3*o+o]+1),e[i]=.5*r,r=.5/r,e[3]=(t[3*a+o]-t[3*o+a])*r,e[a]=(t[3*a+i]+t[3*i+a])*r,e[o]=(t[3*o+i]+t[3*i+o])*r}return e}var tr,rr,nr,ir,ar,or,sr=function(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e},ur=q,cr=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]},lr=function(e,t,r,n){var i=t[0],a=t[1],o=t[2],s=t[3];return e[0]=i+n*(r[0]-i),e[1]=a+n*(r[1]-a),e[2]=o+n*(r[2]-o),e[3]=s+n*(r[3]-s),e},fr=X,hr=Q,dr=function(e,t){var r=t[0],n=t[1],i=t[2],a=t[3],o=r*r+n*n+i*i+a*a;return o>0&&(o=1/Math.sqrt(o)),e[0]=r*o,e[1]=n*o,e[2]=i*o,e[3]=a*o,e},pr=(tr=fe(),rr=de(1,0,0),nr=de(0,1,0),function(e,t,r){var n=pe(t,r);return n<-.999999?(ve(tr,rr,t),be(tr)<1e-6&&ve(tr,nr,t),function(e,t){var r=t[0],n=t[1],i=t[2],a=r*r+n*n+i*i;a>0&&(a=1/Math.sqrt(a)),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a}(tr,tr),Zt(e,tr,Math.PI),e):n>.999999?(e[0]=0,e[1]=0,e[2]=0,e[3]=1,e):(ve(tr,t,r),e[0]=tr[0],e[1]=tr[1],e[2]=tr[2],e[3]=1+n,dr(e,e))});ir=Wt(),ar=Wt(),or=function(){var e=new K(9);return K!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1,e}();function vr(e){var t=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(e){return!1}}();return function(){var r,n=et()(e);if(t){var i=et()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Ye()(this,r)}}var yr=[0,0,0,1],gr=function(e){We()(r,e);var t=vr(r);function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;return Ke()(this,r),e=t.call(this,-0,-0,-0,-0),Array.isArray(n)&&1===arguments.length?e.copy(n):e.set(n,i,a,o),e}return Xe()(r,[{key:"copy",value:function(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this.check()}},{key:"set",value:function(e,t,r,n){return this[0]=e,this[1]=t,this[2]=r,this[3]=n,this.check()}},{key:"fromObject",value:function(e){return this[0]=e.x,this[1]=e.y,this[2]=e.z,this[3]=e.w,this.check()}},{key:"fromMatrix3",value:function(e){return er(this,e),this.check()}},{key:"fromAxisRotation",value:function(e,t){return Zt(this,e,t),this.check()}},{key:"identity",value:function(){return function(e){e[0]=0,e[1]=0,e[2]=0,e[3]=1}(this),this.check()}},{key:"setAxisAngle",value:function(e,t){return this.fromAxisRotation(e,t)}},{key:"ELEMENTS",get:function(){return 4}},{key:"x",get:function(){return this[0]},set:function(e){this[0]=mt(e)}},{key:"y",get:function(){return this[1]},set:function(e){this[1]=mt(e)}},{key:"z",get:function(){return this[2]},set:function(e){this[2]=mt(e)}},{key:"w",get:function(){return this[3]},set:function(e){this[3]=mt(e)}},{key:"len",value:function(){return fr(this)}},{key:"lengthSquared",value:function(){return hr(this)}},{key:"dot",value:function(e){return cr(this,e)}},{key:"rotationTo",value:function(e,t){return pr(this,e,t),this.check()}},{key:"add",value:function(e){return sr(this,this,e),this.check()}},{key:"calculateW",value:function(){return function(e,t){var r=t[0],n=t[1],i=t[2];e[0]=r,e[1]=n,e[2]=i,e[3]=Math.sqrt(Math.abs(1-r*r-n*n-i*i))}(this,this),this.check()}},{key:"conjugate",value:function(){return function(e,t){e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3]}(this,this),this.check()}},{key:"invert",value:function(){return function(e,t){var r=t[0],n=t[1],i=t[2],a=t[3],o=r*r+n*n+i*i+a*a,s=o?1/o:0;e[0]=-r*s,e[1]=-n*s,e[2]=-i*s,e[3]=a*s}(this,this),this.check()}},{key:"lerp",value:function(e,t,r){return void 0===r?this.lerp(this,e,t):(lr(this,e,t,r),this.check())}},{key:"multiplyRight",value:function(e){return Yt(this,this,e),this.check()}},{key:"multiplyLeft",value:function(e){return Yt(this,e,this),this.check()}},{key:"normalize",value:function(){var e=this.len(),t=e>0?1/e:0;return this[0]=this[0]*t,this[1]=this[1]*t,this[2]=this[2]*t,this[3]=this[3]*t,0===e&&(this[3]=1),this.check()}},{key:"rotateX",value:function(e){return function(e,t,r){r*=.5;var n=t[0],i=t[1],a=t[2],o=t[3],s=Math.sin(r),u=Math.cos(r);e[0]=n*u+o*s,e[1]=i*u+a*s,e[2]=a*u-i*s,e[3]=o*u-n*s}(this,this,e),this.check()}},{key:"rotateY",value:function(e){return function(e,t,r){r*=.5;var n=t[0],i=t[1],a=t[2],o=t[3],s=Math.sin(r),u=Math.cos(r);e[0]=n*u-a*s,e[1]=i*u+o*s,e[2]=a*u+n*s,e[3]=o*u-i*s}(this,this,e),this.check()}},{key:"rotateZ",value:function(e){return function(e,t,r){r*=.5;var n=t[0],i=t[1],a=t[2],o=t[3],s=Math.sin(r),u=Math.cos(r);e[0]=n*u+i*s,e[1]=i*u-n*s,e[2]=a*u+o*s,e[3]=o*u-a*s}(this,this,e),this.check()}},{key:"scale",value:function(e){return ur(this,this,e),this.check()}},{key:"slerp",value:function(e,t,r){var n,i,a;switch(arguments.length){case 1:var o=e.start;n=void 0===o?yr:o,i=e.target,a=e.ratio;break;case 2:n=this,i=e,a=t;break;default:n=e,i=t,a=r}return $t(this,n,i,a),this.check()}},{key:"transformVector4",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Qt;return Z(t,e,this),bt(t,4)}},{key:"lengthSq",value:function(){return this.lengthSquared()}},{key:"setFromAxisAngle",value:function(e,t){return this.setAxisAngle(e,t)}},{key:"premultiply",value:function(e){return this.multiplyLeft(e)}},{key:"multiply",value:function(e){return this.multiplyRight(e)}}]),r}(yt),mr=new Tt,br=new Tt,Ar=new Tt,Br=new Tt,wr=new Tt,_r=new Tt,xr=new Tt,Cr=0,Or=1,Er=2,Tr=3,Sr=4,kr=5,Mr=6,Ir=7,Pr=8,Rr=function(){function e(){var t=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];Ne()(this,e),Ve(this,"center",void 0),Ve(this,"halfAxes",void 0),this.center=(new Tt).from(t),this.halfAxes=new qt(r)}return Je()(e,[{key:"halfSize",get:function(){var e=this.halfAxes.getColumn(0),t=this.halfAxes.getColumn(1),r=this.halfAxes.getColumn(2);return[new Tt(e).len(),new Tt(t).len(),new Tt(r).len()]}},{key:"quaternion",get:function(){var e=this.halfAxes.getColumn(0),t=this.halfAxes.getColumn(1),r=this.halfAxes.getColumn(2),n=new Tt(e).normalize(),i=new Tt(t).normalize(),a=new Tt(r).normalize();return(new gr).fromMatrix3(new qt([].concat(Dt()(n),Dt()(i),Dt()(a))))}},{key:"fromCenterHalfSizeQuaternion",value:function(e,t,r){var n=new gr(r),i=(new qt).fromQuaternion(n);return i[0]=i[0]*t[0],i[1]=i[1]*t[0],i[2]=i[2]*t[0],i[3]=i[3]*t[1],i[4]=i[4]*t[1],i[5]=i[5]*t[1],i[6]=i[6]*t[2],i[7]=i[7]*t[2],i[8]=i[8]*t[2],this.center=(new Tt).from(e),this.halfAxes=i,this}},{key:"clone",value:function(){return new e(this.center,this.halfAxes)}},{key:"equals",value:function(e){return this===e||Boolean(e)&&this.center.equals(e.center)&&this.halfAxes.equals(e.halfAxes)}},{key:"getBoundingSphere",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Rt,t=this.halfAxes,r=t.getColumn(0,Ar),n=t.getColumn(1,Br),i=t.getColumn(2,wr),a=mr.copy(r).add(n).add(i);return e.center.copy(this.center),e.radius=a.magnitude(),e}},{key:"intersectPlane",value:function(e){var t=this.center,r=e.normal,n=this.halfAxes,i=r.x,a=r.y,o=r.z,s=Math.abs(i*n[Cr]+a*n[Or]+o*n[Er])+Math.abs(i*n[Tr]+a*n[Sr]+o*n[kr])+Math.abs(i*n[Mr]+a*n[Ir]+o*n[Pr]),u=r.dot(t)+e.distance;return u<=-s?Le:u>=s?Ge:je}},{key:"distanceTo",value:function(e){return Math.sqrt(this.distanceSquaredTo(e))}},{key:"distanceSquaredTo",value:function(e){var t=br.from(e).subtract(this.center),r=this.halfAxes,n=r.getColumn(0,Ar),i=r.getColumn(1,Br),a=r.getColumn(2,wr),o=n.magnitude(),s=i.magnitude(),u=a.magnitude();n.normalize(),i.normalize(),a.normalize();var c,l=0;return(c=Math.abs(t.dot(n))-o)>0&&(l+=c*c),(c=Math.abs(t.dot(i))-s)>0&&(l+=c*c),(c=Math.abs(t.dot(a))-u)>0&&(l+=c*c),l}},{key:"computePlaneDistances",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[-0,-0],n=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY,a=this.center,o=this.halfAxes,s=o.getColumn(0,Ar),u=o.getColumn(1,Br),c=o.getColumn(2,wr),l=_r.copy(s).add(u).add(c).add(a),f=xr.copy(l).subtract(e),h=t.dot(f);return n=Math.min(h,n),i=Math.max(h,i),l.copy(a).add(s).add(u).subtract(c),f.copy(l).subtract(e),h=t.dot(f),n=Math.min(h,n),i=Math.max(h,i),l.copy(a).add(s).subtract(u).add(c),f.copy(l).subtract(e),h=t.dot(f),n=Math.min(h,n),i=Math.max(h,i),l.copy(a).add(s).subtract(u).subtract(c),f.copy(l).subtract(e),h=t.dot(f),n=Math.min(h,n),i=Math.max(h,i),a.copy(l).subtract(s).add(u).add(c),f.copy(l).subtract(e),h=t.dot(f),n=Math.min(h,n),i=Math.max(h,i),a.copy(l).subtract(s).add(u).subtract(c),f.copy(l).subtract(e),h=t.dot(f),n=Math.min(h,n),i=Math.max(h,i),a.copy(l).subtract(s).subtract(u).add(c),f.copy(l).subtract(e),h=t.dot(f),n=Math.min(h,n),i=Math.max(h,i),a.copy(l).subtract(s).subtract(u).subtract(c),f.copy(l).subtract(e),h=t.dot(f),n=Math.min(h,n),i=Math.max(h,i),r[0]=n,r[1]=i,r}},{key:"transform",value:function(e){this.center.transformAsPoint(e);var t=this.halfAxes.getColumn(0,Ar);t.transformAsPoint(e);var r=this.halfAxes.getColumn(1,Br);r.transformAsPoint(e);var n=this.halfAxes.getColumn(2,wr);return n.transformAsPoint(e),this.halfAxes=new qt([].concat(Dt()(t),Dt()(r),Dt()(n))),this}},{key:"getTransform",value:function(){throw new Error("not implemented")}}]),e}(),Fr=new Tt,Dr=new Tt,Lr=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[0,0,1],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;Ne()(this,e),Ve(this,"normal",void 0),Ve(this,"distance",void 0),this.normal=new Tt,this.distance=-0,this.fromNormalDistance(t,r)}return Je()(e,[{key:"fromNormalDistance",value:function(e,t){return tt(Number.isFinite(t)),this.normal.from(e).normalize(),this.distance=t,this}},{key:"fromPointNormal",value:function(e,t){e=Fr.from(e),this.normal.from(t).normalize();var r=-this.normal.dot(e);return this.distance=r,this}},{key:"fromCoefficients",value:function(e,t,r,n){return this.normal.set(e,t,r),tt(ht(this.normal.len(),1)),this.distance=n,this}},{key:"clone",value:function(){return new e(this.normal,this.distance)}},{key:"equals",value:function(e){return ht(this.distance,e.distance)&&ht(this.normal,e.normal)}},{key:"getPointDistance",value:function(e){return this.normal.dot(e)+this.distance}},{key:"transform",value:function(e){var t=Dr.copy(this.normal).transformAsVector(e).normalize(),r=this.normal.scale(-this.distance).transform(e);return this.fromPointNormal(r,t)}},{key:"projectPointOntoPlane",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];e=Fr.from(e);var r=this.getPointDistance(e),n=Dr.copy(this.normal).scale(r);return e.subtract(n).to(t)}}]),e}();function jr(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return Gr(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Gr(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function Gr(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Ur,Nr=[new Tt([1,0,0]),new Tt([0,1,0]),new Tt([0,0,1])],Hr=new Tt,Jr=new Tt,Vr=(new Lr(new Tt(1,0,0),0),function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];Ne()(this,e),Ve(this,"planes",void 0),this.planes=t}return Je()(e,[{key:"fromBoundingSphere",value:function(e){this.planes.length=2*Nr.length;var t,r=e.center,n=e.radius,i=0,a=jr(Nr);try{for(a.s();!(t=a.n()).done;){var o=t.value,s=this.planes[i],u=this.planes[i+1];s||(s=this.planes[i]=new Lr),u||(u=this.planes[i+1]=new Lr);var c=Hr.copy(o).scale(-n).add(r);o.dot(c);s.fromPointNormal(c,o);var l=Hr.copy(o).scale(n).add(r),f=Jr.copy(o).negate();f.dot(l);u.fromPointNormal(l,f),i+=2}}catch(e){a.e(e)}finally{a.f()}return this}},{key:"computeVisibility",value:function(e){var t,r=Ge,n=jr(this.planes);try{for(n.s();!(t=n.n()).done;){var i=t.value;switch(e.intersectPlane(i)){case Le:return Le;case je:r=je}}}catch(e){n.e(e)}finally{n.f()}return r}},{key:"computeVisibilityWithPlaneMask",value:function(t,r){if(tt(Number.isFinite(r),"parentPlaneMask is required."),r===e.MASK_OUTSIDE||r===e.MASK_INSIDE)return r;for(var n=e.MASK_INSIDE,i=this.planes,a=0;a<this.planes.length;++a){var o=a<31?1<<a:0;if(!(a<31&&0==(r&o))){var s=i[a],u=t.intersectPlane(s);if(u===Le)return e.MASK_OUTSIDE;u===je&&(n|=o)}}return n}}]),e}());function zr(e){var t=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(e){return!1}}();return function(){var r,n=et()(e);if(t){var i=et()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Ye()(this,r)}}Ve(Vr,"MASK_OUTSIDE",4294967295),Ve(Vr,"MASK_INSIDE",0),Ve(Vr,"MASK_INDETERMINATE",2147483647),function(e){e[e.COL0ROW0=0]="COL0ROW0",e[e.COL0ROW1=1]="COL0ROW1",e[e.COL0ROW2=2]="COL0ROW2",e[e.COL0ROW3=3]="COL0ROW3",e[e.COL1ROW0=4]="COL1ROW0",e[e.COL1ROW1=5]="COL1ROW1",e[e.COL1ROW2=6]="COL1ROW2",e[e.COL1ROW3=7]="COL1ROW3",e[e.COL2ROW0=8]="COL2ROW0",e[e.COL2ROW1=9]="COL2ROW1",e[e.COL2ROW2=10]="COL2ROW2",e[e.COL2ROW3=11]="COL2ROW3",e[e.COL3ROW0=12]="COL3ROW0",e[e.COL3ROW1=13]="COL3ROW1",e[e.COL3ROW2=14]="COL3ROW2",e[e.COL3ROW3=15]="COL3ROW3"}(Ur||(Ur={}));var Kr,qr,Xr=45*Math.PI/180,Qr=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),Wr=function(e){We()(r,e);var t=zr(r);function r(e){var n;return Ke()(this,r),n=t.call(this,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0),1===arguments.length&&Array.isArray(e)?n.copy(e):n.identity(),n}return Xe()(r,[{key:"ELEMENTS",get:function(){return 16}},{key:"RANK",get:function(){return 4}},{key:"INDICES",get:function(){return Ur}},{key:"copy",value:function(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this[4]=e[4],this[5]=e[5],this[6]=e[6],this[7]=e[7],this[8]=e[8],this[9]=e[9],this[10]=e[10],this[11]=e[11],this[12]=e[12],this[13]=e[13],this[14]=e[14],this[15]=e[15],this.check()}},{key:"set",value:function(e,t,r,n,i,a,o,s,u,c,l,f,h,d,p,v){return this[0]=e,this[1]=t,this[2]=r,this[3]=n,this[4]=i,this[5]=a,this[6]=o,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(e,t,r,n,i,a,o,s,u,c,l,f,h,d,p,v){return this[0]=e,this[1]=i,this[2]=u,this[3]=h,this[4]=t,this[5]=a,this[6]=c,this[7]=d,this[8]=r,this[9]=o,this[10]=l,this[11]=p,this[12]=n,this[13]=s,this[14]=f,this[15]=v,this.check()}},{key:"toRowMajor",value:function(e){return e[0]=this[0],e[1]=this[4],e[2]=this[8],e[3]=this[12],e[4]=this[1],e[5]=this[5],e[6]=this[9],e[7]=this[13],e[8]=this[2],e[9]=this[6],e[10]=this[10],e[11]=this[14],e[12]=this[3],e[13]=this[7],e[14]=this[11],e[15]=this[15],e}},{key:"identity",value:function(){return this.copy(Qr)}},{key:"fromObject",value:function(e){return this.check()}},{key:"fromQuaternion",value:function(e){return function(e,t){var r=t[0],n=t[1],i=t[2],a=t[3],o=r+r,s=n+n,u=i+i,c=r*o,l=n*o,f=n*s,h=i*o,d=i*s,p=i*u,v=a*o,y=a*s,g=a*u;e[0]=1-f-p,e[1]=l+g,e[2]=h-y,e[3]=0,e[4]=l-g,e[5]=1-c-p,e[6]=d+v,e[7]=0,e[8]=h+y,e[9]=d-v,e[10]=1-c-f,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1}(this,e),this.check()}},{key:"frustum",value:function(e){var t=e.left,r=e.right,n=e.bottom,i=e.top,a=e.near,o=void 0===a?.1:a,s=e.far,u=void 0===s?500:s;return u===1/0?function(e,t,r,n,i,a){var o=2*a/(r-t),s=2*a/(i-n),u=(r+t)/(r-t),c=(i+n)/(i-n),l=-2*a;e[0]=o,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=s,e[6]=0,e[7]=0,e[8]=u,e[9]=c,e[10]=-1,e[11]=-1,e[12]=0,e[13]=0,e[14]=l,e[15]=0}(this,t,r,n,i,o):function(e,t,r,n,i,a,o){var s=1/(r-t),u=1/(i-n),c=1/(a-o);e[0]=2*a*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=2*a*u,e[6]=0,e[7]=0,e[8]=(r+t)*s,e[9]=(i+n)*u,e[10]=(o+a)*c,e[11]=-1,e[12]=0,e[13]=0,e[14]=o*a*2*c,e[15]=0}(this,t,r,n,i,o,u),this.check()}},{key:"lookAt",value:function(e){var t=e.eye,r=e.center,n=void 0===r?[0,0,0]:r,i=e.up;return function(e,t,r,n){var i,a,o,s,u,c,l,f,h,d,p=t[0],v=t[1],y=t[2],g=n[0],m=n[1],b=n[2],A=r[0],B=r[1],w=r[2];Math.abs(p-A)<1e-6&&Math.abs(v-B)<1e-6&&Math.abs(y-w)<1e-6?function(e){e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1}(e):(l=p-A,f=v-B,h=y-w,i=m*(h*=d=1/Math.hypot(l,f,h))-b*(f*=d),a=b*(l*=d)-g*h,o=g*f-m*l,(d=Math.hypot(i,a,o))?(i*=d=1/d,a*=d,o*=d):(i=0,a=0,o=0),s=f*o-h*a,u=h*i-l*o,c=l*a-f*i,(d=Math.hypot(s,u,c))?(s*=d=1/d,u*=d,c*=d):(s=0,u=0,c=0),e[0]=i,e[1]=s,e[2]=l,e[3]=0,e[4]=a,e[5]=u,e[6]=f,e[7]=0,e[8]=o,e[9]=c,e[10]=h,e[11]=0,e[12]=-(i*p+a*v+o*y),e[13]=-(s*p+u*v+c*y),e[14]=-(l*p+f*v+h*y),e[15]=1)}(this,t,n,void 0===i?[0,1,0]:i),this.check()}},{key:"ortho",value:function(e){var t=e.left,r=e.right,n=e.bottom,i=e.top,a=e.near,o=void 0===a?.1:a,s=e.far;return ue(this,t,r,n,i,o,void 0===s?500:s),this.check()}},{key:"orthographic",value:function(e){var t=e.fovy,r=void 0===t?Xr:t,n=e.aspect,i=void 0===n?1:n,a=e.focalDistance,o=void 0===a?1:a,s=e.near,u=void 0===s?.1:s,c=e.far,l=void 0===c?500:c;Zr(r);var f=r/2,h=o*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(e){var t=e.fovy,r=void 0===t?45*Math.PI/180:t,n=e.aspect,i=void 0===n?1:n,a=e.near,o=void 0===a?.1:a,s=e.far,u=void 0===s?500:s;return Zr(r),se(this,r,i,o,u),this.check()}},{key:"determinant",value:function(){return t=(e=this)[0],r=e[1],n=e[2],i=e[3],a=e[4],o=e[5],s=e[6],u=e[7],c=e[8],l=e[9],f=e[10],h=e[11],d=e[12],p=e[13],v=e[14],y=e[15],(t*o-r*a)*(f*y-h*v)-(t*s-n*a)*(l*y-h*p)+(t*u-i*a)*(l*v-f*p)+(r*s-n*o)*(c*y-h*d)-(r*u-i*o)*(c*v-f*d)+(n*u-i*s)*(c*p-l*d);var e,t,r,n,i,a,o,s,u,c,l,f,h,d,p,v,y}},{key:"getScale",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[-0,-0,-0];return e[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),e[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),e[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),e}},{key:"getTranslation",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[-0,-0,-0];return e[0]=this[12],e[1]=this[13],e[2]=this[14],e}},{key:"getRotation",value:function(e,t){e=e||[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],t=t||[-0,-0,-0];var r=this.getScale(t),n=1/r[0],i=1/r[1],a=1/r[2];return e[0]=this[0]*n,e[1]=this[1]*i,e[2]=this[2]*a,e[3]=0,e[4]=this[4]*n,e[5]=this[5]*i,e[6]=this[6]*a,e[7]=0,e[8]=this[8]*n,e[9]=this[9]*i,e[10]=this[10]*a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}},{key:"getRotationMatrix3",value:function(e,t){e=e||[-0,-0,-0,-0,-0,-0,-0,-0,-0],t=t||[-0,-0,-0];var r=this.getScale(t),n=1/r[0],i=1/r[1],a=1/r[2];return e[0]=this[0]*n,e[1]=this[1]*i,e[2]=this[2]*a,e[3]=this[4]*n,e[4]=this[5]*i,e[5]=this[6]*a,e[6]=this[8]*n,e[7]=this[9]*i,e[8]=this[10]*a,e}},{key:"transpose",value:function(){return function(e,t){if(e===t){var r=t[1],n=t[2],i=t[3],a=t[6],o=t[7],s=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=r,e[6]=t[9],e[7]=t[13],e[8]=n,e[9]=a,e[11]=t[14],e[12]=i,e[13]=o,e[14]=s}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15]}(this,this),this.check()}},{key:"invert",value:function(){return ee(this,this),this.check()}},{key:"multiplyLeft",value:function(e){return te(this,e,this),this.check()}},{key:"multiplyRight",value:function(e){return te(this,this,e),this.check()}},{key:"rotateX",value:function(e){return ie(this,this,e),this.check()}},{key:"rotateY",value:function(e){return function(e,t,r){var n=Math.sin(r),i=Math.cos(r),a=t[0],o=t[1],s=t[2],u=t[3],c=t[8],l=t[9],f=t[10],h=t[11];t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*i-c*n,e[1]=o*i-l*n,e[2]=s*i-f*n,e[3]=u*i-h*n,e[8]=a*n+c*i,e[9]=o*n+l*i,e[10]=s*n+f*i,e[11]=u*n+h*i}(this,this,e),this.check()}},{key:"rotateZ",value:function(e){return ae(this,this,e),this.check()}},{key:"rotateXYZ",value:function(e){return this.rotateX(e[0]).rotateY(e[1]).rotateZ(e[2])}},{key:"rotateAxis",value:function(e,t){return function(e,t,r,n){var i,a,o,s,u,c,l,f,h,d,p,v,y,g,m,b,A,B,w,_,x,C,O,E,T=n[0],S=n[1],k=n[2],M=Math.hypot(T,S,k);M<1e-6||(T*=M=1/M,S*=M,k*=M,i=Math.sin(r),o=1-(a=Math.cos(r)),s=t[0],u=t[1],c=t[2],l=t[3],f=t[4],h=t[5],d=t[6],p=t[7],v=t[8],y=t[9],g=t[10],m=t[11],b=T*T*o+a,A=S*T*o+k*i,B=k*T*o-S*i,w=T*S*o-k*i,_=S*S*o+a,x=k*S*o+T*i,C=T*k*o+S*i,O=S*k*o-T*i,E=k*k*o+a,e[0]=s*b+f*A+v*B,e[1]=u*b+h*A+y*B,e[2]=c*b+d*A+g*B,e[3]=l*b+p*A+m*B,e[4]=s*w+f*_+v*x,e[5]=u*w+h*_+y*x,e[6]=c*w+d*_+g*x,e[7]=l*w+p*_+m*x,e[8]=s*C+f*O+v*E,e[9]=u*C+h*O+y*E,e[10]=c*C+d*O+g*E,e[11]=l*C+p*O+m*E,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]))}(this,this,e,t),this.check()}},{key:"scale",value:function(e){return ne(this,this,Array.isArray(e)?e:[e,e,e]),this.check()}},{key:"translate",value:function(e){return re(this,this,e),this.check()}},{key:"transform",value:function(e,t){return 4===e.length?(bt(t=W(t||[-0,-0,-0,-0],e,this),4),t):this.transformAsPoint(e,t)}},{key:"transformAsPoint",value:function(e,t){var r;switch(e.length){case 2:r=le(t||[-0,-0],e,this);break;case 3:r=ye(t||[-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return bt(r,e.length),r}},{key:"transformAsVector",value:function(e,t){var r;switch(e.length){case 2:r=wt(t||[-0,-0],e,this);break;case 3:r=_t(t||[-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return bt(r,e.length),r}},{key:"transformPoint",value:function(e,t){return this.transformAsPoint(e,t)}},{key:"transformVector",value:function(e,t){return this.transformAsPoint(e,t)}},{key:"transformDirection",value:function(e,t){return this.transformAsVector(e,t)}},{key:"makeRotationX",value:function(e){return this.identity().rotateX(e)}},{key:"makeTranslation",value:function(e,t,r){return this.identity().translate([e,t,r])}}],[{key:"IDENTITY",get:function(){return function(){qr||(qr=new Wr,Object.freeze(qr));return qr}()}},{key:"ZERO",get:function(){return function(){Kr||(Kr=new Wr([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Object.freeze(Kr));return Kr}()}}]),r}(jt);function Zr(e){if(e>2*Math.PI)throw Error("expected radians")}new Tt,new Tt,new Tt,new Tt,new Tt;function Yr(e){var t=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(e){return!1}}();return function(){var r,n=et()(e);if(t){var i=et()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Ye()(this,r)}}var $r=function(e){We()(r,e);var t=Yr(r);function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return Ke()(this,r),e=t.call(this,2),ot(n)&&1===arguments.length?e.copy(n):(it.debug&&(mt(n),mt(i)),e[0]=n,e[1]=i),e}return Xe()(r,[{key:"set",value:function(e,t){return this[0]=e,this[1]=t,this.check()}},{key:"copy",value:function(e){return this[0]=e[0],this[1]=e[1],this.check()}},{key:"fromObject",value:function(e){return it.debug&&(mt(e.x),mt(e.y)),this[0]=e.x,this[1]=e.y,this.check()}},{key:"toObject",value:function(e){return e.x=this[0],e.y=this[1],e}},{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(e){return this.transformAsPoint(e)}},{key:"transformAsPoint",value:function(e){return le(this,this,e),this.check()}},{key:"transformAsVector",value:function(e){return wt(this,this,e),this.check()}},{key:"transformByMatrix3",value:function(e){return ce(this,this,e),this.check()}},{key:"transformByMatrix2x3",value:function(e){return function(e,t,r){var n=t[0],i=t[1];e[0]=r[0]*n+r[2]*i+r[4],e[1]=r[1]*n+r[3]*i+r[5]}(this,this,e),this.check()}},{key:"transformByMatrix2",value:function(e){return function(e,t,r){var n=t[0],i=t[1];e[0]=r[0]*n+r[2]*i,e[1]=r[1]*n+r[3]*i}(this,this,e),this.check()}}]),r}(Bt);new Tt,new Tt,new Tt,new Tt,new Tt,new Tt,new Tt,new Tt,new Tt,new Tt,new Tt,new Tt,Math.PI;var en=.1,tn=1e-12,rn=1e-15,nn=1e-20,an=(Math.PI,Math.PI,Math.PI,Math.PI,new qt),on=new qt,sn=new qt,un=new qt,cn=new qt;function ln(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=nn,n=10,i=0,a=0,o=on,s=sn;o.identity(),s.copy(e);for(var u=r*fn(s);a<n&&pn(s)>u;)vn(s,un),cn.copy(un).transpose(),s.multiplyRight(un),s.multiplyLeft(cn),o.multiplyRight(un),++i>2&&(++a,i=0);return t.unitary=o.toTarget(t.unitary),t.diagonal=s.toTarget(t.diagonal),t}function fn(e){for(var t=0,r=0;r<9;++r){var n=e[r];t+=n*n}return Math.sqrt(t)}var hn=[1,0,0],dn=[2,2,1];function pn(e){for(var t=0,r=0;r<3;++r){var n=e[an.getElementIndex(dn[r],hn[r])];t+=2*n*n}return Math.sqrt(t)}function vn(e,t){for(var r=rn,n=0,i=1,a=0;a<3;++a){var o=Math.abs(e[an.getElementIndex(dn[a],hn[a])]);o>n&&(i=a,n=o)}var s=hn[i],u=dn[i],c=1,l=0;if(Math.abs(e[an.getElementIndex(u,s)])>r){var f,h=(e[an.getElementIndex(u,u)]-e[an.getElementIndex(s,s)])/2/e[an.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 qt.IDENTITY.to(t),t[an.getElementIndex(s,s)]=t[an.getElementIndex(u,u)]=c,t[an.getElementIndex(u,s)]=l,t[an.getElementIndex(s,u)]=-l,t}function yn(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return gn(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return gn(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function gn(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var mn=new Tt,bn=new Tt,An=new Tt,Bn=new Tt,wn=new Tt,_n=new qt,xn={diagonal:new qt,unitary:new qt};function Cn(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return On(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return On(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function On(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var En=[[.5,.5],[0,0],[0,1],[1,0],[1,1]],Tn=En.concat([[0,.5],[.5,0],[1,.5],[.5,1]]),Sn=Tn.concat([[.25,.5],[.75,.5]]),kn=function(){function e(t,r,n){h()(this,e),A()(this,"x",void 0),A()(this,"y",void 0),A()(this,"z",void 0),A()(this,"childVisible",void 0),A()(this,"selected",void 0),A()(this,"_children",void 0),this.x=t,this.y=r,this.z=n}return C()(e,[{key:"children",get:function(){if(!this._children){var t=2*this.x,r=2*this.y,n=this.z+1;this._children=[new e(t,r,n),new e(t,r+1,n),new e(t+1,r,n),new e(t+1,r+1,n)]}return this._children}},{key:"update",value:function(e){var t=e.viewport,r=e.cullingVolume,n=e.elevationBounds,i=e.minZ,a=e.maxZ,o=e.bounds,s=e.offset,u=e.project,c=this.getBoundingVolume(n,s,u);if(o&&!this.insideBounds(o))return!1;if(r.computeVisibility(c)<0)return!1;if(!this.childVisible){var l=this.z;if(l<a&&l>=i){var f=c.distanceTo(t.cameraPosition)*t.scale/t.height;l+=Math.floor(Math.log2(f))}if(l>=a)return this.selected=!0,!0}this.selected=!1,this.childVisible=!0;var h,d=Cn(this.children);try{for(d.s();!(h=d.n()).done;){h.value.update(e)}}catch(e){d.e(e)}finally{d.f()}return!0}},{key:"getSelected",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];if(this.selected&&e.push(this),this._children){var t,r=Cn(this._children);try{for(r.s();!(t=r.n()).done;){var n=t.value;n.getSelected(e)}}catch(e){r.e(e)}finally{r.f()}}return e}},{key:"insideBounds",value:function(e){var t=M()(e,4),r=t[0],n=t[1],i=t[2],a=t[3],o=512/Math.pow(2,this.z);return this.x*o<i&&this.y*o<a&&(this.x+1)*o>r&&(this.y+1)*o>n}},{key:"getBoundingVolume",value:function(e,t,r){if(r){var n,i=[],a=Cn(this.z<1?Sn:this.z<2?Tn:En);try{for(a.s();!(n=a.n()).done;){var o=n.value,s=Ln(this.x+o[0],this.y+o[1],this.z);s[2]=e[0],i.push(r(s)),e[0]!==e[1]&&(s[2]=e[1],i.push(r(s)))}}catch(e){a.e(e)}finally{a.f()}return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Rr;if(!e||0===e.length)return t.halfAxes=new qt([0,0,0,0,0,0,0,0,0]),t.center=new Tt,t;var r,n=e.length,i=new Tt(0,0,0),a=yn(e);try{for(a.s();!(r=a.n()).done;){var o=r.value;i.add(o)}}catch(e){a.e(e)}finally{a.f()}var s=1/n;i.multiplyByScalar(s);var u,c=0,l=0,f=0,h=0,d=0,p=0,v=yn(e);try{for(v.s();!(u=v.n()).done;){var y=u.value,g=mn.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(e){v.e(e)}finally{v.f()}c*=s,l*=s,f*=s,h*=s,d*=s,p*=s;var m=_n;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=ln(m,xn),B=A.unitary,w=t.halfAxes.copy(B),_=w.getColumn(0,An),x=w.getColumn(1,Bn),C=w.getColumn(2,wn),O=-Number.MAX_VALUE,E=-Number.MAX_VALUE,T=-Number.MAX_VALUE,S=Number.MAX_VALUE,k=Number.MAX_VALUE,M=Number.MAX_VALUE,I=yn(e);try{for(I.s();!(b=I.n()).done;){var P=b.value;mn.copy(P),O=Math.max(mn.dot(_),O),E=Math.max(mn.dot(x),E),T=Math.max(mn.dot(C),T),S=Math.min(mn.dot(_),S),k=Math.min(mn.dot(x),k),M=Math.min(mn.dot(C),M)}}catch(e){I.e(e)}finally{I.f()}_=_.multiplyByScalar(.5*(S+O)),x=x.multiplyByScalar(.5*(k+E)),C=C.multiplyByScalar(.5*(M+T)),t.center.copy(_).add(x).add(C);var R=bn.set(O-S,E-k,T-M).multiplyByScalar(.5),F=new qt([R[0],0,0,0,R[1],0,0,0,R[2]]);return t.halfAxes.multiplyRight(F),t}(i)}var u=512/Math.pow(2,this.z),c=this.x*u+512*t,l=512-(this.y+1)*u;return new Mt([c,l,e[0]],[c+u,l+u,e[1]])}}]),e}();var Mn=[-1/0,-1/0,1/0,1/0],In={type:"url",value:null,validate:function(e,t){return t.optional&&null===e||"string"==typeof e||Array.isArray(e)&&e.every((function(e){return"string"==typeof e}))},equals:function(e,t){if(e===t)return!0;if(!Array.isArray(e)||!Array.isArray(t))return!1;var r=e.length;if(r!==t.length)return!1;for(var n=0;n<r;n++)if(e[n]!==t[n])return!1;return!0}};function Pn(e,t){var r=[t.transformAsPoint([e[0],e[1]]),t.transformAsPoint([e[2],e[1]]),t.transformAsPoint([e[0],e[3]]),t.transformAsPoint([e[2],e[3]])];return[Math.min.apply(Math,De()(r.map((function(e){return e[0]})))),Math.min.apply(Math,De()(r.map((function(e){return e[1]})))),Math.max.apply(Math,De()(r.map((function(e){return e[0]})))),Math.max.apply(Math,De()(r.map((function(e){return e[1]}))))]}function Rn(e,t){if(!e||!e.length)return null;var r,n=t.index,i=t.id;Array.isArray(e)&&(e=e[(r=i,Math.abs(r.split("").reduce((function(e,t){return(e<<5)-e+t.charCodeAt(0)|0}),0))%e.length)]);for(var a=e,o=0,s=Object.keys(n);o<s.length;o++){var u=s[o],c=new RegExp("{".concat(u,"}"),"g");a=a.replace(c,String(n[u]))}return Number.isInteger(n.y)&&Number.isInteger(n.z)&&(a=a.replace(/\{-y\}/g,String(Math.pow(2,n.z)-n.y-1))),a}function Fn(e){var t=e.viewport,r=e.z,n=void 0===r?0:r,i=e.cullRect;return(t.subViewports||[t]).map((function(e){return function e(t,r,n){if(!Array.isArray(r)){var i=n.x-t.x,a=n.y-t.y,o=n.width,s=n.height,u={targetZ:r},c=t.unproject([i,a],u),l=t.unproject([i+o,a],u),f=t.unproject([i,a+s],u),h=t.unproject([i+o,a+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=e(t,r[0],n),p=e(t,r[1],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])]}(e,n,i)}))}function Dn(e,t){return 512*Math.pow(2,e)/t}function Ln(e,t,r){var n=Dn(r,512),i=e/n*360-180,a=Math.PI-2*Math.PI*t/n;return[i,180/Math.PI*Math.atan(.5*(Math.exp(a)-Math.exp(-a)))]}function jn(e,t,r,n){var i=Dn(r,n);return[e/i*512,t/i*512]}function Gn(e,t,r,n){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:512;if(e.isGeospatial){var a=Ln(t,r,n),o=M()(a,2),s=o[0],u=o[1],c=Ln(t+1,r+1,n),l=M()(c,2),f=l[0],h=l[1];return{west:s,north:u,east:f,south:h}}var d=jn(t,r,n,i),p=M()(d,2),v=p[0],y=p[1],g=jn(t+1,r+1,n,i),m=M()(g,2),b=m[0],A=m[1];return{left:v,top:y,right:b,bottom:A}}function Un(e,t,r,n,i){for(var a=function(e,t,r){return r?Pn(e,r).map((function(e){return e*t/512})):e.map((function(e){return e*t/512}))}(function(e,t,r){var n;if(t&&2===t.length){var i=M()(t,2),a=i[0],o=i[1],s=e.getBounds({z:a}),u=e.getBounds({z:o});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=e.getBounds();return e.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])]}(e,null,n),Dn(t,r),i),o=M()(a,4),s=o[0],u=o[1],c=o[2],l=o[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:t});return f}function Nn(e){var t=e.viewport,r=e.maxZoom,n=e.minZoom,i=e.zRange,a=e.extent,o=e.tileSize,s=void 0===o?512:o,u=e.modelMatrix,c=e.modelMatrixInverse,l=e.zoomOffset,f=void 0===l?0:l,h=t.isGeospatial?Math.round(t.zoom+Math.log2(512/s))+f:Math.ceil(t.zoom)+f;if("number"==typeof n&&Number.isFinite(n)&&h<n){if(!a)return[];h=n}"number"==typeof r&&Number.isFinite(r)&&h>r&&(h=r);var d=a;return u&&c&&a&&!t.isGeospatial&&(d=Pn(a,u)),t.isGeospatial?function(e,t,r,n){var i=e instanceof B._GlobeViewport&&e.resolution?e.projectPosition:null,a=Object.values(e.getFrustumPlanes()).map((function(e){var t=e.normal,r=e.distance;return new Lr(t.clone().negate(),r)})),o=new Vr(a),s=e.distanceScales.unitsPerMeter[2],u=r&&r[0]*s||0,c=r&&r[1]*s||0,l=e instanceof B.WebMercatorViewport&&e.pitch<=60?t:0;if(n){var f=n,h=M()(f,4),d=h[0],p=h[1],v=h[2],y=Ce([d,h[3]]),g=Ce([v,p]);n=[y[0],512-y[1],g[0],512-g[1]]}var m=new kn(0,0,0),b={viewport:e,project:i,cullingVolume:o,elevationBounds:[u,c],minZ:l,maxZ:t,bounds:n,offset:0};if(m.update(b),e instanceof B.WebMercatorViewport&&e.subViewports&&e.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()}(t,h,i,a):Un(t,h,s,d||Mn,c)}function Hn(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Jn(){var e;if("undefined"!=typeof window&&window.performance)e=window.performance.now();else if("undefined"!=typeof process&&process.hrtime){var t=process.hrtime();e=1e3*t[0]+t[1]/1e6}else e=Date.now();return e}var Vn=function(){function e(t,r){h()(this,e),Hn(this,"name",void 0),Hn(this,"type",void 0),Hn(this,"sampleSize",1),Hn(this,"time",void 0),Hn(this,"count",void 0),Hn(this,"samples",void 0),Hn(this,"lastTiming",void 0),Hn(this,"lastSampleTime",void 0),Hn(this,"lastSampleCount",void 0),Hn(this,"_count",0),Hn(this,"_time",0),Hn(this,"_samples",0),Hn(this,"_startTime",0),Hn(this,"_timerPending",!1),this.name=t,this.type=r,this.reset()}return C()(e,[{key:"setSampleSize",value:function(e){return this.sampleSize=e,this}},{key:"incrementCount",value:function(){return this.addCount(1),this}},{key:"decrementCount",value:function(){return this.subtractCount(1),this}},{key:"addCount",value:function(e){return this._count+=e,this._samples++,this._checkSampling(),this}},{key:"subtractCount",value:function(e){return this._count-=e,this._samples++,this._checkSampling(),this}},{key:"addTime",value:function(e){return this._time+=e,this.lastTiming=e,this._samples++,this._checkSampling(),this}},{key:"timeStart",value:function(){return this._startTime=Jn(),this._timerPending=!0,this}},{key:"timeEnd",value:function(){return this._timerPending?(this.addTime(Jn()-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)}}]),e}(),zn=function(){function e(t){h()(this,e),Hn(this,"id",void 0),Hn(this,"stats",{}),this.id=t.id,this.stats={},this._initializeStats(t.stats),Object.seal(this)}return C()(e,[{key:"get",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"count";return this._getOrCreate({name:e,type:t})}},{key:"size",get:function(){return Object.keys(this.stats).length}},{key:"reset",value:function(){for(var e in this.stats)this.stats[e].reset();return this}},{key:"forEach",value:function(e){for(var t in this.stats)e(this.stats[t])}},{key:"getTable",value:function(){var e={};return this.forEach((function(t){e[t.name]={time:t.time||0,count:t.count||0,average:t.getAverageTime()||0,hz:t.getHz()||0}})),e}},{key:"_initializeStats",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];t.forEach((function(t){return e._getOrCreate(t)}))}},{key:"_getOrCreate",value:function(e){if(!e||!e.name)return null;var t=e.name,r=e.type;return this.stats[t]||(this.stats[t]=e instanceof Vn?e:new Vn(t,r)),this.stats[t]}}]),e}();function Kn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function qn(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Kn(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Kn(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Xn,Qn={id:"request-scheduler",throttleRequests:!0,maxRequests:6},Wn=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};h()(this,e),Hn(this,"props",void 0),Hn(this,"stats",void 0),Hn(this,"activeRequestCount",0),Hn(this,"requestQueue",[]),Hn(this,"requestMap",new Map),Hn(this,"deferredUpdate",null),this.props=qn(qn({},Qn),t),this.stats=new zn({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 C()(e,[{key:"scheduleRequest",value:function(e){var t=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(e))return this.requestMap.get(e);var r={handle:e,priority:0,getPriority:t},n=new Promise((function(e){return r.resolve=e,r}));return this.requestQueue.push(r),this.requestMap.set(e,n),this._issueNewRequests(),n}},{key:"_issueRequest",value:function(e){var t=this,r=e.handle,n=e.resolve,i=!1,a=function(){i||(i=!0,t.requestMap.delete(r),t.activeRequestCount--,t._issueNewRequests())};return this.activeRequestCount++,n?n({done:a}):Promise.resolve({done:a})}},{key:"_issueNewRequests",value:function(){var e=this;this.deferredUpdate||(this.deferredUpdate=setTimeout((function(){return e._issueNewRequestsAsync()}),0))}},{key:"_issueNewRequestsAsync",value:function(){this.deferredUpdate=null;var e=Math.max(this.props.maxRequests-this.activeRequestCount,0);if(0!==e){this._updateAllRequests();for(var t=0;t<e;++t){var r=this.requestQueue.shift();r&&this._issueRequest(r)}}}},{key:"_updateAllRequests",value:function(){for(var e=this.requestQueue,t=0;t<e.length;++t){var r=e[t];this._updateRequest(r)||(e.splice(t,1),this.requestMap.delete(r.handle),t--)}e.sort((function(e,t){return e.priority-t.priority}))}},{key:"_updateRequest",value:function(e){return e.priority=e.getPriority(e.handle),!(e.priority<0)||(e.resolve(null),!1)}}]),e}();function Zn(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return Yn(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Yn(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function Yn(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var $n=(Xn={},A()(Xn,"best-available",(function(e){var t,r=Zn(e);try{for(r.s();!(t=r.n()).done;){t.value.state=0}}catch(e){r.e(e)}finally{r.f()}var n,i=Zn(e);try{for(i.s();!(n=i.n()).done;){var a=n.value;a.isSelected&&!ti(a)&&ri(a)}}catch(e){i.e(e)}finally{i.f()}var o,s=Zn(e);try{for(s.s();!(o=s.n()).done;){var u=o.value;u.isVisible=Boolean(2&u.state)}}catch(e){s.e(e)}finally{s.f()}})),A()(Xn,"no-overlap",(function(e){var t,r=Zn(e);try{for(r.s();!(t=r.n()).done;){t.value.state=0}}catch(e){r.e(e)}finally{r.f()}var n,i=Zn(e);try{for(i.s();!(n=i.n()).done;){var a=n.value;a.isSelected&&ti(a)}}catch(e){i.e(e)}finally{i.f()}var o,s=Zn(Array.from(e).sort((function(e,t){return e.zoom-t.zoom})));try{for(s.s();!(o=s.n()).done;){var u=o.value;if(u.isVisible=Boolean(2&u.state),u.children&&(u.isVisible||1&u.state)){var c,l=Zn(u.children);try{for(l.s();!(c=l.n()).done;){c.value.state=1}}catch(e){l.e(e)}finally{l.f()}}else u.isSelected&&ri(u)}}catch(e){s.e(e)}finally{s.f()}})),A()(Xn,"never",(function(){})),Xn),ei=function(){function e(t){var r=this;h()(this,e),A()(this,"opts",void 0),A()(this,"_requestScheduler",void 0),A()(this,"_cache",void 0),A()(this,"_dirty",void 0),A()(this,"_tiles",void 0),A()(this,"_cacheByteSize",void 0),A()(this,"_viewport",void 0),A()(this,"_zRange",void 0),A()(this,"_selectedTiles",void 0),A()(this,"_frameNumber",void 0),A()(this,"_modelMatrix",void 0),A()(this,"_modelMatrixInverse",void 0),A()(this,"_maxZoom",void 0),A()(this,"_minZoom",void 0),A()(this,"onTileLoad",void 0),A()(this,"_getCullBounds",Object(B._memoize)(Fn)),this.opts=t,this.onTileLoad=function(e){r.opts.onTileLoad(e),r.opts.maxCacheByteSize&&(r._cacheByteSize+=e.byteLength,r._resizeCache())},this._requestScheduler=new Wn({maxRequests:t.maxRequests,throttleRequests:t.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 Wr,this._modelMatrixInverse=new Wr,this.setOptions(t)}return C()(e,[{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(e){return e.isLoaded}))}},{key:"needsReload",get:function(){return null!==this._selectedTiles&&this._selectedTiles.some((function(e){return e.needsReload}))}},{key:"setOptions",value:function(e){Object.assign(this.opts,e),Number.isFinite(e.maxZoom)&&(this._maxZoom=Math.floor(e.maxZoom)),Number.isFinite(e.minZoom)&&(this._minZoom=Math.ceil(e.minZoom))}},{key:"finalize",value:function(){var e,t=Zn(this._cache.values());try{for(t.s();!(e=t.n()).done;){var r=e.value;r.isLoading&&r.abort()}}catch(e){t.e(e)}finally{t.f()}this._cache.clear(),this._tiles=[],this._selectedTiles=null}},{key:"reloadAll",value:function(){var e,t=Zn(this._cache.keys());try{for(t.s();!(e=t.n()).done;){var r=e.value,n=this._cache.get(r);this._selectedTiles&&this._selectedTiles.includes(n)?n.setNeedsReload():this._cache.delete(r)}}catch(e){t.e(e)}finally{t.f()}}},{key:"update",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=r.zRange,i=r.modelMatrix,a=new Wr(i),o=!a.equals(this._modelMatrix);if(this._viewport&&e.equals(this._viewport)&&ht(this._zRange,n)&&!o)this.needsReload&&(this._selectedTiles=this._selectedTiles.map((function(e){return t._getTile(e.index,!0)})));else{o&&(this._modelMatrixInverse=a.clone().invert(),this._modelMatrix=a),this._viewport=e,this._zRange=n;var s=this.getTileIndices({viewport:e,maxZoom:this._maxZoom,minZoom:this._minZoom,zRange:n,modelMatrix:this._modelMatrix,modelMatrixInverse:this._modelMatrixInverse});this._selectedTiles=s.map((function(e){return t._getTile(e,!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(e,t){if(!e.isVisible)return!1;if(t&&this._viewport){var r,n=this._getCullBounds({viewport:this._viewport,z:this._zRange,cullRect:t}),i=e.bbox,a=Zn(n);try{for(a.s();!(r=a.n()).done;){var o=M()(r.value,4),s=o[0],u=o[1],c=o[2],l=o[3],f=void 0;if("west"in i)f=i.west<c&&i.east>s&&i.south<l&&i.north>u;else{var h=Math.min(i.top,i.bottom),d=Math.max(i.top,i.bottom);f=i.left<c&&i.right>s&&h<l&&d>u}if(f)return!0}}catch(e){a.e(e)}finally{a.f()}return!1}return!0}},{key:"getTileIndices",value:function(e){var t=e.viewport,r=e.maxZoom,n=e.minZoom,i=e.zRange,a=e.modelMatrix,o=e.modelMatrixInverse,s=this.opts;return Nn({viewport:t,maxZoom:r,minZoom:n,zRange:i,tileSize:s.tileSize,extent:s.extent,modelMatrix:a,modelMatrixInverse:o,zoomOffset:s.zoomOffset})}},{key:"getTileId",value:function(e){return"".concat(e.x,"-").concat(e.y,"-").concat(e.z)}},{key:"getTileZoom",value:function(e){return e.z}},{key:"getTileMetadata",value:function(e){var t=this.opts.tileSize;return{bbox:Gn(this._viewport,e.x,e.y,e.z,t)}}},{key:"getParentIndex",value:function(e){return{x:Math.floor(e.x/2),y:Math.floor(e.y/2),z:e.z-1}}},{key:"updateTileStates",value:function(){var e,t=this.opts.refinementStrategy||"best-available",r=new Array(this._cache.size),n=0,i=Zn(this._cache.values());try{for(i.s();!(e=i.n()).done;){var a=e.value;r[n++]=a.isVisible,a.isSelected=!1,a.isVisible=!1}}catch(e){i.e(e)}finally{i.f()}var o,s=Zn(this._selectedTiles);try{for(s.s();!(o=s.n()).done;){var u=o.value;u.isSelected=!0,u.isVisible=!0}}catch(e){s.e(e)}finally{s.f()}("function"==typeof t?t:$n[t])(Array.from(this._cache.values())),n=0;var c,l=Zn(this._cache.values());try{for(l.s();!(c=l.n()).done;){var f=c.value;if(r[n++]!==f.isVisible)return!0}}catch(e){l.e(e)}finally{l.f()}return!1}},{key:"_pruneRequests",value:function(){var e,t=this.opts.maxRequests,r=[],n=0,i=Zn(this._cache.values());try{for(i.s();!(e=i.n()).done;){var a=e.value;a.isLoading&&(n++,a.isSelected||a.isVisible||r.push(a))}}catch(e){i.e(e)}finally{i.f()}for(;t>0&&n>t&&r.length>0;){r.shift().abort(),n--}}},{key:"_rebuildTree",value:function(){var e,t=this._cache,r=Zn(t.values());try{for(r.s();!(e=r.n()).done;){var n=e.value;n.parent=null,n.children&&(n.children.length=0)}}catch(e){r.e(e)}finally{r.f()}var i,a=Zn(t.values());try{for(a.s();!(i=a.n()).done;){var o=i.value,s=this._getNearestAncestor(o);o.parent=s,null!=s&&s.children&&s.children.push(o)}}catch(e){a.e(e)}finally{a.f()}}},{key:"_resizeCache",value:function(){var e=this._cache,t=this.opts,r=t.maxCacheSize||(t.maxCacheByteSize?1/0:5*this.selectedTiles.length),n=t.maxCacheByteSize||1/0;if(e.size>r||this._cacheByteSize>n){var i,a=Zn(e);try{for(a.s();!(i=a.n()).done;){var o=M()(i.value,2),s=o[0],u=o[1];if(u.isVisible||u.isSelected||(this._cacheByteSize-=t.maxCacheByteSize?u.byteLength:0,e.delete(s),this.opts.onTileUnload(u)),e.size<=r&&this._cacheByteSize<=n)break}}catch(e){a.e(e)}finally{a.f()}this._rebuildTree(),this._dirty=!0}this._dirty&&(this._tiles=Array.from(this._cache.values()).sort((function(e,t){return e.zoom-t.zoom})),this._dirty=!1)}},{key:"_getTile",value:function(e,t){var r=this.getTileId(e),n=this._cache.get(r),i=!1;return!n&&t?(n=new Re(e),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(e){for(var t=this._minZoom,r=void 0===t?0:t,n=e.index;this.getTileZoom(n)>r;){n=this.getParentIndex(n);var i=this._getTile(n);if(i)return i}return null}}]),e}();function ti(e){for(var t=e;t;){if(t.isLoaded||t.content)return t.state|=2,!0;t=t.parent}return!1}function ri(e){var t,r=Zn(e.children);try{for(r.s();!(t=r.n()).done;){var n=t.value;n.isLoaded||n.content?n.state|=2:ri(n)}}catch(e){r.e(e)}finally{r.f()}}function ni(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ii(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ni(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ni(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function ai(e){var t=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(e){return!1}}();return function(){var r,n=m()(e);if(t){var i=m()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return y()(this,r)}}var oi={TilesetClass:ei,data:{type:"data",value:[]},dataComparator:In.equals,renderSubLayers:{type:"function",value:function(e){return new B.GeoJsonLayer(e)},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(e){},compare:!1},onTileUnload:{type:"function",value:function(e){},compare:!1},onTileError:{type:"function",value:function(e){return console.error(e)},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},si=function(e){p()(r,e);var t=ai(r);function r(){return h()(this,r),t.apply(this,arguments)}return C()(r,[{key:"initializeState",value:function(){this.state={tileset:null,isLoaded:!1}}},{key:"finalizeState",value:function(){var e,t;null===(e=this.state)||void 0===e||null===(t=e.tileset)||void 0===t||t.finalize()}},{key:"isLoaded",get:function(){var e,t;return null===(e=this.state)||void 0===e?void 0:null===(t=e.tileset)||void 0===t?void 0:t.selectedTiles.every((function(e){return e.isLoaded&&e.layers&&e.layers.every((function(e){return e.isLoaded}))}))}},{key:"shouldUpdateState",value:function(e){return e.changeFlags.somethingChanged}},{key:"updateState",value:function(e){var t=e.changeFlags,r=this.state.tileset,n=t.propsOrDataChanged||t.updateTriggersChanged,i=t.dataChanged||t.updateTriggersChanged&&(t.updateTriggersChanged.all||t.updateTriggersChanged.getTileData);r?n&&(r.setOptions(this._getTilesetOptions()),i?r.reloadAll():this.state.tileset.tiles.forEach((function(e){e.layers=null}))):(r=new this.props.TilesetClass(this._getTilesetOptions()),this.setState({tileset:r})),this._updateTileset()}},{key:"_getTilesetOptions",value:function(){var e=this.props,t=e.tileSize,r=e.maxCacheSize,n=e.maxCacheByteSize,i=e.refinementStrategy,a=e.extent;return{maxCacheSize:r,maxCacheByteSize:n,maxZoom:e.maxZoom,minZoom:e.minZoom,tileSize:t,refinementStrategy:i,extent:a,maxRequests:e.maxRequests,zoomOffset:e.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 e=this.state.tileset,t=this.props,r=t.zRange,n=t.modelMatrix,i=e.update(this.context.viewport,{zRange:r,modelMatrix:n}),a=e.isLoaded,o=this.state.isLoaded!==a,s=this.state.frameNumber!==i;a&&(o||s)&&this._onViewportLoad(),s&&this.setState({frameNumber:i}),this.state.isLoaded=a}},{key:"_onViewportLoad",value:function(){var e=this.state.tileset,t=this.props.onViewportLoad;t&&t(e.selectedTiles)}},{key:"_onTileLoad",value:function(e){this.props.onTileLoad(e),e.layers=null,this.setNeedsUpdate()}},{key:"_onTileError",value:function(e,t){this.props.onTileError(e),t.layers=null,this.setNeedsUpdate()}},{key:"_onTileUnload",value:function(e){this.props.onTileUnload(e)}},{key:"getTileData",value:function(e){var t=this.props,r=t.data,n=t.getTileData,i=t.fetch,a=e.signal;return e.url="string"==typeof r||Array.isArray(r)?Rn(r,e):null,n?n(e):i&&e.url?i(e.url,{propName:"data",layer:this,signal:a}):null}},{key:"renderSubLayers",value:function(e){return this.props.renderSubLayers(e)}},{key:"getSubLayerPropsByTile",value:function(e){return null}},{key:"getPickingInfo",value:function(e){var t=e.info,r=e.sourceLayer;return t.picked&&(t.tile=r.props.tile),t}},{key:"_updateAutoHighlight",value:function(e){e.sourceLayer&&e.sourceLayer.updateAutoHighlight(e)}},{key:"renderLayers",value:function(){var e=this;return this.state.tileset.tiles.map((function(t){var r=e.getSubLayerPropsByTile(t);if(t.isLoaded||t.content)if(t.layers)r&&t.layers[0]&&Object.keys(r).some((function(e){return t.layers[0].props[e]!==r[e]}))&&(t.layers=t.layers.map((function(e){return e.clone(r)})));else{var n=e.renderSubLayers(ii(ii({},e.props),{},{id:"".concat(e.id,"-").concat(t.id),data:t.content,_offset:0,tile:t}));t.layers=Object(B._flatten)(n,Boolean).map((function(e){return e.clone(ii({tile:t},r))}))}else;return t.layers}))}},{key:"filterSubLayer",value:function(e){var t=e.layer,r=e.cullRect,n=t.props.tile;return this.state.tileset.isTileVisible(n,r)}}]),r}(B.CompositeLayer);A()(si,"defaultProps",oi),A()(si,"layerName","TileLayer");var ui=r(15),ci=r.n(ui);function li(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function fi(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?li(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):li(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function hi(e){var t=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(e){return!1}}();return function(){var r,n=m()(e);if(t){var i=m()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return y()(this,r)}}var di=function(e){p()(r,e);var t=hi(r);function r(){return h()(this,r),t.apply(this,arguments)}return C()(r,[{key:"getShaders",value:function(){var e=ci()(m()(r.prototype),"getShaders",this).call(this);return e.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"},e}},{key:"initializeState",value:function(){ci()(m()(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(e){var t=this.props,n=t.fadeTrail,i=t.trailLength,a=t.currentTime;e.uniforms=fi(fi({},e.uniforms),{},{fadeTrail:n,trailLength:i,currentTime:a}),ci()(m()(r.prototype),"draw",this).call(this,e)}}]),r}(B.PathLayer);A()(di,"layerName","TripsLayer"),A()(di,"defaultProps",{fadeTrail:!0,trailLength:{type:"number",value:120,min:0},currentTime:{type:"number",value:0,min:0},getTimestamps:{type:"accessor",value:function(e){return e.timestamps}}});var pi=r(23),vi=r(12),yi=r.n(vi),gi=r(9),mi=r.n(gi);function bi(e){var t=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(e){return!1}}();return function(){var r,n=m()(e);if(t){var i=m()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return y()(this,r)}}function Ai(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Bi(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ai(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ai(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function wi(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return _i(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return _i(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function _i(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function xi(e,t){t=void 0===t?e[0][0]:t;var r,n=wi(e);try{for(n.s();!(r=n.n()).done;){var i=r.value,a=i[0]-t;a>180?i[0]-=360:a<-180&&(i[0]+=360)}}catch(e){n.e(e)}finally{n.f()}}function Ci(e,t,r){var n=Object(pi.h3ToGeo)(e),i=M()(n,2),a=i[0],o=i[1],s=t.length;xi(t,o);for(var u=t[0]===t[s-1]?s-1:s,c=0;c<u;c++)t[c][0]=ft(o,t[c][0],r),t[c][1]=ft(a,t[c][1],r)}function Oi(e,t,r){var n=e(t,r),i=Object(pi.h3ToGeo)(n),a=M()(i,2),o=a[0];return[a[1],o]}function Ei(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=Object(pi.h3ToGeoBoundary)(e,!0);return 1!==t?Ci(e,r,t):xi(r),r}var Ti=Bi(Bi({},B.PolygonLayer.defaultProps),{},{highPrecision:"auto",coverage:{type:"number",min:0,max:1,value:1},centerHexagon:null,getHexagon:{type:"accessor",value:function(e){return e.hexagon}},extruded:!0}),Si=function(e){p()(r,e);var t=bi(r);function r(){var e;h()(this,r);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return e=t.call.apply(t,[this].concat(i)),A()(yi()(e),"state",void 0),e}return C()(r,[{key:"initializeState",value:function(){r._checkH3Lib(),this.state={edgeLengthKM:0,resolution:-1}}},{key:"shouldUpdateState",value:function(e){var t=e.changeFlags;return this._shouldUseHighPrecision()?t.propsOrDataChanged:t.somethingChanged}},{key:"updateState",value:function(e){var t=e.props,r=e.changeFlags;if(!0!==t.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 e,t=-1,r=!1,n=!1,i=Object(B.createIterable)(this.props.data),a=i.iterable,o=i.objectInfo,s=wi(a);try{for(s.s();!(e=s.n()).done;){var u=e.value;o.index++;var c=this.props.getHexagon(u,o),l=Object(pi.h3GetResolution)(c);if(t<0){if(t=l,!this.props.highPrecision)break}else if(t!==l){n=!0;break}if(Object(pi.h3IsPentagon)(c)){r=!0;break}}}catch(e){s.e(e)}finally{s.f()}return{resolution:t,edgeLengthKM:t>=0?Object(pi.edgeLength)(t,"km"):0,hasMultipleRes:n,hasPentagon:r}}},{key:"_shouldUseHighPrecision",value:function(){if("auto"===this.props.highPrecision){var e=this.state,t=e.resolution,r=e.hasPentagon,n=e.hasMultipleRes,i=this.context.viewport;return Boolean(null==i?void 0:i.resolution)||n||r||t>=0&&t<=5}return this.props.highPrecision}},{key:"_updateVertices",value:function(e){if(!this._shouldUseHighPrecision()){var t=this.state,r=t.resolution,n=t.edgeLengthKM,i=t.centerHex;if(!(r<0)){var a=this.props.centerHexagon||Object(pi.geoToH3)(e.latitude,e.longitude,r);if(i!==a){if(i){var o=Object(pi.h3Distance)(i,a);if(o>=0&&o*n<10)return}var s=e.distanceScales.unitsPerMeter,u=Ei(a),c=Object(pi.h3ToGeo)(a),l=M()(c,2),f=l[0],h=l[1],d=e.projectFlat([h,f]),p=M()(d,2),v=p[0],y=p[1];u=u.map((function(t){var r=e.projectFlat(t);return[(r[0]-v)/s[0],(r[1]-y)/s[1]]})),this.setState({centerHex:a,vertices:u})}}}}},{key:"renderLayers",value:function(){return this._shouldUseHighPrecision()?this._renderPolygonLayer():this._renderColumnLayer()}},{key:"_getForwardProps",value:function(){var e=this.props,t=e.elevationScale,r=e.material,n=e.coverage,i=e.extruded,a=e.wireframe,o=e.stroked,s=e.filled,u=e.lineWidthUnits,c=e.lineWidthScale,l=e.lineWidthMinPixels,f=e.lineWidthMaxPixels,h=e.getFillColor,d=e.getElevation,p=e.getLineColor,v=e.getLineWidth,y=e.transitions,g=e.updateTriggers;return{elevationScale:t,extruded:i,coverage:n,wireframe:a,stroked:o,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 e=this.props,t=e.data,r=e.getHexagon,n=e.updateTriggers,i=e.coverage,a=this.getSubLayerClass("hexagon-cell-hifi",B.PolygonLayer),o=this._getForwardProps();return o.updateTriggers.getPolygon=function(e,t){return null==e?t:"object"===mi()(e)?Bi(Bi({},e),{},{coverage:t}):{getHexagon:e,coverage:t}}(n.getHexagon,i),new a(o,this.getSubLayerProps({id:"hexagon-cell-hifi",updateTriggers:o.updateTriggers}),{data:t,_normalize:!1,_windingOrder:"CCW",positionFormat:"XY",getPolygon:function(e,t){return function(e){var t,r=new Float64Array(2*e.length),n=0,i=wi(e);try{for(i.s();!(t=i.n()).done;){var a=t.value;r[n++]=a[0],r[n++]=a[1]}}catch(e){i.e(e)}finally{i.f()}return r}(Ei(r(e,t),i))}})}},{key:"_renderColumnLayer",value:function(){var e=this.props,t=e.data,r=e.getHexagon,n=e.updateTriggers,i=this.getSubLayerClass("hexagon-cell",B.ColumnLayer),a=this._getForwardProps();return a.updateTriggers.getPosition=n.getHexagon,new i(a,this.getSubLayerProps({id:"hexagon-cell",flatShading:!0,updateTriggers:a.updateTriggers}),{data:t,diskResolution:6,radius:1,vertices:this.state.vertices,getPosition:Oi.bind(null,r)})}}]),r}(B.CompositeLayer);function ki(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return Mi(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Mi(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function Mi(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Ii(e){var t=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(e){return!1}}();return function(){var r,n=m()(e);if(t){var i=m()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return y()(this,r)}}A()(Si,"defaultProps",Ti),A()(Si,"layerName","H3HexagonLayer"),A()(Si,"_checkH3Lib",(function(){}));var Pi=function(e){p()(r,e);var t=Ii(r);function r(){return h()(this,r),t.apply(this,arguments)}return C()(r,[{key:"initializeState",value:function(){Si._checkH3Lib()}},{key:"updateState",value:function(e){var t=e.props,r=e.changeFlags;if(r.dataChanged||r.updateTriggersChanged&&r.updateTriggersChanged.getHexagons){var n,i=t.data,a=t.getHexagons,o=[],s=Object(B.createIterable)(i),u=s.iterable,c=s.objectInfo,l=ki(u);try{for(l.s();!(n=l.n()).done;){var f=n.value;c.index++;var h,d=a(f,c),p=ki(Object(pi.h3SetToMultiPolygon)(d,!0));try{for(p.s();!(h=p.n()).done;){var v=h.value;o.push(this.getSubLayerRow({polygon:v},f,c.index))}}catch(e){p.e(e)}finally{p.f()}}}catch(e){l.e(e)}finally{l.f()}this.setState({polygons:o})}}},{key:"indexToBounds",value:function(){return{data:this.state.polygons,getPolygon:function(e){return e.polygon}}}}]),r}(S);A()(Pi,"layerName","H3ClusterLayer"),A()(Pi,"defaultProps",{getHexagons:{type:"accessor",value:function(e){return e.hexagons}}});var Ri=r(31);function Fi(){return!("object"===("undefined"==typeof process?"undefined":mi()(process))&&"[object process]"===String(process)&&!process.browser)||function(e){if("undefined"!=typeof window&&"object"===mi()(window.process)&&"renderer"===window.process.type)return!0;if("undefined"!=typeof process&&"object"===mi()(process.versions)&&Boolean(process.versions.electron))return!0;var t="object"===("undefined"==typeof navigator?"undefined":mi()(navigator))&&"string"==typeof navigator.userAgent&&navigator.userAgent,r=e||t;return!!(r&&r.indexOf("Electron")>=0)}()}Fi();function Di(e){try{var t=window[e],r="__storage_test__";return t.setItem(r,r),t.removeItem(r),t}catch(e){return null}}var Li,ji=function(){function e(t){h()(this,e);var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"sessionStorage";Hn(this,"storage",void 0),Hn(this,"id",void 0),Hn(this,"config",{}),this.storage=Di(n),this.id=t,this.config={},Object.assign(this.config,r),this._loadConfiguration()}return C()(e,[{key:"getConfiguration",value:function(){return this.config}},{key:"setConfiguration",value:function(e){return this.config={},this.updateConfiguration(e)}},{key:"updateConfiguration",value:function(e){if(Object.assign(this.config,e),this.storage){var t=JSON.stringify(this.config);this.storage.setItem(this.id,t)}return this}},{key:"_loadConfiguration",value:function(){var e={};if(this.storage){var t=this.storage.getItem(this.id);e=t?JSON.parse(t):{}}return Object.assign(this.config,e),this}}]),e}();function Gi(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:600,i=e.src.replace(/\(/g,"%28").replace(/\)/g,"%29");e.width>n&&(r=Math.min(r,n/e.width));var a=e.width*r,o=e.height*r,s=["font-size:1px;","padding:".concat(Math.floor(o/2),"px ").concat(Math.floor(a/2),"px;"),"line-height:".concat(o,"px;"),"background:url(".concat(i,");"),"background-size:".concat(a,"px ").concat(o,"px;"),"color:transparent;"].join("");return["".concat(t," %c+"),s]}function Ui(e){return"string"==typeof e?Li[e.toUpperCase()]||Li.WHITE:e}function Ni(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return Hi(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Hi(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function Hi(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Ji(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["constructor"],n=Object.getPrototypeOf(e),i=Object.getOwnPropertyNames(n),a=Ni(i);try{var o=function(){var n=t.value;"function"==typeof e[n]&&(r.find((function(e){return n===e}))||(e[n]=e[n].bind(e)))};for(a.s();!(t=a.n()).done;)o()}catch(e){a.e(e)}finally{a.f()}}function Vi(e,t){if(!e)throw new Error(t||"Assertion failed")}!function(e){e[e.BLACK=30]="BLACK",e[e.RED=31]="RED",e[e.GREEN=32]="GREEN",e[e.YELLOW=33]="YELLOW",e[e.BLUE=34]="BLUE",e[e.MAGENTA=35]="MAGENTA",e[e.CYAN=36]="CYAN",e[e.WHITE=37]="WHITE",e[e.BRIGHT_BLACK=90]="BRIGHT_BLACK",e[e.BRIGHT_RED=91]="BRIGHT_RED",e[e.BRIGHT_GREEN=92]="BRIGHT_GREEN",e[e.BRIGHT_YELLOW=93]="BRIGHT_YELLOW",e[e.BRIGHT_BLUE=94]="BRIGHT_BLUE",e[e.BRIGHT_MAGENTA=95]="BRIGHT_MAGENTA",e[e.BRIGHT_CYAN=96]="BRIGHT_CYAN",e[e.BRIGHT_WHITE=97]="BRIGHT_WHITE"}(Li||(Li={}));var zi={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":mi()(process))&&process},Ki=(globalThis,zi.window||zi.self||zi.global),qi=zi.process||{};console;function Xi(){var e,t,r;if(Fi&&"performance"in Ki)e=null==Ki?void 0:null===(t=Ki.performance)||void 0===t?void 0:null===(r=t.now)||void 0===r?void 0:r.call(t);else if("hrtime"in qi){var n,i=null==qi?void 0:null===(n=qi.hrtime)||void 0===n?void 0:n.call(qi);e=1e3*i[0]+i[1]/1e6}else e=Date.now();return e}var Qi={debug:Fi&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},Wi={enabled:!0,level:0};function Zi(){}var Yi={},$i={once:!0},ea=function(){function e(){h()(this,e);var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{id:""},r=t.id;Hn(this,"id",void 0),Hn(this,"VERSION","8.8.24"),Hn(this,"_startTs",Xi()),Hn(this,"_deltaTs",Xi()),Hn(this,"_storage",void 0),Hn(this,"userData",{}),Hn(this,"LOG_THROTTLE_TIMEOUT",0),this.id=r,this._storage=new ji("__probe-".concat(this.id,"__"),Wi),this.userData={},this.timeStamp("".concat(this.id," started")),Ji(this),Object.seal(this)}return C()(e,[{key:"level",get:function(){return this.getLevel()},set:function(e){this.setLevel(e)}},{key:"isEnabled",value:function(){return this._storage.config.enabled}},{key:"getLevel",value:function(){return this._storage.config.level}},{key:"getTotal",value:function(){return Number((Xi()-this._startTs).toPrecision(10))}},{key:"getDelta",value:function(){return Number((Xi()-this._deltaTs).toPrecision(10))}},{key:"priority",get:function(){return this.level},set:function(e){this.level=e}},{key:"getPriority",value:function(){return this.level}},{key:"enable",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this._storage.updateConfiguration({enabled:e}),this}},{key:"setLevel",value:function(e){return this._storage.updateConfiguration({level:e}),this}},{key:"get",value:function(e){return this._storage.config[e]}},{key:"set",value:function(e,t){this._storage.updateConfiguration(A()({},e,t))}},{key:"settings",value:function(){console.table?console.table(this._storage.config):console.log(this._storage.config)}},{key:"assert",value:function(e,t){Vi(e,t)}},{key:"warn",value:function(e){return this._getLogFunction(0,e,Qi.warn,arguments,$i)}},{key:"error",value:function(e){return this._getLogFunction(0,e,Qi.error,arguments)}},{key:"deprecated",value:function(e,t){return this.warn("`".concat(e,"` is deprecated and will be removed in a later version. Use `").concat(t,"` instead"))}},{key:"removed",value:function(e,t){return this.error("`".concat(e,"` has been removed. Use `").concat(t,"` instead"))}},{key:"probe",value:function(e,t){return this._getLogFunction(e,t,Qi.log,arguments,{time:!0,once:!0})}},{key:"log",value:function(e,t){return this._getLogFunction(e,t,Qi.debug,arguments)}},{key:"info",value:function(e,t){return this._getLogFunction(e,t,console.info,arguments)}},{key:"once",value:function(e,t){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(e,t,Qi.debug||Qi.info,arguments,$i)}},{key:"table",value:function(e,t,r){return t?this._getLogFunction(e,t,console.table||Zi,r&&[r],{tag:na(t)}):Zi}},{key:"image",value:function(e){var t=e.logLevel,n=e.priority,i=e.image,a=e.message,o=void 0===a?"":a,s=e.scale,u=void 0===s?1:s;return this._shouldLog(t||n)?Fi?function(e){var t=e.image,r=e.message,n=void 0===r?"":r,i=e.scale,a=void 0===i?1:i;if("string"==typeof t){var o=new Image;return o.onload=function(){var e,t=Gi(o,n,a);(e=console).log.apply(e,De()(t))},o.src=t,Zi}var s=t.nodeName||"";if("img"===s.toLowerCase()){var u;return(u=console).log.apply(u,De()(Gi(t,n,a))),Zi}if("canvas"===s.toLowerCase()){var c=new Image;return c.onload=function(){var e;return(e=console).log.apply(e,De()(Gi(c,n,a)))},c.src=t.toDataURL(),Zi}return Zi}({image:i,message:o,scale:u}):function(e){var t=e.image,n=(e.message,e.scale),i=void 0===n?1:n,a=null;try{a=r(95)}catch(e){}if(a)return function(){return a(t,{fit:"box",width:"".concat(Math.round(80*i),"%")}).then((function(e){return console.log(e)}))};return Zi}({image:i,message:o,scale:u}):Zi}},{key:"time",value:function(e,t){return this._getLogFunction(e,t,console.time?console.time:console.info)}},{key:"timeEnd",value:function(e,t){return this._getLogFunction(e,t,console.timeEnd?console.timeEnd:console.info)}},{key:"timeStamp",value:function(e,t){return this._getLogFunction(e,t,console.timeStamp||Zi)}},{key:"group",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{collapsed:!1},n=ra({logLevel:e,message:t,opts:r}),i=r.collapsed;return n.method=(i?console.groupCollapsed:console.group)||console.info,this._getLogFunction(n)}},{key:"groupCollapsed",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.group(e,t,Object.assign({},r,{collapsed:!0}))}},{key:"groupEnd",value:function(e){return this._getLogFunction(e,"",console.groupEnd||Zi)}},{key:"withGroup",value:function(e,t,r){this.group(e,t)();try{r()}finally{this.groupEnd(e)()}}},{key:"trace",value:function(){console.trace&&console.trace()}},{key:"_shouldLog",value:function(e){return this.isEnabled()&&this.getLevel()>=ta(e)}},{key:"_getLogFunction",value:function(e,t,r,n,i){if(this._shouldLog(e)){var a;i=ra({logLevel:e,message:t,args:n,opts:i}),Vi(r=r||i.method),i.total=this.getTotal(),i.delta=this.getDelta(),this._deltaTs=Xi();var o=i.tag||i.message;if(i.once){if(Yi[o])return Zi;Yi[o]=Xi()}return t=function(e,t,r){if("string"==typeof t){var n=r.time?function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8,r=Math.max(t-e.length,0);return"".concat(" ".repeat(r)).concat(e)}((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")):"";t=r.time?"".concat(e,": ").concat(n," ").concat(t):"".concat(e,": ").concat(t),i=t,a=r.color,o=r.background,Fi||"string"!=typeof i||(a&&(a=Ui(a),i="[".concat(a,"m").concat(i,"[39m")),o&&(a=Ui(o),i="[".concat(o+10,"m").concat(i,"[49m"))),t=i}var i,a,o;var s;return t}(this.id,i.message,i),(a=r).bind.apply(a,[console,t].concat(De()(i.args)))}return Zi}}]),e}();function ta(e){if(!e)return 0;var t;switch(mi()(e)){case"number":t=e;break;case"object":t=e.logLevel||e.priority||0;break;default:return 0}return Vi(Number.isFinite(t)&&t>=0),t}function ra(e){var t=e.logLevel,r=e.message;e.logLevel=ta(t);for(var n=e.args?Array.from(e.args):[];n.length&&n.shift()!==r;);switch(mi()(t)){case"string":case"function":void 0!==r&&n.unshift(r),e.message=t;break;case"object":Object.assign(e,t)}"function"==typeof e.message&&(e.message=e.message());var i=mi()(e.message);return Vi("string"===i||"object"===i),Object.assign(e,{args:n},e.opts)}function na(e){for(var t in e)for(var r in e[t])return r||"untitled";return"empty"}Hn(ea,"VERSION","8.8.24");var ia=new ea({id:"luma.gl"});function aa(e,t){if(!e)throw new Error(t||"luma.gl: assertion failed.")}function oa(e){return"undefined"!=typeof WebGLRenderingContext&&e instanceof WebGLRenderingContext||("undefined"!=typeof WebGL2RenderingContext&&e instanceof WebGL2RenderingContext||Boolean(e&&Number.isFinite(e._version)))}function sa(e){return"undefined"!=typeof WebGL2RenderingContext&&e instanceof WebGL2RenderingContext||Boolean(e&&2===e._version)}function ua(e){return aa(oa(e),"Invalid WebGLRenderingContext"),e}function ca(e){return aa(sa(e),"Requires WebGL2"),e}var la={};function fa(e,t){var r;la[e]=!0,void 0!==t&&(r=t,globalThis.console&&globalThis.console.error&&globalThis.console.error(r))}var ha=function e(t){var r=t.gl;this.ext=t,this.isAlive=!0,this.hasBeenBound=!1,this.elementArrayBuffer=null,this.attribs=new Array(t.maxVertexAttribs);for(var n=0;n<this.attribs.length;n++){var i=new e.VertexAttrib(r);this.attribs[n]=i}this.maxAttrib=0};(ha.VertexAttrib=function(e){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 da,pa=function(e){var t=this;this.gl=e,function(e){var t=e.getError;e.getError=function(){var r;do{0!==(r=t.apply(e))&&(la[r]=!0)}while(0!==r);for(r in la)if(la[r])return delete la[r],parseInt(r,10);return 0}}(e);var r=this.original={getParameter:e.getParameter,enableVertexAttribArray:e.enableVertexAttribArray,disableVertexAttribArray:e.disableVertexAttribArray,bindBuffer:e.bindBuffer,getVertexAttrib:e.getVertexAttrib,vertexAttribPointer:e.vertexAttribPointer};e.getParameter=function(e){return e===t.VERTEX_ARRAY_BINDING_OES?t.currentVertexArrayObject===t.defaultVertexArrayObject?null:t.currentVertexArrayObject:r.getParameter.apply(this,arguments)},e.enableVertexAttribArray=function(e){var n=t.currentVertexArrayObject;n.maxAttrib=Math.max(n.maxAttrib,e);var i=n.attribs[e];return i.enabled=!0,r.enableVertexAttribArray.apply(this,arguments)},e.disableVertexAttribArray=function(e){var n=t.currentVertexArrayObject;n.maxAttrib=Math.max(n.maxAttrib,e);var i=n.attribs[e];return i.enabled=!1,r.disableVertexAttribArray.apply(this,arguments)},e.bindBuffer=function(e,n){switch(e){case 34962:t.currentArrayBuffer=n;break;case 34963:t.currentVertexArrayObject.elementArrayBuffer=n}return r.bindBuffer.apply(this,arguments)},e.getVertexAttrib=function(e,n){var i=t.currentVertexArrayObject,a=i.attribs[e];switch(n){case 34975:return a.buffer;case 34338:return a.enabled;case 34339:return a.size;case 34340:return a.stride;case 34341:return a.type;case 34922:return a.normalized;default:return r.getVertexAttrib.apply(this,arguments)}},e.vertexAttribPointer=function(e,n,i,a,o,s){var u=t.currentVertexArrayObject;u.maxAttrib=Math.max(u.maxAttrib,e);var c=u.attribs[e];return c.buffer=t.currentArrayBuffer,c.size=n,c.type=i,c.normalized=a,c.stride=o,c.offset=s,c.recache(),r.vertexAttribPointer.apply(this,arguments)},e.instrumentExtension&&e.instrumentExtension(this,"OES_vertex_array_object"),e.canvas&&e.canvas.addEventListener("webglcontextrestored",(function(){var e;e="OESVertexArrayObject emulation library context restored",globalThis.console&&globalThis.console.log&&globalThis.console.log(e),t.reset_()}),!0),this.reset_()};pa.prototype.VERTEX_ARRAY_BINDING_OES=34229,pa.prototype.reset_=function(){if(void 0!==this.vertexArrayObjects)for(var e=0;e<this.vertexArrayObjects.length;++e)this.vertexArrayObjects.isAlive=!1;var t=this.gl;this.maxVertexAttribs=t.getParameter(34921),this.defaultVertexArrayObject=new ha(this),this.currentVertexArrayObject=null,this.currentArrayBuffer=null,this.vertexArrayObjects=[this.defaultVertexArrayObject],this.bindVertexArrayOES(null)},pa.prototype.createVertexArrayOES=function(){var e=new ha(this);return this.vertexArrayObjects.push(e),e},pa.prototype.deleteVertexArrayOES=function(e){e.isAlive=!1,this.vertexArrayObjects.splice(this.vertexArrayObjects.indexOf(e),1),this.currentVertexArrayObject===e&&this.bindVertexArrayOES(null)},pa.prototype.isVertexArrayOES=function(e){return!!(e&&e instanceof ha&&e.hasBeenBound&&e.ext===this)},pa.prototype.bindVertexArrayOES=function(e){var t=this.gl;if(!e||e.isAlive){var r=this.original,n=this.currentVertexArrayObject;this.currentVertexArrayObject=e||this.defaultVertexArrayObject,this.currentVertexArrayObject.hasBeenBound=!0;var i=this.currentVertexArrayObject;if(n!==i){n&&i.elementArrayBuffer===n.elementArrayBuffer||r.bindBuffer.call(t,34963,i.elementArrayBuffer);for(var a=this.currentArrayBuffer,o=Math.max(n?n.maxAttrib:0,i.maxAttrib),s=0;s<=o;s++){var u=i.attribs[s],c=n?n.attribs[s]:null;if(n&&u.enabled===c.enabled||(u.enabled?r.enableVertexAttribArray.call(t,s):r.disableVertexAttribArray.call(t,s)),u.enabled){var l=!1;n&&u.buffer===c.buffer||(a!==u.buffer&&(r.bindBuffer.call(t,34962,u.buffer),a=u.buffer),l=!0),(l||u.cached!==c.cached)&&r.vertexAttribPointer.call(t,s,u.size,u.type,u.normalized,u.stride,u.offset)}}this.currentArrayBuffer!==a&&r.bindBuffer.call(t,34962,this.currentArrayBuffer)}}else fa(1282,"bindVertexArrayOES: attempt to bind deleted arrayObject")};var va,ya=function(e){return sa(e)?void 0:0},ga=(da={},A()(da,3074,(function(e){return sa(e)?void 0:36064})),A()(da,35723,(function(e){return sa(e)?void 0:4352})),A()(da,35977,ya),A()(da,32937,ya),A()(da,36795,(function(e,t){var r=sa(e)?e.getExtension("EXT_disjoint_timer_query_webgl2"):e.getExtension("EXT_disjoint_timer_query");return r&&r.GPU_DISJOINT_EXT?t(r.GPU_DISJOINT_EXT):0})),A()(da,37445,(function(e,t){var r=e.getExtension("WEBGL_debug_renderer_info");return t(r&&r.UNMASKED_VENDOR_WEBGL||7936)})),A()(da,37446,(function(e,t){var r=e.getExtension("WEBGL_debug_renderer_info");return t(r&&r.UNMASKED_RENDERER_WEBGL||7937)})),A()(da,34047,(function(e,t){var r=e.luma.extensions.EXT_texture_filter_anisotropic;return r?t(r.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1})),A()(da,32883,ya),A()(da,35071,ya),A()(da,37447,ya),A()(da,36063,(function(e,t){if(!sa(e)){var r=e.getExtension("WEBGL_draw_buffers");return r?t(r.MAX_COLOR_ATTACHMENTS_WEBGL):0}})),A()(da,35379,ya),A()(da,35374,ya),A()(da,35377,ya),A()(da,34852,(function(e){if(!sa(e)){var t=e.getExtension("WEBGL_draw_buffers");return t?t.MAX_DRAW_BUFFERS_WEBGL:0}})),A()(da,36203,(function(e){return e.getExtension("OES_element_index")?2147483647:65535})),A()(da,33001,(function(e){return e.getExtension("OES_element_index")?16777216:65535})),A()(da,33e3,(function(e){return 16777216})),A()(da,37157,ya),A()(da,35373,ya),A()(da,35657,ya),A()(da,36183,ya),A()(da,37137,ya),A()(da,34045,ya),A()(da,35978,ya),A()(da,35979,ya),A()(da,35968,ya),A()(da,35376,ya),A()(da,35375,ya),A()(da,35659,ya),A()(da,37154,ya),A()(da,35371,ya),A()(da,35658,ya),A()(da,35076,ya),A()(da,35077,ya),A()(da,35380,ya),da);var ma,ba,Aa,Ba=(va={},A()(va,"OES_vertex_array_object",{meta:{suffix:"OES"},createVertexArray:function(){aa(!1,"VertexArray requires WebGL2 or OES_vertex_array_object extension")},deleteVertexArray:function(){},bindVertexArray:function(){},isVertexArray:function(){return!1}}),A()(va,"ANGLE_instanced_arrays",{meta:{suffix:"ANGLE"},vertexAttribDivisor:function(e,t){aa(0===t,"WebGL instanced rendering not supported")},drawElementsInstanced:function(){},drawArraysInstanced:function(){}}),A()(va,"WEBGL_draw_buffers",{meta:{suffix:"WEBGL"},drawBuffers:function(){aa(!1)}}),A()(va,"EXT_disjoint_timer_query",{meta:{suffix:"EXT"},createQuery:function(){aa(!1)},deleteQuery:function(){aa(!1)},beginQuery:function(){aa(!1)},endQuery:function(){},getQuery:function(e,t){return this.getQueryObject(e,t)},getQueryParameter:function(e,t){return this.getQueryObject(e,t)},getQueryObject:function(){}}),va),wa={readBuffer:function(e,t,r){sa(e)&&t(r)},getVertexAttrib:function(e,t,r,n){var i,a=function(e,t){return{webgl2:sa(e),ext:e.getExtension(t)}}(e,"ANGLE_instanced_arrays"),o=a.webgl2,s=a.ext;switch(n){case 35069:i=!!o&&void 0;break;case 35070:i=o||s?void 0:0}return void 0!==i?i:t(r,n)},getProgramParameter:function(e,t,r,n){if(!sa(e))switch(n){case 35967:return 35981;case 35971:case 35382:return 0}return t(r,n)},getInternalformatParameter:function(e,t,r,n,i){if(!sa(e))switch(i){case 32937:return new Int32Array([0])}return e.getInternalformatParameter(r,n,i)},getTexParameter:function(e,t,r,n){switch(n){case 34046:var i=e.luma.extensions.EXT_texture_filter_anisotropic;n=i&&i.TEXTURE_MAX_ANISOTROPY_EXT||34046}return t(r,n)},getParameter:function(e,t,r){var n=ga[r],i="function"==typeof n?n(e,t,r):n;return void 0!==i?i:t(r)},hint:function(e,t,r,n){return t(r,n)}};function _a(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return xa(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return xa(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function xa(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Ca(e,t){var r=t.extension,n=t.target,i=t.target2,a=Ba[r];aa(a);for(var o=a.meta,s=(void 0===o?{}:o).suffix,u=void 0===s?"":s,c=e.getExtension(r),l=function(){var t=h[f],r="".concat(t).concat(u),o=null;"meta"===t||"function"==typeof e[t]||(c&&"function"==typeof c[r]?o=function(){return c[r].apply(c,arguments)}:"function"==typeof a[t]&&(o=a[t].bind(n))),o&&(n[t]=o,i[t]=o)},f=0,h=Object.keys(a);f<h.length;f++)l()}globalThis.polyfillContext=function(e){e.luma=e.luma||{};var t=e.luma;return t.polyfilled||(!function(e){if("function"!=typeof e.createVertexArray){var t=e.getSupportedExtensions;e.getSupportedExtensions=function(){var e=t.call(this)||[];return e.indexOf("OES_vertex_array_object")<0&&e.push("OES_vertex_array_object"),e};var r=e.getExtension;e.getExtension=function(t){var n=r.call(this,t);return n||("OES_vertex_array_object"!==t?null:(e.__OESVertexArrayObject||(this.__OESVertexArrayObject=new pa(this)),this.__OESVertexArrayObject))}}}(e),function(e){e.luma.extensions={};var t,r=_a(e.getSupportedExtensions()||[]);try{for(r.s();!(t=r.n()).done;){var n=t.value;e.luma[n]=e.getExtension(n)}}catch(e){r.e(e)}finally{r.f()}}(e),function(e,t){var r,n=_a(Object.getOwnPropertyNames(t));try{for(n.s();!(r=n.n()).done;){var i=r.value;"overrides"!==i&&Ca(e,{extension:i,target:e.luma,target2:e})}}catch(e){n.e(e)}finally{n.f()}}(e,Ba),function(e,t){var r=t.target,n=t.target2;Object.keys(wa).forEach((function(t){if("function"==typeof wa[t]){var i=e[t]?e[t].bind(e):function(){},a=wa[t].bind(null,e,i);r[t]=a,n[t]=a}}))}(e,{target:t,target2:e}),t.polyfilled=!0),e};var Oa=(ma={},A()(ma,3042,!1),A()(ma,32773,new Float32Array([0,0,0,0])),A()(ma,32777,32774),A()(ma,34877,32774),A()(ma,32969,1),A()(ma,32968,0),A()(ma,32971,1),A()(ma,32970,0),A()(ma,3106,new Float32Array([0,0,0,0])),A()(ma,3107,[!0,!0,!0,!0]),A()(ma,2884,!1),A()(ma,2885,1029),A()(ma,2929,!1),A()(ma,2931,1),A()(ma,2932,513),A()(ma,2928,new Float32Array([0,1])),A()(ma,2930,!0),A()(ma,3024,!0),A()(ma,36006,null),A()(ma,2886,2305),A()(ma,33170,4352),A()(ma,2849,1),A()(ma,32823,!1),A()(ma,32824,0),A()(ma,10752,0),A()(ma,32938,1),A()(ma,32939,!1),A()(ma,3089,!1),A()(ma,3088,new Int32Array([0,0,1024,1024])),A()(ma,2960,!1),A()(ma,2961,0),A()(ma,2968,4294967295),A()(ma,36005,4294967295),A()(ma,2962,519),A()(ma,2967,0),A()(ma,2963,4294967295),A()(ma,34816,519),A()(ma,36003,0),A()(ma,36004,4294967295),A()(ma,2964,7680),A()(ma,2965,7680),A()(ma,2966,7680),A()(ma,34817,7680),A()(ma,34818,7680),A()(ma,34819,7680),A()(ma,2978,[0,0,1024,1024]),A()(ma,3333,4),A()(ma,3317,4),A()(ma,37440,!1),A()(ma,37441,!1),A()(ma,37443,37444),A()(ma,35723,4352),A()(ma,36010,null),A()(ma,35977,!1),A()(ma,3330,0),A()(ma,3332,0),A()(ma,3331,0),A()(ma,3314,0),A()(ma,32878,0),A()(ma,3316,0),A()(ma,3315,0),A()(ma,32877,0),ma),Ea=function(e,t,r){return t?e.enable(r):e.disable(r)},Ta=function(e,t,r){return e.hint(r,t)},Sa=function(e,t,r){return e.pixelStorei(r,t)};function ka(e){return Array.isArray(e)||ArrayBuffer.isView(e)}var Ma=(ba={},A()(ba,3042,Ea),A()(ba,32773,(function(e,t){return e.blendColor.apply(e,De()(t))})),A()(ba,32777,"blendEquation"),A()(ba,34877,"blendEquation"),A()(ba,32969,"blendFunc"),A()(ba,32968,"blendFunc"),A()(ba,32971,"blendFunc"),A()(ba,32970,"blendFunc"),A()(ba,3106,(function(e,t){return e.clearColor.apply(e,De()(t))})),A()(ba,3107,(function(e,t){return e.colorMask.apply(e,De()(t))})),A()(ba,2884,Ea),A()(ba,2885,(function(e,t){return e.cullFace(t)})),A()(ba,2929,Ea),A()(ba,2931,(function(e,t){return e.clearDepth(t)})),A()(ba,2932,(function(e,t){return e.depthFunc(t)})),A()(ba,2928,(function(e,t){return e.depthRange.apply(e,De()(t))})),A()(ba,2930,(function(e,t){return e.depthMask(t)})),A()(ba,3024,Ea),A()(ba,35723,Ta),A()(ba,36006,(function(e,t){var r=sa(e)?36009:36160;return e.bindFramebuffer(r,t)})),A()(ba,2886,(function(e,t){return e.frontFace(t)})),A()(ba,33170,Ta),A()(ba,2849,(function(e,t){return e.lineWidth(t)})),A()(ba,32823,Ea),A()(ba,32824,"polygonOffset"),A()(ba,10752,"polygonOffset"),A()(ba,35977,Ea),A()(ba,32938,"sampleCoverage"),A()(ba,32939,"sampleCoverage"),A()(ba,3089,Ea),A()(ba,3088,(function(e,t){return e.scissor.apply(e,De()(t))})),A()(ba,2960,Ea),A()(ba,2961,(function(e,t){return e.clearStencil(t)})),A()(ba,2968,(function(e,t){return e.stencilMaskSeparate(1028,t)})),A()(ba,36005,(function(e,t){return e.stencilMaskSeparate(1029,t)})),A()(ba,2962,"stencilFuncFront"),A()(ba,2967,"stencilFuncFront"),A()(ba,2963,"stencilFuncFront"),A()(ba,34816,"stencilFuncBack"),A()(ba,36003,"stencilFuncBack"),A()(ba,36004,"stencilFuncBack"),A()(ba,2964,"stencilOpFront"),A()(ba,2965,"stencilOpFront"),A()(ba,2966,"stencilOpFront"),A()(ba,34817,"stencilOpBack"),A()(ba,34818,"stencilOpBack"),A()(ba,34819,"stencilOpBack"),A()(ba,2978,(function(e,t){return e.viewport.apply(e,De()(t))})),A()(ba,3333,Sa),A()(ba,3317,Sa),A()(ba,37440,Sa),A()(ba,37441,Sa),A()(ba,37443,Sa),A()(ba,3330,Sa),A()(ba,3332,Sa),A()(ba,3331,Sa),A()(ba,36010,(function(e,t){return e.bindFramebuffer(36008,t)})),A()(ba,3314,Sa),A()(ba,32878,Sa),A()(ba,3316,Sa),A()(ba,3315,Sa),A()(ba,32877,Sa),A()(ba,"framebuffer",(function(e,t){var r=t&&"handle"in t?t.handle:t;return e.bindFramebuffer(36160,r)})),A()(ba,"blend",(function(e,t){return t?e.enable(3042):e.disable(3042)})),A()(ba,"blendColor",(function(e,t){return e.blendColor.apply(e,De()(t))})),A()(ba,"blendEquation",(function(e,t){t=ka(t)?t:[t,t],e.blendEquationSeparate.apply(e,De()(t))})),A()(ba,"blendFunc",(function(e,t){t=ka(t)&&2===t.length?[].concat(De()(t),De()(t)):t,e.blendFuncSeparate.apply(e,De()(t))})),A()(ba,"clearColor",(function(e,t){return e.clearColor.apply(e,De()(t))})),A()(ba,"clearDepth",(function(e,t){return e.clearDepth(t)})),A()(ba,"clearStencil",(function(e,t){return e.clearStencil(t)})),A()(ba,"colorMask",(function(e,t){return e.colorMask.apply(e,De()(t))})),A()(ba,"cull",(function(e,t){return t?e.enable(2884):e.disable(2884)})),A()(ba,"cullFace",(function(e,t){return e.cullFace(t)})),A()(ba,"depthTest",(function(e,t){return t?e.enable(2929):e.disable(2929)})),A()(ba,"depthFunc",(function(e,t){return e.depthFunc(t)})),A()(ba,"depthMask",(function(e,t){return e.depthMask(t)})),A()(ba,"depthRange",(function(e,t){return e.depthRange.apply(e,De()(t))})),A()(ba,"dither",(function(e,t){return t?e.enable(3024):e.disable(3024)})),A()(ba,"derivativeHint",(function(e,t){e.hint(35723,t)})),A()(ba,"frontFace",(function(e,t){return e.frontFace(t)})),A()(ba,"mipmapHint",(function(e,t){return e.hint(33170,t)})),A()(ba,"lineWidth",(function(e,t){return e.lineWidth(t)})),A()(ba,"polygonOffsetFill",(function(e,t){return t?e.enable(32823):e.disable(32823)})),A()(ba,"polygonOffset",(function(e,t){return e.polygonOffset.apply(e,De()(t))})),A()(ba,"sampleCoverage",(function(e,t){return e.sampleCoverage.apply(e,De()(t))})),A()(ba,"scissorTest",(function(e,t){return t?e.enable(3089):e.disable(3089)})),A()(ba,"scissor",(function(e,t){return e.scissor.apply(e,De()(t))})),A()(ba,"stencilTest",(function(e,t){return t?e.enable(2960):e.disable(2960)})),A()(ba,"stencilMask",(function(e,t){var r=t=ka(t)?t:[t,t],n=M()(r,2),i=n[0],a=n[1];e.stencilMaskSeparate(1028,i),e.stencilMaskSeparate(1029,a)})),A()(ba,"stencilFunc",(function(e,t){var r=t=ka(t)&&3===t.length?[].concat(De()(t),De()(t)):t,n=M()(r,6),i=n[0],a=n[1],o=n[2],s=n[3],u=n[4],c=n[5];e.stencilFuncSeparate(1028,i,a,o),e.stencilFuncSeparate(1029,s,u,c)})),A()(ba,"stencilOp",(function(e,t){var r=t=ka(t)&&3===t.length?[].concat(De()(t),De()(t)):t,n=M()(r,6),i=n[0],a=n[1],o=n[2],s=n[3],u=n[4],c=n[5];e.stencilOpSeparate(1028,i,a,o),e.stencilOpSeparate(1029,s,u,c)})),A()(ba,"viewport",(function(e,t){return e.viewport.apply(e,De()(t))})),ba);function Ia(e,t,r){return void 0!==t[e]?t[e]:r[e]}var Pa={blendEquation:function(e,t,r){return e.blendEquationSeparate(Ia(32777,t,r),Ia(34877,t,r))},blendFunc:function(e,t,r){return e.blendFuncSeparate(Ia(32969,t,r),Ia(32968,t,r),Ia(32971,t,r),Ia(32970,t,r))},polygonOffset:function(e,t,r){return e.polygonOffset(Ia(32824,t,r),Ia(10752,t,r))},sampleCoverage:function(e,t,r){return e.sampleCoverage(Ia(32938,t,r),Ia(32939,t,r))},stencilFuncFront:function(e,t,r){return e.stencilFuncSeparate(1028,Ia(2962,t,r),Ia(2967,t,r),Ia(2963,t,r))},stencilFuncBack:function(e,t,r){return e.stencilFuncSeparate(1029,Ia(34816,t,r),Ia(36003,t,r),Ia(36004,t,r))},stencilOpFront:function(e,t,r){return e.stencilOpSeparate(1028,Ia(2964,t,r),Ia(2965,t,r),Ia(2966,t,r))},stencilOpBack:function(e,t,r){return e.stencilOpSeparate(1029,Ia(34817,t,r),Ia(34818,t,r),Ia(34819,t,r))}},Ra={enable:function(e,t){return e(A()({},t,!0))},disable:function(e,t){return e(A()({},t,!1))},pixelStorei:function(e,t,r){return e(A()({},t,r))},hint:function(e,t,r){return e(A()({},t,r))},bindFramebuffer:function(e,t,r){var n;switch(t){case 36160:return e((n={},A()(n,36006,r),A()(n,36010,r),n));case 36009:return e(A()({},36006,r));case 36008:return e(A()({},36010,r));default:return null}},blendColor:function(e,t,r,n,i){return e(A()({},32773,new Float32Array([t,r,n,i])))},blendEquation:function(e,t){var r;return e((r={},A()(r,32777,t),A()(r,34877,t),r))},blendEquationSeparate:function(e,t,r){var n;return e((n={},A()(n,32777,t),A()(n,34877,r),n))},blendFunc:function(e,t,r){var n;return e((n={},A()(n,32969,t),A()(n,32968,r),A()(n,32971,t),A()(n,32970,r),n))},blendFuncSeparate:function(e,t,r,n,i){var a;return e((a={},A()(a,32969,t),A()(a,32968,r),A()(a,32971,n),A()(a,32970,i),a))},clearColor:function(e,t,r,n,i){return e(A()({},3106,new Float32Array([t,r,n,i])))},clearDepth:function(e,t){return e(A()({},2931,t))},clearStencil:function(e,t){return e(A()({},2961,t))},colorMask:function(e,t,r,n,i){return e(A()({},3107,[t,r,n,i]))},cullFace:function(e,t){return e(A()({},2885,t))},depthFunc:function(e,t){return e(A()({},2932,t))},depthRange:function(e,t,r){return e(A()({},2928,new Float32Array([t,r])))},depthMask:function(e,t){return e(A()({},2930,t))},frontFace:function(e,t){return e(A()({},2886,t))},lineWidth:function(e,t){return e(A()({},2849,t))},polygonOffset:function(e,t,r){var n;return e((n={},A()(n,32824,t),A()(n,10752,r),n))},sampleCoverage:function(e,t,r){var n;return e((n={},A()(n,32938,t),A()(n,32939,r),n))},scissor:function(e,t,r,n,i){return e(A()({},3088,new Int32Array([t,r,n,i])))},stencilMask:function(e,t){var r;return e((r={},A()(r,2968,t),A()(r,36005,t),r))},stencilMaskSeparate:function(e,t,r){return e(A()({},1028===t?2968:36005,r))},stencilFunc:function(e,t,r,n){var i;return e((i={},A()(i,2962,t),A()(i,2967,r),A()(i,2963,n),A()(i,34816,t),A()(i,36003,r),A()(i,36004,n),i))},stencilFuncSeparate:function(e,t,r,n,i){var a;return e((a={},A()(a,1028===t?2962:34816,r),A()(a,1028===t?2967:36003,n),A()(a,1028===t?2963:36004,i),a))},stencilOp:function(e,t,r,n){var i;return e((i={},A()(i,2964,t),A()(i,2965,r),A()(i,2966,n),A()(i,34817,t),A()(i,34818,r),A()(i,34819,n),i))},stencilOpSeparate:function(e,t,r,n,i){var a;return e((a={},A()(a,1028===t?2964:34817,r),A()(a,1028===t?2965:34818,n),A()(a,1028===t?2966:34819,i),a))},viewport:function(e,t,r,n,i){return e(A()({},2978,[t,r,n,i]))}},Fa=function(e,t){return e.isEnabled(t)},Da=(Aa={},A()(Aa,3042,Fa),A()(Aa,2884,Fa),A()(Aa,2929,Fa),A()(Aa,3024,Fa),A()(Aa,32823,Fa),A()(Aa,32926,Fa),A()(Aa,32928,Fa),A()(Aa,3089,Fa),A()(Aa,2960,Fa),A()(Aa,35977,Fa),Aa);function La(e){for(var t in e)return!1;return!0}function ja(e,t){if(e===t)return!0;var r=Array.isArray(e)||ArrayBuffer.isView(e),n=Array.isArray(t)||ArrayBuffer.isView(t);if(r&&n&&e.length===t.length){for(var i=0;i<e.length;++i)if(e[i]!==t[i])return!1;return!0}return!1}function Ga(e,t){var r=e[t].bind(e);e[t]=function(){var t=arguments.length<=0?void 0:arguments[0];return t in e.state.cache&&e.state.enable?e.state.cache[t]:r.apply(void 0,arguments)},Object.defineProperty(e[t],"name",{value:"".concat(t,"-from-cache"),configurable:!1})}function Ua(e,t,r){var n=e[t].bind(e);e[t]=function(){for(var t=arguments.length,i=new Array(t),a=0;a<t;a++)i[a]=arguments[a];var o=r.apply(void 0,[e.state._updateCache].concat(i)),s=o.valueChanged,u=o.oldValue;return s&&n.apply(void 0,i),u},Object.defineProperty(e[t],"name",{value:"".concat(t,"-to-cache"),configurable:!1})}function Na(e){var t=e.useProgram.bind(e);e.useProgram=function(r){e.state.program!==r&&(t(r),e.state.program=r)}}var Ha=function(){function e(t){h()(this,e);var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=r.copyState,i=void 0!==n&&n,a=r.log,o=void 0===a?function(){}:a;this.gl=t,this.program=null,this.stateStack=[],this.enable=!0,this.cache=i?Xa(t):Object.assign({},Oa),this.log=o,this._updateCache=this._updateCache.bind(this),Object.seal(this)}return C()(e,[{key:"push",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.stateStack.push({})}},{key:"pop",value:function(){aa(this.stateStack.length>0);var e=this.stateStack[this.stateStack.length-1];qa(this.gl,e),this.stateStack.pop()}},{key:"_updateCache",value:function(e){var t,r=!1,n=this.stateStack.length>0&&this.stateStack[this.stateStack.length-1];for(var i in e){aa(void 0!==i);var a=e[i],o=this.cache[i];ja(a,o)||(r=!0,t=o,!n||i in n||(n[i]=o),this.cache[i]=a)}return{valueChanged:r,oldValue:t}}}]),e}();function Ja(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.enable,n=void 0===r||r,i=t.copyState;if(aa(void 0!==i),!e.state){var a=globalThis.polyfillContext;for(var o in a&&a(e),e.state=new Ha(e,{copyState:i}),Na(e),Ra){var s=Ra[o];Ua(e,o,s)}Ga(e,"getParameter"),Ga(e,"isEnabled")}return e.state.enable=n,e}function Va(e){aa(e.state),e.state.pop()}function za(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return Ka(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ka(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function Ka(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function qa(e,t){if(aa(oa(e),"setParameters requires a WebGL context"),!La(t)){var r={};for(var n in t){var i=Number(n),a=Ma[n];a&&("string"==typeof a?r[a]=!0:a(e,t[n],i))}var o=e.state&&e.state.cache;if(o)for(var s in r){(0,Pa[s])(e,t,o)}}}function Xa(e,t){if("number"==typeof(t=t||Oa)){var r=t,n=Da[r];return n?n(e,r):e.getParameter(r)}var i,a={},o=za(Array.isArray(t)?t:Object.keys(t));try{for(o.s();!(i=o.n()).done;){var s=i.value,u=Da[s];a[s]=u?u(e,Number(s)):e.getParameter(Number(s))}}catch(e){o.e(e)}finally{o.f()}return a}function Qa(e,t,r){if(La(t))return r(e);var n,i=t.nocatch,a=void 0===i||i;if(function(e){e.state||Ja(e,{copyState:!1}),e.state.push()}(e),qa(e,t),a)n=r(e),Va(e);else try{n=r(e)}finally{Va(e)}return n}var Wa=Fi();var Za=function(){function e(){h()(this,e),this.stats=new Map}return C()(e,[{key:"get",value:function(e){return this.stats.has(e)||this.stats.set(e,new zn({id:e})),this.stats.get(e)}}]),e}(),Ya=new Za;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||(Fi()&&ia.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:ia,stats:Ya,globals:{modules:{},nodeIO:{}}});globalThis.luma;function $a(e,t){if(!e)throw new Error(t||"luma.gl: assertion failed.")}function eo(e,t){if("string"!=typeof t)return t;var r=Number(t);if(!isNaN(r))return r;var n=e[t=t.replace(/^.*\./,"")];return $a(void 0!==n,"Accessing undefined constant GL.".concat(t)),n}function to(e,t){for(var r in t=Number(t),e)if(e[r]===t)return"GL.".concat(r);return String(t)}var ro={};function no(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"id";ro[e]=ro[e]||1;var t=ro[e]++;return"".concat(e,"-").concat(t)}function io(e){return $a("number"==typeof e,"Input must be a number"),e&&0==(e&e-1)}function ao(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return oo(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return oo(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function oo(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var so="Resource subclass must define virtual methods",uo=function(e){function t(e){h()(this,t);var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};ua(e);var n=r.id,i=r.userData,a=void 0===i?{}:i;this.gl=e,this.gl2=e,this.id=n||no(this[Symbol.toStringTag]),this.userData=a,this._bound=!1,this._handle=r.handle,void 0===this._handle&&(this._handle=this._createHandle()),this.byteLength=0,this._initStats(),this._addStats()}return C()(t,[{key:e,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 e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.deleteChildren,r=void 0!==t&&t,n=this._handle&&this._deleteHandle(this._handle);return this._handle&&this._removeStats(),this._handle=null,n&&r&&n.filter(Boolean).forEach((function(e){return e.delete()})),this}},{key:"bind",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.handle;return"function"!=typeof t?(this._bindHandle(t),this):(this._bound?e=t():(this._bindHandle(this.handle),this._bound=!0,e=t(),this._bound=!1,this._bindHandle(null)),e)}},{key:"unbind",value:function(){this.bind(null)}},{key:"getParameter",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};$a(e=eo(this.gl,e));var r=this.constructor.PARAMETERS||{},n=r[e];if(n){var i=sa(this.gl),a=(!("webgl2"in n)||i)&&(!("extension"in n)||this.gl.getExtension(n.extension));if(!a){var o=n.webgl1,s="webgl2"in n?n.webgl2:n.webgl1,u=i?s:o;return u}}return this._getParameter(e,t)}},{key:"getParameters",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.parameters,n=t.keys,i=this.constructor.PARAMETERS||{},a=sa(this.gl),o={},s=r||Object.keys(i),u=ao(s);try{for(u.s();!(e=u.n()).done;){var c=e.value,l=i[c],f=l&&(!("webgl2"in l)||a)&&(!("extension"in l)||this.gl.getExtension(l.extension));if(f){var h=n?to(this.gl,c):c;o[h]=this.getParameter(c,t),n&&"GLenum"===l.type&&(o[h]=to(this.gl,o[h]))}}}catch(e){u.e(e)}finally{u.f()}return o}},{key:"setParameter",value:function(e,t){$a(e=eo(this.gl,e));var r=(this.constructor.PARAMETERS||{})[e];if(r){var n=sa(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&&(t=eo(t))}return this._setParameter(e,t),this}},{key:"setParameters",value:function(e){for(var t in e)this.setParameter(t,e[t]);return this}},{key:"stubRemovedMethods",value:function(e,t,r){return function(e,t,r,n){var i="See luma.gl ".concat(r," Upgrade Guide at https://luma.gl/docs/upgrade-guide"),a=Object.getPrototypeOf(e);n.forEach((function(e){a.methodName||(a[e]=function(){throw ia.removed("Calling removed method ".concat(t,".").concat(e,": "),i)(),new Error(e)})}))}(this,e,t,r)}},{key:"initialize",value:function(e){}},{key:"_createHandle",value:function(){throw new Error(so)}},{key:"_deleteHandle",value:function(){throw new Error(so)}},{key:"_bindHandle",value:function(e){throw new Error(so)}},{key:"_getOptsFromHandle",value:function(){throw new Error(so)}},{key:"_getParameter",value:function(e,t){throw new Error(so)}},{key:"_setParameter",value:function(e,t){throw new Error(so)}},{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 Za}},{key:"_addStats",value:function(){var e=this[Symbol.toStringTag],t=Ya.get("Resource Counts");t.get("Resources Created").incrementCount(),t.get("".concat(e,"s Created")).incrementCount(),t.get("".concat(e,"s Active")).incrementCount()}},{key:"_removeStats",value:function(){var e=this[Symbol.toStringTag];Ya.get("Resource Counts").get("".concat(e,"s Active")).decrementCount()}},{key:"_trackAllocatedMemory",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this[Symbol.toStringTag];this._doTrackAllocatedMemory(e,t),this._doTrackAllocatedMemory(e,t,this.gl.stats.get("Memory Usage"))}},{key:"_doTrackAllocatedMemory",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this[Symbol.toStringTag],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Ya.get("Memory Usage");r.get("GPU Memory").addCount(e),r.get("".concat(t," Memory")).addCount(e),this.byteLength=e}},{key:"_trackDeallocatedMemory",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this[Symbol.toStringTag];this._doTrackDeallocatedMemory(e),this._doTrackDeallocatedMemory(e,this.gl.stats.get("Memory Usage"))}},{key:"_doTrackDeallocatedMemory",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this[Symbol.toStringTag],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ya.get("Memory Usage");t.get("GPU Memory").subtractCount(this.byteLength),t.get("".concat(e," Memory")).subtractCount(this.byteLength),this.byteLength=0}}]),t}(Symbol.toStringTag),co=r(58),lo=r.n(co);function fo(e){switch(ArrayBuffer.isView(e)?e.constructor:e){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 ho(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.clamped,n=void 0===r||r;switch(e){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 po(e){var t=e.data,r=e.width,n=e.height,i=e.bytesPerPixel,a=void 0===i?4:i,o=e.temp,s=r*a;o=o||new Uint8Array(s);for(var u=0;u<n/2;++u){var c=u*s,l=(n-u-1)*s;o.set(t.subarray(c,c+s)),t.copyWithin(c,l,l+s),t.set(o,l)}}function vo(e){for(var t=e.data,r=e.width,n=e.height,i=Math.round(r/2),a=Math.round(n/2),o=new Uint8Array(i*a*4),s=0;s<a;s++)for(var u=0;u<i;u++)for(var c=0;c<4;c++)o[4*(s*i+u)+c]=t[4*(2*s*r+2*u)+c];return{data:o,width:i,height:a}}function yo(e,t,r){var n=r.removedProps,i=void 0===n?{}:n,a=r.deprecatedProps,o=void 0===a?{}:a,s=r.replacedProps,u=void 0===s?{}:s;for(var c in i)if(c in t){var l=i[c]?"".concat(e,".").concat(i[c]):"N/A";ia.removed("".concat(e,".").concat(c),l)()}for(var f in o)if(f in t){var h=o[f];ia.deprecated("".concat(e,".").concat(f),"".concat(e,".").concat(h))()}var d=null;for(var p in u)if(p in t){var v=u[p];ia.deprecated("".concat(e,".").concat(p),"".concat(e,".").concat(v))(),(d=d||Object.assign({},t))[v]=t[p],delete d[p]}return d||t}var go={offset:0,stride:0,type:5126,size:1,divisor:0,normalized:!1,integer:!1},mo={deprecatedProps:{instanced:"divisor",isInstanced:"divisor"}},bo=function(){function e(){var t=this;h()(this,e);for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];n.forEach((function(e){return t._assign(e)})),Object.freeze(this)}return C()(e,[{key:"toString",value:function(){return JSON.stringify(this)}},{key:"BYTES_PER_ELEMENT",get:function(){return e.getBytesPerElement(this)}},{key:"BYTES_PER_VERTEX",get:function(){return e.getBytesPerVertex(this)}},{key:"_assign",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return void 0!==(e=yo("Accessor",e,mo)).type&&(this.type=e.type,5124!==e.type&&5125!==e.type||(this.integer=!0)),void 0!==e.size&&(this.size=e.size),void 0!==e.offset&&(this.offset=e.offset),void 0!==e.stride&&(this.stride=e.stride),void 0!==e.normalized&&(this.normalized=e.normalized),void 0!==e.integer&&(this.integer=e.integer),void 0!==e.divisor&&(this.divisor=e.divisor),void 0!==e.buffer&&(this.buffer=e.buffer),void 0!==e.index&&("boolean"==typeof e.index?this.index=e.index?1:0:this.index=e.index),void 0!==e.instanced&&(this.divisor=e.instanced?1:0),void 0!==e.isInstanced&&(this.divisor=e.isInstanced?1:0),this}}],[{key:"getBytesPerElement",value:function(e){return ho(e.type||5126).BYTES_PER_ELEMENT}},{key:"getBytesPerVertex",value:function(e){return $a(e.size),ho(e.type||5126).BYTES_PER_ELEMENT*e.size}},{key:"resolve",value:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return lo()(e,[go].concat(r))}}]),e}();function Ao(e){var t=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(e){return!1}}();return function(){var r,n=m()(e);if(t){var i=m()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return y()(this,r)}}var Bo,wo,_o,xo={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"},Co={removedProps:{},replacedProps:{bytes:"byteLength"},deprecatedProps:xo},Oo={removedProps:xo},Eo=function(e,t){p()(n,e);var r=Ao(n);function n(e){var t;h()(this,n);var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(t=r.call(this,e,i)).stubRemovedMethods("Buffer","v6.0",["layout","setLayout","getIndexedParameter"]),t.target=i.target||(t.gl.webgl2?36662:34962),t.initialize(i),Object.seal(yi()(t)),t}return C()(n,[{key:t,get:function(){return"Buffer"}},{key:"getElementCount",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.accessor;return Math.round(this.byteLength/bo.getBytesPerElement(e))}},{key:"getVertexCount",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.accessor;return Math.round(this.byteLength/bo.getBytesPerVertex(e))}},{key:"initialize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return ArrayBuffer.isView(e)&&(e={data:e}),Number.isFinite(e)&&(e={byteLength:e}),e=yo("Buffer",e,Co),this.usage=e.usage||35044,this.debugData=null,this.setAccessor(Object.assign({},e,e.accessor)),e.data?this._setData(e.data,e.offset,e.byteLength):this._setByteLength(e.byteLength||0),this}},{key:"setProps",value:function(e){return"accessor"in(e=yo("Buffer",e,Oo))&&this.setAccessor(e.accessor),this}},{key:"setAccessor",value:function(e){return delete(e=Object.assign({},e)).buffer,this.accessor=new bo(e),this}},{key:"reallocate",value:function(e){return e>this.byteLength?(this._setByteLength(e),!0):(this.bytesUsed=e,!1)}},{key:"setData",value:function(e){return this.initialize(e)}},{key:"subData",value:function(e){ArrayBuffer.isView(e)&&(e={data:e});var t=e,r=t.data,n=t.offset,i=void 0===n?0:n,a=t.srcOffset,o=void 0===a?0:a,s=e.byteLength||e.length;$a(r);var u=this.gl.webgl2?36663:this.target;return this.gl.bindBuffer(u,this.handle),0!==o||void 0!==s?(ca(this.gl),this.gl.bufferSubData(this.target,i,r,o,s)):this.gl.bufferSubData(u,i,r),this.gl.bindBuffer(u,null),this.debugData=null,this._inferType(r),this}},{key:"copyData",value:function(e){var t=e.sourceBuffer,r=e.readOffset,n=void 0===r?0:r,i=e.writeOffset,a=void 0===i?0:i,o=e.size,s=this.gl;return ca(s),s.bindBuffer(36662,t.handle),s.bindBuffer(36663,this.handle),s.copyBufferSubData(36662,36663,n,a,o),s.bindBuffer(36662,null),s.bindBuffer(36663,null),this.debugData=null,this}},{key:"getData",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.dstData,r=void 0===t?null:t,n=e.srcByteOffset,i=void 0===n?0:n,a=e.dstOffset,o=void 0===a?0:a,s=e.length,u=void 0===s?0:s;ca(this.gl);var c,l,f=ho(this.accessor.type||5126,{clamped:!1}),h=this._getAvailableElementCount(i),d=o;r?c=(l=r.length)-d:l=d+(c=Math.min(h,u||h));var p=Math.min(h,c);return $a((u=u||p)<=p),r=r||new f(l),this.gl.bindBuffer(36662,this.handle),this.gl.getBufferSubData(36662,i,r,o,u),this.gl.bindBuffer(36662,null),r}},{key:"bind",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.target,r=void 0===t?this.target:t,n=e.index,i=void 0===n?this.accessor&&this.accessor.index:n,a=e.offset,o=void 0===a?0:a,s=e.size;return 35345===r||35982===r?void 0!==s?this.gl.bindBufferRange(r,i,this.handle,o,s):($a(0===o),this.gl.bindBufferBase(r,i,this.handle)):this.gl.bindBuffer(r,this.handle),this}},{key:"unbind",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.target,r=void 0===t?this.target:t,n=e.index,i=void 0===n?this.accessor&&this.accessor.index:n,a=35345===r||35982===r;return a?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(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.byteLength+t;$a(ArrayBuffer.isView(e)),this._trackDeallocatedMemory();var n=this._getTarget();this.gl.bindBuffer(n,this.handle),this.gl.bufferData(n,r,this.usage),this.gl.bufferSubData(n,t,e),this.gl.bindBuffer(n,null),this.debugData=e.slice(0,10),this.bytesUsed=r,this._trackAllocatedMemory(r);var i=fo(e);return $a(i),this.setAccessor(new bo(this.accessor,{type:i})),this}},{key:"_setByteLength",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.usage;$a(e>=0),this._trackDeallocatedMemory();var r=e;0===e&&(r=new Float32Array(0));var n=this._getTarget();return this.gl.bindBuffer(n,this.handle),this.gl.bufferData(n,r,t),this.gl.bindBuffer(n,null),this.usage=t,this.debugData=null,this.bytesUsed=e,this._trackAllocatedMemory(e),this}},{key:"_getTarget",value:function(){return this.gl.webgl2?36663:this.target}},{key:"_getAvailableElementCount",value:function(e){var t=e/ho(this.accessor.type||5126,{clamped:!1}).BYTES_PER_ELEMENT;return this.getElementCount()-t}},{key:"_inferType",value:function(e){this.accessor.type||this.setAccessor(new bo(this.accessor,{type:fo(e)}))}},{key:"_createHandle",value:function(){return this.gl.createBuffer()}},{key:"_deleteHandle",value:function(){this.gl.deleteBuffer(this.handle),this._trackDeallocatedMemory()}},{key:"_getParameter",value:function(e){this.gl.bindBuffer(this.target,this.handle);var t=this.gl.getBufferParameter(this.target,e);return this.gl.bindBuffer(this.target,null),t}},{key:"type",get:function(){return ia.deprecated("Buffer.type","Buffer.accessor.type")(),this.accessor.type}},{key:"bytes",get:function(){return ia.deprecated("Buffer.bytes","Buffer.byteLength")(),this.byteLength}},{key:"setByteLength",value:function(e){return ia.deprecated("setByteLength","reallocate")(),this.reallocate(e)}},{key:"updateAccessor",value:function(e){return ia.deprecated("updateAccessor(...)","setAccessor(new Accessor(buffer.accessor, ...)")(),this.accessor=new bo(this.accessor,e),this}}]),n}(uo,Symbol.toStringTag),To=(Bo={},A()(Bo,6407,{dataFormat:6407,types:[5121,33635]}),A()(Bo,6408,{dataFormat:6408,types:[5121,32819,32820]}),A()(Bo,6406,{dataFormat:6406,types:[5121]}),A()(Bo,6409,{dataFormat:6409,types:[5121]}),A()(Bo,6410,{dataFormat:6410,types:[5121]}),A()(Bo,33326,{dataFormat:6403,types:[5126],gl2:!0}),A()(Bo,33328,{dataFormat:33319,types:[5126],gl2:!0}),A()(Bo,34837,{dataFormat:6407,types:[5126],gl2:!0}),A()(Bo,34836,{dataFormat:6408,types:[5126],gl2:!0}),Bo),So=(wo={},A()(wo,6403,1),A()(wo,36244,1),A()(wo,33319,2),A()(wo,33320,2),A()(wo,6407,3),A()(wo,36248,3),A()(wo,6408,4),A()(wo,36249,4),A()(wo,6402,1),A()(wo,34041,1),A()(wo,6406,1),A()(wo,6409,1),A()(wo,6410,2),wo),ko=(_o={},A()(_o,5126,4),A()(_o,5125,4),A()(_o,5124,4),A()(_o,5123,2),A()(_o,5122,2),A()(_o,5131,2),A()(_o,5120,1),A()(_o,5121,1),_o);function Mo(e,t){var r=To[t];if(!r)return!1;if(void 0===r.gl1&&void 0===r.gl2)return!0;var n=sa(e)&&r.gl2||r.gl1;return"string"==typeof n?e.getExtension(n):n}function Io(e,t){var r=To[t];switch(r&&r.types[0]){case 5126:return e.getExtension("OES_texture_float_linear");case 5131:return e.getExtension("OES_texture_half_float_linear");default:return!0}}function Po(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return Ro(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ro(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function Ro(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Fo(e){var t=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(e){return!1}}();return function(){var r,n=m()(e);if(t){var i=m()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return y()(this,r)}}var Do=[9729,9728],Lo=globalThis.WebGLBuffer||function(){},jo=function(e,t){p()(n,e);var r=Fo(n);function n(e,t){var i;h()(this,n);var a=t.id,o=void 0===a?no("texture"):a,s=t.handle,u=t.target;return(i=r.call(this,e,{id:o,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 C()(n,[{key:t,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 e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.data;if(r instanceof Promise)return r.then((function(r){return e.initialize(Object.assign({},t,{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 e.initialize(t)})),this;var i=t.pixels,a=void 0===i?null:i,o=t.format,s=void 0===o?6408:o,u=t.border,c=void 0===u?0:u,l=t.recreate,f=void 0!==l&&l,h=t.parameters,d=void 0===h?{}:h,p=t.pixelStore,v=void 0===p?{}:p,y=t.textureUnit,g=void 0===y?void 0:y;r||(r=a);var m=t.width,b=t.height,A=t.dataFormat,B=t.type,w=t.compressed,_=void 0!==w&&w,x=t.mipmaps,C=void 0===x||x,O=t.depth,E=void 0===O?0:O,T=this._deduceParameters({format:s,type:B,dataFormat:A,compressed:_,data:r,width:m,height:b});return m=T.width,b=T.height,_=T.compressed,A=T.dataFormat,B=T.type,this.width=m,this.height=b,this.depth=E,this.format=s,this.type=B,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()&&(ia.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:B,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 e=this._video,t=e.video,r=e.parameters;if(e.lastTime===t.currentTime||t.readyState<HTMLVideoElement.HAVE_CURRENT_DATA)return;this.setSubImageData({data:t,parameters:r}),this.mipmaps&&this.generateMipmap(),this._video.lastTime=t.currentTime}}},{key:"resize",value:function(e){var t=e.height,r=e.width,n=e.mipmaps,i=void 0!==n&&n;return r!==this.width||t!==this.height?this.initialize({width:r,height:t,format:this.format,type:this.type,dataFormat:this.dataFormat,border:this.border,mipmaps:i}):this}},{key:"generateMipmap",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._isNPOT()?(ia.warn("texture: ".concat(this," is Non-Power-Of-Two, disabling mipmaping"))(),this):(this.mipmaps=!0,this.gl.bindTexture(this.target,this.handle),Qa(this.gl,t,(function(){e.gl.generateMipmap(e.target)})),this.gl.bindTexture(this.target,null),this)}},{key:"setImageData",value:function(e){this._trackDeallocatedMemory("Texture");var t=e.target,r=void 0===t?this.target:t,n=e.pixels,i=void 0===n?null:n,a=e.level,o=void 0===a?0:a,s=e.format,u=void 0===s?this.format:s,c=e.border,l=void 0===c?this.border:c,f=e.offset,h=void 0===f?0:f,d=e.parameters,p=void 0===d?{}:d,v=e.data,y=void 0===v?null:v,g=e.type,m=void 0===g?this.type:g,b=e.width,A=void 0===b?this.width:b,B=e.height,w=void 0===B?this.height:B,_=e.dataFormat,x=void 0===_?this.dataFormat:_,C=e.compressed,O=void 0!==C&&C;y||(y=i);var E=this._deduceParameters({format:u,type:m,dataFormat:x,compressed:O,data:y,width:A,height:w});m=E.type,x=E.dataFormat,O=E.compressed,A=E.width,w=E.height;var T=this.gl;T.bindTexture(this.target,this.handle);var S,k,I=this._getDataType({data:y,compressed:O});y=I.data,S=I.dataType;var P=0;if(Qa(this.gl,p,(function(){switch(S){case"null":T.texImage2D(r,o,u,A,w,l,x,m,y);break;case"typed-array":T.texImage2D(r,o,u,A,w,l,x,m,y,h);break;case"buffer":(k=ca(T)).bindBuffer(35052,y.handle||y),k.texImage2D(r,o,u,A,w,l,x,m,h),k.bindBuffer(35052,null);break;case"browser-object":sa(T)?T.texImage2D(r,o,u,A,w,l,x,m,y):T.texImage2D(r,o,u,x,m,y);break;case"compressed":var e,t=Po(y.entries());try{for(t.s();!(e=t.n()).done;){var n=M()(e.value,2),i=n[0],a=n[1];T.compressedTexImage2D(r,i,a.format,a.width,a.height,l,a.data),P+=a.levelSize}}catch(e){t.e(e)}finally{t.f()}break;default:$a(!1,"Unknown image data type")}})),"compressed"===S)this._trackAllocatedMemory(P,"Texture");else if(y&&y.byteLength)this._trackAllocatedMemory(y.byteLength,"Texture");else{var R=So[this.dataFormat]||4,F=ko[this.type]||1;this._trackAllocatedMemory(this.width*this.height*R*F,"Texture")}return this.loaded=!0,this}},{key:"setSubImageData",value:function(e){var t=this,r=e.target,n=void 0===r?this.target:r,i=e.pixels,a=void 0===i?null:i,o=e.data,s=void 0===o?null:o,u=e.x,c=void 0===u?0:u,l=e.y,f=void 0===l?0:l,h=e.width,d=void 0===h?this.width:h,p=e.height,v=void 0===p?this.height:p,y=e.level,g=void 0===y?0:y,m=e.format,b=void 0===m?this.format:m,A=e.type,B=void 0===A?this.type:A,w=e.dataFormat,_=void 0===w?this.dataFormat:w,x=e.compressed,C=void 0!==x&&x,O=e.offset,E=void 0===O?0:O,T=e.border,S=(void 0===T&&this.border,e.parameters),k=void 0===S?{}:S,M=this._deduceParameters({format:b,type:B,dataFormat:_,compressed:C,data:s,width:d,height:v});if(B=M.type,_=M.dataFormat,C=M.compressed,d=M.width,v=M.height,$a(0===this.depth,"texSubImage not supported for 3D textures"),s||(s=a),s&&s.data){var I=s;s=I.data,d=I.shape[0],v=I.shape[1]}s instanceof Eo&&(s=s.handle),this.gl.bindTexture(this.target,this.handle),Qa(this.gl,k,(function(){if(C)t.gl.compressedTexSubImage2D(n,g,c,f,d,v,b,s);else if(null===s)t.gl.texSubImage2D(n,g,c,f,d,v,_,B,null);else if(ArrayBuffer.isView(s))t.gl.texSubImage2D(n,g,c,f,d,v,_,B,s,E);else if(s instanceof Lo){var e=ca(t.gl);e.bindBuffer(35052,s),e.texSubImage2D(n,g,c,f,d,v,_,B,E),e.bindBuffer(35052,null)}else if(sa(t.gl)){ca(t.gl).texSubImage2D(n,g,c,f,d,v,_,B,s)}else t.gl.texSubImage2D(n,g,c,f,_,B,s)})),this.gl.bindTexture(this.target,null)}},{key:"copyFramebuffer",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return ia.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 e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.textureUnit,t=this.gl;return void 0!==e&&(this.textureUnit=e,t.activeTexture(33984+e)),t.bindTexture(this.target,this.handle),e}},{key:"unbind",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.textureUnit,t=this.gl;return void 0!==e&&(this.textureUnit=e,t.activeTexture(33984+e)),t.bindTexture(this.target,null),e}},{key:"_getDataType",value:function(e){var t=e.data,r=e.compressed;return void 0!==r&&r?{data:t,dataType:"compressed"}:null===t?{data:t,dataType:"null"}:ArrayBuffer.isView(t)?{data:t,dataType:"typed-array"}:t instanceof Eo?{data:t.handle,dataType:"buffer"}:t instanceof Lo?{data:t,dataType:"buffer"}:{data:t,dataType:"browser-object"}}},{key:"_deduceParameters",value:function(e){var t=e.format,r=e.data,n=e.width,i=e.height,a=e.dataFormat,o=e.type,s=e.compressed,u=To[t];a=a||u&&u.dataFormat,o=o||u&&u.types[0],s=s||u&&u.compressed;var c=this._deduceImageSize(r,n,i);return{dataFormat:a,type:o,compressed:s,width:n=c.width,height:i=c.height,format:t,data:r}}},{key:"_deduceImageSize",value:function(e,t,r){var n;return $a(n="undefined"!=typeof ImageData&&e instanceof ImageData?{width:e.width,height:e.height}:"undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement?{width:e.naturalWidth,height:e.naturalHeight}:"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement?{width:e.width,height:e.height}:"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap?{width:e.width,height:e.height}:"undefined"!=typeof HTMLVideoElement&&e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:e?{width:t,height:r}:{width:t>=0?t:1,height:r>=0?r:1},"Could not deduced texture size"),$a(void 0===t||n.width===t,"Deduced texture width does not match supplied width"),$a(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(e){switch(e){case 4096:return this.width;case 4097:return this.height;default:this.gl.bindTexture(this.target,this.handle);var t=this.gl.getTexParameter(this.target,e);return this.gl.bindTexture(this.target,null),t}}},{key:"_setParameter",value:function(e,t){switch(this.gl.bindTexture(this.target,this.handle),t=this._getNPOTParam(e,t),e){case 33082:case 33083:this.gl.texParameterf(this.handle,e,t);break;case 4096:case 4097:$a(!1);break;default:this.gl.texParameteri(this.target,e,t)}return this.gl.bindTexture(this.target,null),this}},{key:"_isNPOT",value:function(){return!sa(this.gl)&&(!(!this.width||!this.height)&&(!io(this.width)||!io(this.height)))}},{key:"_updateForNPOT",value:function(e){void 0===e[this.gl.TEXTURE_MIN_FILTER]&&(e[this.gl.TEXTURE_MIN_FILTER]=this.gl.LINEAR),void 0===e[this.gl.TEXTURE_WRAP_S]&&(e[this.gl.TEXTURE_WRAP_S]=this.gl.CLAMP_TO_EDGE),void 0===e[this.gl.TEXTURE_WRAP_T]&&(e[this.gl.TEXTURE_WRAP_T]=this.gl.CLAMP_TO_EDGE)}},{key:"_getNPOTParam",value:function(e,t){if(this._isNPOT())switch(e){case 10241:-1===Do.indexOf(t)&&(t=9729);break;case 10242:case 10243:33071!==t&&(t=33071)}return t}}],[{key:"isSupported",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.format,n=t.linearFiltering,i=!0;return r&&(i=(i=i&&Mo(e,r))&&(!n||Io(e,r))),i}}]),n}(uo,Symbol.toStringTag),Go="";function Uo(e,t){return $a("string"==typeof e),e=Go+e,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(e,".")))},i.crossOrigin=t&&t.crossOrigin||"anonymous",i.src=e}catch(e){n(e)}}))}function No(e){var t=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(e){return!1}}();return function(){var r,n=m()(e);if(t){var i=m()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return y()(this,r)}}var Ho,Jo=function(e,t){p()(n,e);var r=No(n);function n(e){var t;h()(this,n);var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return ua(e),(i instanceof Promise||"string"==typeof i)&&(i={data:i}),"string"==typeof i.data&&(i=Object.assign({},i,{data:Uo(i.data)})),(t=r.call(this,e,Object.assign({},i,{target:3553}))).initialize(i),Object.seal(yi()(t)),t}return C()(n,[{key:t,get:function(){return"Texture2D"}}],[{key:"isSupported",value:function(e,t){return jo.isSupported(e,t)}}]),n}(jo,Symbol.toStringTag),Vo="EXT_color_buffer_float",zo=(Ho={},A()(Ho,33189,{bpp:2}),A()(Ho,33190,{gl2:!0,bpp:3}),A()(Ho,36012,{gl2:!0,bpp:4}),A()(Ho,36168,{bpp:1}),A()(Ho,34041,{bpp:4}),A()(Ho,35056,{gl2:!0,bpp:4}),A()(Ho,36013,{gl2:!0,bpp:5}),A()(Ho,32854,{bpp:2}),A()(Ho,36194,{bpp:2}),A()(Ho,32855,{bpp:2}),A()(Ho,33321,{gl2:!0,bpp:1}),A()(Ho,33330,{gl2:!0,bpp:1}),A()(Ho,33329,{gl2:!0,bpp:1}),A()(Ho,33332,{gl2:!0,bpp:2}),A()(Ho,33331,{gl2:!0,bpp:2}),A()(Ho,33334,{gl2:!0,bpp:4}),A()(Ho,33333,{gl2:!0,bpp:4}),A()(Ho,33323,{gl2:!0,bpp:2}),A()(Ho,33336,{gl2:!0,bpp:2}),A()(Ho,33335,{gl2:!0,bpp:2}),A()(Ho,33338,{gl2:!0,bpp:4}),A()(Ho,33337,{gl2:!0,bpp:4}),A()(Ho,33340,{gl2:!0,bpp:8}),A()(Ho,33339,{gl2:!0,bpp:8}),A()(Ho,32849,{gl2:!0,bpp:3}),A()(Ho,32856,{gl2:!0,bpp:4}),A()(Ho,32857,{gl2:!0,bpp:4}),A()(Ho,36220,{gl2:!0,bpp:4}),A()(Ho,36238,{gl2:!0,bpp:4}),A()(Ho,36975,{gl2:!0,bpp:4}),A()(Ho,36214,{gl2:!0,bpp:8}),A()(Ho,36232,{gl2:!0,bpp:8}),A()(Ho,36226,{gl2:!0,bpp:16}),A()(Ho,36208,{gl2:!0,bpp:16}),A()(Ho,33325,{gl2:Vo,bpp:2}),A()(Ho,33327,{gl2:Vo,bpp:4}),A()(Ho,34842,{gl2:Vo,bpp:8}),A()(Ho,33326,{gl2:Vo,bpp:4}),A()(Ho,33328,{gl2:Vo,bpp:8}),A()(Ho,34836,{gl2:Vo,bpp:16}),A()(Ho,35898,{gl2:Vo,bpp:4}),Ho);function Ko(e){var t=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(e){return!1}}();return function(){var r,n=m()(e);if(t){var i=m()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return y()(this,r)}}function qo(e,t,r){var n=r[t];if(!n)return!1;var i=sa(e)&&n.gl2||n.gl1;return"string"==typeof i?e.getExtension(i):i}var Xo=function(e,t){p()(n,e);var r=Ko(n);function n(e){var t;h()(this,n);var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(t=r.call(this,e,i)).initialize(i),Object.seal(yi()(t)),t}return C()(n,[{key:t,get:function(){return"Renderbuffer"}},{key:"initialize",value:function(e){var t=e.format,r=e.width,n=void 0===r?1:r,i=e.height,a=void 0===i?1:i,o=e.samples,s=void 0===o?0:o;return $a(t,"Needs format"),this._trackDeallocatedMemory(),this.gl.bindRenderbuffer(36161,this.handle),0!==s&&sa(this.gl)?this.gl.renderbufferStorageMultisample(36161,s,t,n,a):this.gl.renderbufferStorage(36161,t,n,a),this.format=t,this.width=n,this.height=a,this.samples=s,this._trackAllocatedMemory(this.width*this.height*(this.samples||1)*zo[this.format].bpp),this}},{key:"resize",value:function(e){var t=e.width,r=e.height;return t!==this.width||r!==this.height?this.initialize({width:t,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(e){this.gl.bindRenderbuffer(36161,e)}},{key:"_syncHandle",value:function(e){this.format=this.getParameter(36164),this.width=this.getParameter(36162),this.height=this.getParameter(36163),this.samples=this.getParameter(36011)}},{key:"_getParameter",value:function(e){return this.gl.bindRenderbuffer(36161,this.handle),this.gl.getRenderbufferParameter(36161,e)}}],[{key:"isSupported",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{format:null},r=t.format;return!r||qo(e,r,zo)}},{key:"getSamplesForFormat",value:function(e,t){var r=t.format;return e.getInternalformatParameter(36161,r,32937)}}]),n}(uo,Symbol.toStringTag);function Qo(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.framebuffer,n=void 0===r?null:r,i=t.color,a=void 0===i?null:i,o=t.depth,s=void 0===o?null:o,u=t.stencil,c=void 0===u?null:u,l={};n&&(l.framebuffer=n);var f=0;a&&(f|=16384,!0!==a&&(l.clearColor=a)),s&&(f|=256,!0!==s&&(l.clearDepth=s)),c&&(f|=1024,!0!==s&&(l.clearStencil=s)),$a(0!==f,"clear: bad arguments"),Qa(e,l,(function(){e.clear(f)}))}function Wo(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.framebuffer,n=void 0===r?null:r,i=t.buffer,a=void 0===i?6144:i,o=t.drawBuffer,s=void 0===o?0:o,u=t.value,c=void 0===u?[0,0,0,0]:u;ca(e),Qa(e,{framebuffer:n},(function(){switch(a){case 6144:switch(c.constructor){case Int32Array:e.clearBufferiv(a,s,c);break;case Uint32Array:e.clearBufferuiv(a,s,c);break;case Float32Array:default:e.clearBufferfv(a,s,c)}break;case 6145:e.clearBufferfv(6145,0,[c]);break;case 6146:e.clearBufferiv(6146,0,[c]);break;case 34041:var t=M()(c,2),r=t[0],n=t[1];e.clearBufferfi(34041,0,r,n);break;default:$a(!1,"clear: bad arguments")}}))}function Zo(e){switch(e){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 $a(!1),0}}function Yo(e){var t=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(e){return!1}}();return function(){var r,n=m()(e);if(t){var i=m()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return y()(this,r)}}var $o=[34069,34070,34071,34072,34073,34074],es=function(e,t){p()(i,e);var r,n=Yo(i);function i(e){var t;h()(this,i);var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return ua(e),(t=n.call(this,e,Object.assign({},r,{target:34067}))).initialize(r),Object.seal(yi()(t)),t}return C()(i,[{key:t,get:function(){return"TextureCube"}},{key:"initialize",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.mipmaps,n=void 0===r||r,i=t.parameters,a=void 0===i?{}:i;return this.opts=t,this.setCubeMapImageData(t).then((function(){e.loaded=!0,n&&e.generateMipmap(t),e.setParameters(a)})),this}},{key:"subImage",value:function(e){var t=e.face,r=e.data,n=e.x,i=void 0===n?0:n,a=e.y,o=void 0===a?0:a,s=e.mipmapLevel,u=void 0===s?0:s;return this._subImage({target:t,data:r,x:i,y:o,mipmapLevel:u})}},{key:"setCubeMapImageData",value:(r=Me()(Pe.a.mark((function e(t){var r,n,i,a,o,s,u,c,l,f,h,d,p,v=this;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.width,n=t.height,i=t.pixels,a=t.data,o=t.border,s=void 0===o?0:o,u=t.format,c=void 0===u?6408:u,l=t.type,f=void 0===l?5121:l,h=this.gl,d=i||a,e.next=5,Promise.all($o.map((function(e){var t=d[e];return Promise.all(Array.isArray(t)?t:[t])})));case 5:p=e.sent,this.bind(),$o.forEach((function(e,t){p[t].length>1&&!1!==v.opts.mipmaps&&ia.warn("".concat(v.id," has mipmap and multiple LODs."))(),p[t].forEach((function(t,i){r&&n?h.texImage2D(e,i,c,r,n,s,c,f,t):h.texImage2D(e,i,c,c,f,t)}))})),this.unbind();case 9:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"setImageDataForFace",value:function(e){var t=this,r=e.face,n=e.width,i=e.height,a=e.pixels,o=e.data,s=e.border,u=void 0===s?0:s,c=e.format,l=void 0===c?6408:c,f=e.type,h=void 0===f?5121:f,d=this.gl,p=a||o;return this.bind(),p instanceof Promise?p.then((function(n){return t.setImageDataForFace(Object.assign({},e,{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}(jo,Symbol.toStringTag);function ts(e){var t=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(e){return!1}}();return function(){var r,n=m()(e);if(t){var i=m()(this).constructor;Reflect.construct(n,arguments,i)}else n.apply(this,arguments);return y()(this,r)}}es.FACES=$o;Symbol.toStringTag;function rs(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.sourceX,n=void 0===r?0:r,i=t.sourceY,a=void 0===i?0:i,o=t.sourceFormat,s=void 0===o?6408:o,u=t.sourceAttachment,c=void 0===u?36064:u,l=t.target,f=void 0===l?null:l,h=t.sourceWidth,d=t.sourceHeight,p=t.sourceType,v=is(e),y=v.framebuffer,g=v.deleteFramebuffer;$a(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),$a(A[c]),f=as(f,p=p||A[c].type,s,h,d),p=p||fo(f);var B=m.bindFramebuffer(36160,b);return m.readPixels(n,a,h,d,s,p,f),m.bindFramebuffer(36160,B||null),g&&y.delete(),f}function ns(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.sourceAttachment,n=void 0===r?36064:r,i=t.targetMaxHeight,a=void 0===i?Number.MAX_SAFE_INTEGER:i,o=rs(e,{sourceAttachment:n}),s=e.width,u=e.height;u>a;){var c=vo({data:o,width:s,height:u});o=c.data,s=c.width,u=c.height}po({data:o,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(o),f.putImageData(h,0,0),l.toDataURL()}function is(e){return e instanceof cs?{framebuffer:e,deleteFramebuffer:!1}:{framebuffer:(t=e,n=t.gl,i=t.width,a=t.height,o=t.id,new cs(n,Object.assign({},r,{id:"framebuffer-for-".concat(o),width:i,height:a,attachments:A()({},36064,t)}))),deleteFramebuffer:!0};var t,r,n,i,a,o}function as(e,t,r,n,i){return e||new(ho(t=t||5121,{clamped:!1}))(n*i*Zo(r))}function os(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return ss(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ss(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function ss(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function us(e){var t=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(e){return!1}}();return function(){var r,n=m()(e);if(t){var i=m()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return y()(this,r)}}var cs=function(e,t){p()(n,e);var r=us(n);function n(e){var t;h()(this,n);var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(t=r.call(this,e,i)).width=null,t.height=null,t.attachments={},t.readBuffer=36064,t.drawBuffers=[36064],t.ownResources=[],t.initialize(i),Object.seal(yi()(t)),t}return C()(n,[{key:t,get:function(){return"Framebuffer"}},{key:"MAX_COLOR_ATTACHMENTS",get:function(){var e=ca(this.gl);return e.getParameter(e.MAX_COLOR_ATTACHMENTS)}},{key:"MAX_DRAW_BUFFERS",get:function(){var e=ca(this.gl);return e.getParameter(e.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(e){var t=e.width,r=void 0===t?1:t,n=e.height,i=void 0===n?1:n,a=e.attachments,o=void 0===a?null:a,s=e.color,u=void 0===s||s,c=e.depth,l=void 0===c||c,f=e.stencil,h=void 0!==f&&f,d=e.check,p=void 0===d||d,v=e.readBuffer,y=void 0===v?void 0:v,g=e.drawBuffers,m=void 0===g?void 0:g;if($a(r>=0&&i>=0,"Width and height need to be integers"),this.width=r,this.height=i,o)for(var b in o){var A=o[b];(Array.isArray(A)?A[0]:A).resize({width:r,height:i})}else o=this._createDefaultAttachments(u,l,h,r,i);this.update({clearAttachments:!0,attachments:o,readBuffer:y,drawBuffers:m}),o&&p&&this.checkStatus()}},{key:"delete",value:function(){var e,t=os(this.ownResources);try{for(t.s();!(e=t.n()).done;){e.value.delete()}}catch(e){t.e(e)}finally{t.f()}return ci()(m()(n.prototype),"delete",this).call(this),this}},{key:"update",value:function(e){var t=e.attachments,r=void 0===t?{}:t,n=e.readBuffer,i=e.drawBuffers,a=e.clearAttachments,o=void 0!==a&&a,s=e.resizeAttachments,u=void 0===s||s;this.attach(r,{clearAttachments:o,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 e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.width,r=e.height;if(null===this.handle)return $a(void 0===t&&void 0===r),this.width=this.gl.drawingBufferWidth,this.height=this.gl.drawingBufferHeight,this;for(var n in void 0===t&&(t=this.gl.drawingBufferWidth),void 0===r&&(r=this.gl.drawingBufferHeight),t!==this.width&&r!==this.height&&ia.log(2,"Resizing framebuffer ".concat(this.id," to ").concat(t,"x").concat(r))(),this.attachments)this.attachments[n].resize({width:t,height:r});return this.width=t,this.height=r,this}},{key:"attach",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=r.clearAttachments,i=void 0!==n&&n,a=r.resizeAttachments,o=void 0===a||a,s={};i&&Object.keys(this.attachments).forEach((function(e){s[e]=null})),Object.assign(s,e);var u=this.gl.bindFramebuffer(36160,this.handle);for(var c in s){$a(void 0!==c,"Misspelled framebuffer binding point?");var l=Number(c),f=s[l],h=f;if(h)if(h instanceof Xo)this._attachRenderbuffer({attachment:l,renderbuffer:h});else if(Array.isArray(f)){var d=M()(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);o&&h&&h.resize({width:this.width,height:this.height})}this.gl.bindFramebuffer(36160,u||null),Object.assign(this.attachments,e),Object.keys(this.attachments).filter((function(e){return!t.attachments[e]})).forEach((function(e){delete t.attachments[e]}))}},{key:"checkStatus",value:function(){this.gl;var e=this.getStatus();if(36053!==e)throw new Error(function(e){return(cs.STATUS||{})[e]||"Framebuffer error ".concat(e)}(e));return this}},{key:"getStatus",value:function(){var e=this.gl,t=e.bindFramebuffer(36160,this.handle),r=e.checkFramebufferStatus(36160);return e.bindFramebuffer(36160,t||null),r}},{key:"clear",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.color,n=t.depth,i=t.stencil,a=t.drawBuffers,o=void 0===a?[]:a,s=this.gl.bindFramebuffer(36160,this.handle);return(r||n||i)&&Qo(this.gl,{color:r,depth:n,stencil:i}),o.forEach((function(t,r){Wo(e.gl,{drawBuffer:r,value:t})})),this.gl.bindFramebuffer(36160,s||null),this}},{key:"readPixels",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return ia.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 ia.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 ia.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 ia.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 ia.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 ia.error("Framebuffer.blit({...}) is no logner supported, use blit(source, target, opts)")(),null}},{key:"invalidate",value:function(e){var t=e.attachments,r=void 0===t?[]:t,n=e.x,i=void 0===n?0:n,a=e.y,o=void 0===a?0:a,s=e.width,u=e.height,c=ca(this.gl),l=c.bindFramebuffer(36008,this.handle);return 0===i&&0===o&&void 0===s&&void 0===u?c.invalidateFramebuffer(36008,r):c.invalidateFramebuffer(36008,r,i,o,s,u),c.bindFramebuffer(36008,l),this}},{key:"getAttachmentParameter",value:function(e,t,r){var n=this._getAttachmentParameterFallback(t);return null===n&&(this.gl.bindFramebuffer(36160,this.handle),n=this.gl.getFramebufferAttachmentParameter(36160,e,t),this.gl.bindFramebuffer(36160,null)),r&&n>1e3&&(n=to(this.gl,n)),n}},{key:"getAttachmentParameters",value:function(){var e,t=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={},a=os(n);try{for(a.s();!(e=a.n()).done;){var o=e.value,s=r?to(this.gl,o):o;i[s]=this.getAttachmentParameter(t,o,r)}}catch(e){a.e(e)}finally{a.f()}return i}},{key:"getParameters",value:function(){for(var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=Object.keys(this.attachments),r={},n=0,i=t;n<i.length;n++){var a=i[n],o=Number(a),s=e?to(this.gl,o):o;r[s]=this.getAttachmentParameters(o,e)}return r}},{key:"show",value:function(){return"undefined"!=typeof window&&window.open(ns(this),"luma-debug-texture"),this}},{key:"log",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(e>ia.level||"undefined"==typeof window)return this;t=t||"Framebuffer ".concat(this.id);var r=ns(this,{targetMaxHeight:100});return ia.image({logLevel:e,message:t,image:r},t)(),this}},{key:"bind",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.target,r=void 0===t?36160:t;return this.gl.bindFramebuffer(r,this.handle),this}},{key:"unbind",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.target,r=void 0===t?36160:t;return this.gl.bindFramebuffer(r,null),this}},{key:"_createDefaultAttachments",value:function(e,t,r,n,i){var a,o=null;e&&((o=o||{})[36064]=new Jo(this.gl,{id:"".concat(this.id,"-color0"),pixels:null,format:6408,type:5121,width:n,height:i,mipmaps:!1,parameters:(a={},A()(a,10241,9729),A()(a,10240,9729),A()(a,10242,33071),A()(a,10243,33071),a)}),this.ownResources.push(o[36064]));return t&&r?((o=o||{})[33306]=new Xo(this.gl,{id:"".concat(this.id,"-depth-stencil"),format:35056,width:n,height:111}),this.ownResources.push(o[33306])):t?((o=o||{})[36096]=new Xo(this.gl,{id:"".concat(this.id,"-depth"),format:33189,width:n,height:i}),this.ownResources.push(o[36096])):r&&$a(!1),o}},{key:"_unattach",value:function(e){var t=this.attachments[e];t&&(t instanceof Xo?this.gl.framebufferRenderbuffer(36160,e,36161,null):this.gl.framebufferTexture2D(36160,e,3553,null,0),delete this.attachments[e])}},{key:"_attachRenderbuffer",value:function(e){var t=e.attachment,r=void 0===t?36064:t,n=e.renderbuffer;this.gl.framebufferRenderbuffer(36160,r,36161,n.handle),this.attachments[r]=n}},{key:"_attachTexture",value:function(e){var t=e.attachment,r=void 0===t?36064:t,n=e.texture,i=e.layer,a=e.level,o=this.gl;switch(o.bindTexture(n.target,n.handle),n.target){case 35866:case 32879:ca(o).framebufferTextureLayer(36160,r,n.target,a,i);break;case 34067:var s=function(e){return e<34069?e+34069:e}(i);o.framebufferTexture2D(36160,r,s,n.handle,a);break;case 3553:o.framebufferTexture2D(36160,r,3553,n.handle,a);break;default:$a(!1,"Illegal texture type")}o.bindTexture(n.target,null),this.attachments[r]=n}},{key:"_setReadBuffer",value:function(e){var t,r=sa(t=this.gl)?t:null;r?r.readBuffer(e):$a(36064===e||1029===e,"Multiple render targets not supported"),this.readBuffer=e}},{key:"_setDrawBuffers",value:function(e){var t=this.gl,r=ca(t);if(r)r.drawBuffers(e);else{var n=t.getExtension("WEBGL_draw_buffers");n?n.drawBuffersWEBGL(e):$a(1===e.length&&(36064===e[0]||1029===e[0]),"Multiple render targets not supported")}this.drawBuffers=e}},{key:"_getAttachmentParameterFallback",value:function(e){var t=function(e){for(var t in e.luma=e.luma||{},e.luma.caps=e.luma.caps||{},Ps)void 0===e.luma.caps[t]&&(e.luma.caps[t]=Ls(e,t));return e.luma.caps}(this.gl);switch(e){case 36052:return t.WEBGL2?null:0;case 33298:case 33299:case 33300:case 33301:case 33302:case 33303:return t.WEBGL2?null:8;case 33297:return t.WEBGL2?null:5125;case 33296:return t.WEBGL2||t.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(e){return this.gl.bindFramebuffer(36160,e)}}],[{key:"isSupported",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.colorBufferFloat,n=t.colorBufferHalfFloat,i=!0;return r&&(i=Boolean(e.getExtension("EXT_color_buffer_float")||e.getExtension("WEBGL_color_buffer_float")||e.getExtension("OES_texture_float"))),n&&(i=i&&Boolean(e.getExtension("EXT_color_buffer_float")||e.getExtension("EXT_color_buffer_half_float"))),i}},{key:"getDefaultFramebuffer",value:function(e){return e.luma=e.luma||{},e.luma.defaultFramebuffer=e.luma.defaultFramebuffer||new n(e,{id:"default-framebuffer",handle:null,attachments:{}}),e.luma.defaultFramebuffer}}]),n}(uo,Symbol.toStringTag);var ls;cs.ATTACHMENT_PARAMETERS=[36049,36048,33296,33298,33299,33300,33301,33302,33303];var fs="WEBGL2",hs="VERTEX_ARRAY_OBJECT",ds="TIMER_QUERY",ps="INSTANCED_RENDERING",vs="MULTIPLE_RENDER_TARGETS",ys="ELEMENT_INDEX_UINT32",gs="BLEND_EQUATION_MINMAX",ms="FLOAT_BLEND",bs="COLOR_ENCODING_SRGB",As="TEXTURE_DEPTH",Bs="TEXTURE_FLOAT",ws="TEXTURE_HALF_FLOAT",_s="TEXTURE_FILTER_LINEAR_FLOAT",xs="TEXTURE_FILTER_LINEAR_HALF_FLOAT",Cs="TEXTURE_FILTER_ANISOTROPIC",Os="COLOR_ATTACHMENT_RGBA32F",Es="COLOR_ATTACHMENT_FLOAT",Ts="COLOR_ATTACHMENT_HALF_FLOAT",Ss="GLSL_FRAG_DATA",ks="GLSL_FRAG_DEPTH",Ms="GLSL_DERIVATIVES",Is="GLSL_TEXTURE_LOD";var Ps=(ls={},A()(ls,fs,[!1,!0]),A()(ls,hs,["OES_vertex_array_object",!0]),A()(ls,ds,["EXT_disjoint_timer_query","EXT_disjoint_timer_query_webgl2"]),A()(ls,ps,["ANGLE_instanced_arrays",!0]),A()(ls,vs,["WEBGL_draw_buffers",!0]),A()(ls,ys,["OES_element_index_uint",!0]),A()(ls,gs,["EXT_blend_minmax",!0]),A()(ls,ms,["EXT_float_blend"]),A()(ls,bs,["EXT_sRGB",!0]),A()(ls,As,["WEBGL_depth_texture",!0]),A()(ls,Bs,["OES_texture_float",!0]),A()(ls,ws,["OES_texture_half_float",!0]),A()(ls,_s,["OES_texture_float_linear"]),A()(ls,xs,["OES_texture_half_float_linear"]),A()(ls,Cs,["EXT_texture_filter_anisotropic"]),A()(ls,Os,[function(e){var t=new Jo(e,{format:6408,type:5126,dataFormat:6408}),r=new cs(e,{id:"test-framebuffer",check:!1,attachments:A()({},36064,t)}),n=r.getStatus();return t.delete(),r.delete(),36053===n},"EXT_color_buffer_float"]),A()(ls,Es,[!1,"EXT_color_buffer_float"]),A()(ls,Ts,["EXT_color_buffer_half_float"]),A()(ls,Ss,["WEBGL_draw_buffers",!0]),A()(ls,ks,["EXT_frag_depth",!0]),A()(ls,Ms,["OES_standard_derivatives",!0]),A()(ls,Is,["EXT_shader_texture_lod",!0]),ls);function Rs(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return Fs(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Fs(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function Fs(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Ds(e,t){return function(e,t){return(t=Array.isArray(t)?t:[t]).every((function(t){return Ls(e,t)}))}(e,t)}function Ls(e,t){return e.luma=e.luma||{},e.luma.caps=e.luma.caps||{},void 0===e.luma.caps[t]&&(e.luma.caps[t]=function(e,t){var r,n=Ps[t];$a(n,t);var i=sa(e)&&n[1]||n[0];if("function"==typeof i)r=i(e);else if(Array.isArray(i)){r=!0;var a,o=Rs(i);try{for(o.s();!(a=o.n()).done;){var s=a.value;r=r&&Boolean(e.getExtension(s))}}catch(e){o.e(e)}finally{o.f()}}else"string"==typeof i?r=Boolean(e.getExtension(i)):"boolean"==typeof i?r=i:$a(!1);return r}(e,t)),e.luma.caps[t]||ia.log(2,"Feature: ".concat(t," not supported"))(),e.luma.caps[t]}function js(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Gs(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?js(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):js(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Us=function(){function e(t,r){h()(this,e);var n=r.attributes,i=r.material,a=r.pbrDebug,o=r.imageBasedLightingEnvironment,s=r.lights,u=r.useTangents;this.gl=t,this.defines={MANUAL_SRGB:1,SRGB_FAST_APPROXIMATION:1},Ds(t,Is)&&(this.defines.USE_TEX_LOD=1),this.uniforms={u_Camera:[0,0,0],u_MetallicRoughnessValues:[1,1]},this.parameters={},this.generatedTextures=[],o&&(this.uniforms.u_DiffuseEnvSampler=o.getDiffuseEnvSampler(),this.uniforms.u_SpecularEnvSampler=o.getSpecularEnvSampler(),this.uniforms.u_brdfLUT=o.getBrdfTexture(),this.uniforms.u_ScaleIBLAmbient=[1,1]),a&&(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(o,"USE_IBL"),this.defineIfPresent(s,"USE_LIGHTS"),this.defineIfPresent(a,"PBR_DEBUG"),i&&this.parseMaterial(i)}return C()(e,[{key:"defineIfPresent",value:function(e,t){e&&(this.defines[t]=1)}},{key:"parseTexture",value:function(e,t){var r,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=e.texture&&e.texture.sampler&&e.texture.sampler.parameters||{},a=e.texture.source.image,o={};a.compressed?(r=a,o=A()({},this.gl.TEXTURE_MIN_FILTER,a.data.length>1?this.gl.LINEAR_MIPMAP_NEAREST:this.gl.LINEAR)):r={data:a};var s=new Jo(this.gl,Gs({id:e.name||e.id,parameters:Gs(Gs({},i),o),pixelStore:A()({},this.gl.UNPACK_FLIP_Y_WEBGL,!1)},r));this.uniforms[t]=s,this.defineIfPresent(n,n),this.generatedTextures.push(s)}},{key:"parsePbrMetallicRoughness",value:function(e){e.baseColorTexture&&this.parseTexture(e.baseColorTexture,"u_BaseColorSampler","HAS_BASECOLORMAP"),this.uniforms.u_BaseColorFactor=e.baseColorFactor||[1,1,1,1],e.metallicRoughnessTexture&&this.parseTexture(e.metallicRoughnessTexture,"u_MetallicRoughnessSampler","HAS_METALROUGHNESSMAP");var t=e.metallicFactor,r=void 0===t?1:t,n=e.roughnessFactor,i=void 0===n?1:n;this.uniforms.u_MetallicRoughnessValues=[r,i]}},{key:"parseMaterial",value:function(e){if(this.uniforms.pbr_uUnlit=Boolean(e.unlit),e.pbrMetallicRoughness&&this.parsePbrMetallicRoughness(e.pbrMetallicRoughness),e.normalTexture){this.parseTexture(e.normalTexture,"u_NormalSampler","HAS_NORMALMAP");var t=e.normalTexture.scale,r=void 0===t?1:t;this.uniforms.u_NormalScale=r}if(e.occlusionTexture){this.parseTexture(e.occlusionTexture,"u_OcclusionSampler","HAS_OCCLUSIONMAP");var n=e.occlusionTexture.strength,i=void 0===n?1:n;this.uniforms.u_OcclusionStrength=i}if(e.emissiveTexture&&(this.parseTexture(e.emissiveTexture,"u_EmissiveSampler","HAS_EMISSIVEMAP"),this.uniforms.u_EmissiveFactor=e.emissiveFactor||[0,0,0]),"MASK"===e.alphaMode){var a=e.alphaCutoff,o=void 0===a?.5:a;this.defines.ALPHA_CUTOFF=1,this.uniforms.u_AlphaCutoff=o}else"BLEND"===e.alphaMode&&(ia.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(e){return e.delete()}))}}]),e}();function Ns(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Hs(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ns(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ns(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Js(e){var t=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(e){return!1}}();return function(){var r,n=m()(e);if(t){var i=m()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return y()(this,r)}}var Vs=function(e){p()(r,e);var t=Js(r);function r(){return h()(this,r),t.apply(this,arguments)}return C()(r,[{key:"getShaders",value:function(){var e=ci()(m()(r.prototype),"getShaders",this).call(this);return e.modules.push(Ri.pbr),Hs(Hs({},e),{},{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 e=this.props.featureIds;ci()(m()(r.prototype),"initializeState",this).call(this);var t=this.getAttributeManager();e&&t.add({featureIdsPickingColors:{type:5121,size:3,noAlloc:!0,update:this.calculateFeatureIdsPickingColors}})}},{key:"updateState",value:function(e){ci()(m()(r.prototype),"updateState",this).call(this,e);var t=e.props,n=e.oldProps;t.pbrMaterial!==n.pbrMaterial&&this.updatePbrMaterialUniforms(t.pbrMaterial)}},{key:"draw",value:function(e){var t=this.props.featureIds;this.state.model&&(this.state.model.setUniforms({u_Camera:this.state.model.getUniforms().project_uCameraPosition,pickFeatureIds:Boolean(t)}),ci()(m()(r.prototype),"draw",this).call(this,e))}},{key:"getModel",value:function(e){var t=this.props,r=t.id,n=t.pbrMaterial,i=this.parseMaterial(n,e);this.setState({materialParser:i});var a,o=this.getShaders();return(a=e.attributes).COLOR_0||a.colors||(a.colors={constant:!0,value:new Float32Array([1,1,1])}),new Ri.Model(this.context.gl,Hs(Hs({},this.getShaders()),{},{id:r,geometry:e,defines:Hs(Hs(Hs({},o.defines),null==i?void 0:i.defines),{},{HAS_UV_REGIONS:e.attributes.uvRegions}),parameters:null==i?void 0:i.parameters,isInstanced:!0}))}},{key:"updatePbrMaterialUniforms",value:function(e){var t=this.state.model;if(t){var r=this.props.mesh,n=this.parseMaterial(e,r);this.setState({materialParser:n}),t.setUniforms(n.uniforms)}}},{key:"parseMaterial",value:function(e,t){var r,n=Boolean(e.pbrMetallicRoughness&&e.pbrMetallicRoughness.baseColorTexture);return null===(r=this.state.materialParser)||void 0===r||r.delete(),new Us(this.context.gl,{attributes:{NORMAL:t.attributes.normals,TEXCOORD_0:t.attributes.texCoords},material:Hs({unlit:n},e),pbrDebug:!1,imageBasedLightingEnvironment:null,lights:!0,useTangents:!1})}},{key:"calculateFeatureIdsPickingColors",value:function(e){for(var t=this.props.featureIds,r=new Uint8ClampedArray(t.length*e.size),n=[],i=0;i<t.length;i++)this.encodePickingColor(t[i],n),r[3*i]=n[0],r[3*i+1]=n[1],r[3*i+2]=n[2];e.value=r}},{key:"finalizeState",value:function(e){var t;ci()(m()(r.prototype),"finalizeState",this).call(this,e),null===(t=this.state.materialParser)||void 0===t||t.delete(),this.setState({materialParser:null})}}]),r}(B.SimpleMeshLayer);A()(Vs,"layerName","MeshLayer"),A()(Vs,"defaultProps",{pbrMaterial:{type:"object",value:null},featureIds:{type:"array",value:null,optional:!0}});var zs=function(e){return"boolean"==typeof e},Ks=function(e){return"function"==typeof e},qs=function(e){return null!==e&&"object"===mi()(e)},Xs=function(e){return qs(e)&&e.constructor==={}.constructor},Qs=function(e){return e&&"function"==typeof e[Symbol.iterator]},Ws=function(e){return e&&"function"==typeof e[Symbol.asyncIterator]},Zs=function(e){return"undefined"!=typeof Response&&e instanceof Response||e&&e.arrayBuffer&&e.text&&e.json},Ys=function(e){return"undefined"!=typeof Blob&&e instanceof Blob},$s=function(e){return function(e){return"undefined"!=typeof ReadableStream&&e instanceof ReadableStream||qs(e)&&Ks(e.tee)&&Ks(e.cancel)&&Ks(e.getReader)}(e)||function(e){return qs(e)&&Ks(e.read)&&Ks(e.pipe)&&zs(e.readable)}(e)};function eu(e,t){if(!e)throw new Error(t||"loader assertion failed.")}function tu(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ru(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?tu(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):tu(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function nu(e){var t;return!!e&&(Array.isArray(e)&&(e=e[0]),Array.isArray(null===(t=e)||void 0===t?void 0:t.extensions))}function iu(e){var t,r,n;return eu(e,"null loader"),eu(nu(e),"invalid loader"),Array.isArray(e)&&(n=e[1],e=ru(ru({},e=e[0]),{},{options:ru(ru({},e.options),n)})),(null!==(t=e)&&void 0!==t&&t.parseTextSync||null!==(r=e)&&void 0!==r&&r.parseText)&&(e.text=!0),e.text||(e.binary=!0),e}var au="",ou={};function su(e){for(var t in ou)if(e.startsWith(t)){var r=ou[t];e=e.replace(t,r)}return e.startsWith("http://")||e.startsWith("https://")||(e="".concat(au).concat(e)),e}var uu=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,cu=/^([-\w.]+\/[-\w.+]+)/;function lu(e){var t=cu.exec(e);return t?t[1]:e}function fu(e){var t=uu.exec(e);return t?t[1]:""}var hu=/\?.*/;function du(e){if(Zs(e)){var t=vu(e.url||"");return{url:t,type:lu(e.headers.get("content-type")||"")||fu(t)}}return Ys(e)?{url:vu(e.name||""),type:e.type||""}:"string"==typeof e?{url:vu(e),type:fu(e)}:{url:"",type:""}}function pu(e){return Zs(e)?e.headers["content-length"]||-1:Ys(e)?e.size:"string"==typeof e?e.length:e instanceof ArrayBuffer?e.byteLength:ArrayBuffer.isView(e)?e.byteLength:-1}function vu(e){return e.replace(hu,"")}function yu(e){return gu.apply(this,arguments)}function gu(){return(gu=Me()(Pe.a.mark((function e(t){var r,n,i,a,o,s,u;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!Zs(t)){e.next=2;break}return e.abrupt("return",t);case 2:return r={},(n=pu(t))>=0&&(r["content-length"]=String(n)),i=du(t),a=i.url,(o=i.type)&&(r["content-type"]=o),e.next=9,wu(t);case 9:return(s=e.sent)&&(r["x-first-bytes"]=s),"string"==typeof t&&(t=(new TextEncoder).encode(t)),u=new Response(t,{headers:r}),Object.defineProperty(u,"url",{value:a}),e.abrupt("return",u);case 15:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function mu(e){return bu.apply(this,arguments)}function bu(){return(bu=Me()(Pe.a.mark((function e(t){var r;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.ok){e.next=5;break}return e.next=3,Au(t);case 3:throw r=e.sent,new Error(r);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Au(e){return Bu.apply(this,arguments)}function Bu(){return(Bu=Me()(Pe.a.mark((function e(t){var r,n,i;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r="Failed to fetch resource ".concat(t.url," (").concat(t.status,"): "),e.prev=1,n=t.headers.get("Content-Type"),i=t.statusText,!n.includes("application/json")){e.next=11;break}return e.t0=i,e.t1=" ",e.next=9,t.text();case 9:e.t2=e.sent,i=e.t0+=e.t1.concat.call(e.t1,e.t2);case 11:r=(r+=i).length>60?"".concat(r.slice(0,60),"..."):r,e.next=17;break;case 15:e.prev=15,e.t3=e.catch(1);case 17:return e.abrupt("return",r);case 18:case"end":return e.stop()}}),e,null,[[1,15]])})))).apply(this,arguments)}function wu(e){return _u.apply(this,arguments)}function _u(){return(_u=Me()(Pe.a.mark((function e(t){var r,n,i,a;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=5,"string"!=typeof t){e.next=3;break}return e.abrupt("return","data:,".concat(t.slice(0,r)));case 3:if(!(t instanceof Blob)){e.next=8;break}return n=t.slice(0,5),e.next=7,new Promise((function(e){var t=new FileReader;t.onload=function(t){var r;return e(null==t?void 0:null===(r=t.target)||void 0===r?void 0:r.result)},t.readAsDataURL(n)}));case 7:return e.abrupt("return",e.sent);case 8:if(!(t instanceof ArrayBuffer)){e.next=12;break}return i=t.slice(0,r),a=xu(i),e.abrupt("return","data:base64,".concat(a));case 12:return e.abrupt("return",null);case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function xu(e){for(var t="",r=new Uint8Array(e),n=0;n<r.byteLength;n++)t+=String.fromCharCode(r[n]);return btoa(t)}function Cu(e,t){return Ou.apply(this,arguments)}function Ou(){return(Ou=Me()(Pe.a.mark((function e(t,r){var n;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("string"!=typeof t){e.next=7;break}return t=su(t),n=r,null!=r&&r.fetch&&"function"!=typeof(null==r?void 0:r.fetch)&&(n=r.fetch),e.next=6,fetch(t,n);case 6:return e.abrupt("return",e.sent);case 7:return e.next=9,yu(t);case 9:return e.abrupt("return",e.sent);case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Eu(){return!("object"===("undefined"==typeof process?"undefined":mi()(process))&&"[object process]"===String(process)&&!process.browser)||function(e){if("undefined"!=typeof window&&"object"===mi()(window.process)&&"renderer"===window.process.type)return!0;if("undefined"!=typeof process&&"object"===mi()(process.versions)&&Boolean(process.versions.electron))return!0;var t="object"===("undefined"==typeof navigator?"undefined":mi()(navigator))&&"string"==typeof navigator.userAgent&&navigator.userAgent,r=e||t;return!!(r&&r.indexOf("Electron")>=0)}()}var Tu=Eu();function Su(e){try{var t=window[e],r="__storage_test__";return t.setItem(r,r),t.removeItem(r),t}catch(e){return null}}var ku=function(){function e(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"sessionStorage";h()(this,e),this.storage=Su(n),this.id=t,this.config={},Object.assign(this.config,r),this._loadConfiguration()}return C()(e,[{key:"getConfiguration",value:function(){return this.config}},{key:"setConfiguration",value:function(e){return this.config={},this.updateConfiguration(e)}},{key:"updateConfiguration",value:function(e){if(Object.assign(this.config,e),this.storage){var t=JSON.stringify(this.config);this.storage.setItem(this.id,t)}return this}},{key:"_loadConfiguration",value:function(){var e={};if(this.storage){var t=this.storage.getItem(this.id);e=t?JSON.parse(t):{}}return Object.assign(this.config,e),this}}]),e}();function Mu(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:600,i=e.src.replace(/\(/g,"%28").replace(/\)/g,"%29");e.width>n&&(r=Math.min(r,n/e.width));var a=e.width*r,o=e.height*r,s=["font-size:1px;","padding:".concat(Math.floor(o/2),"px ").concat(Math.floor(a/2),"px;"),"line-height:".concat(o,"px;"),"background:url(".concat(i,");"),"background-size:".concat(a,"px ").concat(o,"px;"),"color:transparent;"].join("");return["".concat(t," %c+"),s]}var Iu={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 Pu(e){return"string"==typeof e?Iu[e.toUpperCase()]||Iu.WHITE:e}function Ru(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return Fu(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Fu(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function Fu(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Du(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["constructor"],n=Object.getPrototypeOf(e),i=Object.getOwnPropertyNames(n),a=Ru(i);try{var o=function(){var n=t.value;"function"==typeof e[n]&&(r.find((function(e){return n===e}))||(e[n]=e[n].bind(e)))};for(a.s();!(t=a.n()).done;)o()}catch(e){a.e(e)}finally{a.f()}}function Lu(e,t){if(!e)throw new Error(t||"Assertion failed")}var ju={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":mi()(process))&&process},Gu=ju.window||ju.self||ju.global,Uu=ju.process||{};console;function Nu(){var e;if(Tu&&Gu.performance)e=Gu.performance.now();else if(Uu.hrtime){var t=Uu.hrtime();e=1e3*t[0]+t[1]/1e6}else e=Date.now();return e}var Hu={debug:Tu&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},Ju={enabled:!0,level:0};function Vu(){}var zu={},Ku={once:!0};function qu(e){for(var t in e)for(var r in e[t])return r||"untitled";return"empty"}var Xu=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{id:""},r=t.id;h()(this,e),this.id=r,this.VERSION="8.8.24",this._startTs=Nu(),this._deltaTs=Nu(),this.LOG_THROTTLE_TIMEOUT=0,this._storage=new ku("__probe-".concat(this.id,"__"),Ju),this.userData={},this.timeStamp("".concat(this.id," started")),Du(this),Object.seal(this)}return C()(e,[{key:"level",get:function(){return this.getLevel()},set:function(e){this.setLevel(e)}},{key:"isEnabled",value:function(){return this._storage.config.enabled}},{key:"getLevel",value:function(){return this._storage.config.level}},{key:"getTotal",value:function(){return Number((Nu()-this._startTs).toPrecision(10))}},{key:"getDelta",value:function(){return Number((Nu()-this._deltaTs).toPrecision(10))}},{key:"priority",get:function(){return this.level},set:function(e){this.level=e}},{key:"getPriority",value:function(){return this.level}},{key:"enable",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this._storage.updateConfiguration({enabled:e}),this}},{key:"setLevel",value:function(e){return this._storage.updateConfiguration({level:e}),this}},{key:"assert",value:function(e,t){Lu(e,t)}},{key:"warn",value:function(e){return this._getLogFunction(0,e,Hu.warn,arguments,Ku)}},{key:"error",value:function(e){return this._getLogFunction(0,e,Hu.error,arguments)}},{key:"deprecated",value:function(e,t){return this.warn("`".concat(e,"` is deprecated and will be removed in a later version. Use `").concat(t,"` instead"))}},{key:"removed",value:function(e,t){return this.error("`".concat(e,"` has been removed. Use `").concat(t,"` instead"))}},{key:"probe",value:function(e,t){return this._getLogFunction(e,t,Hu.log,arguments,{time:!0,once:!0})}},{key:"log",value:function(e,t){return this._getLogFunction(e,t,Hu.debug,arguments)}},{key:"info",value:function(e,t){return this._getLogFunction(e,t,console.info,arguments)}},{key:"once",value:function(e,t){return this._getLogFunction(e,t,Hu.debug||Hu.info,arguments,Ku)}},{key:"table",value:function(e,t,r){return t?this._getLogFunction(e,t,console.table||Vu,r&&[r],{tag:qu(t)}):Vu}},{key:"image",value:function(e){var t=e.logLevel,n=e.priority,i=e.image,a=e.message,o=void 0===a?"":a,s=e.scale,u=void 0===s?1:s;return this._shouldLog(t||n)?Tu?function(e){var t=e.image,r=e.message,n=void 0===r?"":r,i=e.scale,a=void 0===i?1:i;if("string"==typeof t){var o=new Image;return o.onload=function(){var e,t=Mu(o,n,a);(e=console).log.apply(e,De()(t))},o.src=t,Vu}var s=t.nodeName||"";if("img"===s.toLowerCase()){var u;return(u=console).log.apply(u,De()(Mu(t,n,a))),Vu}if("canvas"===s.toLowerCase()){var c=new Image;return c.onload=function(){var e;return(e=console).log.apply(e,De()(Mu(c,n,a)))},c.src=t.toDataURL(),Vu}return Vu}({image:i,message:o,scale:u}):function(e){var t=e.image,n=(e.message,e.scale),i=void 0===n?1:n,a=null;try{a=r(94)}catch(e){}if(a)return function(){return a(t,{fit:"box",width:"".concat(Math.round(80*i),"%")}).then((function(e){return console.log(e)}))};return Vu}({image:i,message:o,scale:u}):Vu}},{key:"settings",value:function(){console.table?console.table(this._storage.config):console.log(this._storage.config)}},{key:"get",value:function(e){return this._storage.config[e]}},{key:"set",value:function(e,t){this._storage.updateConfiguration(A()({},e,t))}},{key:"time",value:function(e,t){return this._getLogFunction(e,t,console.time?console.time:console.info)}},{key:"timeEnd",value:function(e,t){return this._getLogFunction(e,t,console.timeEnd?console.timeEnd:console.info)}},{key:"timeStamp",value:function(e,t){return this._getLogFunction(e,t,console.timeStamp||Vu)}},{key:"group",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{collapsed:!1},n=r=Wu({logLevel:e,message:t,opts:r}),i=n.collapsed;return r.method=(i?console.groupCollapsed:console.group)||console.info,this._getLogFunction(r)}},{key:"groupCollapsed",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.group(e,t,Object.assign({},r,{collapsed:!0}))}},{key:"groupEnd",value:function(e){return this._getLogFunction(e,"",console.groupEnd||Vu)}},{key:"withGroup",value:function(e,t,r){this.group(e,t)();try{r()}finally{this.groupEnd(e)()}}},{key:"trace",value:function(){console.trace&&console.trace()}},{key:"_shouldLog",value:function(e){return this.isEnabled()&&this.getLevel()>=Qu(e)}},{key:"_getLogFunction",value:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],i=arguments.length>4?arguments[4]:void 0;if(this._shouldLog(e)){var a;i=Wu({logLevel:e,message:t,args:n,opts:i}),Lu(r=r||i.method),i.total=this.getTotal(),i.delta=this.getDelta(),this._deltaTs=Nu();var o=i.tag||i.message;if(i.once){if(zu[o])return Vu;zu[o]=Nu()}return t=Zu(this.id,i.message,i),(a=r).bind.apply(a,[console,t].concat(De()(i.args)))}return Vu}}]),e}();function Qu(e){if(!e)return 0;var t;switch(mi()(e)){case"number":t=e;break;case"object":t=e.logLevel||e.priority||0;break;default:return 0}return Lu(Number.isFinite(t)&&t>=0),t}function Wu(e){var t=e.logLevel,r=e.message;e.logLevel=Qu(t);for(var n=e.args?Array.from(e.args):[];n.length&&n.shift()!==r;);switch(e.args=n,mi()(t)){case"string":case"function":void 0!==r&&n.unshift(r),e.message=t;break;case"object":Object.assign(e,t)}"function"==typeof e.message&&(e.message=e.message());var i=mi()(e.message);return Lu("string"===i||"object"===i),Object.assign(e,e.opts)}function Zu(e,t,r){if("string"==typeof t){var n=r.time?function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8,r=Math.max(t-e.length,0);return"".concat(" ".repeat(r)).concat(e)}((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")):"";t=r.time?"".concat(e,": ").concat(n," ").concat(t):"".concat(e,": ").concat(t),i=t,a=r.color,o=r.background,Tu||"string"!=typeof i||(a&&(a=Pu(a),i="[".concat(a,"m").concat(i,"[39m")),o&&(a=Pu(o),i="[".concat(o+10,"m").concat(i,"[49m"))),t=i}var i,a,o,s;return t}Xu.VERSION="8.8.24";var Yu=new Xu({id:"loaders.gl"}),$u=function(){function e(){h()(this,e)}return C()(e,[{key:"log",value:function(){return function(){}}},{key:"info",value:function(){return function(){}}},{key:"warn",value:function(){return function(){}}},{key:"error",value:function(){return function(){}}}]),e}(),ec=function(){function e(){h()(this,e),Hn(this,"console",void 0),this.console=console}return C()(e,[{key:"log",value:function(){for(var e,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return(e=this.console.log).bind.apply(e,[this.console].concat(r))}},{key:"info",value:function(){for(var e,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return(e=this.console.info).bind.apply(e,[this.console].concat(r))}},{key:"warn",value:function(){for(var e,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return(e=this.console.warn).bind.apply(e,[this.console].concat(r))}},{key:"error",value:function(){for(var e,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return(e=this.console.error).bind.apply(e,[this.console].concat(r))}}]),e}(),tc=("undefined"!=typeof self&&self,"undefined"!=typeof window&&window,"undefined"!=typeof global&&global,"undefined"!=typeof document&&document,Boolean("object"!==("undefined"==typeof process?"undefined":mi()(process))||"[object process]"!==String(process)||process.browser)),rc="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version),nc=(rc&&parseFloat(rc[1]),{fetch:null,mimeType:void 0,nothrow:!1,log:new ec,CDN:"https://unpkg.com/@loaders.gl",worker:!0,maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:tc,_nodeWorkers:!1,_workerType:"",limit:0,_limitMB:0,batchSize:"auto",batchDebounceMs:0,metadata:!1,transforms:[]}),ic={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 ac(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return oc(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return oc(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function oc(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function sc(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function uc(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?sc(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):sc(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function cc(){globalThis.loaders=globalThis.loaders||{};var e=globalThis.loaders;return e._state=e._state||{},e._state}var lc=function(){var e=cc();return e.globalOptions=e.globalOptions||uc({},nc),e.globalOptions};function fc(e,t,r,n){return r=r||[],function(e,t){dc(e,null,nc,ic,t);var r,n=ac(t);try{for(n.s();!(r=n.n()).done;){var i=r.value,a=e&&e[i.id]||{},o=i.options&&i.options[i.id]||{},s=i.deprecatedOptions&&i.deprecatedOptions[i.id]||{};dc(a,i.id,o,s,t)}}catch(e){n.e(e)}finally{n.f()}}(e,r=Array.isArray(r)?r:[r]),vc(t,e,n)}function hc(e,t){var r=lc(),n=e||r;return"function"==typeof n.fetch?n.fetch:qs(n.fetch)?function(e){return Cu(e,n)}:null!=t&&t.fetch?null==t?void 0:t.fetch:Cu}function dc(e,t,r,n,i){var a=t||"Top level",o=t?"".concat(t,"."):"";for(var s in e){var u=!t&&qs(e[s]);if(!(s in r||"baseUri"===s&&!t||"workerUrl"===s&&t))if(s in n)Yu.warn("".concat(a," loader option '").concat(o).concat(s,"' no longer supported, use '").concat(n[s],"'"))();else if(!u){var c=pc(s,i);Yu.warn("".concat(a," loader option '").concat(o).concat(s,"' not recognized. ").concat(c))()}}}function pc(e,t){var r,n=e.toLowerCase(),i="",a=ac(t);try{for(a.s();!(r=a.n()).done;){var o=r.value;for(var s in o.options){if(e===s)return"Did you mean '".concat(o.id,".").concat(s,"'?");var u=s.toLowerCase();(n.startsWith(u)||u.startsWith(n))&&(i=i||"Did you mean '".concat(o.id,".").concat(s,"'?"))}}}catch(e){a.e(e)}finally{a.f()}return i}function vc(e,t,r){var n=uc({},e.options||{});return function(e,t){!t||"baseUri"in e||(e.baseUri=t)}(n,r),null===n.log&&(n.log=new $u),yc(n,lc()),yc(n,t),n}function yc(e,t){for(var r in t)if(r in t){var n=t[r];Xs(n)&&Xs(e[r])?e[r]=uc(uc({},e[r]),t[r]):e[r]=t[r]}}function gc(e,t){if(!e)throw new Error(t||"loaders.gl assertion failed.")}function mc(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"3.2.10";gc(e,"no worker provided");var r=e.version;return!(!t||!r)}var bc={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},Ac=bc.global||bc.self||bc.window||{},Bc="object"!==("undefined"==typeof process?"undefined":mi()(process))||"[object process]"!==String(process)||process.browser,wc="function"==typeof importScripts,_c="undefined"!=typeof window&&void 0!==window.orientation,xc="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version),Cc=(xc&&parseFloat(xc[1]),function e(){h()(this,e)}),Oc=new Map;function Ec(e){gc(e.source&&!e.url||!e.source&&e.url);var t=Oc.get(e.source||e.url);return t||(e.url&&(t=function(e){if(!e.startsWith("http"))return e;return Tc((t=e,"try {\n importScripts('".concat(t,"');\n} catch (error) {\n console.error(error);\n throw error;\n}")));var t}(e.url),Oc.set(e.url,t)),e.source&&(t=Tc(e.source),Oc.set(e.source,t))),gc(t),t}function Tc(e){var t=new Blob([e],{type:"application/javascript"});return URL.createObjectURL(t)}function Sc(e){return!!e&&(e instanceof ArrayBuffer||("undefined"!=typeof MessagePort&&e instanceof MessagePort||("undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap||"undefined"!=typeof OffscreenCanvas&&e instanceof OffscreenCanvas)))}var kc=function(){},Mc=function(){function e(t){h()(this,e),Hn(this,"name",void 0),Hn(this,"source",void 0),Hn(this,"url",void 0),Hn(this,"terminated",!1),Hn(this,"worker",void 0),Hn(this,"onMessage",void 0),Hn(this,"onError",void 0),Hn(this,"_loadableURL","");var r=t.name,n=t.source,i=t.url;gc(n||i),this.name=r,this.source=n,this.url=i,this.onMessage=kc,this.onError=function(e){return console.log(e)},this.worker=Bc?this._createBrowserWorker():this._createNodeWorker()}return C()(e,[{key:"destroy",value:function(){this.onMessage=kc,this.onError=kc,this.worker.terminate(),this.terminated=!0}},{key:"isRunning",get:function(){return Boolean(this.onMessage)}},{key:"postMessage",value:function(e,t){t=t||function e(t){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2?arguments[2]:void 0,i=n||new Set;if(t){if(Sc(t))i.add(t);else if(Sc(t.buffer))i.add(t.buffer);else if(ArrayBuffer.isView(t));else if(r&&"object"===mi()(t))for(var a in t)e(t[a],r,i)}else;return void 0===n?Array.from(i):[]}(e),this.worker.postMessage(e,t)}},{key:"_getErrorFromErrorEvent",value:function(e){var t="Failed to load ";return t+="worker ".concat(this.name," from ").concat(this.url,". "),e.message&&(t+="".concat(e.message," in ")),e.lineno&&(t+=":".concat(e.lineno,":").concat(e.colno)),new Error(t)}},{key:"_createBrowserWorker",value:function(){var e=this;this._loadableURL=Ec({source:this.source,url:this.url});var t=new Worker(this._loadableURL,{name:this.name});return t.onmessage=function(t){t.data?e.onMessage(t.data):e.onError(new Error("No data received"))},t.onerror=function(t){e.onError(e._getErrorFromErrorEvent(t)),e.terminated=!0},t.onmessageerror=function(e){return console.error(e)},t}},{key:"_createNodeWorker",value:function(){var e,t=this;if(this.url){var r=this.url.includes(":/")||this.url.startsWith("/")?this.url:"./".concat(this.url);e=new Cc(r,{eval:!1})}else{if(!this.source)throw new Error("no worker");e=new Cc(this.source,{eval:!0})}return e.on("message",(function(e){t.onMessage(e)})),e.on("error",(function(e){t.onError(e)})),e.on("exit",(function(e){})),e}}],[{key:"isSupported",value:function(){return"undefined"!=typeof Worker&&Bc||!Bc}}]),e}(),Ic=function(){function e(t,r){var n=this;h()(this,e),Hn(this,"name",void 0),Hn(this,"workerThread",void 0),Hn(this,"isRunning",!0),Hn(this,"result",void 0),Hn(this,"_resolve",(function(){})),Hn(this,"_reject",(function(){})),this.name=t,this.workerThread=r,this.result=new Promise((function(e,t){n._resolve=e,n._reject=t}))}return C()(e,[{key:"postMessage",value:function(e,t){this.workerThread.postMessage({source:"loaders.gl",type:e,payload:t})}},{key:"done",value:function(e){gc(this.isRunning),this.isRunning=!1,this._resolve(e)}},{key:"error",value:function(e){gc(this.isRunning),this.isRunning=!1,this._reject(e)}}]),e}();function Pc(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Rc(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Pc(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Pc(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Fc=function(){function e(t){h()(this,e),Hn(this,"name","unnamed"),Hn(this,"source",void 0),Hn(this,"url",void 0),Hn(this,"maxConcurrency",1),Hn(this,"maxMobileConcurrency",1),Hn(this,"onDebug",(function(){})),Hn(this,"reuseWorkers",!0),Hn(this,"props",{}),Hn(this,"jobQueue",[]),Hn(this,"idleQueue",[]),Hn(this,"count",0),Hn(this,"isDestroyed",!1),this.source=t.source,this.url=t.url,this.setProps(t)}var t,r;return C()(e,[{key:"destroy",value:function(){this.idleQueue.forEach((function(e){return e.destroy()})),this.isDestroyed=!0}},{key:"setProps",value:function(e){this.props=Rc(Rc({},this.props),e),void 0!==e.name&&(this.name=e.name),void 0!==e.maxConcurrency&&(this.maxConcurrency=e.maxConcurrency),void 0!==e.maxMobileConcurrency&&(this.maxMobileConcurrency=e.maxMobileConcurrency),void 0!==e.reuseWorkers&&(this.reuseWorkers=e.reuseWorkers),void 0!==e.onDebug&&(this.onDebug=e.onDebug)}},{key:"startJob",value:(r=Me()(Pe.a.mark((function e(t){var r,n,i,a=this,o=arguments;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=o.length>1&&void 0!==o[1]?o[1]:function(e,t,r){return e.done(r)},n=o.length>2&&void 0!==o[2]?o[2]:function(e,t){return e.error(t)},i=new Promise((function(e){return a.jobQueue.push({name:t,onMessage:r,onError:n,onStart:e}),a})),this._startQueuedJob(),e.next=6,i;case 6:return e.abrupt("return",e.sent);case 7:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"_startQueuedJob",value:(t=Me()(Pe.a.mark((function e(){var t,r,n;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.jobQueue.length){e.next=2;break}return e.abrupt("return");case 2:if(t=this._getAvailableWorker()){e.next=5;break}return e.abrupt("return");case 5:if(!(r=this.jobQueue.shift())){e.next=18;break}return this.onDebug({message:"Starting job",name:r.name,workerThread:t,backlog:this.jobQueue.length}),n=new Ic(r.name,t),t.onMessage=function(e){return r.onMessage(n,e.type,e.payload)},t.onError=function(e){return r.onError(n,e)},r.onStart(n),e.prev=12,e.next=15,n.result;case 15:return e.prev=15,this.returnWorkerToQueue(t),e.finish(15);case 18:case"end":return e.stop()}}),e,this,[[12,,15,18]])}))),function(){return t.apply(this,arguments)})},{key:"returnWorkerToQueue",value:function(e){this.isDestroyed||!this.reuseWorkers||this.count>this._getMaxConcurrency()?(e.destroy(),this.count--):this.idleQueue.push(e),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 e="".concat(this.name.toLowerCase()," (#").concat(this.count," of ").concat(this.maxConcurrency,")");return new Mc({name:e,source:this.source,url:this.url})}return null}},{key:"_getMaxConcurrency",value:function(){return _c?this.maxMobileConcurrency:this.maxConcurrency}}],[{key:"isSupported",value:function(){return Mc.isSupported()}}]),e}();function Dc(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return Lc(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Lc(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function Lc(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function jc(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Gc(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?jc(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):jc(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Uc={maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:!0,onDebug:function(){}},Nc=function(){function e(t){h()(this,e),Hn(this,"props",void 0),Hn(this,"workerPools",new Map),this.props=Gc({},Uc),this.setProps(t),this.workerPools=new Map}return C()(e,[{key:"destroy",value:function(){var e,t=Dc(this.workerPools.values());try{for(t.s();!(e=t.n()).done;){e.value.destroy()}}catch(e){t.e(e)}finally{t.f()}this.workerPools=new Map}},{key:"setProps",value:function(e){this.props=Gc(Gc({},this.props),e);var t,r=Dc(this.workerPools.values());try{for(r.s();!(t=r.n()).done;){t.value.setProps(this._getWorkerPoolProps())}}catch(e){r.e(e)}finally{r.f()}}},{key:"getWorkerPool",value:function(e){var t=e.name,r=e.source,n=e.url,i=this.workerPools.get(t);return i||((i=new Fc({name:t,source:r,url:n})).setProps(this._getWorkerPoolProps()),this.workerPools.set(t,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 Mc.isSupported()}},{key:"getWorkerFarm",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e._workerFarm=e._workerFarm||new e({}),e._workerFarm.setProps(t),e._workerFarm}}]),e}();Hn(Nc,"_workerFarm",void 0);function Hc(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t[e.id]||{},n="".concat(e.id,"-worker.js"),i=r.workerUrl;if(i||"compression"!==e.id||(i=t.workerUrl),"test"===t._workerType&&(i="modules/".concat(e.module,"/dist/").concat(n)),!i){var a=e.version;"latest"===a&&(a="latest");var o=a?"@".concat(a):"";i="https://unpkg.com/@loaders.gl/".concat(e.module).concat(o,"/dist/").concat(n)}return gc(i),i}function Jc(e,t){return!!Nc.isSupported()&&(!!(Bc||null!=t&&t._nodeWorkers)&&(e.worker&&(null==t?void 0:t.worker)))}function Vc(e,t,r,n,i){return zc.apply(this,arguments)}function zc(){return(zc=Me()(Pe.a.mark((function e(t,r,n,i,a){var o,s,u,c,l,f;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=t.id,s=Hc(t,n),u=Nc.getWorkerFarm(n),c=u.getWorkerPool({name:o,url:s}),n=JSON.parse(JSON.stringify(n)),i=JSON.parse(JSON.stringify(i||{})),e.next=8,c.startJob("process-on-worker",Kc.bind(null,a));case 8:return(l=e.sent).postMessage("process",{input:r,options:n,context:i}),e.next=12,l.result;case 12:return f=e.sent,e.next=15,f.result;case 15:return e.abrupt("return",e.sent);case 16:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Kc(e,t,r,n){return qc.apply(this,arguments)}function qc(){return(qc=Me()(Pe.a.mark((function e(t,r,n,i){var a,o,s,u,c;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.t0=n,e.next="done"===e.t0?3:"error"===e.t0?5:"process"===e.t0?7:20;break;case 3:return r.done(i),e.abrupt("break",21);case 5:return r.error(new Error(i.error)),e.abrupt("break",21);case 7:return a=i.id,o=i.input,s=i.options,e.prev=8,e.next=11,t(o,s);case 11:u=e.sent,r.postMessage("done",{id:a,result:u}),e.next=19;break;case 15:e.prev=15,e.t1=e.catch(8),c=e.t1 instanceof Error?e.t1.message:"unknown error",r.postMessage("error",{id:a,error:c});case 19:return e.abrupt("break",21);case 20:console.warn("parse-with-worker unknown message ".concat(n));case 21:case"end":return e.stop()}}),e,null,[[8,15]])})))).apply(this,arguments)}var Xc=r(33),Qc=r.n(Xc);r(40);function Wc(e){return e&&"object"===mi()(e)&&e.isBuffer}function Zc(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return Yc(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Yc(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function Yc(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function $c(e){if(Wc(e))return Wc(t=e)?new Uint8Array(t.buffer,t.byteOffset,t.length).slice().buffer:t;var t;if(e instanceof ArrayBuffer)return e;if(ArrayBuffer.isView(e))return 0===e.byteOffset&&e.byteLength===e.buffer.byteLength?e.buffer:e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);if("string"==typeof e){var r=e;return(new TextEncoder).encode(r).buffer}if(e&&"object"===mi()(e)&&e._toArrayBuffer)return e._toArrayBuffer();throw new Error("toArrayBuffer")}function el(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n,i=t.map((function(e){return e instanceof ArrayBuffer?new Uint8Array(e):e})),a=i.reduce((function(e,t){return e+t.byteLength}),0),o=new Uint8Array(a),s=0,u=Zc(i);try{for(u.s();!(n=u.n()).done;){var c=n.value;o.set(c,s),s+=c.byteLength}}catch(e){u.e(e)}finally{u.f()}return o.buffer}function tl(e,t,r){var n=void 0!==r?new Uint8Array(e).subarray(t,t+r):new Uint8Array(e).subarray(t);return new Uint8Array(n).buffer}function rl(e){return nl.apply(this,arguments)}function nl(){return(nl=Me()(Pe.a.mark((function e(t){var r,n,i,a,o,s,u;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=[],n=!1,i=!1,e.prev=3,o=Qc()(t);case 5:return e.next=7,o.next();case 7:if(!(n=!(s=e.sent).done)){e.next=13;break}u=s.value,r.push(u);case 10:n=!1,e.next=5;break;case 13:e.next=19;break;case 15:e.prev=15,e.t0=e.catch(3),i=!0,a=e.t0;case 19:if(e.prev=19,e.prev=20,!n||null==o.return){e.next=24;break}return e.next=24,o.return();case 24:if(e.prev=24,!i){e.next=27;break}throw a;case 27:return e.finish(24);case 28:return e.finish(19);case 29:return e.abrupt("return",el.apply(void 0,r));case 30:case"end":return e.stop()}}),e,null,[[3,15,19,29],[20,,24,28]])})))).apply(this,arguments)}var il=Pe.a.mark(al);function al(e,t){var r,n,i,a,o;return Pe.a.wrap((function(s){for(;;)switch(s.prev=s.next){case 0:r=(null==t?void 0:t.chunkSize)||262144,n=0,i=new TextEncoder;case 3:if(!(n<e.length)){s.next=11;break}return a=Math.min(e.length-n,r),o=e.slice(n,n+a),n+=a,s.next=9,i.encode(o);case 9:s.next=3;break;case 11:case"end":return s.stop()}}),il)}var ol=Pe.a.mark(sl);function sl(e){var t,r,n,i,a,o,s,u=arguments;return Pe.a.wrap((function(c){for(;;)switch(c.prev=c.next){case 0:t=u.length>1&&void 0!==u[1]?u[1]:{},r=t.chunkSize,n=void 0===r?262144:r,i=0;case 3:if(!(i<e.byteLength)){c.next=14;break}return a=Math.min(e.byteLength-i,n),o=new ArrayBuffer(a),s=new Uint8Array(e,i,a),new Uint8Array(o).set(s),i+=a,c.next=12,o;case 12:c.next=3;break;case 14:case"end":return c.stop()}}),ol)}var ul=r(27),cl=r.n(ul),ll=r(32),fl=r.n(ll);function hl(){return(hl=fl()(Pe.a.mark((function e(t,r){var n,i,a,o;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=(null==r?void 0:r.chunkSize)||1048576,i=0;case 2:if(!(i<t.size)){e.next=12;break}return a=i+n,e.next=6,cl()(t.slice(i,a).arrayBuffer());case 6:return o=e.sent,i=a,e.next=10,o;case 10:e.next=2;break;case 12:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function dl(e,t){return tc?function(e,t){return pl.apply(this,arguments)}(e,t):function(e,t){return vl.apply(this,arguments)}(e,t)}function pl(){return(pl=fl()(Pe.a.mark((function e(t,r){var n,i,a,o,s,u;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=t.getReader(),e.prev=1;case 2:return a=i||n.read(),null!=r&&r._streamReadAhead&&(i=n.read()),e.next=7,cl()(a);case 7:if(o=e.sent,s=o.done,u=o.value,!s){e.next=12;break}return e.abrupt("return");case 12:return e.next=14,$c(u);case 14:e.next=2;break;case 16:e.next=21;break;case 18:e.prev=18,e.t0=e.catch(1),n.releaseLock();case 21:case"end":return e.stop()}}),e,null,[[1,18]])})))).apply(this,arguments)}function vl(){return(vl=fl()(Pe.a.mark((function e(t,r){var n,i,a,o,s,u;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=!1,i=!1,e.prev=2,o=Qc()(t);case 4:return e.next=6,cl()(o.next());case 6:if(!(n=!(s=e.sent).done)){e.next=13;break}return u=s.value,e.next=10,$c(u);case 10:n=!1,e.next=4;break;case 13:e.next=19;break;case 15:e.prev=15,e.t0=e.catch(2),i=!0,a=e.t0;case 19:if(e.prev=19,e.prev=20,!n||null==o.return){e.next=24;break}return e.next=24,cl()(o.return());case 24:if(e.prev=24,!i){e.next=27;break}throw a;case 27:return e.finish(24);case 28:return e.finish(19);case 29:case"end":return e.stop()}}),e,null,[[2,15,19,29],[20,,24,28]])})))).apply(this,arguments)}function yl(e,t){if("string"==typeof e)return al(e,t);if(e instanceof ArrayBuffer)return sl(e,t);if(Ys(e))return function(e,t){return hl.apply(this,arguments)}(e,t);if($s(e))return dl(e,t);if(Zs(e))return dl(e.body,t);throw new Error("makeIterator")}var gl="Cannot convert supplied data type";function ml(e,t,r){if(t.text&&"string"==typeof e)return e;var n;if((n=e)&&"object"===mi()(n)&&n.isBuffer&&(e=e.buffer),e instanceof ArrayBuffer){var i=e;return t.text&&!t.binary?new TextDecoder("utf8").decode(i):i}if(ArrayBuffer.isView(e)){if(t.text&&!t.binary)return new TextDecoder("utf8").decode(e);var a=e.buffer,o=e.byteLength||e.length;return 0===e.byteOffset&&o===a.byteLength||(a=a.slice(e.byteOffset,e.byteOffset+o)),a}throw new Error(gl)}function bl(e,t,r){return Al.apply(this,arguments)}function Al(){return(Al=Me()(Pe.a.mark((function e(t,r,n){var i,a;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=t instanceof ArrayBuffer||ArrayBuffer.isView(t),"string"!=typeof t&&!i){e.next=3;break}return e.abrupt("return",ml(t,r));case 3:if(!Ys(t)){e.next=7;break}return e.next=6,yu(t);case 6:t=e.sent;case 7:if(!Zs(t)){e.next=21;break}return a=t,e.next=11,mu(a);case 11:if(!r.binary){e.next=17;break}return e.next=14,a.arrayBuffer();case 14:e.t0=e.sent,e.next=20;break;case 17:return e.next=19,a.text();case 19:e.t0=e.sent;case 20:return e.abrupt("return",e.t0);case 21:if($s(t)&&(t=yl(t,n)),!Qs(t)&&!Ws(t)){e.next=24;break}return e.abrupt("return",rl(t));case 24:throw new Error(gl);case 25:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Bl(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function wl(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Bl(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Bl(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function _l(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(r)return r;var n=wl({fetch:hc(t,e)},e);return Array.isArray(n.loaders)||(n.loaders=null),n}function xl(e,t){if(!t&&e&&!Array.isArray(e))return e;var r;if(e&&(r=Array.isArray(e)?e:[e]),t&&t.loaders){var n=Array.isArray(t.loaders)?t.loaders:[t.loaders];r=r?[].concat(De()(r),De()(n)):n}return r&&r.length?r:null}function Cl(e){var t=e&&e.lastIndexOf("/");return t>=0?e.substr(t+1):""}function Ol(e){var t=e&&e.lastIndexOf("/");return t>=0?e.substr(0,t):""}function El(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n="/";return(t=t.map((function(e,r){return r&&(e=e.replace(new RegExp("^".concat(n)),"")),r!==t.length-1&&(e=e.replace(new RegExp("".concat(n,"$")),"")),e}))).join(n)}r(37),r(50);var Tl=new ea({id:"loaders.gl"});var Sl=function(){var e=cc();return e.loaderRegistry=e.loaderRegistry||[],e.loaderRegistry};function kl(){return Sl()}function Ml(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Il(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ml(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ml(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Pl(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return Rl(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Rl(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function Rl(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Fl=/\.([^.]+)$/;function Dl(e){return Ll.apply(this,arguments)}function Ll(){return(Ll=Me()(Pe.a.mark((function e(t){var r,n,i,a,o=arguments;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=o.length>1&&void 0!==o[1]?o[1]:[],n=o.length>2?o[2]:void 0,i=o.length>3?o[3]:void 0,Ul(t)){e.next=5;break}return e.abrupt("return",null);case 5:if(!(a=jl(t,r,Il(Il({},n),{},{nothrow:!0}),i))){e.next=8;break}return e.abrupt("return",a);case 8:if(!Ys(t)){e.next=13;break}return e.next=11,t.slice(0,10).arrayBuffer();case 11:t=e.sent,a=jl(t,r,n,i);case 13:if(a||null!=n&&n.nothrow){e.next=15;break}throw new Error(Nl(t));case 15:return e.abrupt("return",a);case 16:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function jl(e){var t=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(!Ul(e))return null;if(t&&!Array.isArray(t))return iu(t);var i,a=[];(t&&(a=a.concat(t)),null!=r&&r.ignoreRegisteredLoaders)||(i=a).push.apply(i,De()(kl()));Hl(a);var o=Gl(e,a,r,n);if(!(o||null!=r&&r.nothrow))throw new Error(Nl(e));return o}function Gl(e,t,r,n){var i,a=du(e),o=a.url,s=a.type,u=o||(null==n?void 0:n.url),c=null,l="";(null!=r&&r.mimeType&&(c=Jl(t,null==r?void 0:r.mimeType),l="match forced by supplied MIME type ".concat(null==r?void 0:r.mimeType)),c=c||function(e,t){var r=t&&Fl.exec(t),n=r&&r[1];return n?function(e,t){t=t.toLowerCase();var r,n=Pl(e);try{for(n.s();!(r=n.n()).done;){var i,a=r.value,o=Pl(a.extensions);try{for(o.s();!(i=o.n()).done;){if(i.value.toLowerCase()===t)return a}}catch(e){o.e(e)}finally{o.f()}}}catch(e){n.e(e)}finally{n.f()}return null}(e,n):null}(t,u),l=l||(c?"matched url ".concat(u):""),c=c||Jl(t,s),l=l||(c?"matched MIME type ".concat(s):""),c=c||function(e,t){if(!t)return null;var r,n=Pl(e);try{for(n.s();!(r=n.n()).done;){var i=r.value;if("string"==typeof t){if(Vl(t,i))return i}else if(ArrayBuffer.isView(t)){if(zl(t.buffer,t.byteOffset,i))return i}else if(t instanceof ArrayBuffer){if(zl(t,0,i))return i}}}catch(e){n.e(e)}finally{n.f()}return null}(t,e),l=l||(c?"matched initial data ".concat(Kl(e)):""),c=c||Jl(t,null==r?void 0:r.fallbackMimeType),l=l||(c?"matched fallback MIME type ".concat(s):""))&&Tl.log(1,"selectLoader selected ".concat(null===(i=c)||void 0===i?void 0:i.name,": ").concat(l,"."));return c}function Ul(e){return!(e instanceof Response&&204===e.status)}function Nl(e){var t=du(e),r=t.url,i=t.type,a="No valid loader found (";a+=r?"".concat(n.filename(r),", "):"no url provided, ",a+="MIME type: ".concat(i?'"'.concat(i,'"'):"not provided",", ");var o=e?Kl(e):"";return a+=o?' first bytes: "'.concat(o,'"'):"first bytes: not available",a+=")"}function Hl(e){var t,r=Pl(e);try{for(r.s();!(t=r.n()).done;){iu(t.value)}}catch(e){r.e(e)}finally{r.f()}}function Jl(e,t){var r,n=Pl(e);try{for(n.s();!(r=n.n()).done;){var i=r.value;if(i.mimeTypes&&i.mimeTypes.includes(t))return i;if(t==="application/x.".concat(i.id))return i}}catch(e){n.e(e)}finally{n.f()}return null}function Vl(e,t){return t.testText?t.testText(e):(Array.isArray(t.tests)?t.tests:[t.tests]).some((function(t){return e.startsWith(t)}))}function zl(e,t,r){return(Array.isArray(r.tests)?r.tests:[r.tests]).some((function(n){return function(e,t,r,n){if(n instanceof ArrayBuffer)return function(e,t,r){if(r=r||e.byteLength,e.byteLength<r||t.byteLength<r)return!1;for(var n=new Uint8Array(e),i=new Uint8Array(t),a=0;a<n.length;++a)if(n[a]!==i[a])return!1;return!0}(n,e,n.byteLength);switch(mi()(n)){case"function":return n(e,r);case"string":var i=ql(e,t,n.length);return n===i;default:return!1}}(e,t,r,n)}))}function Kl(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5;if("string"==typeof e)return e.slice(0,t);if(ArrayBuffer.isView(e))return ql(e.buffer,e.byteOffset,t);if(e instanceof ArrayBuffer){var r=0;return ql(e,r,t)}return""}function ql(e,t,r){if(e.byteLength<t+r)return"";for(var n=new DataView(e),i="",a=0;a<r;a++)i+=String.fromCharCode(n.getUint8(t+a));return i}function Xl(e,t,r,n){return Ql.apply(this,arguments)}function Ql(){return(Ql=Me()(Pe.a.mark((function e(t,r,n,i){var a,o,s,u;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return gc(!i||"object"===mi()(i)),!r||Array.isArray(r)||nu(r)||(i=void 0,n=r,r=void 0),e.next=4,t;case 4:return t=e.sent,n=n||{},a=du(t),o=a.url,s=xl(r,i),e.next=11,Dl(t,s,n);case 11:if(u=e.sent){e.next=14;break}return e.abrupt("return",null);case 14:return n=fc(n,u,s,o),i=_l({url:o,parse:Xl,loaders:s},n,i),e.next=18,Wl(u,t,n,i);case 18:return e.abrupt("return",e.sent);case 19:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Wl(e,t,r,n){return Zl.apply(this,arguments)}function Zl(){return(Zl=Me()(Pe.a.mark((function e(t,r,n,i){var a,o,s,u,c,l,f,h;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return mc(t),Zs(r)&&(o=(a=r).ok,s=a.redirected,u=a.status,c=a.statusText,l=a.type,f=a.url,h=Object.fromEntries(a.headers.entries()),i.response={headers:h,ok:o,redirected:s,status:u,statusText:c,type:l,url:f}),e.next=4,bl(r,t,n);case 4:if(r=e.sent,!t.parseTextSync||"string"!=typeof r){e.next=8;break}return n.dataType="text",e.abrupt("return",t.parseTextSync(r,n,i,t));case 8:if(!Jc(t,n)){e.next=12;break}return e.next=11,Vc(t,r,n,i,Xl);case 11:return e.abrupt("return",e.sent);case 12:if(!t.parseText||"string"!=typeof r){e.next=16;break}return e.next=15,t.parseText(r,n,i,t);case 15:return e.abrupt("return",e.sent);case 16:if(!t.parse){e.next=20;break}return e.next=19,t.parse(r,n,i,t);case 19:return e.abrupt("return",e.sent);case 20:throw gc(!t.parseSync),new Error("".concat(t.id," loader - no parser found and worker is disabled"));case 22:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Yl(e,t,r,n){return $l.apply(this,arguments)}function $l(){return($l=Me()(Pe.a.mark((function e(t,r,n,i){var a,o;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(Array.isArray(r)||nu(r)||(void 0,n=r,r=void 0),a=hc(n),o=t,"string"!=typeof t){e.next=7;break}return e.next=6,a(t);case 6:o=e.sent;case 7:if(!Ys(t)){e.next=11;break}return e.next=10,a(t);case 10:o=e.sent;case 11:return e.next=13,Xl(o,r,n);case 13:return e.abrupt("return",e.sent);case 14:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var ef=r(55),tf=r.n(ef),rf=r(56),nf=r.n(rf),af=r(57),of=r.n(af);function sf(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}Math.max(6378137,6378137,6356752.314245179);function uf(e){return e}new Tt;function cf(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:uf;return"longitude"in e?(t[0]=r(e.longitude),t[1]=r(e.latitude),t[2]=e.height):"x"in e?(t[0]=r(e.x),t[1]=r(e.y),t[2]=e.z):(t[0]=r(e[0]),t[1]=r(e[1]),t[2]=e[2]),t}function lf(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return cf(e,t,it._cartographicRadians?uf:st)}function ff(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:uf;return"longitude"in t?(t.longitude=r(e[0]),t.latitude=r(e[1]),t.height=e[2]):"x"in t?(t.x=r(e[0]),t.y=r(e[1]),t.z=e[2]):(t[0]=r(e[0]),t[1]=r(e[1]),t[2]=e[2]),t}function hf(e,t){return ff(e,t,it._cartographicRadians?uf:ut)}var df=new Tt,pf=new Tt,vf=new Tt;var yf=new Tt,gf={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"}},mf={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},bf={east:new Tt,north:new Tt,up:new Tt,west:new Tt,south:new Tt,down:new Tt},Af=new Tt,Bf=new Tt,wf=new Tt;function _f(e,t,r,n,i,a){var o,s,u,c=gf[t]&&gf[t][r];tt(c&&(!n||n===c));var l=yf.copy(i);if(ht(l.x,0,1e-14)&&ht(l.y,0,1e-14)){var f=Math.sign(l.z);o=Af.fromArray(mf[t]),"east"!==t&&"west"!==t&&o.scale(f),s=Bf.fromArray(mf[r]),"east"!==r&&"west"!==r&&s.scale(f),u=wf.fromArray(mf[n]),"east"!==n&&"west"!==n&&u.scale(f)}else{var h=bf.up,d=bf.east,p=bf.north;d.set(-l.y,l.x,0).normalize(),e.geodeticSurfaceNormal(l,h),p.copy(h).cross(d);var v=bf.west,y=bf.south;bf.down.copy(h).scale(-1),v.copy(d).scale(-1),y.copy(p).scale(-1),o=bf[t],s=bf[r],u=bf[n]}return a[0]=o.x,a[1]=o.y,a[2]=o.z,a[3]=0,a[4]=s.x,a[5]=s.y,a[6]=s.z,a[7]=0,a[8]=u.x,a[9]=u.y,a[10]=u.z,a[11]=0,a[12]=l.x,a[13]=l.y,a[14]=l.z,a[15]=1,a}var xf=new Tt,Cf=new Tt,Of=new Tt,Ef=new Tt,Tf=new Tt,Sf=new Tt,kf=function(){function e(){var t=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;nf()(this,e),sf(this,"radii",void 0),sf(this,"radiiSquared",void 0),sf(this,"radiiToTheFourth",void 0),sf(this,"oneOverRadii",void 0),sf(this,"oneOverRadiiSquared",void 0),sf(this,"minimumRadius",void 0),sf(this,"maximumRadius",void 0),sf(this,"centerToleranceSquared",en),sf(this,"squaredXOverSquaredZ",void 0),tt(t>=0),tt(r>=0),tt(n>=0),this.radii=new Tt(t,r,n),this.radiiSquared=new Tt(t*t,r*r,n*n),this.radiiToTheFourth=new Tt(t*t*t*t,r*r*r*r,n*n*n*n),this.oneOverRadii=new Tt(0===t?0:1/t,0===r?0:1/r,0===n?0:1/n),this.oneOverRadiiSquared=new Tt(0===t?0:1/(t*t),0===r?0:1/(r*r),0===n?0:1/(n*n)),this.minimumRadius=Math.min(t,r,n),this.maximumRadius=Math.max(t,r,n),0!==this.radiiSquared.z&&(this.squaredXOverSquaredZ=this.radiiSquared.x/this.radiiSquared.z),Object.freeze(this)}return of()(e,[{key:"equals",value:function(e){return this===e||Boolean(e&&this.radii.equals(e.radii))}},{key:"toString",value:function(){return this.radii.toString()}},{key:"cartographicToCartesian",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0],r=Cf,n=Of,i=tf()(e,3),a=i[2];this.geodeticSurfaceNormalCartographic(e,r),n.copy(this.radiiSquared).scale(r);var o=Math.sqrt(r.dot(n));return n.scale(1/o),r.scale(a),n.add(r),n.to(t)}},{key:"cartesianToCartographic",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];Sf.from(e);var r=this.scaleToGeodeticSurface(Sf,Ef);if(r){var n=this.geodeticSurfaceNormal(r,Cf),i=Tf;i.copy(Sf).subtract(r);var a=Math.atan2(n.y,n.x),o=Math.asin(n.z),s=Math.sign(pe(i,Sf))*he(i);return hf([a,o,s],t)}}},{key:"eastNorthUpToFixedFrame",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Wr;return _f(this,"east","north","up",e,t)}},{key:"localFrameToFixedFrame",value:function(e,t,r,n){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:new Wr;return _f(this,e,t,r,n,i)}},{key:"geocentricSurfaceNormal",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];return xf.from(e).normalize().to(t)}},{key:"geodeticSurfaceNormalCartographic",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0],r=lf(e),n=r[0],i=r[1],a=Math.cos(i);return xf.set(a*Math.cos(n),a*Math.sin(n),Math.sin(i)).normalize(),xf.to(t)}},{key:"geodeticSurfaceNormal",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];return xf.from(e).scale(this.oneOverRadiiSquared).normalize().to(t)}},{key:"scaleToGeodeticSurface",value:function(e,t){return function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],n=t.oneOverRadii,i=t.oneOverRadiiSquared,a=t.centerToleranceSquared;df.from(e);var o=df.x,s=df.y,u=df.z,c=n.x,l=n.y,f=n.z,h=o*o*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=pf;if(g.copy(e).scale(y),v<a)return g.to(r);var m=i.x,b=i.y,A=i.z,B=vf;B.set(g.x*m*2,g.y*b*2,g.z*A*2);var w,_,x,C,O=(1-y)*df.len()/(.5*B.len()),E=0;do{var T=(w=1/(1+(O-=E)*m))*w,S=(_=1/(1+O*b))*_,k=(x=1/(1+O*A))*x,M=T*w,I=S*_,P=k*x,R=h*M*m+d*I*b+p*P*A,F=-2*R;E=(C=h*T+d*S+p*k-1)/F}while(Math.abs(C)>tn);return df.scale([w,_,x]).to(r)}}(e,this,t)}},{key:"scaleToGeocentricSurface",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];Ef.from(e);var r=Ef.x,n=Ef.y,i=Ef.z,a=this.oneOverRadiiSquared,o=1/Math.sqrt(r*r*a.x+n*n*a.y+i*i*a.z);return Ef.multiplyScalar(o).to(t)}},{key:"transformPositionToScaledSpace",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];return Ef.from(e).scale(this.oneOverRadii).to(t)}},{key:"transformPositionFromScaledSpace",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];return Ef.from(e).scale(this.radii).to(t)}},{key:"getSurfaceNormalIntersectionWithZAxis",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[0,0,0];tt(ht(this.radii.x,this.radii.y,rn)),tt(this.radii.z>0),Ef.from(e);var n=Ef.z*(1-this.squaredXOverSquaredZ);if(!(Math.abs(n)>=this.radii.z-t))return Ef.set(0,0,n).to(r)}}]),e}();sf(kf,"WGS84",new kf(6378137,6378137,6356752.314245179));var Mf=function e(t,r,n){h()(this,e),Hn(this,"item",void 0),Hn(this,"previous",void 0),Hn(this,"next",void 0),this.item=t,this.previous=r,this.next=n},If=function(){function e(){h()(this,e),Hn(this,"head",null),Hn(this,"tail",null),Hn(this,"_length",0)}return C()(e,[{key:"length",get:function(){return this._length}},{key:"add",value:function(e){var t=new Mf(e,this.tail,null);return this.tail?(this.tail.next=t,this.tail=t):(this.head=t,this.tail=t),++this._length,t}},{key:"remove",value:function(e){e&&(e.previous&&e.next?(e.previous.next=e.next,e.next.previous=e.previous):e.previous?(e.previous.next=null,this.tail=e.previous):e.next?(e.next.previous=null,this.head=e.next):(this.head=null,this.tail=null),e.next=null,e.previous=null,--this._length)}},{key:"splice",value:function(e,t){e!==t&&(this.remove(t),this._insert(e,t))}},{key:"_insert",value:function(e,t){var r=e.next;e.next=t,this.tail===e?this.tail=t:r.previous=t,t.next=r,t.previous=e,++this._length}}]),e}();function Pf(e){return null!=e}var Rf=function(){function e(){h()(this,e),Hn(this,"_list",void 0),Hn(this,"_sentinel",void 0),Hn(this,"_trimTiles",void 0),this._list=new If,this._sentinel=this._list.add("sentinel"),this._trimTiles=!1}return C()(e,[{key:"reset",value:function(){this._list.splice(this._list.tail,this._sentinel)}},{key:"touch",value:function(e){var t=e._cacheNode;Pf(t)&&this._list.splice(this._sentinel,t)}},{key:"add",value:function(e,t,r){Pf(t._cacheNode)||(t._cacheNode=this._list.add(t),r&&r(e,t))}},{key:"unloadTile",value:function(e,t,r){var n=t._cacheNode;Pf(n)&&(this._list.remove(n),t._cacheNode=void 0,r&&r(e,t))}},{key:"unloadTiles",value:function(e,t){var r=this._trimTiles;this._trimTiles=!1;for(var n=this._list,i=1024*e.maximumMemoryUsage*1024,a=this._sentinel,o=n.head;o!==a&&(e.gpuMemoryUsageInBytes>i||r);){var s=o.item;o=o.next,this.unloadTile(e,s,t)}}},{key:"trim",value:function(){this._trimTiles=!0}}]),e}();function Ff(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return Df(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Df(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function Df(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Lf=new Tt,jf=new Tt,Gf=new Vr([new Lr,new Lr,new Lr,new Lr,new Lr,new Lr]);function Uf(e,t){var r=e.cameraDirection,n=e.cameraUp,i=e.height,a=e.distanceScales.metersPerUnit,o=Hf(e,e.center),s=kf.WGS84.eastNorthUpToFixedFrame(o),u=e.unprojectPosition(e.cameraPosition),c=kf.WGS84.cartographicToCartesian(u,new Tt),l=new Tt(s.transformAsVector(new Tt(r).scale(a))).normalize(),f=new Tt(s.transformAsVector(new Tt(n).scale(a))).normalize();return function(e){var t=e.getFrustumPlanes(),r=Nf(t.near,e.cameraPosition),n=Hf(e,r),i=Hf(e,e.cameraPosition,jf),a=0;for(var o in Gf.planes[a++].fromPointNormal(n,Lf.copy(n).subtract(i)),t)if("near"!==o){var s=Nf(t[o],r,jf),u=Hf(e,s,jf);Gf.planes[a++].fromPointNormal(u,Lf.copy(n).subtract(u))}}(e),{camera:{position:c,direction:l,up:f},viewport:e,topDownViewport:new(0,e.constructor)({longitude:e.longitude,latitude:e.latitude,height:i,width:e.width,bearing:e.bearing,zoom:e.zoom,pitch:0}),height:i,cullingVolume:Gf,frameNumber:t,sseDenominator:1.15}}function Nf(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Tt,n=e.normal.dot(t);return r.copy(e.normal).scale(e.distance-n).add(t),r}function Hf(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Tt,n=e.unprojectPosition(t);return kf.WGS84.cartographicToCartesian(n,r)}var Jf=new Tt;function Vf(e,t){if(e instanceof Rr){var r=function(e){e.getColumn(0,Jf);var t=e.getColumn(1),r=e.getColumn(2);return Jf.add(t).add(r).len()}(e.halfAxes);return Math.log2(6356752.314245179/(r+t[2]))}if(e instanceof Rt){var n=e.radius;return Math.log2(6356752.314245179/(n+t[2]))}if(e.width&&e.height){var i=e.width,a=e.height;return(Math.log2(6378137/i)+Math.log2(6378137/a))/2}return 1}function zf(e,t,r){var n=kf.WGS84.cartographicToCartesian([e.xmax,e.ymax,e.zmax],new Tt),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+t[2]))}var Kf=0,qf=1,Xf=3,Qf=4,Wf=5,Zf=1,Yf=2,$f="empty",eh="scenegraph",th="pointcloud",rh="mesh",nh="I3S",ih="TILES3D",ah="geometricError",oh=1;function sh(e){return null!=e}var uh=new Tt,ch=new Tt,lh=new Tt;function fh(e,t,r){if(eu(e,"3D Tile: boundingVolume must be defined"),e.box)return function(e,t,r){var n=new Tt(e[0],e[1],e[2]);t.transform(n,n);var i=[];if(10===e.length){var a=e.slice(3,6),o=new gr;o.fromArray(e,6);var s=new Tt([1,0,0]),u=new Tt([0,1,0]),c=new Tt([0,0,1]);s.transformByQuaternion(o),s.scale(a[0]),u.transformByQuaternion(o),u.scale(a[1]),c.transformByQuaternion(o),c.scale(a[2]),i=[].concat(De()(s.toArray()),De()(u.toArray()),De()(c.toArray()))}else i=[].concat(De()(e.slice(3,6)),De()(e.slice(6,9)),De()(e.slice(9,12)));var l=t.transformAsVector(i.slice(0,3)),f=t.transformAsVector(i.slice(3,6)),h=t.transformAsVector(i.slice(6,9)),d=new qt([l[0],l[1],l[2],f[0],f[1],f[2],h[0],h[1],h[2]]);if(sh(r))return r.center=n,r.halfAxes=d,r;return new Rr(n,d)}(e.box,t,r);if(e.region){var n=M()(e.region,6),i=n[0],a=n[1],o=n[2],s=n[3],u=n[4],c=n[5],l=kf.WGS84.cartographicToCartesian([ct(i),ct(s),u],ch),f=kf.WGS84.cartographicToCartesian([ct(o),ct(a),c],lh),h=(new Tt).addVectors(l,f).multiplyScalar(.5),d=(new Tt).subVectors(l,f).len()/2;return hh([h[0],h[1],h[2],d],new Wr)}if(e.sphere)return hh(e.sphere,t,r);throw new Error("3D Tile: boundingVolume must contain a sphere, region, or box")}function hh(e,t,r){var n=new Tt(e[0],e[1],e[2]);t.transform(n,n);var i=t.getScale(uh),a=Math.max(Math.max(i[0],i[1]),i[2]),o=e[3]*a;return sh(r)?(r.center=n,r.radius=o,r):new Rt(n,o)}new Tt,new Tt,new Wr,new Tt,new Tt,new Tt;function dh(e,t){if(e.dynamicScreenSpaceError&&e.dynamicScreenSpaceErrorComputedDensity){var r=e.dynamicScreenSpaceErrorComputedDensity,n=e.dynamicScreenSpaceErrorFactor;return function(e,t){var r=e*t;return 1-Math.exp(-r*r)}(t,r)*n}return 0}var ph=new Tt,vh=new Tt,yh=new Tt,gh=new Tt,mh=new Tt,bh=new Wr,Ah=new Wr;function Bh(e,t){var r=t.topDownViewport,n=e.header.mbs[1],i=e.header.mbs[0],a=e.header.mbs[2],o=e.header.mbs[3],s=De()(e.boundingVolume.center),u=r.unprojectPosition(r.cameraPosition);kf.WGS84.cartographicToCartesian(u,ph),vh.copy(ph).subtract(s).normalize(),kf.WGS84.eastNorthUpToFixedFrame(s,bh),Ah.copy(bh).invert(),yh.copy(ph).transform(Ah);var c=Math.sqrt(yh[0]*yh[0]+yh[1]*yh[1]),l=c*c/yh[2];gh.copy([yh[0],yh[1],l]);var f=gh.transform(bh).subtract(s).normalize(),h=vh.cross(f).normalize().scale(o).add(s),d=kf.WGS84.cartesianToCartographic(h),p=r.project([i,n,a]),v=r.project(d);return mh.copy(p).subtract(v).magnitude()}var wh=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;h()(this,e),Hn(this,"_map",new Map),Hn(this,"_array",void 0),Hn(this,"_length",void 0),this._array=new Array(t),this._length=t}return C()(e,[{key:"length",get:function(){return this._length},set:function(e){this._length=e,e>this._array.length&&(this._array.length=e)}},{key:"values",get:function(){return this._array}},{key:"get",value:function(e){return eu(e<this._array.length),this._array[e]}},{key:"set",value:function(e,t){eu(e>=0),e>=this.length&&(this.length=e+1),this._map.has(this._array[e])&&this._map.delete(this._array[e]),this._array[e]=t,this._map.set(t,e)}},{key:"delete",value:function(e){var t=this._map.get(e);t>=0&&(this._array.splice(t,1),this._map.delete(e),this.length--)}},{key:"peek",value:function(){return this._array[this._length-1]}},{key:"push",value:function(e){if(!this._map.has(e)){var t=this.length++;this._array[t]=e,this._map.set(e,t)}}},{key:"pop",value:function(){var e=this._array[--this.length];return this._map.delete(e),e}},{key:"reserve",value:function(e){eu(e>=0),e>this._array.length&&(this._array.length=e)}},{key:"resize",value:function(e){eu(e>=0),this.length=e}},{key:"trim",value:function(e){null==e&&(e=this.length),this._array.length=e}},{key:"reset",value:function(){this._array=[],this._map=new Map,this._length=0}},{key:"find",value:function(e){return this._map.has(e)}}]),e}();function _h(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return xh(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return xh(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function xh(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Ch(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Oh(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ch(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ch(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Eh={loadSiblings:!1,skipLevelOfDetail:!1,maximumScreenSpaceError:2,updateTransforms:!0,onTraversalEnd:function(){},viewportTraversersMap:{},basePath:""},Th=function(){function e(t){h()(this,e),Hn(this,"options",void 0),Hn(this,"root",void 0),Hn(this,"requestedTiles",void 0),Hn(this,"selectedTiles",void 0),Hn(this,"emptyTiles",void 0),Hn(this,"lastUpdate",(new Date).getTime()),Hn(this,"updateDebounceTime",1e3),Hn(this,"_traversalStack",void 0),Hn(this,"_emptyTraversalStack",void 0),Hn(this,"_frameNumber",void 0),this.options=Oh(Oh({},Eh),t),this._traversalStack=new wh,this._emptyTraversalStack=new wh,this._frameNumber=null,this.root=null,this.selectedTiles={},this.requestedTiles={},this.emptyTiles={}}return C()(e,[{key:"traversalFinished",value:function(e){return!0}},{key:"traverse",value:function(e,t,r){this.root=e,this.options=Oh(Oh({},this.options),r),this.reset(),this.updateTile(e,t),this._frameNumber=t.frameNumber,this.executeTraversal(e,t)}},{key:"reset",value:function(){this.requestedTiles={},this.selectedTiles={},this.emptyTiles={},this._traversalStack.reset(),this._emptyTraversalStack.reset()}},{key:"executeTraversal",value:function(e,t){var r=this._traversalStack;for(e._selectionDepth=1,r.push(e);r.length>0;){var n=r.pop(),i=!1;this.canTraverse(n,t)&&(this.updateChildTiles(n,t),i=this.updateAndPushChildren(n,t,r,n.hasRenderContent?n._selectionDepth+1:n._selectionDepth));var a=n.parent,o=Boolean(!a||a._shouldRefine),s=!i;n.hasRenderContent?n.refine===Zf?(this.loadTile(n,t),this.selectTile(n,t)):n.refine===Yf&&(this.loadTile(n,t),s&&this.selectTile(n,t)):(this.emptyTiles[n.id]=n,this.loadTile(n,t),s&&this.selectTile(n,t)),this.touchTile(n,t),n._shouldRefine=i&&o}var u=(new Date).getTime();(this.traversalFinished(t)||u-this.lastUpdate>this.updateDebounceTime)&&(this.lastUpdate=u,this.options.onTraversalEnd(t))}},{key:"updateChildTiles",value:function(e,t){var r,n=_h(e.children);try{for(n.s();!(r=n.n()).done;){var i=r.value;this.updateTile(i,t)}}catch(e){n.e(e)}finally{n.f()}return!0}},{key:"updateAndPushChildren",value:function(e,t,r,n){var i=this.options,a=i.loadSiblings,o=i.skipLevelOfDetail,s=e.children;s.sort(this.compareDistanceToCamera.bind(this));var u,c=e.refine===Yf&&e.hasRenderContent&&!o,l=!1,f=!0,h=_h(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||a)&&(this.loadTile(d,t),this.touchTile(d,t)),c){var p=void 0;if(p=!!d._inRequestVolume&&(d.hasRenderContent?d.contentAvailable:this.executeEmptyTraversal(d,t)),!(f=f&&p))return!1}}}catch(e){h.e(e)}finally{h.f()}return l||(f=!1),f}},{key:"updateTile",value:function(e,t){this.updateTileVisibility(e,t)}},{key:"selectTile",value:function(e,t){this.shouldSelectTile(e)&&(e._selectedFrame=t.frameNumber,this.selectedTiles[e.id]=e)}},{key:"loadTile",value:function(e,t){this.shouldLoadTile(e)&&(e._requestedFrame=t.frameNumber,e._priority=e._getPriority(),this.requestedTiles[e.id]=e)}},{key:"touchTile",value:function(e,t){e.tileset._cache.touch(e),e._touchedFrame=t.frameNumber}},{key:"canTraverse",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return!!e.hasChildren&&(e.hasTilesetContent?!e.contentExpired:!(!n&&!e.isVisibleAndInRequestVolume)&&this.shouldRefine(e,t,r))}},{key:"shouldLoadTile",value:function(e){return e.hasUnloadedContent||e.contentExpired}},{key:"shouldSelectTile",value:function(e){return e.contentAvailable&&!this.options.skipLevelOfDetail}},{key:"shouldRefine",value:function(e,t,r){var n=e._screenSpaceError;return r&&(n=e.getScreenSpaceError(t,!0)),n>this.options.maximumScreenSpaceError}},{key:"updateTileVisibility",value:function(e,t){var r=[];if(this.options.viewportTraversersMap)for(var n in this.options.viewportTraversersMap){this.options.viewportTraversersMap[n]===t.viewport.id&&r.push(n)}else r.push(t.viewport.id);e.updateVisibility(t,r)}},{key:"compareDistanceToCamera",value:function(e,t){return e._distanceToCamera-t._distanceToCamera}},{key:"anyChildrenVisible",value:function(e,t){var r,n=!1,i=_h(e.children);try{for(i.s();!(r=i.n()).done;){var a=r.value;a.updateVisibility(t),n=n||a.isVisibleAndInRequestVolume}}catch(e){i.e(e)}finally{i.f()}return n}},{key:"executeEmptyTraversal",value:function(e,t){var r=!0,n=this._emptyTraversalStack;for(n.push(e);n.length>0&&r;){var i=n.pop();if(this.updateTile(i,t),i.isVisibleAndInRequestVolume||this.loadTile(i,t),this.touchTile(i,t),!i.hasRenderContent&&this.canTraverse(i,t,!1,!0)){var a,o=_h(i.children);try{for(o.s();!(a=o.n()).done;){var s=a.value;n.find(s)&&n.delete(s),n.push(s)}}catch(e){o.e(e)}finally{o.f()}}else i.contentAvailable||(r=!1)}return r}}]),e}();function Sh(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function kh(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Sh(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Sh(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Mh=new Tt;var Ih=function(){function e(t,r,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";h()(this,e),Hn(this,"tileset",void 0),Hn(this,"header",void 0),Hn(this,"id",void 0),Hn(this,"url",void 0),Hn(this,"parent",void 0),Hn(this,"refine",void 0),Hn(this,"type",void 0),Hn(this,"contentUrl",void 0),Hn(this,"lodMetricType",void 0),Hn(this,"lodMetricValue",void 0),Hn(this,"boundingVolume",void 0),Hn(this,"content",void 0),Hn(this,"contentState",void 0),Hn(this,"gpuMemoryUsageInBytes",void 0),Hn(this,"children",void 0),Hn(this,"depth",void 0),Hn(this,"viewportIds",void 0),Hn(this,"transform",void 0),Hn(this,"extensions",void 0),Hn(this,"userData",void 0),Hn(this,"computedTransform",void 0),Hn(this,"hasEmptyContent",void 0),Hn(this,"hasTilesetContent",void 0),Hn(this,"traverser",void 0),Hn(this,"_cacheNode",void 0),Hn(this,"_frameNumber",void 0),Hn(this,"_lodJudge",void 0),Hn(this,"_expireDate",void 0),Hn(this,"_expiredContent",void 0),Hn(this,"_shouldRefine",void 0),Hn(this,"_distanceToCamera",void 0),Hn(this,"_centerZDepth",void 0),Hn(this,"_screenSpaceError",void 0),Hn(this,"_visibilityPlaneMask",void 0),Hn(this,"_visible",void 0),Hn(this,"_inRequestVolume",void 0),Hn(this,"_stackLength",void 0),Hn(this,"_selectionDepth",void 0),Hn(this,"_touchedFrame",void 0),Hn(this,"_visitedFrame",void 0),Hn(this,"_selectedFrame",void 0),Hn(this,"_requestedFrame",void 0),Hn(this,"_priority",void 0),Hn(this,"_contentBoundingVolume",void 0),Hn(this,"_viewerRequestVolume",void 0),Hn(this,"_initialTransform",void 0),this.header=r,this.tileset=t,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=Kf,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 Th({}),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 Wr,this.transform=new Wr,this._initializeLodMetric(r),this._initializeTransforms(r),this._initializeBoundingVolumes(r),this._initializeContent(r),this._initializeRenderingState(r),this._lodJudge=null,this._expireDate=null,this._expiredContent=null,Object.seal(this)}var t;return C()(e,[{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===Xf||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===Kf}},{key:"contentExpired",get:function(){return this.contentState===Qf}},{key:"contentFailed",get:function(){return this.contentState===Wf}},{key:"getScreenSpaceError",value:function(e,t){switch(this.tileset.type){case nh:return Bh(this,e);case ih:return function(e,t,r){var n=e.tileset,i=e.parent&&e.parent.lodMetricValue||e.lodMetricValue,a=r?i:e.lodMetricValue;if(0===a)return 0;var o=Math.max(e._distanceToCamera,1e-7),s=t.height,u=t.sseDenominator,c=a*s*(n.options.viewDistanceScale||1)/(o*u);return c-=dh(n,o)}(this,e,t);default:throw new Error("Unsupported tileset type")}}},{key:"unselect",value:function(){this._selectedFrame=0}},{key:"_getPriority",value:function(){var e=this.tileset._traverser,t=e.options.skipLevelOfDetail,r=this.refine===Zf||t;if(r&&!this.isVisible&&void 0!==this._visible)return-1;if(this.tileset._frameNumber-this._touchedFrame>=1)return-1;if(this.contentState===Kf)return-1;var n=this.parent,i=n&&(!r||0===this._screenSpaceError||n.hasTilesetContent)?n._screenSpaceError:this._screenSpaceError,a=e.root?e.root._screenSpaceError:0;return Math.max(a-i,0)}},{key:"loadContent",value:(t=Me()(Pe.a.mark((function e(){var t,r,n,i;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.hasEmptyContent){e.next=2;break}return e.abrupt("return",!1);case 2:if(!this.content){e.next=4;break}return e.abrupt("return",!0);case 4:return this.contentExpired&&(this._expireDate=null),this.contentState=qf,e.next=9,this.tileset._requestScheduler.scheduleRequest(this.id,this._getPriority.bind(this));case 9:if(t=e.sent){e.next=13;break}return this.contentState=Kf,e.abrupt("return",!1);case 13:return e.prev=13,r=this.tileset.getTileUrl(this.contentUrl),n=this.tileset.loader,i=kh(kh({},this.tileset.loadOptions),{},A()({},n.id,kh(kh({},this.tileset.loadOptions[n.id]),{},{isTileset:"json"===this.type},this._getLoaderSpecificOptions(n.id)))),e.next=19,Yl(r,n,i);case 19:if(this.content=e.sent,!this.tileset.options.contentLoader){e.next=23;break}return e.next=23,this.tileset.options.contentLoader(this);case 23:return this._isTileset()&&this.tileset._initializeTileHeaders(this.content,this),this.contentState=Xf,this._onContentLoaded(),e.abrupt("return",!0);case 29:throw e.prev=29,e.t0=e.catch(13),this.contentState=Wf,e.t0;case 33:return e.prev=33,t.done(),e.finish(33);case 36:case"end":return e.stop()}}),e,this,[[13,29,33,36]])}))),function(){return t.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=Kf,!0}},{key:"updateVisibility",value:function(e,t){if(this._frameNumber!==e.frameNumber){var r=this.parent,n=r?r._visibilityPlaneMask:Vr.MASK_INDETERMINATE;if(this.tileset._traverser.options.updateTransforms){var i=r?r.computedTransform:this.tileset.modelMatrix;this._updateTransform(i)}this._distanceToCamera=this.distanceToTile(e),this._screenSpaceError=this.getScreenSpaceError(e,!1),this._visibilityPlaneMask=this.visibility(e,n),this._visible=this._visibilityPlaneMask!==Vr.MASK_OUTSIDE,this._inRequestVolume=this.insideViewerRequestVolume(e),this._frameNumber=e.frameNumber,this.viewportIds=t}}},{key:"visibility",value:function(e,t){var r=e.cullingVolume,n=this.boundingVolume;return r.computeVisibilityWithPlaneMask(n,t)}},{key:"contentVisibility",value:function(){return!0}},{key:"distanceToTile",value:function(e){var t=this.boundingVolume;return Math.sqrt(Math.max(t.distanceSquaredTo(e.camera.position),0))}},{key:"cameraSpaceZDepth",value:function(e){var t=e.camera,r=this.boundingVolume;return Mh.subVectors(r.center,t.position),t.direction.dot(Mh)}},{key:"insideViewerRequestVolume",value:function(e){var t=this._viewerRequestVolume;return!t||t.distanceSquaredTo(e.camera.position)<=0}},{key:"updateExpiration",value:function(){if(null!=this._expireDate&&this.contentReady&&!this.hasEmptyContent){var e=Date.now();Date.lessThan(this._expireDate,e)&&(this.contentState=Qf,this._expiredContent=this.content)}}},{key:"extras",get:function(){return this.header.extras}},{key:"_initializeLodMetric",value:function(e){"lodMetricType"in e?this.lodMetricType=e.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 e?this.lodMetricValue=e.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(e){this.transform=e.transform?new Wr(e.transform):new Wr;var t=this.parent,r=this.tileset,n=t&&t.computedTransform?t.computedTransform.clone():r.modelMatrix.clone();this.computedTransform=new Wr(n).multiplyRight(this.transform);var i=t&&t._initialTransform?t._initialTransform.clone():new Wr;this._initialTransform=new Wr(i).multiplyRight(this.transform)}},{key:"_initializeBoundingVolumes",value:function(e){this._contentBoundingVolume=null,this._viewerRequestVolume=null,this._updateBoundingVolume(e)}},{key:"_initializeContent",value:function(e){this.content={_tileset:this.tileset,_tile:this},this.hasEmptyContent=!0,this.contentState=Kf,this.hasTilesetContent=!1,e.contentUrl&&(this.content=null,this.hasEmptyContent=!1)}},{key:"_initializeRenderingState",value:function(e){this.depth=e.level||(this.parent?this.parent.depth+1:0),this._shouldRefine=!1,this._distanceToCamera=0,this._centerZDepth=0,this._screenSpaceError=0,this._visibilityPlaneMask=Vr.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(e){return e||this.parent&&this.parent.refine||Yf}},{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(e){this.boundingVolume=fh(e.boundingVolume,this.computedTransform,this.boundingVolume);var t=e.content;t&&(t.boundingVolume&&(this._contentBoundingVolume=fh(t.boundingVolume,this.computedTransform,this._contentBoundingVolume)),e.viewerRequestVolume&&(this._viewerRequestVolume=fh(e.viewerRequestVolume,this.computedTransform,this._viewerRequestVolume)))}},{key:"_updateTransform",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Wr,t=e.clone().multiplyRight(this.transform),r=!t.equals(this.computedTransform);r&&(this.computedTransform=t,this._updateBoundingVolume(this.header))}},{key:"_getLoaderSpecificOptions",value:function(e){switch(e){case"i3s":return kh(kh({},this.tileset.options.i3s),{},{tile:this.header,tileset:this.tileset.tileset,isTileHeader:!1});case"3d-tiles":case"cesium-ion":default:return{assetGltfUpAxis:(t=this.tileset.tileset).asset&&t.asset.gltfUpAxis||"Y"}}var t}}]),e}();function Ph(e){var t=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(e){return!1}}();return function(){var r,n=m()(e);if(t){var i=m()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return y()(this,r)}}var Rh=function(e){p()(r,e);var t=Ph(r);function r(){return h()(this,r),t.apply(this,arguments)}return C()(r,[{key:"compareDistanceToCamera",value:function(e,t){return 0===t._distanceToCamera&&0===e._distanceToCamera?t._centerZDepth-e._centerZDepth:t._distanceToCamera-e._distanceToCamera}},{key:"updateTileVisibility",value:function(e,t){if(ci()(m()(r.prototype),"updateTileVisibility",this).call(this,e,t),e.isVisibleAndInRequestVolume){var n=e.children.length>0;if(e.hasTilesetContent&&n){var i=e.children[0];return this.updateTileVisibility(i,t),void(e._visible=i._visible)}if(this.meetsScreenSpaceErrorEarly(e,t))e._visible=!1;else{var a=e.refine===Yf,o=e._optimChildrenWithinParent===oh;a&&o&&n&&!this.anyChildrenVisible(e,t)&&(e._visible=!1)}}}},{key:"meetsScreenSpaceErrorEarly",value:function(e,t){var r=e.parent;return!(!r||r.hasTilesetContent||r.refine!==Zf)&&!this.shouldRefine(e,t,!0)}}]),r}(Th),Fh=function(){function e(){h()(this,e),Hn(this,"frameNumberMap",new Map)}return C()(e,[{key:"register",value:function(e,t){var r=this.frameNumberMap.get(e)||new Map,n=r.get(t)||0;r.set(t,n+1),this.frameNumberMap.set(e,r)}},{key:"deregister",value:function(e,t){var r=this.frameNumberMap.get(e);if(r){var n=r.get(t)||1;r.set(t,n-1)}}},{key:"isZero",value:function(e,t){var r;return 0===((null===(r=this.frameNumberMap.get(e))||void 0===r?void 0:r.get(t))||0)}}]),e}(),Dh="REQUESTED",Lh="COMPLETED",jh="ERROR",Gh=function(){function e(){h()(this,e),Hn(this,"_statusMap",void 0),Hn(this,"pendingTilesRegister",new Fh),this._statusMap={}}return C()(e,[{key:"add",value:function(e,t,r,n){var i=this;if(!this._statusMap[t]){var a=n.frameNumber,o=n.viewport.id;this._statusMap[t]={request:e,callback:r,key:t,frameState:n,status:Dh},this.pendingTilesRegister.register(o,a),e().then((function(e){i._statusMap[t].status=Lh;var r=i._statusMap[t].frameState,a=r.frameNumber,o=r.viewport.id;i.pendingTilesRegister.deregister(o,a),i._statusMap[t].callback(e,n)})).catch((function(e){i._statusMap[t].status=jh;var n=i._statusMap[t].frameState,a=n.frameNumber,o=n.viewport.id;i.pendingTilesRegister.deregister(o,a),r(e)}))}}},{key:"update",value:function(e,t){if(this._statusMap[e]){var r=this._statusMap[e].frameState,n=r.frameNumber,i=r.viewport.id;this.pendingTilesRegister.deregister(i,n);var a=t.frameNumber,o=t.viewport.id;this.pendingTilesRegister.register(o,a),this._statusMap[e].frameState=t}}},{key:"find",value:function(e){return this._statusMap[e]}},{key:"hasPendingTiles",value:function(e,t){return!this.pendingTilesRegister.isZero(e,t)}}]),e}();function Uh(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Nh(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Uh(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Uh(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Hh(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return Jh(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Jh(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function Jh(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Vh(e){var t=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(e){return!1}}();return function(){var r,n=m()(e);if(t){var i=m()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return y()(this,r)}}var zh=function(e){p()(n,e);var t,r=Vh(n);function n(e){var t;return h()(this,n),t=r.call(this,e),Hn(yi()(t),"_tileManager",void 0),t._tileManager=new Gh,t}return C()(n,[{key:"traversalFinished",value:function(e){return!this._tileManager.hasPendingTiles(e.viewport.id,this._frameNumber||0)}},{key:"shouldRefine",value:function(e,t){return e._lodJudge=function(e,t){if(0===e.lodMetricValue||isNaN(e.lodMetricValue))return"DIG";var r=2*Bh(e,t);return r<2?"OUT":!e.header.children||r<=e.lodMetricValue?"DRAW":e.header.children?"DIG":"OUT"}(e,t),"DIG"===e._lodJudge}},{key:"updateChildTiles",value:function(e,t){var r,n=this,i=e.header.children||[],a=e.children,o=e.tileset,s=Hh(i);try{var u=function(){var i=r.value,s="".concat(i.id,"-").concat(t.viewport.id),u=a&&a.find((function(e){return e.id===s}));if(u)u&&n.updateTile(u,t);else{var c=function(){return n._loadTile(i.id,o)};n._tileManager.find(s)?n._tileManager.update(s,t):(o.tileset.nodePages&&(c=function(){return o.tileset.nodePagesTile.formTileFromNodePages(i.id)}),n._tileManager.add(c,s,(function(t){return n._onTileLoad(t,e,s)}),t))}};for(s.s();!(r=s.n()).done;)u()}catch(e){s.e(e)}finally{s.f()}return!1}},{key:"_loadTile",value:(t=Me()(Pe.a.mark((function e(t,r){var n,i,a;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=r.loader,i=r.getTileUrl("".concat(r.url,"/nodes/").concat(t)),a=Nh(Nh({},r.loadOptions),{},{i3s:Nh(Nh({},r.loadOptions.i3s),{},{isTileHeader:!0,loadContent:!1})}),e.next=5,Yl(i,n,a);case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e)}))),function(e,r){return t.apply(this,arguments)})},{key:"_onTileLoad",value:function(e,t,r){var n=new Ih(t.tileset,e,t,r);t.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}(Th);function Kh(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return qh(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return qh(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function qh(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Xh(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Qh(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Xh(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Xh(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Wh={description:"",ellipsoid:kf.WGS84,modelMatrix:new Wr,throttleRequests:!0,maxRequests:64,maximumMemoryUsage:32,maximumTilesSelected:0,debounceTime:0,onTileLoad:function(){},onTileUnload:function(){},onTileError:function(){},onTraversalComplete:function(e){return e},contentLoader:void 0,viewDistanceScale:1,maximumScreenSpaceError:8,loadTiles:!0,updateTransforms:!0,viewportTraversersMap:null,loadOptions:{fetch:{}},attributions:[],basePath:"",i3s:{}},Zh="Tiles In Tileset(s)",Yh=function(){function e(t,r){h()(this,e),Hn(this,"options",void 0),Hn(this,"loadOptions",void 0),Hn(this,"type",void 0),Hn(this,"tileset",void 0),Hn(this,"loader",void 0),Hn(this,"url",void 0),Hn(this,"basePath",void 0),Hn(this,"modelMatrix",void 0),Hn(this,"ellipsoid",void 0),Hn(this,"lodMetricType",void 0),Hn(this,"lodMetricValue",void 0),Hn(this,"refine",void 0),Hn(this,"root",void 0),Hn(this,"roots",void 0),Hn(this,"asset",void 0),Hn(this,"description",void 0),Hn(this,"properties",void 0),Hn(this,"extras",void 0),Hn(this,"attributions",void 0),Hn(this,"credits",void 0),Hn(this,"stats",void 0),Hn(this,"traverseCounter",void 0),Hn(this,"geometricError",void 0),Hn(this,"selectedTiles",void 0),Hn(this,"updatePromise",null),Hn(this,"tilesetInitializationPromise",void 0),Hn(this,"cartographicCenter",void 0),Hn(this,"cartesianCenter",void 0),Hn(this,"zoom",void 0),Hn(this,"boundingVolume",void 0),Hn(this,"gpuMemoryUsageInBytes",void 0),Hn(this,"dynamicScreenSpaceErrorComputedDensity",void 0),Hn(this,"_traverser",void 0),Hn(this,"_cache",void 0),Hn(this,"_requestScheduler",void 0),Hn(this,"_frameNumber",void 0),Hn(this,"_queryParamsString",void 0),Hn(this,"_queryParams",void 0),Hn(this,"_extensionsUsed",void 0),Hn(this,"_tiles",void 0),Hn(this,"_pendingCount",void 0),Hn(this,"lastUpdatedVieports",void 0),Hn(this,"_requestedTiles",void 0),Hn(this,"_emptyTiles",void 0),Hn(this,"frameStateData",void 0),Hn(this,"maximumMemoryUsage",void 0),eu(t),this.options=Qh(Qh({},Wh),r),this.tileset=t,this.loader=t.loader,this.type=t.type,this.url=t.url,this.basePath=t.basePath||n.dirname(this.url),this.modelMatrix=this.options.modelMatrix,this.ellipsoid=this.options.ellipsoid,this.lodMetricType=t.lodMetricType,this.lodMetricValue=t.lodMetricValue,this.refine=t.root.refine,this.loadOptions=this.options.loadOptions||{},this.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 Rf,this._requestScheduler=new Wn({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 zn({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(t)}var t,r,i;return C()(e,[{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(e){for(var t=[],r=0,n=Object.keys(e);r<n.length;r++){var i=n[r];t.push("".concat(i,"=").concat(e[i]))}switch(t.length){case 0:return"";case 1:return"?".concat(t[0]);default:return"?".concat(t.join("&"))}}(this._queryParams)),this._queryParamsString}},{key:"setProps",value:function(e){this.options=Qh(Qh({},this.options),e)}},{key:"setOptions",value:function(e){this.options=Qh(Qh({},this.options),e)}},{key:"getTileUrl",value:function(e){return e.startsWith("data:")?e:"".concat(e).concat(this.queryParams)}},{key:"hasExtension",value:function(e){return Boolean(this._extensionsUsed&&this._extensionsUsed.indexOf(e)>-1)}},{key:"update",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this.tilesetInitializationPromise.then((function(){!t&&e.lastUpdatedVieports?t=e.lastUpdatedVieports:e.lastUpdatedVieports=t,t&&e.doUpdate(t)}))}},{key:"selectTiles",value:(i=Me()(Pe.a.mark((function e(){var t,r=this,n=arguments;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=n.length>0&&void 0!==n[0]?n[0]:null,e.next=3,this.tilesetInitializationPromise;case 3:return t&&(this.lastUpdatedVieports=t),this.updatePromise||(this.updatePromise=new Promise((function(e){setTimeout((function(){r.lastUpdatedVieports&&r.doUpdate(r.lastUpdatedVieports),e(r._frameNumber),r.updatePromise=null}),r.options.debounceTime)}))),e.abrupt("return",this.updatePromise);case 6:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"doUpdate",value:function(e){if((!("loadTiles"in this.options)||this.options.loadTiles)&&!(this.traverseCounter>0)){var t=e instanceof Array?e:[e];this._cache.reset(),this._frameNumber++,this.traverseCounter=t.length;var r,n=[],i=Kh(t);try{for(i.s();!(r=i.n()).done;){var a=r.value.id;this._needTraverse(a)?n.push(a):this.traverseCounter--}}catch(e){i.e(e)}finally{i.f()}var o,s=Kh(t);try{for(s.s();!(o=s.n()).done;){var u=o.value,c=u.id;if(this.roots[c]||(this.roots[c]=this._initializeTileHeaders(this.tileset,null)),n.includes(c)){var l=Uf(u,this._frameNumber);this._traverser.traverse(this.roots[c],l,this.options)}}}catch(e){s.e(e)}finally{s.f()}}}},{key:"_needTraverse",value:function(e){var t=e;return this.options.viewportTraversersMap&&(t=this.options.viewportTraversersMap[e]),t===e}},{key:"_onTraversalEnd",value:function(e){var t=e.viewport.id;this.frameStateData[t]||(this.frameStateData[t]={selectedTiles:[],_requestedTiles:[],_emptyTiles:[]});var r=this.frameStateData[t],n=function(e,t,r){if(0===r||e.length<=r)return[e,[]];var n,i=[],a=t.viewport,o=a.longitude,s=a.latitude,u=Ff(e.entries());try{for(u.s();!(n=u.n()).done;){var c=M()(n.value,2),l=c[0],f=c[1],h=M()(f.header.mbs,2),d=h[0],p=h[1],v=Math.abs(o-d),y=Math.abs(s-p),g=Math.sqrt(y*y+v*v);i.push([l,g])}}catch(e){u.e(e)}finally{u.f()}for(var m=i.sort((function(e,t){return e[1]-t[1]})),b=[],A=0;A<r;A++)b.push(e[m[A][0]]);for(var B=[],w=r;w<m.length;w++)B.push(e[m[w][0]]);return[b,B]}(Object.values(this._traverser.selectedTiles),e,this.options.maximumTilesSelected),i=M()(n,2),a=i[0],o=i[1];r.selectedTiles=a;var s,u=Kh(o);try{for(u.s();!(s=u.n()).done;){s.value.unselect()}}catch(e){u.e(e)}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 e in this.selectedTiles=[],this._requestedTiles=[],this._emptyTiles=[],this.frameStateData){var t=this.frameStateData[e];this.selectedTiles=this.selectedTiles.concat(t.selectedTiles),this._requestedTiles=this._requestedTiles.concat(t._requestedTiles),this._emptyTiles=this._emptyTiles.concat(t._emptyTiles)}this.selectedTiles=this.options.onTraversalComplete(this.selectedTiles);var r,n=Kh(this.selectedTiles);try{for(n.s();!(r=n.n()).done;){var i=r.value;this._tiles[i.id]=i}}catch(e){n.e(e)}finally{n.f()}this._loadTiles(),this._unloadTiles(),this._updateStats()}},{key:"_tilesChanged",value:function(e,t){if(e.length!==t.length)return!0;var r=new Set(e.map((function(e){return e.id}))),n=new Set(t.map((function(e){return e.id}))),i=e.filter((function(e){return!n.has(e.id)})).length>0;return i=i||t.filter((function(e){return!r.has(e.id)})).length>0}},{key:"_loadTiles",value:function(){var e,t=Kh(this._requestedTiles);try{for(t.s();!(e=t.n()).done;){var r=e.value;r.contentUnloaded&&this._loadTile(r)}}catch(e){t.e(e)}finally{t.f()}}},{key:"_unloadTiles",value:function(){this._cache.unloadTiles(this,(function(e,t){return e._unloadTile(t)}))}},{key:"_updateStats",value:function(){var e,t=0,r=0,n=Kh(this.selectedTiles);try{for(n.s();!(e=n.n()).done;){var i=e.value;i.contentAvailable&&i.content&&(t++,i.content.pointCount?r+=i.content.pointCount:r+=i.content.vertexCount)}}catch(e){n.e(e)}finally{n.f()}this.stats.get("Tiles In View").count=this.selectedTiles.length,this.stats.get("Tiles To Render").count=t,this.stats.get("Points/Vertices").count=r}},{key:"_initializeTileSet",value:(r=Me()(Pe.a.mark((function e(t){return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.type!==nh){e.next=5;break}return this.calculateViewPropsI3S(),e.next=4,t.root;case 4:t.root=e.sent;case 5:this.root=this._initializeTileHeaders(t,null),this.type===ih&&(this._initializeTiles3DTileset(t),this.calculateViewPropsTiles3D()),this.type===nh&&this._initializeI3STileset();case 8:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"calculateViewPropsI3S",value:function(){var e,t=this.tileset.fullExtent;if(t){var r=t.xmin,n=t.xmax,i=t.ymin,a=t.ymax,o=t.zmin,s=t.zmax;return this.cartographicCenter=new Tt(r+(n-r)/2,i+(a-i)/2,o+(s-o)/2),this.cartesianCenter=kf.WGS84.cartographicToCartesian(this.cartographicCenter,new Tt),void(this.zoom=zf(t,this.cartographicCenter,this.cartesianCenter))}var u=null===(e=this.tileset.store)||void 0===e?void 0:e.extent;if(u){var c=M()(u,4),l=c[0],f=c[1],h=c[2],d=c[3];return this.cartographicCenter=new Tt(l+(h-l)/2,f+(d-f)/2,0),this.cartesianCenter=kf.WGS84.cartographicToCartesian(this.cartographicCenter,new Tt),void(this.zoom=function(e,t,r){var n=M()(e,4),i=n[0],a=n[1];return zf({xmin:i,xmax:n[2],ymin:a,ymax:n[3],zmin:0,zmax:0},t,r)}(u,this.cartographicCenter,this.cartesianCenter))}console.warn("Extent is not defined in the tileset header"),this.cartographicCenter=new Tt,this.zoom=1}},{key:"calculateViewPropsTiles3D",value:function(){var e=this.root;eu(e);var t=e.boundingVolume.center;if(!t)return console.warn("center was not pre-calculated for the root tile"),this.cartographicCenter=new Tt,void(this.zoom=1);0!==t[0]||0!==t[1]||0!==t[2]?this.cartographicCenter=kf.WGS84.cartesianToCartographic(t,new Tt):this.cartographicCenter=new Tt(0,0,-kf.WGS84.radii[0]),this.cartesianCenter=t,this.zoom=Vf(e.boundingVolume,this.cartographicCenter)}},{key:"_initializeStats",value:function(){this.stats.get(Zh),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(e,t){var r=new Ih(this,e.root,t);if(t&&(t.children.push(r),r.depth=t.depth+1),this.type===ih){var n=[];for(n.push(r);n.length>0;){var i=n.pop();this.stats.get(Zh).incrementCount();var a,o=Kh(i.header.children||[]);try{for(o.s();!(a=o.n()).done;){var s=a.value,u=new Ih(this,s,i);i.children.push(u),u.depth=i.depth+1,n.push(u)}}catch(e){o.e(e)}finally{o.f()}}}return r}},{key:"_initializeTraverser",value:function(){var e;switch(this.type){case ih:e=Rh;break;case nh:e=zh;break;default:e=Th}return new e({basePath:this.basePath,onTraversalEnd:this._onTraversalEnd.bind(this)})}},{key:"_destroyTileHeaders",value:function(e){this._destroySubtree(e)}},{key:"_loadTile",value:(t=Me()(Pe.a.mark((function e(t){var r;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,this._onStartTileLoading(),e.next=4,t.loadContent();case 4:r=e.sent,e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),this._onTileLoadError(t,e.t0);case 10:return e.prev=10,this._onEndTileLoading(),this._onTileLoad(t,r),e.finish(10);case 14:case"end":return e.stop()}}),e,this,[[0,7,10,14]])}))),function(e){return t.apply(this,arguments)})},{key:"_onTileLoadError",value:function(e,t){this.stats.get("Failed Tile Loads").incrementCount();var r=t.message||t.toString(),n=e.url;console.error("A 3D tile failed to load: ".concat(e.url," ").concat(r)),this.options.onTileError(e,r,n)}},{key:"_onTileLoad",value:function(e,t){if(t){if(this.type===nh){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(Zh).reset(),this.stats.get(Zh).addCount(i)}e&&e.content&&function(e,t){eu(e),eu(t);var r=t.rtcCenter,n=t.gltfUpAxis,i=e.computedTransform,a=e.boundingVolume.center,o=new Wr(i);switch(r&&o.translate(r),n){case"Z":break;case"Y":var s=(new Wr).rotateX(Math.PI/2);o=o.multiplyRight(s);break;case"X":var u=(new Wr).rotateY(-Math.PI/2);o=o.multiplyRight(u)}t.isQuantized&&o.translate(t.quantizedVolumeOffset).scale(t.quantizedVolumeScale);var c=new Tt(a);t.cartesianModelMatrix=o,t.cartesianOrigin=c;var l=kf.WGS84.cartesianToCartographic(c,new Tt),f=kf.WGS84.eastNorthUpToFixedFrame(c).invert();t.cartographicModelMatrix=f.multiplyRight(o),t.cartographicOrigin=l,t.coordinateSystem||(t.modelMatrix=t.cartographicModelMatrix)}(e,e.content),this._addTileToCache(e),this.options.onTileLoad(e)}}},{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(e){this._cache.add(this,e,(function(t){return t._updateCacheStats(e)}))}},{key:"_updateCacheStats",value:function(e){this.stats.get("Tiles Loaded").incrementCount(),this.stats.get("Tiles In Memory").incrementCount(),this.gpuMemoryUsageInBytes+=e.content.byteLength||0,this.stats.get("Tile Memory Use").count=this.gpuMemoryUsageInBytes}},{key:"_unloadTile",value:function(e){this.gpuMemoryUsageInBytes-=e.content&&e.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(e),e.unloadContent()}},{key:"_destroy",value:function(){var e=[];for(this.root&&e.push(this.root);e.length>0;){var t,r=e.pop(),n=Kh(r.children);try{for(n.s();!(t=n.n()).done;){var i=t.value;e.push(i)}}catch(e){n.e(e)}finally{n.f()}this._destroyTile(r)}this.root=null}},{key:"_destroySubtree",value:function(e){var t=e,r=[];for(r.push(t);r.length>0;){var n,i=Kh((e=r.pop()).children);try{for(i.s();!(n=i.n()).done;){var a=n.value;r.push(a)}}catch(e){i.e(e)}finally{i.f()}e!==t&&this._destroyTile(e)}t.children=[]}},{key:"_destroyTile",value:function(e){this._cache.unloadTile(this,e),this._unloadTile(e),e.destroy()}},{key:"_initializeTiles3DTileset",value:function(e){if(this.asset=e.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=e.properties,this.geometricError=e.geometricError,this._extensionsUsed=e.extensionsUsed,this.extras=e.extras}},{key:"_initializeI3STileset",value:function(){this.loadOptions.i3s&&"token"in this.loadOptions.i3s&&(this._queryParams.token=this.loadOptions.i3s.token)}}]),e}();var $h={COMPOSITE:"cmpt",POINT_CLOUD:"pnts",BATCHED_3D_MODEL:"b3dm",INSTANCED_3D_MODEL:"i3dm",GEOMETRY:"geom",VECTOR:"vect",GLTF:"glTF"};Object.keys($h);function ed(e,t,r){eu(e instanceof ArrayBuffer);var n=new TextDecoder("utf8"),i=new Uint8Array(e,t,r);return n.decode(i)}function td(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=new DataView(e);return"".concat(String.fromCharCode(r.getUint8(t+0))).concat(String.fromCharCode(r.getUint8(t+1))).concat(String.fromCharCode(r.getUint8(t+2))).concat(String.fromCharCode(r.getUint8(t+3)))}var rd={name:"Draco",id:"draco",module:"draco",shapes:["mesh"],version:"3.2.10",worker:!0,extensions:["drc"],mimeTypes:["application/octet-stream"],binary:!0,tests:["DRACO"],options:{draco:{decoderType:"object"===("undefined"==typeof WebAssembly?"undefined":mi()(WebAssembly))?"wasm":"js",libraryPath:"libs/",extraAttributes:{},attributeNameEntry:void 0}}};function nd(e){for(var t=1/0,r=1/0,n=1/0,i=-1/0,a=-1/0,o=-1/0,s=e.POSITION?e.POSITION.value:[],u=s&&s.length,c=0;c<u;c+=3){var l=s[c],f=s[c+1],h=s[c+2];t=l<t?l:t,r=f<r?f:r,n=h<n?h:n,i=l>i?l:i,a=f>a?f:a,o=h>o?h:o}return[[t,r,n],[i,a,o]]}function id(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return ad(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ad(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function ad(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var od=function(){function e(t,r){h()(this,e),Hn(this,"fields",void 0),Hn(this,"metadata",void 0),function(e,t){if(!e)throw new Error(t||"loader assertion failed.")}(Array.isArray(t)),function(e){var t,r={},n=id(e);try{for(n.s();!(t=n.n()).done;){var i=t.value;r[i.name]&&console.warn("Schema: duplicated field name",i.name,i),r[i.name]=!0}}catch(e){n.e(e)}finally{n.f()}}(t),this.fields=t,this.metadata=r||new Map}return C()(e,[{key:"compareTo",value:function(e){if(this.metadata!==e.metadata)return!1;if(this.fields.length!==e.fields.length)return!1;for(var t=0;t<this.fields.length;++t)if(!this.fields[t].compareTo(e.fields[t]))return!1;return!0}},{key:"select",value:function(){for(var t=Object.create(null),r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];for(var a=0,o=n;a<o.length;a++){var s=o[a];t[s]=!0}var u=this.fields.filter((function(e){return t[e.name]}));return new e(u,this.metadata)}},{key:"selectAt",value:function(){for(var t=this,r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];var a=n.map((function(e){return t.fields[e]})).filter(Boolean);return new e(a,this.metadata)}},{key:"assign",value:function(t){var r,n=this.metadata;if(t instanceof e){var i=t;r=i.fields,n=sd(sd(new Map,this.metadata),i.metadata)}else r=t;var a,o=Object.create(null),s=id(this.fields);try{for(s.s();!(a=s.n()).done;){var u=a.value;o[u.name]=u}}catch(e){s.e(e)}finally{s.f()}var c,l=id(r);try{for(l.s();!(c=l.n()).done;){var f=c.value;o[f.name]=f}}catch(e){l.e(e)}finally{l.f()}return new e(Object.values(o),n)}}]),e}();function sd(e,t){return new Map([].concat(De()(e||new Map),De()(t||new Map)))}var ud,cd=function(){function e(t,r){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new Map;h()(this,e),Hn(this,"name",void 0),Hn(this,"type",void 0),Hn(this,"nullable",void 0),Hn(this,"metadata",void 0),this.name=t,this.type=r,this.nullable=n,this.metadata=i}return C()(e,[{key:"typeId",get:function(){return this.type&&this.type.typeId}},{key:"clone",value:function(){return new e(this.name,this.type,this.nullable,this.metadata)}},{key:"compareTo",value:function(e){return this.name===e.name&&this.type===e.type&&this.nullable===e.nullable&&this.metadata===e.metadata}},{key:"toString",value:function(){return"".concat(this.type).concat(this.nullable?", nullable":"").concat(this.metadata?", metadata: ".concat(this.metadata):"")}}]),e}();function ld(e){var t=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(e){return!1}}();return function(){var r,n=m()(e);if(t){var i=m()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return y()(this,r)}}!function(e){e[e.NONE=0]="NONE",e[e.Null=1]="Null",e[e.Int=2]="Int",e[e.Float=3]="Float",e[e.Binary=4]="Binary",e[e.Utf8=5]="Utf8",e[e.Bool=6]="Bool",e[e.Decimal=7]="Decimal",e[e.Date=8]="Date",e[e.Time=9]="Time",e[e.Timestamp=10]="Timestamp",e[e.Interval=11]="Interval",e[e.List=12]="List",e[e.Struct=13]="Struct",e[e.Union=14]="Union",e[e.FixedSizeBinary=15]="FixedSizeBinary",e[e.FixedSizeList=16]="FixedSizeList",e[e.Map=17]="Map",e[e.Dictionary=-1]="Dictionary",e[e.Int8=-2]="Int8",e[e.Int16=-3]="Int16",e[e.Int32=-4]="Int32",e[e.Int64=-5]="Int64",e[e.Uint8=-6]="Uint8",e[e.Uint16=-7]="Uint16",e[e.Uint32=-8]="Uint32",e[e.Uint64=-9]="Uint64",e[e.Float16=-10]="Float16",e[e.Float32=-11]="Float32",e[e.Float64=-12]="Float64",e[e.DateDay=-13]="DateDay",e[e.DateMillisecond=-14]="DateMillisecond",e[e.TimestampSecond=-15]="TimestampSecond",e[e.TimestampMillisecond=-16]="TimestampMillisecond",e[e.TimestampMicrosecond=-17]="TimestampMicrosecond",e[e.TimestampNanosecond=-18]="TimestampNanosecond",e[e.TimeSecond=-19]="TimeSecond",e[e.TimeMillisecond=-20]="TimeMillisecond",e[e.TimeMicrosecond=-21]="TimeMicrosecond",e[e.TimeNanosecond=-22]="TimeNanosecond",e[e.DenseUnion=-23]="DenseUnion",e[e.SparseUnion=-24]="SparseUnion",e[e.IntervalDayTime=-25]="IntervalDayTime",e[e.IntervalYearMonth=-26]="IntervalYearMonth"}(ud||(ud={}));var fd=function(){function e(){h()(this,e)}return C()(e,[{key:"typeId",get:function(){return ud.NONE}},{key:"compareTo",value:function(e){return this===e}}],[{key:"isNull",value:function(e){return e&&e.typeId===ud.Null}},{key:"isInt",value:function(e){return e&&e.typeId===ud.Int}},{key:"isFloat",value:function(e){return e&&e.typeId===ud.Float}},{key:"isBinary",value:function(e){return e&&e.typeId===ud.Binary}},{key:"isUtf8",value:function(e){return e&&e.typeId===ud.Utf8}},{key:"isBool",value:function(e){return e&&e.typeId===ud.Bool}},{key:"isDecimal",value:function(e){return e&&e.typeId===ud.Decimal}},{key:"isDate",value:function(e){return e&&e.typeId===ud.Date}},{key:"isTime",value:function(e){return e&&e.typeId===ud.Time}},{key:"isTimestamp",value:function(e){return e&&e.typeId===ud.Timestamp}},{key:"isInterval",value:function(e){return e&&e.typeId===ud.Interval}},{key:"isList",value:function(e){return e&&e.typeId===ud.List}},{key:"isStruct",value:function(e){return e&&e.typeId===ud.Struct}},{key:"isUnion",value:function(e){return e&&e.typeId===ud.Union}},{key:"isFixedSizeBinary",value:function(e){return e&&e.typeId===ud.FixedSizeBinary}},{key:"isFixedSizeList",value:function(e){return e&&e.typeId===ud.FixedSizeList}},{key:"isMap",value:function(e){return e&&e.typeId===ud.Map}},{key:"isDictionary",value:function(e){return e&&e.typeId===ud.Dictionary}}]),e}(),hd=(Symbol.toStringTag,Symbol.toStringTag,function(e,t){p()(n,e);var r=ld(n);function n(e,t){var i;return h()(this,n),i=r.call(this),Hn(yi()(i),"isSigned",void 0),Hn(yi()(i),"bitWidth",void 0),i.isSigned=e,i.bitWidth=t,i}return C()(n,[{key:"typeId",get:function(){return ud.Int}},{key:t,get:function(){return"Int"}},{key:"toString",value:function(){return"".concat(this.isSigned?"I":"Ui","nt").concat(this.bitWidth)}}]),n}(fd,Symbol.toStringTag)),dd=function(e){p()(r,e);var t=ld(r);function r(){return h()(this,r),t.call(this,!0,8)}return r}(hd),pd=function(e){p()(r,e);var t=ld(r);function r(){return h()(this,r),t.call(this,!0,16)}return r}(hd),vd=function(e){p()(r,e);var t=ld(r);function r(){return h()(this,r),t.call(this,!0,32)}return r}(hd),yd=function(e){p()(r,e);var t=ld(r);function r(){return h()(this,r),t.call(this,!1,8)}return r}(hd),gd=function(e){p()(r,e);var t=ld(r);function r(){return h()(this,r),t.call(this,!1,16)}return r}(hd),md=function(e){p()(r,e);var t=ld(r);function r(){return h()(this,r),t.call(this,!1,32)}return r}(hd),bd=32,Ad=64,Bd=function(e,t){p()(n,e);var r=ld(n);function n(e){var t;return h()(this,n),t=r.call(this),Hn(yi()(t),"precision",void 0),t.precision=e,t}return C()(n,[{key:"typeId",get:function(){return ud.Float}},{key:t,get:function(){return"Float"}},{key:"toString",value:function(){return"Float".concat(this.precision)}}]),n}(fd,Symbol.toStringTag),wd=function(e){p()(r,e);var t=ld(r);function r(){return h()(this,r),t.call(this,bd)}return r}(Bd),_d=function(e){p()(r,e);var t=ld(r);function r(){return h()(this,r),t.call(this,Ad)}return r}(Bd),xd=(Symbol.toStringTag,Symbol.toStringTag,{DAY:0,MILLISECOND:1}),Cd=(Symbol.toStringTag,{SECOND:1,MILLISECOND:1e3,MICROSECOND:1e6,NANOSECOND:1e9}),Od=(Symbol.toStringTag,Symbol.toStringTag,{DAY_TIME:0,YEAR_MONTH:1}),Ed=(Symbol.toStringTag,function(e,t){p()(n,e);var r=ld(n);function n(e,t){var i;return h()(this,n),i=r.call(this),Hn(yi()(i),"listSize",void 0),Hn(yi()(i),"children",void 0),i.listSize=e,i.children=[t],i}return C()(n,[{key:"typeId",get:function(){return ud.FixedSizeList}},{key:"valueType",get:function(){return this.children[0].type}},{key:"valueField",get:function(){return this.children[0]}},{key:t,get:function(){return"FixedSizeList"}},{key:"toString",value:function(){return"FixedSizeList[".concat(this.listSize,"]<").concat(this.valueType,">")}}]),n}(fd,Symbol.toStringTag));Symbol.toStringTag;function Td(e,t,r){var n=function(e){switch(e.constructor){case Int8Array:return new dd;case Uint8Array:return new yd;case Int16Array:return new pd;case Uint16Array:return new gd;case Int32Array:return new vd;case Uint32Array:return new md;case Float32Array:return new wd;case Float64Array:return new _d;default:throw new Error("array type not supported")}}(t.value),i=r||function(e){var t=new Map;"byteOffset"in e&&t.set("byteOffset",e.byteOffset.toString(10));"byteStride"in e&&t.set("byteStride",e.byteStride.toString(10));"normalized"in e&&t.set("normalized",e.normalized.toString());return t}(t);return new cd(e,new Ed(t.size,new cd("value",n)),!1,i)}function Sd(e,t,r){var n=Md(t.metadata),i=[],a=function(e){var t={};for(var r in e){var n=e[r];t[n.name||"undefined"]=n}return t}(t.attributes);for(var o in e){var s=kd(o,e[o],a[o]);i.push(s)}if(r){var u=kd("indices",r);i.push(u)}return new od(i,n)}function kd(e,t,r){return Td(e,t,r?Md(r.metadata):void 0)}function Md(e){var t=new Map;for(var r in e)t.set("".concat(r,".string"),JSON.stringify(e[r]));return t}function Id(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return Pd(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Pd(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function Pd(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Rd(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Fd(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Rd(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Rd(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Dd={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},Ld={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array},jd=function(){function e(t){h()(this,e),Hn(this,"draco",void 0),Hn(this,"decoder",void 0),Hn(this,"metadataQuerier",void 0),this.draco=t,this.decoder=new this.draco.Decoder,this.metadataQuerier=new this.draco.MetadataQuerier}return C()(e,[{key:"destroy",value:function(){this.draco.destroy(this.decoder),this.draco.destroy(this.metadataQuerier)}},{key:"parseSync",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=new this.draco.DecoderBuffer;r.Init(new Int8Array(e),e.byteLength),this._disableAttributeTransforms(t);var n=this.decoder.GetEncodedGeometryType(r),i=n===this.draco.TRIANGULAR_MESH?new this.draco.Mesh:new this.draco.PointCloud;try{var a;switch(n){case this.draco.TRIANGULAR_MESH:a=this.decoder.DecodeBufferToMesh(r,i);break;case this.draco.POINT_CLOUD:a=this.decoder.DecodeBufferToPointCloud(r,i);break;default:throw new Error("DRACO: Unknown geometry type.")}if(!a.ok()||!i.ptr){var o="DRACO decompression failed: ".concat(a.error_msg());throw new Error(o)}var s=this._getDracoLoaderData(i,n,t),u=this._getMeshData(i,s,t),c=nd(u.attributes),l=Sd(u.attributes,s,u.indices),f=Fd(Fd({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(e,t,r){var n=this._getTopLevelMetadata(e),i=this._getDracoAttributes(e,r);return{geometry_type:t,num_attributes:e.num_attributes(),num_points:e.num_points(),num_faces:e instanceof this.draco.Mesh?e.num_faces():0,metadata:n,attributes:i}}},{key:"_getDracoAttributes",value:function(e,t){for(var r={},n=0;n<e.num_attributes();n++){var i=this.decoder.GetAttribute(e,n),a=this._getAttributeMetadata(e,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:a};var o=this._getQuantizationTransform(i,t);o&&(r[i.unique_id()].quantization_transform=o);var s=this._getOctahedronTransform(i,t);s&&(r[i.unique_id()].octahedron_transform=s)}return r}},{key:"_getMeshData",value:function(e,t,r){var n=this._getMeshAttributes(t,e,r);if(!n.POSITION)throw new Error("DRACO: No position attribute found.");if(e instanceof this.draco.Mesh)switch(r.topology){case"triangle-strip":return{topology:"triangle-strip",mode:4,attributes:n,indices:{value:this._getTriangleStripIndices(e),size:1}};case"triangle-list":default:return{topology:"triangle-list",mode:5,attributes:n,indices:{value:this._getTriangleListIndices(e),size:1}}}return{topology:"point-list",mode:0,attributes:n}}},{key:"_getMeshAttributes",value:function(e,t,r){for(var n={},i=0,a=Object.values(e.attributes);i<a.length;i++){var o=a[i],s=this._deduceAttributeName(o,r);o.name=s;var u=this._getAttributeValues(t,o),c=u.value,l=u.size;n[s]={value:c,size:l,byteOffset:o.byte_offset,byteStride:o.byte_stride,normalized:o.normalized}}return n}},{key:"_getTriangleListIndices",value:function(e){var t=3*e.num_faces(),r=4*t,n=this.draco._malloc(r);try{return this.decoder.GetTrianglesUInt32Array(e,r,n),new Uint32Array(this.draco.HEAPF32.buffer,n,t).slice()}finally{this.draco._free(n)}}},{key:"_getTriangleStripIndices",value:function(e){var t=new this.draco.DracoInt32Array;try{return this.decoder.GetTriangleStripsFromMesh(e,t),function(e){for(var t=e.size(),r=new Int32Array(t),n=0;n<t;n++)r[n]=e.GetValue(n);return r}(t)}finally{this.draco.destroy(t)}}},{key:"_getAttributeValues",value:function(e,t){var r,n=Ld[t.data_type],i=t.num_components,a=e.num_points()*i,o=a*n.BYTES_PER_ELEMENT,s=function(e,t){switch(t){case Float32Array:return e.DT_FLOAT32;case Int8Array:return e.DT_INT8;case Int16Array:return e.DT_INT16;case Int32Array:return e.DT_INT32;case Uint8Array:return e.DT_UINT8;case Uint16Array:return e.DT_UINT16;case Uint32Array:return e.DT_UINT32;default:return e.DT_INVALID}}(this.draco,n),u=this.draco._malloc(o);try{var c=this.decoder.GetAttribute(e,t.attribute_index);this.decoder.GetAttributeDataArrayForAllPoints(e,c,s,o,u),r=new n(this.draco.HEAPF32.buffer,u,a).slice()}finally{this.draco._free(u)}return{value:r,size:i}}},{key:"_deduceAttributeName",value:function(e,t){for(var r=e.unique_id,n=0,i=Object.entries(t.extraAttributes||{});n<i.length;n++){var a=M()(i[n],2),o=a[0];if(a[1]===r)return o}var s=e.attribute_type;for(var u in Dd){if(this.draco[u]===s)return Dd[u]}var c=t.attributeNameEntry||"name";return e.metadata[c]?e.metadata[c].string:"CUSTOM_ATTRIBUTE_".concat(r)}},{key:"_getTopLevelMetadata",value:function(e){var t=this.decoder.GetMetadata(e);return this._getDracoMetadata(t)}},{key:"_getAttributeMetadata",value:function(e,t){var r=this.decoder.GetAttributeMetadata(e,t);return this._getDracoMetadata(r)}},{key:"_getDracoMetadata",value:function(e){if(!e||!e.ptr)return{};for(var t={},r=this.metadataQuerier.NumEntries(e),n=0;n<r;n++){var i=this.metadataQuerier.GetEntryName(e,n);t[i]=this._getDracoMetadataField(e,i)}return t}},{key:"_getDracoMetadataField",value:function(e,t){var r=new this.draco.DracoInt32Array;try{this.metadataQuerier.GetIntEntryArray(e,t,r);var n=function(e){for(var t=e.size(),r=new Int32Array(t),n=0;n<t;n++)r[n]=e.GetValue(n);return r}(r);return{int:this.metadataQuerier.GetIntEntry(e,t),string:this.metadataQuerier.GetStringEntry(e,t),double:this.metadataQuerier.GetDoubleEntry(e,t),intArray:n}}finally{this.draco.destroy(r)}}},{key:"_disableAttributeTransforms",value:function(e){var t,r=e.quantizedAttributes,n=void 0===r?[]:r,i=e.octahedronAttributes,a=void 0===i?[]:i,o=Id([].concat(De()(n),De()(a)));try{for(o.s();!(t=o.n()).done;){var s=t.value;this.decoder.SkipAttributeTransform(this.draco[s])}}catch(e){o.e(e)}finally{o.f()}}},{key:"_getQuantizationTransform",value:function(e,t){var r=this,n=t.quantizedAttributes,i=void 0===n?[]:n,a=e.attribute_type();if(i.map((function(e){return r.decoder[e]})).includes(a)){var o=new this.draco.AttributeQuantizationTransform;try{if(o.InitFromAttribute(e))return{quantization_bits:o.quantization_bits(),range:o.range(),min_values:new Float32Array([1,2,3]).map((function(e){return o.min_value(e)}))}}finally{this.draco.destroy(o)}}return null}},{key:"_getOctahedronTransform",value:function(e,t){var r=this,n=t.octahedronAttributes,i=void 0===n?[]:n,a=e.attribute_type();if(i.map((function(e){return r.decoder[e]})).includes(a)){var o=new this.draco.AttributeQuantizationTransform;try{if(o.InitFromAttribute(e))return{quantization_bits:o.quantization_bits()}}finally{this.draco.destroy(o)}}return null}}]),e}();var Gd=r(28),Ud={};function Nd(e){return Hd.apply(this,arguments)}function Hd(){return(Hd=Me()(Pe.a.mark((function e(t){var r,n,i=arguments;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.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&&(t=Jd(t,r,n)),Ud[t]=Ud[t]||Vd(t),e.next=6,Ud[t];case 6:return e.abrupt("return",e.sent);case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Jd(e,t,r){if(e.startsWith("http"))return e;var n=r.modules||{};return n[e]?n[e]:Bc?r.CDN?(gc(r.CDN.startsWith("http")),"".concat(r.CDN,"/").concat(t,"@").concat("3.2.10","/dist/libs/").concat(e)):wc?"../src/libs/".concat(e):"modules/".concat(t,"/src/libs/").concat(e):"modules/".concat(t,"/dist/libs/").concat(e)}function Vd(e){return zd.apply(this,arguments)}function zd(){return(zd=Me()(Pe.a.mark((function e(t){var r,n,i;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.endsWith("wasm")){e.next=7;break}return e.next=3,fetch(t);case 3:return r=e.sent,e.next=6,r.arrayBuffer();case 6:return e.abrupt("return",e.sent);case 7:if(Bc){e.next=20;break}if(e.prev=8,e.t0=Gd&&Gd.requireFromFile,!e.t0){e.next=14;break}return e.next=13,Gd.requireFromFile(t);case 13:e.t0=e.sent;case 14:return e.abrupt("return",e.t0);case 17:return e.prev=17,e.t1=e.catch(8),e.abrupt("return",null);case 20:if(!wc){e.next=22;break}return e.abrupt("return",importScripts(t));case 22:return e.next=24,fetch(t);case 24:return n=e.sent,e.next=27,n.text();case 27:return i=e.sent,e.abrupt("return",Kd(i,t));case 29:case"end":return e.stop()}}),e,null,[[8,17]])})))).apply(this,arguments)}function Kd(e,t){if(!Bc)return Gd.requireFromString&&Gd.requireFromString(e,t);if(wc)return eval.call(Ac,e),null;var r=document.createElement("script");r.id=t;try{r.appendChild(document.createTextNode(e))}catch(t){r.text=e}return document.body.appendChild(r),null}function qd(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Xd(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?qd(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):qd(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Qd,Wd="https://www.gstatic.com/draco/versioned/decoders/".concat("1.4.1","/draco_decoder.js"),Zd="https://www.gstatic.com/draco/versioned/decoders/".concat("1.4.1","/draco_wasm_wrapper.js"),Yd="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 $d(e){return ep.apply(this,arguments)}function ep(){return(ep=Me()(Pe.a.mark((function e(t){var r;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.modules||{},Qd=r.draco3d?Qd||r.draco3d.createDecoderModule({}).then((function(e){return{draco:e}})):Qd||tp(t),e.next=4,Qd;case 4:return e.abrupt("return",e.sent);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function tp(e){return rp.apply(this,arguments)}function rp(){return(rp=Me()(Pe.a.mark((function e(t){var r,n,i,a;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.t0=t.draco&&t.draco.decoderType,e.next="js"===e.t0?3:(e.t0,7);break;case 3:return e.next=5,Nd(Wd,"draco",t);case 5:return r=e.sent,e.abrupt("break",21);case 7:return e.t1=Promise,e.next=10,Nd(Zd,"draco",t);case 10:return e.t2=e.sent,e.next=13,Nd(Yd,"draco",t);case 13:return e.t3=e.sent,e.t4=[e.t2,e.t3],e.next=17,e.t1.all.call(e.t1,e.t4);case 17:i=e.sent,a=M()(i,2),r=a[0],n=a[1];case 21:return r=r||globalThis.DracoDecoderModule,e.next=24,np(r,n);case 24:return e.abrupt("return",e.sent);case 25:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function np(e,t){var r={};return t&&(r.wasmBinary=t),new Promise((function(t){e(Xd(Xd({},r),{},{onModuleLoaded:function(e){return t({draco:e})}}))}))}function ip(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ap(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ip(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ip(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var op=ap(ap({},rd),{},{parse:function(e,t){return sp.apply(this,arguments)}});function sp(){return(sp=Me()(Pe.a.mark((function e(t,r){var n,i,a;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,$d(r);case 2:return n=e.sent,i=n.draco,a=new jd(i),e.prev=5,e.abrupt("return",a.parseSync(t,null==r?void 0:r.draco));case 7:return e.prev=7,a.destroy(),e.finish(7);case 10:case"end":return e.stop()}}),e,null,[[5,,7,10]])})))).apply(this,arguments)}var up,cp=(up={},A()(up,5130,Float64Array),A()(up,5126,Float32Array),A()(up,5123,Uint16Array),A()(up,5125,Uint32Array),A()(up,5121,Uint8Array),A()(up,5120,Int8Array),A()(up,5122,Int16Array),A()(up,5124,Int32Array),up),lp={DOUBLE:5130,FLOAT:5126,UNSIGNED_SHORT:5123,UNSIGNED_INT:5125,UNSIGNED_BYTE:5121,BYTE:5120,SHORT:5122,INT:5124},fp=function(){function e(){h()(this,e)}return C()(e,null,[{key:"fromTypedArray",value:function(e){for(var t in e=ArrayBuffer.isView(e)?e.constructor:e,cp){if(cp[t]===e)return t}throw new Error("Failed to convert GL type")}},{key:"fromName",value:function(e){var t=lp[e];if(!t)throw new Error("Failed to convert GL type");return t}},{key:"getArrayType",value:function(e){switch(e){case 33635:case 32819:case 32820:return Uint16Array;default:var t=cp[e];if(!t)throw new Error("Failed to convert GL type");return t}}},{key:"getByteSize",value:function(t){return e.getArrayType(t).BYTES_PER_ELEMENT}},{key:"validate",value:function(t){return Boolean(e.getArrayType(t))}},{key:"createTypedArray",value:function(t,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)/e.getByteSize(t));var a=e.getArrayType(t);return new a(r,n,i)}}]),e}(),hp=function(){function e(t,r){h()(this,e),Hn(this,"json",void 0),Hn(this,"buffer",void 0),Hn(this,"featuresLength",0),Hn(this,"_cachedTypedArrays",{}),this.json=t,this.buffer=r}return C()(e,[{key:"getExtension",value:function(e){return this.json.extensions&&this.json.extensions[e]}},{key:"hasProperty",value:function(e){return Boolean(this.json[e])}},{key:"getGlobalProperty",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5125,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,n=this.json[e];return n&&Number.isFinite(n.byteOffset)?this._getTypedArrayFromBinary(e,t,r,1,n.byteOffset):n}},{key:"getPropertyArray",value:function(e,t,r){var n=this.json[e];return n&&Number.isFinite(n.byteOffset)?("componentType"in n&&(t=fp.fromName(n.componentType)),this._getTypedArrayFromBinary(e,t,r,this.featuresLength,n.byteOffset)):this._getTypedArrayFromArray(e,t,n)}},{key:"getProperty",value:function(e,t,r,n,i){var a=this.json[e];if(!a)return a;var o=this.getPropertyArray(e,t,r);if(1===r)return o[n];for(var s=0;s<r;++s)i[s]=o[r*n+s];return i}},{key:"_getTypedArrayFromBinary",value:function(e,t,r,n,i){var a=this._cachedTypedArrays,o=a[e];return o||(o=fp.createTypedArray(t,this.buffer.buffer,this.buffer.byteOffset+i,n*r),a[e]=o),o}},{key:"_getTypedArrayFromArray",value:function(e,t,r){var n=this._cachedTypedArrays,i=n[e];return i||(i=fp.createTypedArray(t,r),n[e]=i),i}}]),e}(),dp={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},pp={SCALAR:function(e,t){return e[t]},VEC2:function(e,t){return[e[2*t+0],e[2*t+1]]},VEC3:function(e,t){return[e[3*t+0],e[3*t+1],e[3*t+2]]},VEC4:function(e,t){return[e[4*t+0],e[4*t+1],e[4*t+2],e[4*t+3]]},MAT2:function(e,t){return[e[4*t+0],e[4*t+1],e[4*t+2],e[4*t+3]]},MAT3:function(e,t){return[e[9*t+0],e[9*t+1],e[9*t+2],e[9*t+3],e[9*t+4],e[9*t+5],e[9*t+6],e[9*t+7],e[9*t+8]]},MAT4:function(e,t){return[e[16*t+0],e[16*t+1],e[16*t+2],e[16*t+3],e[16*t+4],e[16*t+5],e[16*t+6],e[16*t+7],e[16*t+8],e[16*t+9],e[16*t+10],e[16*t+11],e[16*t+12],e[16*t+13],e[16*t+14],e[16*t+15]]}},vp={SCALAR:function(e,t,r){t[r]=e},VEC2:function(e,t,r){t[2*r+0]=e[0],t[2*r+1]=e[1]},VEC3:function(e,t,r){t[3*r+0]=e[0],t[3*r+1]=e[1],t[3*r+2]=e[2]},VEC4:function(e,t,r){t[4*r+0]=e[0],t[4*r+1]=e[1],t[4*r+2]=e[2],t[4*r+3]=e[3]},MAT2:function(e,t,r){t[4*r+0]=e[0],t[4*r+1]=e[1],t[4*r+2]=e[2],t[4*r+3]=e[3]},MAT3:function(e,t,r){t[9*r+0]=e[0],t[9*r+1]=e[1],t[9*r+2]=e[2],t[9*r+3]=e[3],t[9*r+4]=e[4],t[9*r+5]=e[5],t[9*r+6]=e[6],t[9*r+7]=e[7],t[9*r+8]=e[8],t[9*r+9]=e[9]},MAT4:function(e,t,r){t[16*r+0]=e[0],t[16*r+1]=e[1],t[16*r+2]=e[2],t[16*r+3]=e[3],t[16*r+4]=e[4],t[16*r+5]=e[5],t[16*r+6]=e[6],t[16*r+7]=e[7],t[16*r+8]=e[8],t[16*r+9]=e[9],t[16*r+10]=e[10],t[16*r+11]=e[11],t[16*r+12]=e[12],t[16*r+13]=e[13],t[16*r+14]=e[14],t[16*r+15]=e[15]}};var yp=function(e){return void 0!==e};function gp(e,t,r){if(!t)return null;var n=e.getExtension("3DTILES_batch_table_hierarchy"),i=t.HIERARCHY;return i&&(console.warn("3D Tile Parser: HIERARCHY is deprecated. Use 3DTILES_batch_table_hierarchy."),t.extensions=t.extensions||{},t.extensions["3DTILES_batch_table_hierarchy"]=i,n=i),n?function(e,t){var r,n,i,a,o=e.instancesLength,s=e.classes,u=e.classIds,c=e.parentCounts,l=e.parentIds,f=o;yp(u.byteOffset)&&(u.componentType=defaultValue(u.componentType,5123),u.type=AttributeType.SCALAR,i=getBinaryAccessor(u),u=i.createArrayBufferView(t.buffer,t.byteOffset+u.byteOffset,o));if(yp(c))for(yp(c.byteOffset)&&(c.componentType=defaultValue(c.componentType,5123),c.type=AttributeType.SCALAR,i=getBinaryAccessor(c),c=i.createArrayBufferView(t.buffer,t.byteOffset+c.byteOffset,o)),a=new Uint16Array(o),f=0,r=0;r<o;++r)a[r]=f,f+=c[r];yp(l)&&yp(l.byteOffset)&&(l.componentType=defaultValue(l.componentType,5123),l.type=AttributeType.SCALAR,i=getBinaryAccessor(l),l=i.createArrayBufferView(t.buffer,t.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,t);s[r].instances=combine(v,p)}var y=new Array(h).fill(0),g=new Uint16Array(o);for(r=0;r<o;++r)n=u[r],g[r]=y[n],++y[n];var m={classes:s,classIds:u,classIndexes:g,parentCounts:c,parentIndexes:a,parentIds:l};return function(e){for(var t=e.classIds.length,r=0;r<t;++r)bp(e,r,stack)}(m),m}(n,r):null}function mp(e,t,r){if(e){var n=e.parentCounts;return e.parentIds?r(e,t):n>0?function(e,t,r){var n=e.classIds,i=e.parentCounts,a=e.parentIds,o=e.parentIndexes,s=n.length,u=scratchVisited;u.length=Math.max(u.length,s);var c=++marker,l=scratchStack;l.length=0,l.push(t);for(;l.length>0;)if(t=l.pop(),u[t]!==c){u[t]=c;var f=r(e,t);if(yp(f))return f;for(var h=i[t],d=o[t],p=0;p<h;++p){var v=a[d+p];v!==t&&l.push(v)}}return null}(e,t,r):function(e,t,r){var n=!0;for(;n;){var i=r(e,t);if(yp(i))return i;var a=e.parentIds[t];n=a!==t,t=a}throw new Error("traverseHierarchySingleParent")}(e,t,r)}}function bp(e,t,r){var n=e.parentCounts,i=e.parentIds,a=e.parentIndexes,o=e.classIds.length;if(yp(i)){assert(t<o,"Parent index ".concat(t," exceeds the total number of instances: ").concat(o)),assert(-1===r.indexOf(t),"Circular dependency detected in the batch table hierarchy."),r.push(t);for(var s=yp(n)?n[t]:1,u=yp(n)?a[t]:t,c=0;c<s;++c){var l=i[u+c];l!==t&&bp(e,l,r)}r.pop(t)}}function Ap(e){return null!=e}var Bp=function(e,t){return e},wp={HIERARCHY:!0,extensions:!0,extras:!0},_p=function(){function e(t,r,n){var i,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};for(var o in h()(this,e),Hn(this,"json",void 0),Hn(this,"binary",void 0),Hn(this,"featureCount",void 0),Hn(this,"_extensions",void 0),Hn(this,"_properties",void 0),Hn(this,"_binaryProperties",void 0),Hn(this,"_hierarchy",void 0),eu(n>=0),this.json=t||{},this.binary=r,this.featureCount=n,this._extensions=(null===(i=this.json)||void 0===i?void 0:i.extensions)||{},this._properties={},this.json)wp[o]||(this._properties[o]=this.json[o]);this._binaryProperties=this._initializeBinaryProperties(),a["3DTILES_batch_table_hierarchy"]&&(this._hierarchy=gp(this,this.json,this.binary))}return C()(e,[{key:"getExtension",value:function(e){return this.json&&this.json.extensions&&this.json.extensions[e]}},{key:"memorySizeInBytes",value:function(){return 0}},{key:"isClass",value:function(e,t){return this._checkBatchId(e),eu("string"==typeof t,t),!!this._hierarchy&&Ap(mp(this._hierarchy,e,(function(e,r){var n=e.classIds[r];return e.classes[n].name===t})))}},{key:"isExactClass",value:function(e,t){return eu("string"==typeof t,t),this.getExactClassName(e)===t}},{key:"getExactClassName",value:function(e){if(this._checkBatchId(e),this._hierarchy){var t=this._hierarchy.classIds[e];return this._hierarchy.classes[t].name}}},{key:"hasProperty",value:function(e,t){return this._checkBatchId(e),eu("string"==typeof t,t),Ap(this._properties[t])||this._hasPropertyInHierarchy(e,t)}},{key:"getPropertyNames",value:function(e,t){var r;this._checkBatchId(e),(t=Ap(t)?t:[]).length=0;var n=Object.keys(this._properties);return(r=t).push.apply(r,De()(n)),this._hierarchy&&this._getPropertyNamesInHierarchy(e,t),t}},{key:"getProperty",value:function(e,t){if(this._checkBatchId(e),eu("string"==typeof t,t),this._binaryProperties){var r=this._binaryProperties[t];if(Ap(r))return this._getBinaryProperty(r,e)}var n=this._properties[t];if(Ap(n))return Bp(n[e]);if(this._hierarchy){var i=this._getHierarchyProperty(e,t);if(Ap(i))return i}}},{key:"setProperty",value:function(e,t,r){var n=this.featureCount;if(this._checkBatchId(e),eu("string"==typeof t,t),this._binaryProperties){var i=this._binaryProperties[t];if(i)return void this._setBinaryProperty(i,e,r)}if(!this._hierarchy||!this._setHierarchyProperty(this,e,t,r)){var a=this._properties[t];Ap(a)||(this._properties[t]=new Array(n),a=this._properties[t]),a[e]=Bp(r)}}},{key:"_checkBatchId",value:function(e){if(!(e>=0&&e<this.featureCount))throw new Error("batchId not in range [0, featureCount - 1].")}},{key:"_getBinaryProperty",value:function(e,t){return e.unpack(e.typedArray,t)}},{key:"_setBinaryProperty",value:function(e,t,r){e.pack(r,e.typedArray,t)}},{key:"_initializeBinaryProperties",value:function(){var e=null;for(var t in this._properties){var r=this._properties[t],n=this._initializeBinaryProperty(t,r);n&&((e=e||{})[t]=n)}return e}},{key:"_initializeBinaryProperty",value:function(e,t){if("byteOffset"in t){var r=t;eu(this.binary,"Property ".concat(e," requires a batch table binary.")),eu(r.type,"Property ".concat(e," requires a type."));var n=function(e,t,r,n){var i=e.componentType;eu(e.componentType);var a="string"==typeof i?fp.fromName(i):i,o=dp[e.type],s=pp[e.type],u=vp[e.type];return r+=e.byteOffset,{values:fp.createTypedArray(a,t,r,o*n),type:a,size:o,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(e,t){if(!this._hierarchy)return!1;var r=mp(this._hierarchy,e,(function(e,r){var n=e.classIds[r];return Ap(e.classes[n].instances[t])}));return Ap(r)}},{key:"_getPropertyNamesInHierarchy",value:function(e,t){mp(this._hierarchy,e,(function(e,r){var n=e.classIds[r],i=e.classes[n].instances;for(var a in i)i.hasOwnProperty(a)&&-1===t.indexOf(a)&&t.push(a)}))}},{key:"_getHierarchyProperty",value:function(e,t){var r=this;return mp(this._hierarchy,e,(function(e,n){var i=e.classIds[n],a=e.classes[i],o=e.classIndexes[n],s=a.instances[t];return Ap(s)?Ap(s.typedArray)?r._getBinaryProperty(s,o):Bp(s[o]):null}))}},{key:"_setHierarchyProperty",value:function(e,t,r,n){var i=this,a=mp(this._hierarchy,t,(function(e,a){var o=e.classIds[a],s=e.classes[o],u=e.classIndexes[a],c=s.instances[r];return!!Ap(c)&&(eu(a===t,'Inherited property "'.concat(r,'" is read-only.')),Ap(c.typedArray)?i._setBinaryProperty(c,u,n):c[u]=Bp(n),!0)}));return Ap(a)}}]),e}();function xp(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=new DataView(t);if(e.magic=n.getUint32(r,!0),r+=4,e.version=n.getUint32(r,!0),r+=4,e.byteLength=n.getUint32(r,!0),r+=4,1!==e.version)throw new Error("3D Tile Version ".concat(e.version," not supported"));return r}function Cp(e,t,r){var n,i=new DataView(t);e.header=e.header||{};var a=i.getUint32(r,!0);r+=4;var o=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=a,s=o,u=0,a=0,o=0,console.warn("b3dm tile in legacy format.")):u>=570425344&&(r-=4,n=s,s=a,u=o,a=0,o=0,console.warn("b3dm tile in legacy format.")),e.header.featureTableJsonByteLength=a,e.header.featureTableBinaryByteLength=o,e.header.batchTableJsonByteLength=s,e.header.batchTableBinaryByteLength=u,e.header.batchLength=n,r}function Op(e,t,r,n){return r=function(e,t,r,n){var i=e.header,a=i.featureTableJsonByteLength,o=i.featureTableBinaryByteLength,s=i.batchLength;if(e.featureTableJson={BATCH_LENGTH:s||0},a>0){var u=ed(t,r,a);e.featureTableJson=JSON.parse(u)}return r+=a,e.featureTableBinary=new Uint8Array(t,r,o),r+=o}(e,t,r),r=function(e,t,r,n){var i=e.header,a=i.batchTableJsonByteLength,o=i.batchTableBinaryByteLength;if(a>0){var s=ed(t,r,a);e.batchTableJson=JSON.parse(s),r+=a,o>0&&(e.batchTableBinary=new Uint8Array(t,r,o),e.batchTableBinary=new Uint8Array(e.batchTableBinary),r+=o)}return r}(e,t,r)}function Ep(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0],r=e>>11&31,n=e>>5&63,i=31&e;return t[0]=r<<3,t[1]=n<<2,t[2]=i<<3,t}function Tp(e,t,r){if(!(t||e&&e.batchIds&&r))return null;var n=e.batchIds,i=e.isRGB565,a=e.pointCount;if(n&&r){for(var o=new Uint8ClampedArray(3*a),s=0;s<a;s++){var u=n[s],c=r.getProperty(u,"dimensions").map((function(e){return 255*e}));o[3*s]=c[0],o[3*s+1]=c[1],o[3*s+2]=c[2]}return{type:5121,value:o,size:3,normalized:!0}}if(i){for(var l=new Uint8ClampedArray(3*a),f=0;f<a;f++){var h=Ep(t[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 t&&t.length===3*a?{type:5121,value:t,size:3,normalized:!0}:{type:5121,value:t,size:4,normalized:!0}}function Sp(e,t){if(!e)throw new Error("math.gl assertion failed. ".concat(t))}new $r,new Tt,new $r,new $r,new Uint8Array(1);function kp(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:255;return lt(e,0,t)/t*2-1}function Mp(e){return e<0?-1:1}function Ip(e,t,r,n){if(Sp(n),e<0||e>r||t<0||t>r)throw new Error("x and y must be unsigned normalized integers between 0 and ".concat(r));if(n.x=kp(e,r),n.y=kp(t,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))*Mp(i),n.y=(1-Math.abs(i))*Mp(n.y)}return n.normalize()}function Pp(e,t,r){return Ip(e,t,255,r)}var Rp=new Tt;function Fp(e,t,r){return e.isQuantized?r["3d-tiles"]&&r["3d-tiles"].decodeQuantizedPositions?(e.isQuantized=!1,function(e,t){for(var r=new Tt,n=new Float32Array(3*e.pointCount),i=0;i<e.pointCount;i++)r.set(t[3*i],t[3*i+1],t[3*i+2]).scale(1/e.quantizedRange).multiply(e.quantizedVolumeScale).add(e.quantizedVolumeOffset).toArray(n,3*i);return n}(e,t)):{type:5123,value:t,size:3,normalized:!0}:t}function Dp(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Lp(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Dp(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Dp(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function jp(e,t,r,n,i){return Gp.apply(this,arguments)}function Gp(){return(Gp=Me()(Pe.a.mark((function e(t,r,n,i,a){var o,s,u;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=xp(t,r,n),n=Cp(t,r,n),n=Op(t,r,n),Up(t),o=Np(t),s=o.featureTable,u=o.batchTable,e.next=7,zp(t,s,u,i,a);case 7:return Hp(t,s,i),Jp(t,s,u),Vp(t,s),e.abrupt("return",n);case 11:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Up(e){e.attributes={positions:null,colors:null,normals:null,batchIds:null},e.isQuantized=!1,e.isTranslucent=!1,e.isRGB565=!1,e.isOctEncoded16P=!1}function Np(e){var t=new hp(e.featureTableJson,e.featureTableBinary),r=t.getGlobalProperty("POINTS_LENGTH");if(!Number.isFinite(r))throw new Error("POINTS_LENGTH must be defined");t.featuresLength=r,e.featuresLength=r,e.pointsLength=r,e.pointCount=r,e.rtcCenter=t.getGlobalProperty("RTC_CENTER",5126,3);var n=function(e,t){var r=null;if(!e.batchIds&&t.hasProperty("BATCH_ID")&&(e.batchIds=t.getPropertyArray("BATCH_ID",5123,1),e.batchIds)){var n=t.getGlobalProperty("BATCH_LENGTH");if(!n)throw new Error("Global property: BATCH_LENGTH must be defined when BATCH_ID is defined.");var i=e.batchTableJson,a=e.batchTableBinary;r=new _p(i,a,n)}return r}(e,t);return{featureTable:t,batchTable:n}}function Hp(e,t,r){if(!e.attributes.positions)if(t.hasProperty("POSITION"))e.attributes.positions=t.getPropertyArray("POSITION",5126,3);else if(t.hasProperty("POSITION_QUANTIZED")){var n=t.getPropertyArray("POSITION_QUANTIZED",5123,3);if(e.isQuantized=!0,e.quantizedRange=65535,e.quantizedVolumeScale=t.getGlobalProperty("QUANTIZED_VOLUME_SCALE",5126,3),!e.quantizedVolumeScale)throw new Error("QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");if(e.quantizedVolumeOffset=t.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",5126,3),!e.quantizedVolumeOffset)throw new Error("QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");e.attributes.positions=Fp(e,n,r)}if(!e.attributes.positions)throw new Error("Either POSITION or POSITION_QUANTIZED must be defined.")}function Jp(e,t,r){if(!e.attributes.colors){var n=null;t.hasProperty("RGBA")?(n=t.getPropertyArray("RGBA",5121,4),e.isTranslucent=!0):t.hasProperty("RGB")?n=t.getPropertyArray("RGB",5121,3):t.hasProperty("RGB565")&&(n=t.getPropertyArray("RGB565",5123,1),e.isRGB565=!0),e.attributes.colors=Tp(e,n,r)}t.hasProperty("CONSTANT_RGBA")&&(e.constantRGBA=t.getGlobalProperty("CONSTANT_RGBA",5121,4))}function Vp(e,t){if(!e.attributes.normals){var r=null;t.hasProperty("NORMAL")?r=t.getPropertyArray("NORMAL",5126,3):t.hasProperty("NORMAL_OCT16P")&&(r=t.getPropertyArray("NORMAL_OCT16P",5121,2),e.isOctEncoded16P=!0),e.attributes.normals=function(e,t){if(!t)return null;if(e.isOctEncoded16P){for(var r=new Float32Array(3*e.pointsLength),n=0;n<e.pointsLength;n++)Pp(t[2*n],t[2*n+1],Rp),Rp.toArray(r,3*n);return{type:5126,size:2,value:r}}return{type:5126,size:2,value:t}}(e,r)}}function zp(e,t,r,n,i){return Kp.apply(this,arguments)}function Kp(){return(Kp=Me()(Pe.a.mark((function e(t,r,n,i,a){var o,s,u,c,l,f,h,d;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((c=t.batchTableJson&&t.batchTableJson.extensions&&t.batchTableJson.extensions["3DTILES_draco_point_compression"])&&(u=c.properties),!(l=r.getExtension("3DTILES_draco_point_compression"))){e.next=15;break}if(s=l.properties,f=l.byteOffset,h=l.byteLength,s&&Number.isFinite(f)&&h){e.next=9;break}throw new Error("Draco properties, byteOffset, and byteLength must be defined");case 9:o=t.featureTableBinary.slice(f,f+h),t.hasPositions=Number.isFinite(s.POSITION),t.hasColors=Number.isFinite(s.RGB)||Number.isFinite(s.RGBA),t.hasNormals=Number.isFinite(s.NORMAL),t.hasBatchIds=Number.isFinite(s.BATCH_ID),t.isTranslucent=Number.isFinite(s.RGBA);case 15:if(o){e.next=17;break}return e.abrupt("return",!0);case 17:return d={buffer:o,properties:Lp(Lp({},s),u),featureTableProperties:s,batchTableProperties:u,dequantizeInShader:!1},e.next=20,qp(t,d,i,a);case 20:return e.abrupt("return",e.sent);case 21:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function qp(e,t,r,n){return Xp.apply(this,arguments)}function Xp(){return(Xp=Me()(Pe.a.mark((function e(t,r,n,i){var a,o,s,u,c,l,f,h,d,p,v,y,g,m,b;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=i.parse,delete(o=Lp(Lp({},n),{},{draco:Lp(Lp({},n.draco),{},{extraAttributes:r.batchTableProperties||{}})}))["3d-tiles"],e.next=5,a(r.buffer,op,o);case 5:if(s=e.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,t.quantizedVolumeScale=new Tt(v,v,v),t.quantizedVolumeOffset=new Tt(p.minValues),t.quantizedRange=(1<<p.quantizationBits)-1,t.isQuantizedDraco=!0),d&&(t.octEncodedRange=(1<<s.NORMAL.data.quantization.quantizationBits)-1,t.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);t.attributes=Lp({positions:u,colors:Tp(t,c,void 0),normals:l,batchIds:f},y);case 17:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Qp,Wp,Zp="https://unpkg.com/@loaders.gl/textures@".concat("3.2.10","/dist/libs/basis_encoder.wasm"),Yp="https://unpkg.com/@loaders.gl/textures@".concat("3.2.10","/dist/libs/basis_encoder.js");function $p(e){return ev.apply(this,arguments)}function ev(){return(ev=Me()(Pe.a.mark((function e(t){var r;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(r=t.modules||{}).basis){e.next=3;break}return e.abrupt("return",r.basis);case 3:return Qp=Qp||tv(t),e.next=6,Qp;case 6:return e.abrupt("return",e.sent);case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function tv(e){return rv.apply(this,arguments)}function rv(){return(rv=Me()(Pe.a.mark((function e(t){var r,n,i,a;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=null,n=null,e.t0=Promise,e.next=5,Nd("basis_transcoder.js","textures",t);case 5:return e.t1=e.sent,e.next=8,Nd("basis_transcoder.wasm","textures",t);case 8:return e.t2=e.sent,e.t3=[e.t1,e.t2],e.next=12,e.t0.all.call(e.t0,e.t3);case 12:return i=e.sent,a=M()(i,2),r=a[0],n=a[1],r=r||globalThis.BASIS,e.next=19,nv(r,n);case 19:return e.abrupt("return",e.sent);case 20:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function nv(e,t){var r={};return t&&(r.wasmBinary=t),new Promise((function(t){e(r).then((function(e){var r=e.BasisFile;(0,e.initializeBasis)(),t({BasisFile:r})}))}))}function iv(e){return av.apply(this,arguments)}function av(){return(av=Me()(Pe.a.mark((function e(t){var r;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(r=t.modules||{}).basisEncoder){e.next=3;break}return e.abrupt("return",r.basisEncoder);case 3:return Wp=Wp||ov(t),e.next=6,Wp;case 6:return e.abrupt("return",e.sent);case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ov(e){return sv.apply(this,arguments)}function sv(){return(sv=Me()(Pe.a.mark((function e(t){var r,n,i,a;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=null,n=null,e.t0=Promise,e.next=5,Nd(Yp,"textures",t);case 5:return e.t1=e.sent,e.next=8,Nd(Zp,"textures",t);case 8:return e.t2=e.sent,e.t3=[e.t1,e.t2],e.next=12,e.t0.all.call(e.t0,e.t3);case 12:return i=e.sent,a=M()(i,2),r=a[0],n=a[1],r=r||globalThis.BASIS,e.next=19,uv(r,n);case 19:return e.abrupt("return",e.sent);case 20:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function uv(e,t){var r={};return t&&(r.wasmBinary=t),new Promise((function(t){e(r).then((function(e){var r=e.BasisFile,n=e.KTX2File,i=e.initializeBasis,a=e.BasisEncoder;i(),t({BasisFile:r,KTX2File:n,BasisEncoder:a})}))}))}var cv={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 lv(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return fv(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return fv(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function fv(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var hv=["","WEBKIT_","MOZ_"],dv={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"},pv=null;function vv(e){if(!pv){e=e||function(){try{return document.createElement("canvas").getContext("webgl")}catch(e){return null}}()||void 0,pv=new Set;var t,r=lv(hv);try{for(r.s();!(t=r.n()).done;){var n=t.value;for(var i in dv)if(e&&e.getExtension("".concat(n).concat(i))){var a=dv[i];pv.add(a)}}}catch(e){r.e(e)}finally{r.f()}}return pv}new Uint8Array([0]);var yv,gv,mv,bv,Av,Bv,wv,_v,xv;(xv=yv||(yv={}))[xv.NONE=0]="NONE",xv[xv.BASISLZ=1]="BASISLZ",xv[xv.ZSTD=2]="ZSTD",xv[xv.ZLIB=3]="ZLIB",function(e){e[e.BASICFORMAT=0]="BASICFORMAT"}(gv||(gv={})),function(e){e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.ETC1S=163]="ETC1S",e[e.UASTC=166]="UASTC"}(mv||(mv={})),function(e){e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.SRGB=1]="SRGB"}(bv||(bv={})),function(e){e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.LINEAR=1]="LINEAR",e[e.SRGB=2]="SRGB",e[e.ITU=3]="ITU",e[e.NTSC=4]="NTSC",e[e.SLOG=5]="SLOG",e[e.SLOG2=6]="SLOG2"}(Av||(Av={})),function(e){e[e.ALPHA_STRAIGHT=0]="ALPHA_STRAIGHT",e[e.ALPHA_PREMULTIPLIED=1]="ALPHA_PREMULTIPLIED"}(Bv||(Bv={})),function(e){e[e.RGB=0]="RGB",e[e.RRR=3]="RRR",e[e.GGG=4]="GGG",e[e.AAA=15]="AAA"}(wv||(wv={})),function(e){e[e.RGB=0]="RGB",e[e.RGBA=3]="RGBA",e[e.RRR=4]="RRR",e[e.RRRG=5]="RRRG"}(_v||(_v={}));var Cv=[171,75,84,88,32,50,48,187,13,10,26,10];function Ov(e){var t=new Uint8Array(e);return!(t.byteLength<Cv.length||t[0]!==Cv[0]||t[1]!==Cv[1]||t[2]!==Cv[2]||t[3]!==Cv[3]||t[4]!==Cv[4]||t[5]!==Cv[5]||t[6]!==Cv[6]||t[7]!==Cv[7]||t[8]!==Cv[8]||t[9]!==Cv[9]||t[10]!==Cv[10]||t[11]!==Cv[11])}var Ev={etc1:{basisFormat:0,compressed:!0,format:cv.COMPRESSED_RGB_ETC1_WEBGL},etc2:{basisFormat:1,compressed:!0},bc1:{basisFormat:2,compressed:!0,format:cv.COMPRESSED_RGB_S3TC_DXT1_EXT},bc3:{basisFormat:3,compressed:!0,format:cv.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:cv.COMPRESSED_RGB_PVRTC_4BPPV1_IMG},"pvrtc1-4-rgba":{basisFormat:9,compressed:!0,format:cv.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG},"astc-4x4":{basisFormat:10,compressed:!0,format:cv.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 Tv(){return(Tv=Me()(Pe.a.mark((function e(t,r){var n,i,a,o,s,u;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("auto"!==r.basis.containerFormat){e.next=11;break}if(!Ov(t)){e.next=6;break}return e.next=4,iv(r);case 4:return n=e.sent,e.abrupt("return",Mv(n.KTX2File,t,r));case 6:return e.next=8,$p(r);case 8:return i=e.sent,a=i.BasisFile,e.abrupt("return",Sv(a,t,r));case 11:e.t0=r.basis.module,e.next="encoder"===e.t0?14:(e.t0,22);break;case 14:return e.next=16,iv(r);case 16:o=e.sent,e.t1=r.basis.containerFormat,e.next="ktx2"===e.t1?20:(e.t1,21);break;case 20:return e.abrupt("return",Mv(o.KTX2File,t,r));case 21:return e.abrupt("return",Sv(o.BasisFile,t,r));case 22:return e.next=24,$p(r);case 24:return s=e.sent,u=s.BasisFile,e.abrupt("return",Sv(u,t,r));case 27:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Sv(e,t,r){var n=new e(new Uint8Array(t));try{if(!n.startTranscoding())throw new Error("Failed to start basis transcoding");for(var i=n.getNumImages(),a=[],o=0;o<i;o++){for(var s=n.getNumLevels(o),u=[],c=0;c<s;c++)u.push(kv(n,o,c,r));a.push(u)}return a}finally{n.close(),n.delete()}}function kv(e,t,r,n){var i=e.getImageWidth(t,r),a=e.getImageHeight(t,r),o=e.getHasAlpha(),s=Pv(n,o),u=s.compressed,c=s.format,l=s.basisFormat,f=e.getImageTranscodedSizeInBytes(t,r,l),h=new Uint8Array(f);if(!e.transcodeImage(h,t,r,l,0,0))throw new Error("failed to start Basis transcoding");return{width:i,height:a,data:h,compressed:u,format:c,hasAlpha:o}}function Mv(e,t,r){var n=new e(new Uint8Array(t));try{if(!n.startTranscoding())throw new Error("failed to start KTX2 transcoding");for(var i=n.getLevels(),a=[],o=0;o<i;o++){a.push(Iv(n,o,r));break}return[a]}finally{n.close(),n.delete()}}function Iv(e,t,r){var n=e.getImageLevelInfo(t,0,0),i=n.alphaFlag,a=n.height,o=n.width,s=Pv(r,i),u=s.compressed,c=s.format,l=s.basisFormat,f=e.getImageTranscodedSizeInBytes(t,0,0,l),h=new Uint8Array(f);if(!e.transcodeImage(h,t,0,0,l,0,-1,-1))throw new Error("Failed to transcode KTX2 image");return{width:o,height:a,data:h,compressed:u,hasAlpha:i,format:c}}function Pv(e,t){var r=e&&e.basis&&e.basis.format;return"auto"===r&&(r=Rv()),"object"===mi()(r)&&(r=t?r.alpha:r.noAlpha),r=r.toLowerCase(),Ev[r]}function Rv(){var e=vv();return e.has("astc")?"astc-4x4":e.has("dxt")?{alpha:"bc3",noAlpha:"bc1"}:e.has("pvrtc")?{alpha:"pvrtc1-4-rgba",noAlpha:"pvrtc1-4-rgb"}:e.has("etc1")?"etc1":e.has("etc2")?"etc2":"rgb565"}function Fv(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Dv(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Fv(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Fv(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Lv={name:"Basis",id:"basis",module:"textures",version:"3.2.10",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"}}},jv=Dv(Dv({},Lv),{},{parse:function(e,t){return Tv.apply(this,arguments)}}),Gv=globalThis._parseImageNode,Uv="undefined"!=typeof Image,Nv="undefined"!=typeof ImageBitmap,Hv=Boolean(Gv),Jv=!!tc||Hv;function Vv(e){var t=Kv(e);if(!t)throw new Error("Not an image");return t}function zv(e){switch(Vv(e)){case"data":return e;case"image":case"imagebitmap":var t=document.createElement("canvas"),r=t.getContext("2d");if(!r)throw new Error("getImageData");return t.width=e.width,t.height=e.height,r.drawImage(e,0,0),r.getImageData(0,0,e.width,e.height);default:throw new Error("getImageData")}}function Kv(e){return"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap?"imagebitmap":"undefined"!=typeof Image&&e instanceof Image?"image":e&&"object"===mi()(e)&&e.data&&e.width&&e.height?"data":null}var qv=/^data:image\/svg\+xml/,Xv=/\.svg((\?|#).*)?$/;function Qv(e){return e&&(qv.test(e)||Xv.test(e))}function Wv(e,t){if(Qv(t)){var r=(new TextDecoder).decode(e);try{"function"==typeof unescape&&"function"==typeof encodeURIComponent&&(r=unescape(encodeURIComponent(r)))}catch(e){throw new Error(e.message)}return"data:image/svg+xml;base64,".concat(btoa(r))}return Zv(e,t)}function Zv(e,t){if(Qv(t))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(e)])}function Yv(e,t,r){return $v.apply(this,arguments)}function $v(){return($v=Me()(Pe.a.mark((function e(t,r,n){var i,a,o;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=Wv(t,n),a=self.URL||self.webkitURL,o="string"!=typeof i&&a.createObjectURL(i),e.prev=3,e.next=6,ey(o||i,r);case 6:return e.abrupt("return",e.sent);case 7:return e.prev=7,o&&a.revokeObjectURL(o),e.finish(7);case 10:case"end":return e.stop()}}),e,null,[[3,,7,10]])})))).apply(this,arguments)}function ey(e,t){return ty.apply(this,arguments)}function ty(){return(ty=Me()(Pe.a.mark((function e(t,r){var n;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((n=new Image).src=t,!(r.image&&r.image.decode&&n.decode)){e.next=6;break}return e.next=5,n.decode();case 5:return e.abrupt("return",n);case 6:return e.next=8,new Promise((function(e,r){try{n.onload=function(){return e(n)},n.onerror=function(e){return r(new Error("Could not load image ".concat(t,": ").concat(e)))}}catch(e){r(e)}}));case 8:return e.abrupt("return",e.sent);case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var ry={},ny=!0;function iy(e,t,r){return ay.apply(this,arguments)}function ay(){return(ay=Me()(Pe.a.mark((function e(t,r,n){var i,a,o;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!Qv(n)){e.next=7;break}return e.next=3,Yv(t,r,n);case 3:a=e.sent,i=a,e.next=8;break;case 7:i=Zv(t,n);case 8:return o=r&&r.imagebitmap,e.next=11,oy(i,o);case 11:return e.abrupt("return",e.sent);case 12:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function oy(e){return sy.apply(this,arguments)}function sy(){return(sy=Me()(Pe.a.mark((function e(t){var r,n=arguments;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!uy(r=n.length>1&&void 0!==n[1]?n[1]:null)&&ny||(r=null),!r){e.next=13;break}return e.prev=3,e.next=6,createImageBitmap(t,r);case 6:return e.abrupt("return",e.sent);case 9:e.prev=9,e.t0=e.catch(3),console.warn(e.t0),ny=!1;case 13:return e.next=15,createImageBitmap(t);case 15:return e.abrupt("return",e.sent);case 16:case"end":return e.stop()}}),e,null,[[3,9]])})))).apply(this,arguments)}function uy(e){for(var t in e||ry)return!1;return!0}function cy(e){var t=ly(e);return function(e){var t=ly(e);if(!(t.byteLength>=24&&2303741511===t.getUint32(0,!1)))return null;return{mimeType:"image/png",width:t.getUint32(16,!1),height:t.getUint32(20,!1)}}(t)||function(e){var t=ly(e);if(!(t.byteLength>=3&&65496===t.getUint16(0,!1)&&255===t.getUint8(2)))return null;var r=function(){for(var e=new Set([65499,65476,65484,65501,65534]),t=65504;t<65520;++t)e.add(t);var r=new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502]);return{tableMarkers:e,sofMarkers:r}}(),n=r.tableMarkers,i=r.sofMarkers,a=2;for(;a+9<t.byteLength;){var o=t.getUint16(a,!1);if(i.has(o))return{mimeType:"image/jpeg",height:t.getUint16(a+5,!1),width:t.getUint16(a+7,!1)};if(!n.has(o))return null;a+=2,a+=t.getUint16(a,!1)}return null}(t)||function(e){var t=ly(e);if(!(t.byteLength>=10&&1195984440===t.getUint32(0,!1)))return null;return{mimeType:"image/gif",width:t.getUint16(6,!0),height:t.getUint16(8,!0)}}(t)||function(e){var t=ly(e);if(!(t.byteLength>=14&&16973===t.getUint16(0,!1)&&t.getUint32(2,!0)===t.byteLength))return null;return{mimeType:"image/bmp",width:t.getUint32(18,!0),height:t.getUint32(22,!0)}}(t)}function ly(e){if(e instanceof DataView)return e;if(ArrayBuffer.isView(e))return new DataView(e.buffer);if(e instanceof ArrayBuffer)return new DataView(e);throw new Error("toDataView")}function fy(e,t){return hy.apply(this,arguments)}function hy(){return(hy=Me()(Pe.a.mark((function e(t,r){var n,i,a;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=cy(t)||{},i=n.mimeType,eu(a=globalThis._parseImageNode),e.next=5,a(t,i);case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function dy(){return(dy=Me()(Pe.a.mark((function e(t,r,n){var i,a,o,s,u;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=(r=r||{}).image||{},a=i.type||"auto",o=(n||{}).url,s=py(a),e.t0=s,e.next="imagebitmap"===e.t0?8:"image"===e.t0?12:"data"===e.t0?16:20;break;case 8:return e.next=10,iy(t,r,o);case 10:return u=e.sent,e.abrupt("break",21);case 12:return e.next=14,Yv(t,r,o);case 14:return u=e.sent,e.abrupt("break",21);case 16:return e.next=18,fy(t,r);case 18:return u=e.sent,e.abrupt("break",21);case 20:eu(!1);case 21:return"data"===a&&(u=zv(u)),e.abrupt("return",u);case 23:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function py(e){switch(e){case"auto":case"data":return function(){if(Nv)return"imagebitmap";if(Uv)return"image";if(Jv)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}();default:return function(e){switch(e){case"auto":return Nv||Uv||Jv;case"imagebitmap":return Nv;case"image":return Uv;case"data":return Jv;default:throw new Error("@loaders.gl/images: image ".concat(e," not supported in this environment"))}}(e),e}}var vy={id:"image",module:"images",name:"Images",version:"3.2.10",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(e,t,r){return dy.apply(this,arguments)},tests:[function(e){return Boolean(cy(new DataView(e)))}],options:{image:{type:"auto",decode:!0}}};function yy(e,t,r){if(e.byteLength<=t+r)return"";for(var n=new DataView(e),i="",a=0;a<r;a++)i+=String.fromCharCode(n.getUint8(t+a));return i}function gy(e){try{return JSON.parse(e)}catch(t){throw new Error('Failed to parse JSON from data starting with "'.concat(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5;if("string"==typeof e)return e.slice(0,t);if(ArrayBuffer.isView(e))return yy(e.buffer,e.byteOffset,t);if(e instanceof ArrayBuffer){var r=0;return yy(e,r,t)}return""}(e),'"'))}}function my(e,t){if(!e)throw new Error(t||"assert failed: gltf")}function by(e,t){if(e.startsWith("data:")||e.startsWith("http:")||e.startsWith("https:"))return e;var r=t.baseUri||t.uri;if(!r)throw new Error("'baseUri' must be provided to resolve relative url ".concat(e));return r.substr(0,r.lastIndexOf("/")+1)+e}function Ay(e,t,r){var n=e.bufferViews[r];my(n);var i=t[n.buffer];my(i);var a=(n.byteOffset||0)+i.byteOffset;return new Uint8Array(i.arrayBuffer,a,n.byteLength)}function By(e,t){return eu(e>=0),eu(t>0),e+(t-1)&~(t-1)}function wy(e,t,r){var n;if(e instanceof ArrayBuffer)n=new Uint8Array(e);else{var i=e.byteOffset,a=e.byteLength;n=new Uint8Array(e.buffer||e.arrayBuffer,i,a)}return t.set(n,r),r+By(n.byteLength,4)}var _y=["SCALAR","VEC2","VEC3","VEC4"],xy=[[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Uint32Array,5125],[Float32Array,5126],[Float64Array,5130]],Cy=new Map(xy),Oy={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Ey={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},Ty={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function Sy(e){return _y[e-1]||_y[0]}function ky(e){var t=Cy.get(e.constructor);if(!t)throw new Error("Illegal typed array");return t}function My(e,t){var r=Ty[e.componentType],n=Oy[e.type],i=Ey[e.componentType],a=e.count*n,o=e.count*n*i;return my(o>=0&&o<=t.byteLength),{ArrayType:r,length:a,byteLength:o}}function Iy(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return Py(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Py(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function Py(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Ry(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Fy(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ry(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ry(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Dy,Ly={asset:{version:"2.0",generator:"loaders.gl"},buffers:[]},jy=function(){function e(t){h()(this,e),Hn(this,"gltf",void 0),Hn(this,"sourceBuffers",void 0),Hn(this,"byteLength",void 0),this.gltf=t||{json:Fy({},Ly),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 C()(e,[{key:"json",get:function(){return this.gltf.json}},{key:"getApplicationData",value:function(e){return this.json[e]}},{key:"getExtraData",value:function(e){return(this.json.extras||{})[e]}},{key:"getExtension",value:function(e){var t=this.getUsedExtensions().find((function(t){return t===e})),r=this.json.extensions||{};return t?r[e]||!0:null}},{key:"getRequiredExtension",value:function(e){return this.getRequiredExtensions().find((function(t){return t===e}))?this.getExtension(e):null}},{key:"getRequiredExtensions",value:function(){return this.json.extensionsRequired||[]}},{key:"getUsedExtensions",value:function(){return this.json.extensionsUsed||[]}},{key:"getObjectExtension",value:function(e,t){return(e.extensions||{})[t]}},{key:"getScene",value:function(e){return this.getObject("scenes",e)}},{key:"getNode",value:function(e){return this.getObject("nodes",e)}},{key:"getSkin",value:function(e){return this.getObject("skins",e)}},{key:"getMesh",value:function(e){return this.getObject("meshes",e)}},{key:"getMaterial",value:function(e){return this.getObject("materials",e)}},{key:"getAccessor",value:function(e){return this.getObject("accessors",e)}},{key:"getTexture",value:function(e){return this.getObject("textures",e)}},{key:"getSampler",value:function(e){return this.getObject("samplers",e)}},{key:"getImage",value:function(e){return this.getObject("images",e)}},{key:"getBufferView",value:function(e){return this.getObject("bufferViews",e)}},{key:"getBuffer",value:function(e){return this.getObject("buffers",e)}},{key:"getObject",value:function(e,t){if("object"===mi()(t))return t;var r=this.json[e]&&this.json[e][t];if(!r)throw new Error("glTF file error: Could not find ".concat(e,"[").concat(t,"]"));return r}},{key:"getTypedArrayForBufferView",value:function(e){var t=(e=this.getBufferView(e)).buffer,r=this.gltf.buffers[t];my(r);var n=(e.byteOffset||0)+r.byteOffset;return new Uint8Array(r.arrayBuffer,n,e.byteLength)}},{key:"getTypedArrayForAccessor",value:function(e){e=this.getAccessor(e);var t=this.getBufferView(e.bufferView),r=this.getBuffer(t.buffer).data,n=My(e,t),i=n.ArrayType,a=n.length;return new i(r,t.byteOffset+e.byteOffset,a)}},{key:"getTypedArrayForImageData",value:function(e){e=this.getAccessor(e);var t=this.getBufferView(e.bufferView),r=this.getBuffer(t.buffer).data,n=t.byteOffset||0;return new Uint8Array(r,n,t.byteLength)}},{key:"addApplicationData",value:function(e,t){return this.json[e]=t,this}},{key:"addExtraData",value:function(e,t){return this.json.extras=this.json.extras||{},this.json.extras[e]=t,this}},{key:"addObjectExtension",value:function(e,t,r){return e.extensions=e.extensions||{},e.extensions[t]=r,this.registerUsedExtension(t),this}},{key:"setObjectExtension",value:function(e,t,r){(e.extensions||{})[t]=r}},{key:"removeObjectExtension",value:function(e,t){var r=e.extensions||{},n=r[t];return delete r[t],n}},{key:"addExtension",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return my(t),this.json.extensions=this.json.extensions||{},this.json.extensions[e]=t,this.registerUsedExtension(e),t}},{key:"addRequiredExtension",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return my(t),this.addExtension(e,t),this.registerRequiredExtension(e),t}},{key:"registerUsedExtension",value:function(e){this.json.extensionsUsed=this.json.extensionsUsed||[],this.json.extensionsUsed.find((function(t){return t===e}))||this.json.extensionsUsed.push(e)}},{key:"registerRequiredExtension",value:function(e){this.registerUsedExtension(e),this.json.extensionsRequired=this.json.extensionsRequired||[],this.json.extensionsRequired.find((function(t){return t===e}))||this.json.extensionsRequired.push(e)}},{key:"removeExtension",value:function(e){this.json.extensionsRequired&&this._removeStringFromArray(this.json.extensionsRequired,e),this.json.extensionsUsed&&this._removeStringFromArray(this.json.extensionsUsed,e),this.json.extensions&&delete this.json.extensions[e]}},{key:"setDefaultScene",value:function(e){this.json.scene=e}},{key:"addScene",value:function(e){var t=e.nodeIndices;return this.json.scenes=this.json.scenes||[],this.json.scenes.push({nodes:t}),this.json.scenes.length-1}},{key:"addNode",value:function(e){var t=e.meshIndex,r=e.matrix;this.json.nodes=this.json.nodes||[];var n={mesh:t};return r&&(n.matrix=r),this.json.nodes.push(n),this.json.nodes.length-1}},{key:"addMesh",value:function(e){var t=e.attributes,r=e.indices,n=e.material,i=e.mode,a=void 0===i?4:i,o={primitives:[{attributes:this._addAttributes(t),mode:a}]};if(r){var s=this._addIndices(r);o.primitives[0].indices=s}return Number.isFinite(n)&&(o.primitives[0].material=n),this.json.meshes=this.json.meshes||[],this.json.meshes.push(o),this.json.meshes.length-1}},{key:"addPointCloud",value:function(e){var t={primitives:[{attributes:this._addAttributes(e),mode:0}]};return this.json.meshes=this.json.meshes||[],this.json.meshes.push(t),this.json.meshes.length-1}},{key:"addImage",value:function(e,t){var r=cy(e),n=t||(null==r?void 0:r.mimeType),i={bufferView:this.addBufferView(e),mimeType:n};return this.json.images=this.json.images||[],this.json.images.push(i),this.json.images.length-1}},{key:"addBufferView",value:function(e){var t=e.byteLength;my(Number.isFinite(t)),this.sourceBuffers=this.sourceBuffers||[],this.sourceBuffers.push(e);var r={buffer:0,byteOffset:this.byteLength,byteLength:t};return this.byteLength+=By(t,4),this.json.bufferViews=this.json.bufferViews||[],this.json.bufferViews.push(r),this.json.bufferViews.length-1}},{key:"addAccessor",value:function(e,t){var r={bufferView:e,type:Sy(t.size),componentType:t.componentType,count:t.count,max:t.max,min:t.min};return this.json.accessors=this.json.accessors||[],this.json.accessors.push(r),this.json.accessors.length-1}},{key:"addBinaryBuffer",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{size:3},r=this.addBufferView(e),n={min:t.min,max:t.max};n.min&&n.max||(n=this._getAccessorMinMax(e,t.size));var i={size:t.size,componentType:ky(e),count:Math.round(e.length/t.size),min:n.min,max:n.max};return this.addAccessor(r,Object.assign(i,t))}},{key:"addTexture",value:function(e){var t={source:e.imageIndex};return this.json.textures=this.json.textures||[],this.json.textures.push(t),this.json.textures.length-1}},{key:"addMaterial",value:function(e){return this.json.materials=this.json.materials||[],this.json.materials.push(e),this.json.materials.length-1}},{key:"createBinaryChunk",value:function(){var e,t;this.gltf.buffers=[];var r,n=this.byteLength,i=new ArrayBuffer(n),a=new Uint8Array(i),o=0,s=Iy(this.sourceBuffers||[]);try{for(s.s();!(r=s.n()).done;){o=wy(r.value,a,o)}}catch(e){s.e(e)}finally{s.f()}null!==(e=this.json)&&void 0!==e&&null!==(t=e.buffers)&&void 0!==t&&t[0]?this.json.buffers[0].byteLength=n:this.json.buffers=[{byteLength:n}],this.gltf.binary=i,this.sourceBuffers=[i]}},{key:"_removeStringFromArray",value:function(e,t){for(var r=!0;r;){var n=e.indexOf(t);n>-1?e.splice(n,1):r=!1}}},{key:"_addAttributes",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={};for(var r in e){var n=e[r],i=this._getGltfAttributeName(r),a=this.addBinaryBuffer(n.value,n);t[i]=a}return t}},{key:"_addIndices",value:function(e){return this.addBinaryBuffer(e,{size:1})}},{key:"_getGltfAttributeName",value:function(e){switch(e.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 e}}},{key:"_getAccessorMinMax",value:function(e,t){var r={min:null,max:null};if(e.length<t)return r;r.min=[],r.max=[];var n,i=Iy(e.subarray(0,t));try{for(i.s();!(n=i.n()).done;){var a=n.value;r.min.push(a),r.max.push(a)}}catch(e){i.e(e)}finally{i.f()}for(var o=t;o<e.length;o+=t)for(var s=0;s<t;s++)r.min[0+s]=Math.min(r.min[0+s],e[o+s]),r.max[0+s]=Math.max(r.max[0+s],e[o+s]);return r}}]),e}(),Gy=("undefined"==typeof WebAssembly||mi()(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"),Uy="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",Ny=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]),Hy=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]),Jy={0:"",1:"meshopt_decodeFilterOct",2:"meshopt_decodeFilterQuat",3:"meshopt_decodeFilterExp",NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},Vy={0:"meshopt_decodeVertexBuffer",1:"meshopt_decodeIndexBuffer",2:"meshopt_decodeIndexSequence",ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"};function zy(e,t,r,n,i){return Ky.apply(this,arguments)}function Ky(){return(Ky=Me()(Pe.a.mark((function e(t,r,n,i,a){var o,s,u=arguments;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=u.length>5&&void 0!==u[5]?u[5]:"NONE",e.next=3,qy();case 3:Yy(s=e.sent,s.exports[Vy[a]],t,r,n,i,s.exports[Jy[o||"NONE"]]);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function qy(){return Xy.apply(this,arguments)}function Xy(){return(Xy=Me()(Pe.a.mark((function e(){return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Dy||(Dy=Qy()),e.abrupt("return",Dy);case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Qy(){return Wy.apply(this,arguments)}function Wy(){return(Wy=Me()(Pe.a.mark((function e(){var t,r;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=Gy,WebAssembly.validate(Ny)&&(t=Uy,console.log("Warning: meshopt_decoder is using experimental SIMD support")),e.next=4,WebAssembly.instantiate(Zy(t),{});case 4:return r=e.sent,e.next=7,r.instance.exports.__wasm_call_ctors();case 7:return e.abrupt("return",r.instance);case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Zy(e){for(var t=new Uint8Array(e.length),r=0;r<e.length;++r){var n=e.charCodeAt(r);t[r]=n>96?n-71:n>64?n-65:n>47?n+4:n>46?63:62}for(var i=0,a=0;a<e.length;++a)t[i++]=t[a]<60?Hy[t[a]]:64*(t[a]-60)+t[++a];return t.buffer.slice(0,i)}function Yy(e,t,r,n,i,a,o){var s=e.exports.sbrk,u=n+3&-4,c=s(u*i),l=s(a.length),f=new Uint8Array(e.exports.memory.buffer);f.set(a,l);var h=t(c,n,i,l,a.length);if(0===h&&o&&o(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 $y(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return eg(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return eg(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function eg(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var tg="EXT_meshopt_compression";function rg(e,t){return ng.apply(this,arguments)}function ng(){return(ng=Me()(Pe.a.mark((function e(t,r){var n,i,a,o,s,u;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=new jy(t),null!=r&&null!==(n=r.gltf)&&void 0!==n&&n.decompressMeshes){e.next=3;break}return e.abrupt("return");case 3:a=[],o=$y(t.json.bufferViews||[]);try{for(o.s();!(s=o.n()).done;)u=s.value,a.push(ig(i,u))}catch(e){o.e(e)}finally{o.f()}return e.next=8,Promise.all(a);case 8:i.removeExtension("EXT_meshopt_compression");case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ig(e,t){return ag.apply(this,arguments)}function ag(){return(ag=Me()(Pe.a.mark((function e(t,r){var n,i,a,o,s,u,c,l,f,h,d,p,v,y;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(n=t.getObjectExtension(r,"EXT_meshopt_compression"))){e.next=9;break}return i=n.byteOffset,a=void 0===i?0:i,o=n.byteLength,s=void 0===o?0:o,u=n.byteStride,c=n.count,l=n.mode,f=n.filter,h=void 0===f?"NONE":f,d=n.buffer,p=t.gltf.buffers[d],v=new Uint8Array(p.arrayBuffer,p.byteOffset+a,s),y=new Uint8Array(t.gltf.buffers[r.buffer].arrayBuffer,r.byteOffset,r.byteLength),e.next=8,zy(y,c,u,v,l,h);case 8:return e.abrupt("return",y);case 9:return e.abrupt("return",null);case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var og=["image/png","image/jpeg","image/gif"],sg={};function ug(e){return void 0===sg[e]&&(sg[e]=function(e){switch(e){case"image/webp":return function(){if(!tc)return!1;try{return 0===document.createElement("canvas").toDataURL("image/webp").indexOf("data:image/webp")}catch(e){return!1}}();case"image/svg":return tc;default:if(!tc){var t=globalThis._parseImageNode;return Boolean(t)&&og.includes(e)}return!0}}(e)),sg[e]}function cg(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return lg(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return lg(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function lg(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var fg="EXT_texture_webp";function hg(e,t){var r=new jy(e);if(ug("image/webp")){var n,i=cg(r.json.textures||[]);try{for(i.s();!(n=i.n()).done;){var a=n.value,o=r.getObjectExtension(a,"EXT_texture_webp");o&&(a.source=o.source),r.removeObjectExtension(a,"EXT_texture_webp")}}catch(e){i.e(e)}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 dg(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return pg(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return pg(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function pg(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var vg="KHR_texture_basisu";function yg(e,t){var r,n=new jy(e),i=dg(n.json.textures||[]);try{for(i.s();!(r=i.n()).done;){var a=r.value,o=n.getObjectExtension(a,"KHR_texture_basisu");o&&(a.source=o.source),n.removeObjectExtension(a,"KHR_texture_basisu")}}catch(e){i.e(e)}finally{i.f()}n.removeExtension("KHR_texture_basisu")}function gg(e){var t={};for(var r in e){var n=e[r];if("indices"!==r){var i=mg(n);t[r]=i}}return t}function mg(e){var t=function(e){var t=e,r=1,n=0;e&&e.value&&(t=e.value,r=e.size||1);t&&(ArrayBuffer.isView(t)||(t=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!e)return null;if(Array.isArray(e))return new t(e);if(r&&!(e instanceof t))return new t(e);return e}(t,Float32Array)),n=t.length/r);return{buffer:t,size:r,count:n}}(e),r=t.buffer,n=t.size;return{value:r,size:n,byteOffset:0,count:t.count,type:Sy(n),componentType:ky(r)}}function bg(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ag(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?bg(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):bg(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Bg=Pe.a.mark(Pg);function wg(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return _g(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return _g(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function _g(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var xg="KHR_draco_mesh_compression";function Cg(e,t,r){var n,i=new jy(e),a=wg(Pg(i));try{for(a.s();!(n=a.n()).done;){var o=n.value;i.getObjectExtension(o,"KHR_draco_mesh_compression")}}catch(e){a.e(e)}finally{a.f()}}function Og(e,t,r){return Eg.apply(this,arguments)}function Eg(){return(Eg=Me()(Pe.a.mark((function e(t,r,n){var i,a,o,s,u,c;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=r&&null!==(i=r.gltf)&&void 0!==i&&i.decompressMeshes){e.next=2;break}return e.abrupt("return");case 2:a=new jy(t),o=[],s=wg(Pg(a));try{for(s.s();!(u=s.n()).done;)c=u.value,a.getObjectExtension(c,"KHR_draco_mesh_compression")&&o.push(Sg(a,c,r,n))}catch(e){s.e(e)}finally{s.f()}return e.next=8,Promise.all(o);case 8:a.removeExtension("KHR_draco_mesh_compression");case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Tg(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=new jy(e),i=wg(n.json.meshes||[]);try{for(i.s();!(t=i.n()).done;){var a=t.value;Mg(a,r),n.addRequiredExtension("KHR_draco_mesh_compression")}}catch(e){i.e(e)}finally{i.f()}}function Sg(e,t,r,n){return kg.apply(this,arguments)}function kg(){return(kg=Me()(Pe.a.mark((function e(t,r,n,i){var a,o,s,u,c,l,f,h,d,p,v,y,g,m;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=t.getObjectExtension(r,"KHR_draco_mesh_compression")){e.next=3;break}return e.abrupt("return");case 3:return o=t.getTypedArrayForBufferView(a.bufferView),s=tl(o.buffer,o.byteOffset),u=i.parse,delete(c=Ag({},n))["3d-tiles"],e.next=10,u(s,op,c,i);case 10:for(l=e.sent,f=gg(l.attributes),h=0,d=Object.entries(f);h<d.length;h++)p=M()(d[h],2),v=p[0],y=p[1],v in r.attributes&&(g=r.attributes[v],null!=(m=t.getAccessor(g))&&m.min&&null!=m&&m.max&&(y.min=m.min,y.max=m.max));r.attributes=f,l.indices&&(r.indices=mg(l.indices)),Ig(r);case 16:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Mg(e,t){var r,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:4,i=arguments.length>3?arguments[3]:void 0,a=arguments.length>4?arguments[4]:void 0;if(!i.DracoWriter)throw new Error("options.gltf.DracoWriter not provided");var o=i.DracoWriter.encodeSync({attributes:e}),s=null==a?void 0:null===(r=a.parseSync)||void 0===r?void 0:r.call(a,{attributes:e}),u=i._addFauxAttributes(s.attributes),c=i.addBufferView(o),l={primitives:[{attributes:u,mode:n,extensions:A()({},"KHR_draco_mesh_compression",{bufferView:c,attributes:u})}]};return l}function Ig(e){if(!e.attributes&&Object.keys(e.attributes).length>0)throw new Error("glTF: Empty primitive detected: Draco decompression failure?")}function Pg(e){var t,r,n,i,a,o;return Pe.a.wrap((function(s){for(;;)switch(s.prev=s.next){case 0:t=wg(e.json.meshes||[]),s.prev=1,t.s();case 3:if((r=t.n()).done){s.next=24;break}n=r.value,i=wg(n.primitives),s.prev=6,i.s();case 8:if((a=i.n()).done){s.next=14;break}return o=a.value,s.next=12,o;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),t.e(s.t1);case 29:return s.prev=29,t.f(),s.finish(29);case 32:case"end":return s.stop()}}),Bg,null,[[1,26,29,32],[6,16,19,22]])}function Rg(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return Fg(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Fg(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function Fg(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Dg="KHR_lights_punctual";function Lg(e){return jg.apply(this,arguments)}function jg(){return(jg=Me()(Pe.a.mark((function e(t){var r,n,i,a,o,s,u;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=new jy(t),n=r.json,(i=r.getExtension("KHR_lights_punctual"))&&(r.json.lights=i.lights,r.removeExtension("KHR_lights_punctual")),a=Rg(n.nodes||[]);try{for(a.s();!(o=a.n()).done;)s=o.value,(u=r.getObjectExtension(s,"KHR_lights_punctual"))&&(s.light=u.light),r.removeObjectExtension(s,"KHR_lights_punctual")}catch(e){a.e(e)}finally{a.f()}case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Gg(e){return Ug.apply(this,arguments)}function Ug(){return(Ug=Me()(Pe.a.mark((function e(t){var r,n,i,a,o,s,u;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=new jy(t),(n=r.json).lights&&(my(!(i=r.addExtension("KHR_lights_punctual")).lights),i.lights=n.lights,delete n.lights),r.json.lights){a=Rg(r.json.lights);try{for(a.s();!(o=a.n()).done;)s=o.value,u=s.node,r.addObjectExtension(u,"KHR_lights_punctual",s)}catch(e){a.e(e)}finally{a.f()}delete r.json.lights}case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ng(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return Hg(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Hg(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function Hg(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Jg="KHR_materials_unlit";function Vg(e){return zg.apply(this,arguments)}function zg(){return(zg=Me()(Pe.a.mark((function e(t){var r,n,i,a,o;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=new jy(t),n=r.json,r.removeExtension("KHR_materials_unlit"),i=Ng(n.materials||[]);try{for(i.s();!(a=i.n()).done;)o=a.value,o.extensions&&o.extensions.KHR_materials_unlit&&(o.unlit=!0),r.removeObjectExtension(o,"KHR_materials_unlit")}catch(e){i.e(e)}finally{i.f()}case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Kg(e){var t=new jy(e),r=t.json;if(t.materials){var n,i=Ng(r.materials||[]);try{for(i.s();!(n=i.n()).done;){var a=n.value;a.unlit&&(delete a.unlit,t.addObjectExtension(a,"KHR_materials_unlit",{}),t.addExtension("KHR_materials_unlit"))}}catch(e){i.e(e)}finally{i.f()}}}function qg(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return Xg(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Xg(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function Xg(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Qg="KHR_techniques_webgl";function Wg(e){return Zg.apply(this,arguments)}function Zg(){return(Zg=Me()(Pe.a.mark((function e(t){var r,n,i,a,o,s,u,c;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=new jy(t),n=r.json,i=r.getExtension("KHR_techniques_webgl")){a=em(i,r),o=qg(n.materials||[]);try{for(o.s();!(s=o.n()).done;)u=s.value,(c=r.getObjectExtension(u,"KHR_techniques_webgl"))&&(u.technique=Object.assign({},c,a[c.technique]),u.technique.values=tm(u.technique,r)),r.removeObjectExtension(u,"KHR_techniques_webgl")}catch(e){o.e(e)}finally{o.f()}r.removeExtension("KHR_techniques_webgl")}case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Yg(e,t){return $g.apply(this,arguments)}function $g(){return($g=Me()(Pe.a.mark((function e(t,r){return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function em(e,t){var r=e.programs,n=void 0===r?[]:r,i=e.shaders,a=void 0===i?[]:i,o=e.techniques,s=void 0===o?[]:o,u=new TextDecoder;return a.forEach((function(e){if(!Number.isFinite(e.bufferView))throw new Error("KHR_techniques_webgl: no shader code");e.code=u.decode(t.getTypedArrayForBufferView(e.bufferView))})),n.forEach((function(e){e.fragmentShader=a[e.fragmentShader],e.vertexShader=a[e.vertexShader]})),s.forEach((function(e){e.program=n[e.program]})),s}function tm(e,t){var r=Object.assign({},e.values);return Object.keys(e.uniforms||{}).forEach((function(t){!e.uniforms[t].value||t in r||(r[t]=e.uniforms[t].value)})),Object.keys(r).forEach((function(e){"object"===mi()(r[e])&&void 0!==r[e].index&&(r[e].texture=t.getTexture(r[e].index))})),r}function rm(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return nm(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return nm(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function nm(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var im=[i,a,o,s,u,c,l];function am(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,i=im.filter((function(e){return um(e.name,r)})),a=rm(i);try{for(a.s();!(t=a.n()).done;){var o,s=t.value;null===(o=s.preprocess)||void 0===o||o.call(s,e,r,n)}}catch(e){a.e(e)}finally{a.f()}}function om(e){return sm.apply(this,arguments)}function sm(){return(sm=Me()(Pe.a.mark((function e(t){var r,n,i,a,o,s,u,c=arguments;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=c.length>1&&void 0!==c[1]?c[1]:{},n=c.length>2?c[2]:void 0,i=im.filter((function(e){return um(e.name,r)})),a=rm(i),e.prev=4,a.s();case 6:if((o=a.n()).done){e.next=12;break}return s=o.value,e.next=10,null===(u=s.decode)||void 0===u?void 0:u.call(s,t,r,n);case 10:e.next=6;break;case 12:e.next=17;break;case 14:e.prev=14,e.t0=e.catch(4),a.e(e.t0);case 17:return e.prev=17,a.f(),e.finish(17);case 20:case"end":return e.stop()}}),e,null,[[4,14,17,20]])})))).apply(this,arguments)}function um(e,t){var r,n=(null==t?void 0:null===(r=t.gltf)||void 0===r?void 0:r.excludeExtensions)||{};return!(e in n&&!n[e])}function cm(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return lm(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return lm(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function lm(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function fm(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return hm(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return hm(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function hm(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var dm,pm={accessors:"accessor",animations:"animation",buffers:"buffer",bufferViews:"bufferView",images:"image",materials:"material",meshes:"mesh",nodes:"node",samplers:"sampler",scenes:"scene",skins:"skin",textures:"texture"},vm={accessor:"accessors",animations:"animation",buffer:"buffers",bufferView:"bufferViews",image:"images",material:"materials",mesh:"meshes",node:"nodes",sampler:"samplers",scene:"scenes",skin:"skins",texture:"textures"},ym=function(){function e(){h()(this,e),Hn(this,"idToIndexMap",{animations:{},accessors:{},buffers:{},bufferViews:{},images:{},materials:{},meshes:{},nodes:{},samplers:{},scenes:{},skins:{},textures:{}}),Hn(this,"json",void 0)}return C()(e,[{key:"normalize",value:function(e,t){this.json=e.json;var r=e.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(!t.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(e){var t,r=new jy(e),n=r.json,i=cm(n.images||[]);try{for(i.s();!(t=i.n()).done;){var a=t.value,o=r.getObjectExtension(a,"KHR_binary_glTF");o&&Object.assign(a,o),r.removeObjectExtension(a,"KHR_binary_glTF")}}catch(e){i.e(e)}finally{i.f()}n.buffers&&n.buffers[0]&&delete n.buffers[0].uri,r.removeExtension("KHR_binary_glTF")}(e),this._convertObjectIdsToArrayIndices(r),this._updateObjects(r),this._updateMaterial(r)}},{key:"_addAsset",value:function(e){e.asset=e.asset||{},e.asset.version="2.0",e.asset.generator=e.asset.generator||"Normalized to glTF 2.0 by loaders.gl"}},{key:"_convertTopLevelObjectsToArrays",value:function(e){for(var t in pm)this._convertTopLevelObjectToArray(e,t)}},{key:"_convertTopLevelObjectToArray",value:function(e,t){var r=e[t];if(r&&!Array.isArray(r))for(var n in e[t]=[],r){var i=r[n];i.id=i.id||n;var a=e[t].length;e[t].push(i),this.idToIndexMap[t][n]=a}}},{key:"_convertObjectIdsToArrayIndices",value:function(e){for(var t in pm)this._convertIdsToIndices(e,t);"scene"in e&&(e.scene=this._convertIdToIndex(e.scene,"scene"));var r,n=fm(e.textures);try{for(n.s();!(r=n.n()).done;){var i=r.value;this._convertTextureIds(i)}}catch(e){n.e(e)}finally{n.f()}var a,o=fm(e.meshes);try{for(o.s();!(a=o.n()).done;){var s=a.value;this._convertMeshIds(s)}}catch(e){o.e(e)}finally{o.f()}var u,c=fm(e.nodes);try{for(c.s();!(u=c.n()).done;){var l=u.value;this._convertNodeIds(l)}}catch(e){c.e(e)}finally{c.f()}var f,h=fm(e.scenes);try{for(h.s();!(f=h.n()).done;){var d=f.value;this._convertSceneIds(d)}}catch(e){h.e(e)}finally{h.f()}}},{key:"_convertTextureIds",value:function(e){e.source&&(e.source=this._convertIdToIndex(e.source,"image"))}},{key:"_convertMeshIds",value:function(e){var t,r=fm(e.primitives);try{for(r.s();!(t=r.n()).done;){var n=t.value,i=n.attributes,a=n.indices,o=n.material;for(var s in i)i[s]=this._convertIdToIndex(i[s],"accessor");a&&(n.indices=this._convertIdToIndex(a,"accessor")),o&&(n.material=this._convertIdToIndex(o,"material"))}}catch(e){r.e(e)}finally{r.f()}}},{key:"_convertNodeIds",value:function(e){var t=this;e.children&&(e.children=e.children.map((function(e){return t._convertIdToIndex(e,"node")}))),e.meshes&&(e.meshes=e.meshes.map((function(e){return t._convertIdToIndex(e,"mesh")})))}},{key:"_convertSceneIds",value:function(e){var t=this;e.nodes&&(e.nodes=e.nodes.map((function(e){return t._convertIdToIndex(e,"node")})))}},{key:"_convertIdsToIndices",value:function(e,t){e[t]||(console.warn("gltf v1: json doesn't contain attribute ".concat(t)),e[t]=[]);var r,n=fm(e[t]);try{for(n.s();!(r=n.n()).done;){var i=r.value;for(var a in i){var o=i[a],s=this._convertIdToIndex(o,a);i[a]=s}}}catch(e){n.e(e)}finally{n.f()}}},{key:"_convertIdToIndex",value:function(e,t){var r=vm[t];if(r in this.idToIndexMap){var n=this.idToIndexMap[r][e];if(!Number.isFinite(n))throw new Error("gltf v1: failed to resolve ".concat(t," with id ").concat(e));return n}return e}},{key:"_updateObjects",value:function(e){var t,r=fm(this.json.buffers);try{for(r.s();!(t=r.n()).done;){delete t.value.type}}catch(e){r.e(e)}finally{r.f()}}},{key:"_updateMaterial",value:function(e){var t,r=fm(e.materials);try{var n=function(){var r=t.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===(a=r.values)||void 0===a?void 0:a.texture2d_0)||(null===(o=r.values)||void 0===o?void 0:o.diffuseTex),s=e.textures.findIndex((function(e){return e.id===n}));-1!==s&&(r.pbrMetallicRoughness.baseColorTexture={index:s})};for(r.s();!(t=r.n()).done;){var i,a,o;n()}}catch(e){r.e(e)}finally{r.f()}}}]),e}();function gm(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(new ym).normalize(e,t)}function mm(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function bm(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?mm(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):mm(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Am={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Bm={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},wm=10240,_m=10241,xm=10242,Cm=10243,Om=10497,Em=9729,Tm=9986,Sm={magFilter:wm,minFilter:_m,wrapS:xm,wrapT:Cm},km=(dm={},A()(dm,wm,Em),A()(dm,_m,Tm),A()(dm,xm,Om),A()(dm,Cm,Om),dm);var Mm=function(){function e(){h()(this,e),Hn(this,"baseUri",""),Hn(this,"json",{}),Hn(this,"buffers",[]),Hn(this,"images",[])}return C()(e,[{key:"postProcess",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.json,n=e.buffers,i=void 0===n?[]:n,a=e.images,o=void 0===a?[]:a,s=e.baseUri,u=void 0===s?"":s;return my(r),this.baseUri=u,this.json=r,this.buffers=i,this.images=o,this._resolveTree(this.json,t),this.json}},{key:"_resolveTree",value:function(e){var t=this;arguments.length>1&&void 0!==arguments[1]&&arguments[1];e.bufferViews&&(e.bufferViews=e.bufferViews.map((function(e,r){return t._resolveBufferView(e,r)}))),e.images&&(e.images=e.images.map((function(e,r){return t._resolveImage(e,r)}))),e.samplers&&(e.samplers=e.samplers.map((function(e,r){return t._resolveSampler(e,r)}))),e.textures&&(e.textures=e.textures.map((function(e,r){return t._resolveTexture(e,r)}))),e.accessors&&(e.accessors=e.accessors.map((function(e,r){return t._resolveAccessor(e,r)}))),e.materials&&(e.materials=e.materials.map((function(e,r){return t._resolveMaterial(e,r)}))),e.meshes&&(e.meshes=e.meshes.map((function(e,r){return t._resolveMesh(e,r)}))),e.nodes&&(e.nodes=e.nodes.map((function(e,r){return t._resolveNode(e,r)}))),e.skins&&(e.skins=e.skins.map((function(e,r){return t._resolveSkin(e,r)}))),e.scenes&&(e.scenes=e.scenes.map((function(e,r){return t._resolveScene(e,r)}))),void 0!==e.scene&&(e.scene=e.scenes[this.json.scene])}},{key:"getScene",value:function(e){return this._get("scenes",e)}},{key:"getNode",value:function(e){return this._get("nodes",e)}},{key:"getSkin",value:function(e){return this._get("skins",e)}},{key:"getMesh",value:function(e){return this._get("meshes",e)}},{key:"getMaterial",value:function(e){return this._get("materials",e)}},{key:"getAccessor",value:function(e){return this._get("accessors",e)}},{key:"getCamera",value:function(e){return null}},{key:"getTexture",value:function(e){return this._get("textures",e)}},{key:"getSampler",value:function(e){return this._get("samplers",e)}},{key:"getImage",value:function(e){return this._get("images",e)}},{key:"getBufferView",value:function(e){return this._get("bufferViews",e)}},{key:"getBuffer",value:function(e){return this._get("buffers",e)}},{key:"_get",value:function(e,t){if("object"===mi()(t))return t;var r=this.json[e]&&this.json[e][t];return r||console.warn("glTF file error: Could not find ".concat(e,"[").concat(t,"]")),r}},{key:"_resolveScene",value:function(e,t){var r=this;return e.id=e.id||"scene-".concat(t),e.nodes=(e.nodes||[]).map((function(e){return r.getNode(e)})),e}},{key:"_resolveNode",value:function(e,t){var r=this;return e.id=e.id||"node-".concat(t),e.children&&(e.children=e.children.map((function(e){return r.getNode(e)}))),void 0!==e.mesh?e.mesh=this.getMesh(e.mesh):void 0!==e.meshes&&e.meshes.length&&(e.mesh=e.meshes.reduce((function(e,t){var n=r.getMesh(t);return e.id=n.id,e.primitives=e.primitives.concat(n.primitives),e}),{primitives:[]})),void 0!==e.camera&&(e.camera=this.getCamera(e.camera)),void 0!==e.skin&&(e.skin=this.getSkin(e.skin)),e}},{key:"_resolveSkin",value:function(e,t){return e.id=e.id||"skin-".concat(t),e.inverseBindMatrices=this.getAccessor(e.inverseBindMatrices),e}},{key:"_resolveMesh",value:function(e,t){var r=this;return e.id=e.id||"mesh-".concat(t),e.primitives&&(e.primitives=e.primitives.map((function(e){var t=(e=bm({},e)).attributes;for(var n in e.attributes={},t)e.attributes[n]=r.getAccessor(t[n]);return void 0!==e.indices&&(e.indices=r.getAccessor(e.indices)),void 0!==e.material&&(e.material=r.getMaterial(e.material)),e}))),e}},{key:"_resolveMaterial",value:function(e,t){if(e.id=e.id||"material-".concat(t),e.normalTexture&&(e.normalTexture=bm({},e.normalTexture),e.normalTexture.texture=this.getTexture(e.normalTexture.index)),e.occlusionTexture&&(e.occlustionTexture=bm({},e.occlustionTexture),e.occlusionTexture.texture=this.getTexture(e.occlusionTexture.index)),e.emissiveTexture&&(e.emmisiveTexture=bm({},e.emmisiveTexture),e.emissiveTexture.texture=this.getTexture(e.emissiveTexture.index)),e.emissiveFactor||(e.emissiveFactor=e.emmisiveTexture?[1,1,1]:[0,0,0]),e.pbrMetallicRoughness){e.pbrMetallicRoughness=bm({},e.pbrMetallicRoughness);var r=e.pbrMetallicRoughness;r.baseColorTexture&&(r.baseColorTexture=bm({},r.baseColorTexture),r.baseColorTexture.texture=this.getTexture(r.baseColorTexture.index)),r.metallicRoughnessTexture&&(r.metallicRoughnessTexture=bm({},r.metallicRoughnessTexture),r.metallicRoughnessTexture.texture=this.getTexture(r.metallicRoughnessTexture.index))}return e}},{key:"_resolveAccessor",value:function(e,t){var r,n;if(e.id=e.id||"accessor-".concat(t),void 0!==e.bufferView&&(e.bufferView=this.getBufferView(e.bufferView)),e.bytesPerComponent=(r=e.componentType,Bm[r]),e.components=(n=e.type,Am[n]),e.bytesPerElement=e.bytesPerComponent*e.components,e.bufferView){var i=e.bufferView.buffer,a=My(e,e.bufferView),o=a.ArrayType,s=a.byteLength,u=(e.bufferView.byteOffset||0)+(e.byteOffset||0)+i.byteOffset,c=i.arrayBuffer.slice(u,u+s);e.bufferView.byteStride&&(c=this._getValueFromInterleavedBuffer(i,u,e.bufferView.byteStride,e.bytesPerElement,e.count)),e.value=new o(c)}return e}},{key:"_getValueFromInterleavedBuffer",value:function(e,t,r,n,i){for(var a=new Uint8Array(i*n),o=0;o<i;o++){var s=t+o*r;a.set(new Uint8Array(e.arrayBuffer.slice(s,s+n)),o*n)}return a.buffer}},{key:"_resolveTexture",value:function(e,t){return e.id=e.id||"texture-".concat(t),e.sampler="sampler"in e?this.getSampler(e.sampler):km,e.source=this.getImage(e.source),e}},{key:"_resolveSampler",value:function(e,t){for(var r in e.id=e.id||"sampler-".concat(t),e.parameters={},e){var n=this._enumSamplerParameter(r);void 0!==n&&(e.parameters[n]=e[r])}return e}},{key:"_enumSamplerParameter",value:function(e){return Sm[e]}},{key:"_resolveImage",value:function(e,t){e.id=e.id||"image-".concat(t),void 0!==e.bufferView&&(e.bufferView=this.getBufferView(e.bufferView));var r=this.images[t];return r&&(e.image=r),e}},{key:"_resolveBufferView",value:function(e,t){var r=e.buffer,n=bm(bm({id:"bufferView-".concat(t)},e),{},{buffer:this.buffers[r]}),i=this.buffers[r].arrayBuffer,a=this.buffers[r].byteOffset||0;return"byteOffset"in e&&(a+=e.byteOffset),n.data=new Uint8Array(i,a,e.byteLength),n}},{key:"_resolveCamera",value:function(e,t){return e.id=e.id||"camera-".concat(t),e.perspective,e.orthographic,e}}]),e}();function Im(e,t){return(new Mm).postProcess(e,t)}function Pm(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return"".concat(String.fromCharCode(e.getUint8(t+0))).concat(String.fromCharCode(e.getUint8(t+1))).concat(String.fromCharCode(e.getUint8(t+2))).concat(String.fromCharCode(e.getUint8(t+3)))}function Rm(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=new DataView(e),i=r.magic,a=void 0===i?1735152710:i,o=n.getUint32(t,!1);return o===a||1735152710===o}function Fm(e,t,r){eu(e.header.byteLength>20);var n=t.getUint32(r+0,!0),i=t.getUint32(r+4,!0);return r+=8,eu(0===i),Lm(e,t,r,n),r+=n,r+=jm(e,t,r,e.header.byteLength)}function Dm(e,t,r,n){return eu(e.header.byteLength>20),function(e,t,r,n){for(;r+8<=e.header.byteLength;){var i=t.getUint32(r+0,!0),a=t.getUint32(r+4,!0);switch(r+=8,a){case 1313821514:Lm(e,t,r,i);break;case 5130562:jm(e,t,r,i);break;case 0:n.strict||Lm(e,t,r,i);break;case 1:n.strict||jm(e,t,r,i)}r+=By(i,4)}}(e,t,r,n),r+e.header.byteLength}function Lm(e,t,r,n){var i=new Uint8Array(t.buffer,r,n),a=new TextDecoder("utf8").decode(i);return e.json=JSON.parse(a),By(n,4)}function jm(e,t,r,n){return e.header.hasBinChunk=!0,e.binChunks.push({byteOffset:r,byteLength:n,arrayBuffer:t.buffer}),By(n,4)}function Gm(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return Um(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Um(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function Um(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Nm(e,t){return Hm.apply(this,arguments)}function Hm(){return(Hm=Me()(Pe.a.mark((function e(t,r){var n,i,a,o,s,u,c,l,f,h,d=arguments;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=d.length>2&&void 0!==d[2]?d[2]:0,i=d.length>3?d[3]:void 0,a=d.length>4?d[4]:void 0,Jm(t,r,n,i),gm(t,{normalize:null==i?void 0:null===(o=i.gltf)||void 0===o?void 0:o.normalize}),am(t,i,a),l=[],null==i||null===(s=i.gltf)||void 0===s||!s.loadBuffers||!t.json.buffers){e.next=10;break}return e.next=10,Vm(t,i,a);case 10:return null!=i&&null!==(u=i.gltf)&&void 0!==u&&u.loadImages&&(f=Km(t,i,a),l.push(f)),h=om(t,i,a),l.push(h),e.next=15,Promise.all(l);case 15:return e.abrupt("return",null!=i&&null!==(c=i.gltf)&&void 0!==c&&c.postProcess?Im(t,i):t);case 16:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Jm(e,t,r,n){(n.uri&&(e.baseUri=n.uri),t instanceof ArrayBuffer&&!Rm(t,r,n))&&(t=(new TextDecoder).decode(t));if("string"==typeof t)e.json=gy(t);else if(t instanceof ArrayBuffer){var i={};r=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=(arguments.length>3&&void 0!==arguments[3]&&arguments[3],new DataView(t)),i=Pm(n,r+0),a=n.getUint32(r+4,!0),o=n.getUint32(r+8,!0);switch(Object.assign(e,{header:{byteOffset:r,byteLength:o,hasBinChunk:!1},type:i,version:a,json:{},binChunks:[]}),r+=12,e.version){case 1:return Fm(e,n,r);case 2:return Dm(e,n,r,{});default:throw new Error("Invalid GLB version ".concat(e.version,". Only supports v1 and v2."))}}(i,t,r,n.glb),my("glTF"===i.type,"Invalid GLB magic string ".concat(i.type)),e._glb=i,e.json=i.json}else my(!1,"GLTF: must be ArrayBuffer or string");var a=e.json.buffers||[];if(e.buffers=new Array(a.length).fill(null),e._glb&&e._glb.header.hasBinChunk){var o=e._glb.binChunks;e.buffers[0]={arrayBuffer:o[0].arrayBuffer,byteOffset:o[0].byteOffset,byteLength:o[0].byteLength}}var s=e.json.images||[];e.images=new Array(s.length).fill({})}function Vm(e,t,r){return zm.apply(this,arguments)}function zm(){return(zm=Me()(Pe.a.mark((function e(t,r,n){var i,a,o,s,u,c,l,f;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=t.json.buffers||[],a=0;case 2:if(!(a<i.length)){e.next=22;break}if(!(o=i[a]).uri){e.next=18;break}return my(n.fetch),c=by(o.uri,r),e.next=10,null==n?void 0:null===(s=n.fetch)||void 0===s?void 0:s.call(n,c);case 10:return l=e.sent,e.next=13,null==l?void 0:null===(u=l.arrayBuffer)||void 0===u?void 0:u.call(l);case 13:f=e.sent,t.buffers[a]={arrayBuffer:f,byteOffset:0,byteLength:f.byteLength},delete o.uri,e.next=19;break;case 18:null===t.buffers[a]&&(t.buffers[a]={arrayBuffer:new ArrayBuffer(o.byteLength),byteOffset:0,byteLength:o.byteLength});case 19:++a,e.next=2;break;case 22:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Km(e,t,r){return qm.apply(this,arguments)}function qm(){return(qm=Me()(Pe.a.mark((function e(t,r,n){var i,a,o,s,u,c;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=Xm(t),a=t.json.images||[],o=[],s=Gm(i);try{for(s.s();!(u=s.n()).done;)c=u.value,o.push(Qm(t,a[c],c,r,n))}catch(e){s.e(e)}finally{s.f()}return e.next=7,Promise.all(o);case 7:return e.abrupt("return",e.sent);case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Xm(e){var t,r=new Set,n=Gm(e.json.textures||[]);try{for(n.s();!(t=n.n()).done;){var i=t.value;void 0!==i.source&&r.add(i.source)}}catch(e){n.e(e)}finally{n.f()}return Array.from(r).sort()}function Qm(e,t,r,n,i){return Wm.apply(this,arguments)}function Wm(){return(Wm=Me()(Pe.a.mark((function e(t,r,n,i,a){var o,s,u,c,l,f,h;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=a.fetch,s=a.parse,!r.uri||r.hasOwnProperty("bufferView")){e.next=9;break}return c=by(r.uri,i),e.next=5,o(c);case 5:return l=e.sent,e.next=8,l.arrayBuffer();case 8:u=e.sent;case 9:return Number.isFinite(r.bufferView)&&(f=Ay(t.json,t.buffers,r.bufferView),u=tl(f.buffer,f.byteOffset,f.byteLength)),my(u,"glTF image has no data"),e.next=13,s(u,[vy,jv],{mimeType:r.mimeType,basis:i.basis||{format:Rv()}},a);case 13:(h=e.sent)&&h[0]&&(h={compressed:!0,mipmaps:!1,width:h[0].width,height:h[0].height,data:h[0]}),t.images=t.images||[],t.images[n]=h;case 17:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Zm(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ym(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Zm(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Zm(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var $m={name:"glTF",id:"gltf",module:"gltf",version:"3.2.10",extensions:["gltf","glb"],mimeTypes:["model/gltf+json","model/gltf-binary"],text:!0,binary:!0,tests:["glTF"],parse:function(e){return eb.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 eb(){return(eb=Me()(Pe.a.mark((function e(t){var r,n,i,a,o,s=arguments;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=s.length>1&&void 0!==s[1]?s[1]:{},n=s.length>2?s[2]:void 0,(r=Ym(Ym({},$m.options),r)).gltf=Ym(Ym({},$m.options.gltf),r.gltf),i=r.byteOffset,a=void 0===i?0:i,o={},e.next=8,Nm(o,t,a,r,n);case 8:return e.abrupt("return",e.sent);case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var tb=0,rb=1;function nb(e,t,r,n){e.rotateYtoZ=!0;var i=e.byteOffset+e.byteLength-r;if(0===i)throw new Error("glTF byte length must be greater than 0.");return e.gltfUpAxis=n["3d-tiles"]&&n["3d-tiles"].assetGltfUpAxis?n["3d-tiles"].assetGltfUpAxis:"Y",e.gltfArrayBuffer=tl(t,r,i),e.gltfByteOffset=0,e.gltfByteLength=i,r%4==0||console.warn("".concat(e.type,": embedded glb is not aligned to a 4-byte boundary.")),e.byteOffset+e.byteLength}function ib(e,t,r,n){return ab.apply(this,arguments)}function ab(){return(ab=Me()(Pe.a.mark((function e(t,r,n,i){var a,o,s;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=n["3d-tiles"]||{},ob(t,r,n),!a.loadGLTF){e.next=16;break}if(o=i.parse,s=i.fetch,!t.gltfUrl){e.next=9;break}return e.next=7,s(t.gltfUrl,n);case 7:t.gltfArrayBuffer=e.sent,t.gltfByteOffset=0;case 9:if(!t.gltfArrayBuffer){e.next=16;break}return e.next=12,o(t.gltfArrayBuffer,$m,n,i);case 12:t.gltf=e.sent,delete t.gltfArrayBuffer,delete t.gltfByteOffset,delete t.gltfByteLength;case 16:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ob(e,t,r){switch(t){case tb:var n=new Uint8Array(e.gltfArrayBuffer,e.gltfByteOffset),i=(new TextDecoder).decode(n);e.gltfUrl=i.replace(/[\s\0]+$/,""),delete e.gltfArrayBuffer,delete e.gltfByteOffset,delete e.gltfByteLength;break;case rb:break;default:throw new Error("b3dm: Illegal glTF format field")}}function sb(e,t,r,n,i){return ub.apply(this,arguments)}function ub(){return(ub=Me()(Pe.a.mark((function e(t,r,n,i,a){var o,s;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=cb(t,r,n,i,a),e.next=3,ib(t,rb,i,a);case 3:return(s=null==t?void 0:null===(o=t.gltf)||void 0===o?void 0:o.extensions)&&s.CESIUM_RTC&&(t.rtcCenter=s.CESIUM_RTC.center),e.abrupt("return",n);case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function cb(e,t,r,n,i){r=nb(e,t,r=Op(e,t,r=Cp(e,t,r=xp(e,t,r))),n);var a=new hp(e.featureTableJson,e.featureTableBinary);return e.rtcCenter=a.getGlobalProperty("RTC_CENTER",5126,3),r}function lb(e,t,r,n,i){return fb.apply(this,arguments)}function fb(){return(fb=Me()(Pe.a.mark((function e(t,r,n,i,a){return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=hb(t,r,n,i,a),e.next=3,ib(t,t.gltfFormat,i,a);case 3:return e.abrupt("return",n);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function hb(e,t,r,n,i){if(r=xp(e,t,r),1!==e.version)throw new Error("Instanced 3D Model version ".concat(e.version," is not supported"));r=Cp(e,t,r);var a=new DataView(t);if(e.gltfFormat=a.getUint32(r,!0),r=nb(e,t,r=Op(e,t,r+=4),n),0===e.featureTableJsonByteLength)throw new Error("i3dm parser: featureTableJsonByteLength is zero.");var o=new hp(e.featureTableJson,e.featureTableBinary),s=o.getGlobalProperty("INSTANCES_LENGTH");if(o.featuresLength=s,!Number.isFinite(s))throw new Error("i3dm parser: INSTANCES_LENGTH must be defined");e.eastNorthUp=o.getGlobalProperty("EAST_NORTH_UP"),e.rtcCenter=o.getGlobalProperty("RTC_CENTER",5126,3);new _p(e.batchTableJson,e.batchTableBinary,s);return function(e,t,r,n){for(var i=[new Array(n),e._batchTable][0],a=new Tt,o=(new Tt,new Tt,new Tt,new qt),s=new gr,u=new Tt,c={},l=new Wr,f=[],h=[],d=new Tt,p=new Tt,v=0;v<n;v++){var y=void 0;if(t.hasProperty("POSITION"))y=t.getProperty("POSITION",5126,3,v,a);else if(t.hasProperty("POSITION_QUANTIZED")){y=t.getProperty("POSITION_QUANTIZED",5123,3,v,a);var g=t.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=t.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.");a.copy(y),c.translation=a,e.normalUp=t.getProperty("NORMAL_UP",5126,3,v,f),e.normalRight=t.getProperty("NORMAL_RIGHT",5126,3,v,h);if(e.normalUp){if(!e.normalRight)throw new Error("i3dm: Custom orientation requires both NORMAL_UP and NORMAL_RIGHT.");e.hasCustomOrientation=!0}else{if(e.octNormalUp=t.getProperty("NORMAL_UP_OCT32P",5123,2,f),e.octNormalRight=t.getProperty("NORMAL_RIGHT_OCT32P",5123,2,h),e.octNormalUp){if(!e.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")}e.eastNorthUp?(kf.WGS84.eastNorthUpToFixedFrame(a,l),l.getRotationMatrix3(o)):o.identity()}!1,s.fromMatrix3(o),c.rotation=s,u.set(1,1,1);var A=t.getProperty("SCALE",5126,1,v);Number.isFinite(A)&&u.multiplyByScalar(A);var B=t.getProperty("SCALE_NON_UNIFORM",5126,3,v,f);B&&u.scale(B),c.scale=u;var w=t.getProperty("BATCH_ID",5123,1,v);void 0===w&&(w=v);var _=(new Wr).fromQuaternion(c.rotation);l.identity(),l.translate(c.translation),l.multiplyRight(_),l.scale(c.scale);var x=l.clone();i[v]={modelMatrix:x,batchId:w}}e.instances=i}(e,o,0,s),r}function db(e,t,r,n,i,a){return pb.apply(this,arguments)}function pb(){return(pb=Me()(Pe.a.mark((function e(t,r,n,i,a,o){var s,u;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=xp(t,r,n),s=new DataView(r),t.tilesLength=s.getUint32(n,!0),n+=4,t.tiles=[];case 5:if(!(t.tiles.length<t.tilesLength&&t.byteLength-n>12)){e.next=13;break}return u={},t.tiles.push(u),e.next=10,o(r,n,i,a,u);case 10:n=e.sent,e.next=5;break;case 13:return e.abrupt("return",n);case 14:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function vb(e,t,r,n){return yb.apply(this,arguments)}function yb(){return(yb=Me()(Pe.a.mark((function e(t,r,n,i){var a;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.rotateYtoZ=!0,t.gltfUpAxis=n["3d-tiles"]&&n["3d-tiles"].assetGltfUpAxis?n["3d-tiles"].assetGltfUpAxis:"Y",a=i.parse,e.next=5,a(r,$m,n,i);case 5:t.gltf=e.sent;case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function gb(e){return mb.apply(this,arguments)}function mb(){return(mb=Me()(Pe.a.mark((function e(t){var r,n,i,a,o=arguments;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=o.length>1&&void 0!==o[1]?o[1]:0,n=o.length>2?o[2]:void 0,i=o.length>3?o[3]:void 0,(a=o.length>4&&void 0!==o[4]?o[4]:{}).byteOffset=r,a.type=td(t,r),e.t0=a.type,e.next=e.t0===$h.COMPOSITE?9:e.t0===$h.BATCHED_3D_MODEL?12:e.t0===$h.GLTF?15:e.t0===$h.INSTANCED_3D_MODEL?18:e.t0===$h.POINT_CLOUD?21:24;break;case 9:return e.next=11,db(a,t,r,n,i,gb);case 11:return e.abrupt("return",e.sent);case 12:return e.next=14,sb(a,t,r,n,i);case 14:return e.abrupt("return",e.sent);case 15:return e.next=17,vb(a,t,n,i);case 17:return e.abrupt("return",e.sent);case 18:return e.next=20,lb(a,t,r,n,i);case 20:return e.abrupt("return",e.sent);case 21:return e.next=23,jp(a,t,r,n,i);case 23:return e.abrupt("return",e.sent);case 24:throw new Error("3DTileLoader: unknown type ".concat(a.type));case 25:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function bb(){return(bb=Me()(Pe.a.mark((function e(t){var r,n,i,a,o,s,u;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(1952609651===new Uint32Array(t.slice(0,4))[0]){e.next=3;break}throw new Error("Wrong subtree file magic number");case 3:if(1===new Uint32Array(t.slice(4,8))[0]){e.next=6;break}throw new Error("Wrong subtree file verson, must be 1");case 6:if(r=wb(t.slice(8,16)),n=new Uint8Array(t,24,r),i=new TextDecoder("utf8"),a=i.decode(n),o=JSON.parse(a),s=wb(t.slice(16,24)),u=new ArrayBuffer(0),s&&(u=t.slice(24+r)),!("bufferView"in o.tileAvailability)){e.next=18;break}return e.next=17,Ab(o,"tileAvailability",u);case 17:o.tileAvailability.explicitBitstream=e.sent;case 18:if(!("bufferView"in o.contentAvailability)){e.next=22;break}return e.next=21,Ab(o,"contentAvailability",u);case 21:o.contentAvailability.explicitBitstream=e.sent;case 22:if(!("bufferView"in o.childSubtreeAvailability)){e.next=26;break}return e.next=25,Ab(o,"childSubtreeAvailability",u);case 25:o.childSubtreeAvailability.explicitBitstream=e.sent;case 26:return e.abrupt("return",o);case 27:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ab(e,t,r){return Bb.apply(this,arguments)}function Bb(){return(Bb=Me()(Pe.a.mark((function e(t,r,n){var i,a,o,s,u;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=t[r].bufferView,a=t.bufferViews[i],!(o=t.buffers[a.buffer]).uri){e.next=11;break}return e.next=6,Cu(o.uri);case 6:return s=e.sent,e.next=9,s.arrayBuffer();case 9:return u=e.sent,e.abrupt("return",new Uint8Array(u,a.byteOffset,a.byteLength));case 11:return e.abrupt("return",new Uint8Array(n,a.byteOffset,a.byteLength));case 12:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function wb(e){var t=new DataView(e),r=t.getUint32(0,!0),n=t.getUint32(4,!0);return r+Math.pow(2,32)*n}var _b={id:"3d-tiles-subtree",name:"3D Tiles Subtree",module:"3d-tiles",version:"3.2.10",extensions:["subtree"],mimeTypes:["application/octet-stream"],tests:["subtree"],parse:function(e){return bb.apply(this,arguments)},options:{}},xb={QUADTREE:4,OCTREE:8};function Cb(e){return Ob.apply(this,arguments)}function Ob(){return(Ob=Me()(Pe.a.mark((function e(t){var r,n,i,a,o,s,u,c,l,f,h,d,p,v,y,g,m,b,A,B,w,_,x,C,O,E,T,S,k,M,I,P,R,F,D,L,j,G,U,N;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.options,n=t.parentData,i=void 0===n?{mortonIndex:0,x:0,y:0,z:0}:n,a=t.childIndex,o=void 0===a?0:a,s=t.globalData,u=void 0===s?{level:0,mortonIndex:0,x:0,y:0,z:0}:s,c=t.subtree,l=t.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=xb[h],A=1&o,B=o>>1&1,w=o>>2&1,_=(Math.pow(b,f)-1)/(b-1),x=Sb(i.mortonIndex,o),C=_+x,O=Sb(i.x,A),E=Sb(i.y,B),T=Sb(i.z,w),S=!1,f+1>d&&(S=Eb(c.childSubtreeAvailability,x)),k=Sb(u.x,O),M=Sb(u.y,E),I=Sb(u.z,T),P=f+u.level,!S){e.next=38;break}return R="".concat(g,"/").concat(y),F=kb(R,P,k,M,I),e.next=25,Yl(F,_b);case 25:D=e.sent,c=D,u.mortonIndex=x,u.x=O,u.y=E,u.z=T,u.level=f,x=0,C=0,O=0,E=0,T=0,f=0;case 38:if(Eb(c.tileAvailability,C)&&!(f>p)){e.next=41;break}return e.abrupt("return",m);case 41:Eb(c.contentAvailability,C)&&(m.contentUrl=kb(v,P,k,M,I)),L=f+1,j={mortonIndex:x,x:O,y:E,z:T},G=0;case 46:if(!(G<b)){e.next=54;break}return e.next=49,Cb({subtree:c,options:r,parentData:j,childIndex:G,level:L,globalData:u});case 49:((U=e.sent).contentUrl||U.children.length)&&(N=Tb(U,P+1,{childTileX:O,childTileY:E,childTileZ:T},r),m.children.push(N));case 51:G++,e.next=46;break;case 54:return e.abrupt("return",m);case 55:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Eb(e,t){return"constant"in e?Boolean(e.constant):!!e.explicitBitstream&&(r=t,n=e.explicitBitstream,i=Math.floor(r/8),a=r%8,1==(n[i]>>a&1));var r,n,i,a}function Tb(e,t,r,n){var i=n.basePath,a=n.refine,o=n.getRefine,s=n.lodMetricType,u=n.getTileType,c=n.rootLodMetricValue,l=n.rootBoundingVolume,f=e.contentUrl&&e.contentUrl.replace("".concat(i,"/"),""),h=c/Math.pow(2,t),d=function(e,t,r){if(t.region){var n=r.childTileX,i=r.childTileY,a=r.childTileZ,o=M()(t.region,6),s=o[0],u=o[1],c=o[2],l=o[3],f=o[4],h=o[5],d=Math.pow(2,e),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*a,f+y*(a+1)]}}return console.warn("Unsupported bounding volume type: ",t),null}(t,l,r);return{children:e.children,contentUrl:e.contentUrl,content:{uri:f},id:e.contentUrl,refine:o(a),type:u(e),lodMetricType:s,lodMetricValue:h,boundingVolume:d}}function Sb(e,t){return parseInt(e.toString(2)+t.toString(2),2)}function kb(e,t,r,n,i){var a=function(e){var t={};for(var r in e)t["{".concat(r,"}")]=e[r];return t}({level:t,x:r,y:n,z:i});return e.replace(/{level}|{x}|{y}|{z}/gi,(function(e){return a[e]}))}function Mb(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return Ib(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ib(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function Ib(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Pb(e){if(!e.contentUrl)return $f;var t=e.contentUrl.split(".").pop();switch(t){case"pnts":return th;case"i3dm":case"b3dm":case"glb":case"gltf":return eh;default:return t}}function Rb(e){switch(e){case"REPLACE":case"replace":return Yf;case"ADD":case"add":return Zf;default:return e}}function Fb(e,t){if(/^[a-z][0-9a-z+.-]*:/i.test(t)){var r=new URL(e,"".concat(t,"/"));return decodeURI(r.toString())}return e.startsWith("/")?e:"".concat(t,"/").concat(e)}function Db(e,t){if(!e)return null;if(e.content){var r=e.content.uri||e.content.url;e.contentUrl=Fb(r,t.basePath)}return e.id=e.contentUrl,e.lodMetricType=ah,e.lodMetricValue=e.geometricError,e.transformMatrix=e.transform,e.type=Pb(e),e.refine=Rb(e.refine),e}function Lb(e){var t=e.basePath,r=Db(e.root,e),n=[];for(n.push(r);n.length>0;){var i,a=Mb((n.pop()||{}).children||[]);try{for(a.s();!(i=a.n()).done;){var o=i.value;Db(o,{basePath:t}),n.push(o)}}catch(e){a.e(e)}finally{a.f()}}return r}function jb(e){return Gb.apply(this,arguments)}function Gb(){return(Gb=Me()(Pe.a.mark((function e(t){var r,n,i,a,o,s,u,c,l,f,h,d,p,v;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.root){e.next=2;break}return e.abrupt("return",null);case 2:return r=t.basePath,n=t.root.extensions["3DTILES_implicit_tiling"],i=n.subdivisionScheme,a=n.maximumLevel,o=n.subtreeLevels,s=n.subtrees.uri,u=kb(s,0,0,0,0),c=Fb(u,r),e.next=9,Yl(c,_b);case 9:return l=e.sent,f=Fb(t.root.content.uri,r),h=t.root.refine,d=t.root.geometricError,p=t.root.boundingVolume,v={contentUrlTemplate:f,subtreesUriTemplate:s,subdivisionScheme:i,subtreeLevels:o,maximumLevel:a,refine:h,basePath:r,lodMetricType:ah,rootLodMetricValue:d,rootBoundingVolume:p,getTileType:Pb,getRefine:Rb},e.next=17,Ub(t.root,l,v);case 17:return e.abrupt("return",e.sent);case 18:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ub(e,t,r){return Nb.apply(this,arguments)}function Nb(){return(Nb=Me()(Pe.a.mark((function e(t,r,n){var i,a,o;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t){e.next=2;break}return e.abrupt("return",null);case 2:return t.lodMetricType=ah,t.lodMetricValue=t.geometricError,t.transformMatrix=t.transform,e.next=7,Cb({subtree:r,options:n});case 7:return i=e.sent,a=i.children,(o=i.contentUrl)&&(t.contentUrl=o,t.content={uri:o.replace("".concat(n.basePath,"/"),"")}),t.refine=Rb(t.refine),t.type=Pb(t),t.children=a,t.id=t.contentUrl,e.abrupt("return",t);case 16:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Hb={id:"3d-tiles",name:"3D Tiles",module:"3d-tiles",version:"3.2.10",extensions:["cmpt","pnts","b3dm","i3dm"],mimeTypes:["application/octet-stream"],tests:["cmpt","pnts","b3dm","i3dm"],parse:function(e,t,r){return Xb.apply(this,arguments)},options:{"3d-tiles":{loadGLTF:!0,decodeQuantizedPositions:!1,isTileset:"auto",assetGltfUpAxis:null}}};function Jb(e){return n.dirname(e.url)}function Vb(e,t,r){return zb.apply(this,arguments)}function zb(){return(zb=Me()(Pe.a.mark((function e(t,r,n){var i;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i={content:{featureIds:null}},0,e.next=4,gb(t,0,r,n,i.content);case 4:return e.abrupt("return",i.content);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Kb(e,t,r){return qb.apply(this,arguments)}function qb(){return(qb=Me()(Pe.a.mark((function e(t,r,n){var i,a;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((a=JSON.parse((new TextDecoder).decode(t))).loader=r.loader||Hb,a.url=n.url,a.basePath=Jb(a),!Qb(a)){e.next=10;break}return e.next=7,jb(a);case 7:e.t0=e.sent,e.next=11;break;case 10:e.t0=Lb(a);case 11:return a.root=e.t0,a.type=ih,a.lodMetricType=ah,a.lodMetricValue=(null===(i=a.root)||void 0===i?void 0:i.lodMetricValue)||0,e.abrupt("return",a);case 16:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Xb(){return(Xb=Me()(Pe.a.mark((function e(t,r,n){var i;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=r["3d-tiles"]||{},!("auto"===i.isTileset?n.url&&-1!==n.url.indexOf(".json"):i.isTileset)){e.next=8;break}return e.next=5,Kb(t,r,n);case 5:t=e.sent,e.next=11;break;case 8:return e.next=10,Vb(t,r,n);case 10:t=e.sent;case 11:return e.abrupt("return",t);case 12:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Qb(e){var t,r;return(null==e?void 0:null===(t=e.extensionsRequired)||void 0===t?void 0:t.includes("3DTILES_implicit_tiling"))&&(null==e?void 0:null===(r=e.extensionsUsed)||void 0===r?void 0:r.includes("3DTILES_implicit_tiling"))}function Wb(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Zb(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Wb(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Wb(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Yb(e){var t=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(e){return!1}}();return function(){var r,n=m()(e);if(t){var i=m()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return y()(this,r)}}var $b=[0],eA={getPointColor:{type:"accessor",value:[0,0,0,255]},pointSize:1,data:null,loader:Hb,onTilesetLoad:{type:"function",value:function(e){},compare:!1},onTileLoad:{type:"function",value:function(e){},compare:!1},onTileUnload:{type:"function",value:function(e){},compare:!1},onTileError:{type:"function",value:function(e,t,r){},compare:!1},_getMeshColor:{type:"function",value:function(e){return[255,255,255]},compare:!1}},tA=function(e){p()(n,e);var t,r=Yb(n);function n(){var e;h()(this,n);for(var t=arguments.length,i=new Array(t),a=0;a<t;a++)i[a]=arguments[a];return e=r.call.apply(r,[this].concat(i)),A()(yi()(e),"state",void 0),e}return C()(n,[{key:"initializeState",value:function(){"onTileLoadFail"in this.props&&B.log.removed("onTileLoadFail","onTileError")(),this.state={layerMap:{},tileset3d:null,activeViewports:{},lastUpdatedViewports:null}}},{key:"isLoaded",get:function(){var e=this.state.tileset3d;return null!==e&&e.isLoaded()}},{key:"shouldUpdateState",value:function(e){return e.changeFlags.somethingChanged}},{key:"updateState",value:function(e){var t=e.props,r=e.oldProps,n=e.changeFlags;if(t.data&&t.data!==r.data&&this._loadTileset(t.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 a=this.state.layerMap;for(var o in a)a[o].needsUpdate=!0}}},{key:"activateViewport",value:function(e){var t=this.state,r=t.activeViewports,n=t.lastUpdatedViewports;this.internalState.viewport=e,r[e.id]=e;var i=null==n?void 0:n[e.id];i&&e.equals(i)||(this.setChangeFlags({viewportChanged:!0}),this.setNeedsUpdate())}},{key:"getPickingInfo",value:function(e){var t=e.info,r=e.sourceLayer,n=this.state.layerMap,i=r&&r.id;if(i){var a=i.substring(this.id.length+1),o=a.substring(a.indexOf("-")+1);t.object=n[o]&&n[o].tile}return t}},{key:"filterSubLayer",value:function(e){var t=e.layer,r=e.viewport,n=t.props.tile,i=r.id;return n.selected&&n.viewportIds.includes(i)}},{key:"_updateAutoHighlight",value:function(e){e.sourceLayer&&e.sourceLayer.updateAutoHighlight(e)}},{key:"_loadTileset",value:(t=Me()(Pe.a.mark((function e(t){var r,n,i,a,o,s,u;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.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]),a={loadOptions:Zb({},n)},!i.preload){e.next=10;break}return e.next=7,i.preload(t,n);case 7:(o=e.sent).headers&&(a.loadOptions.fetch=Zb(Zb({},a.loadOptions.fetch),{},{headers:o.headers})),Object.assign(a,o);case 10:return e.next=12,Yl(t,i,a.loadOptions);case 12:s=e.sent,u=new Yh(s,Zb({onTileLoad:this._onTileLoad.bind(this),onTileUnload:this._onTileUnload.bind(this),onTileError:this.props.onTileError},a)),this.setState({tileset3d:u,layerMap:{}}),this._updateTileset(this.state.activeViewports),this.props.onTilesetLoad(u);case 17:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"_onTileLoad",value:function(e){var t=this.state.lastUpdatedViewports;this.props.onTileLoad(e),this._updateTileset(t),this.setNeedsUpdate()}},{key:"_onTileUnload",value:function(e){delete this.state.layerMap[e.id],this.props.onTileUnload(e)}},{key:"_updateTileset",value:function(e){var t=this;if(e){var r=this.state.tileset3d,n=this.context.timeline,i=Object.keys(e).length;n&&i&&r&&r.selectTiles(Object.values(e)).then((function(e){t.state.frameNumber!==e&&t.setState({frameNumber:e})}))}}},{key:"_getSubLayer",value:function(e,t){if(!e.content)return null;switch(e.type){case th:return this._makePointCloudLayer(e,t);case eh:return this._make3DModelLayer(e);case rh:return this._makeSimpleMeshLayer(e,t);default:throw new Error("Tile3DLayer: Failed to render layer of type ".concat(e.content.type))}}},{key:"_makePointCloudLayer",value:function(e,t){var r=e.content,n=r.attributes,i=r.pointCount,a=r.constantRGBA,o=r.cartographicOrigin,s=r.modelMatrix,u=n.positions,c=n.normals,l=n.colors;if(!u)return null;var f=t&&t.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",B.PointCloudLayer))({pointSize:d},this.getSubLayerProps({id:"pointcloud"}),{id:"".concat(this.id,"-pointcloud-").concat(e.id),tile:e,data:f,coordinateSystem:B.COORDINATE_SYSTEM.METER_OFFSETS,coordinateOrigin:o,modelMatrix:s,getColor:a||p,_offset:0})}},{key:"_make3DModelLayer",value:function(e){var t=e.content,r=t.gltf,n=t.instances,i=t.cartographicOrigin,a=t.modelMatrix;return new(this.getSubLayerClass("scenegraph",B.ScenegraphLayer))({_lighting:"pbr"},this.getSubLayerProps({id:"scenegraph"}),{id:"".concat(this.id,"-scenegraph-").concat(e.id),tile:e,data:n||$b,scenegraph:r,coordinateSystem:B.COORDINATE_SYSTEM.METER_OFFSETS,coordinateOrigin:i,modelMatrix:a,getTransformMatrix:function(e){return e.modelMatrix},getPosition:[0,0,0],_offset:0})}},{key:"_makeSimpleMeshLayer",value:function(e,t){var r=e.content,n=r.attributes,i=r.indices,a=r.modelMatrix,o=r.cartographicOrigin,s=r.coordinateSystem,u=void 0===s?B.COORDINATE_SYSTEM.METER_OFFSETS:s,c=r.material,l=r.featureIds,f=this.props._getMeshColor,h=t&&t.props.mesh||new Ri.Geometry({drawMode:4,attributes:rA(n),indices:i});return new(this.getSubLayerClass("mesh",Vs))(this.getSubLayerProps({id:"mesh"}),{id:"".concat(this.id,"-mesh-").concat(e.id),tile:e,mesh:h,data:$b,getColor:f(e),pbrMaterial:c,modelMatrix:a,coordinateOrigin:o,coordinateSystem:u,featureIds:l,_offset:0})}},{key:"renderLayers",value:function(){var e=this,t=this.state,r=t.tileset3d,n=t.layerMap;return r?r.tiles.map((function(t){var r=n[t.id]=n[t.id]||{tile:t},i=r.layer;return t.selected&&(i?r.needsUpdate&&(i=e._getSubLayer(t,i),r.needsUpdate=!1):i=e._getSubLayer(t)),r.layer=i,i})).filter(Boolean):null}}]),n}(B.CompositeLayer);function rA(e){var t={};return t.positions=Zb(Zb({},e.positions),{},{value:new Float32Array(e.positions.value)}),e.normals&&(t.normals=e.normals),e.texCoords&&(t.texCoords=e.texCoords),e.colors&&(t.colors=e.colors),e.uvRegions&&(t.uvRegions=e.uvRegions),t}A()(tA,"defaultProps",eA),A()(tA,"layerName","Tile3DLayer");var nA={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 iA(e){var t=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(e){return!1}}();return function(){var r,n=m()(e);if(t){var i=m()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return y()(this,r)}}function aA(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function oA(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?aA(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):aA(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var sA=[1],uA=oA(oA({},si.defaultProps),{},{elevationData:In,texture:oA(oA({},In),{},{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:[nA]});function cA(e){return Array.isArray(e)?e.join(";"):e||""}var lA=function(e){p()(r,e);var t=iA(r);function r(){var e;h()(this,r);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return e=t.call.apply(t,[this].concat(i)),A()(yi()(e),"state",void 0),e}return C()(r,[{key:"updateState",value:function(e){var t=e.props,r=e.oldProps,n=t.elevationData!==r.elevationData;if(n){var i=t.elevationData,a=i&&(Array.isArray(i)||i.includes("{x}")&&i.includes("{y}"));this.setState({isTiled:a})}var o=n||t.meshMaxError!==r.meshMaxError||t.elevationDecoder!==r.elevationDecoder||t.bounds!==r.bounds;if(!this.state.isTiled&&o){var s=this.loadTerrain(t);this.setState({terrain:s})}t.workerUrl&&B.log.removed("workerUrl","loadOptions.terrain.workerUrl")()}},{key:"loadTerrain",value:function(e){var t,r=e.elevationData,n=e.bounds,i=e.elevationDecoder,a=e.meshMaxError,o=e.signal;if(!r)return null;var s=this.getLoadOptions();return s=oA(oA({},s),{},{terrain:oA(oA({skirtHeight:this.state.isTiled?2*a:0},null===(t=s)||void 0===t?void 0:t.terrain),{},{bounds:n,meshMaxError:a,elevationDecoder:i})}),(0,this.props.fetch)(r,{propName:"elevationData",layer:this,loadOptions:s,signal:o})}},{key:"getTiledTerrainData",value:function(e){var t=this.props,r=t.elevationData,n=t.fetch,i=t.texture,a=t.elevationDecoder,o=t.meshMaxError,s=this.context.viewport,u=Rn(r,e),c=i&&Rn(i,e),l=e.signal,f=[0,0],h=[0,0];if(s.isGeospatial){var d=e.bbox;f=s.projectFlat([d.west,d.south]),h=s.projectFlat([d.east,d.north])}else{var p=e.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:a,meshMaxError:o,signal:l}),g=c?n(c,{propName:"texture",layer:this,loaders:[],signal:l}).catch((function(e){return null})):Promise.resolve(null);return Promise.all([y,g])}},{key:"renderSubLayers",value:function(e){var t=this.getSubLayerClass("mesh",B.SimpleMeshLayer),r=this.props,n=r.color,i=r.wireframe,a=r.material,o=e.data;if(!o)return null;var s=M()(o,2),u=s[0],c=s[1];return new t(e,{data:sA,mesh:u,texture:c,_instanced:!1,coordinateSystem:B.COORDINATE_SYSTEM.CARTESIAN,getPosition:function(e){return[0,0,0]},getColor:n,wireframe:i,material:a})}},{key:"onViewportLoad",value:function(e){if(e){var t=this.state.zRange,r=e.map((function(e){return e.content})).filter(Boolean).map((function(e){return e[0].header.boundingBox.map((function(e){return e[2]}))}));if(0!==r.length){var n=Math.min.apply(Math,De()(r.map((function(e){return e[0]})))),i=Math.max.apply(Math,De()(r.map((function(e){return e[1]}))));(!t||n<t[0]||i>t[1])&&this.setState({zRange:[n,i]})}}}},{key:"renderLayers",value:function(){var e=this.props,t=e.color,r=e.material,n=e.elevationData,i=e.texture,a=e.wireframe,o=e.meshMaxError,s=e.elevationDecoder,u=e.tileSize,c=e.maxZoom,l=e.minZoom,f=e.extent,h=e.maxRequests,d=e.onTileLoad,p=e.onTileUnload,v=e.onTileError,y=e.maxCacheSize,g=e.maxCacheByteSize,m=e.refinementStrategy;return this.state.isTiled?new si(this.getSubLayerProps({id:"tiles"}),{getTileData:this.getTiledTerrainData.bind(this),renderSubLayers:this.renderSubLayers.bind(this),updateTriggers:{getTileData:{elevationData:cA(n),texture:cA(i),meshMaxError:o,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",B.SimpleMeshLayer))(this.getSubLayerProps({id:"mesh"}),{data:sA,mesh:this.state.terrain,texture:i,_instanced:!1,getPosition:function(e){return[0,0,0]},getColor:t,material:r,wireframe:a})}}]),r}(B.CompositeLayer);A()(lA,"defaultProps",uA),A()(lA,"layerName","TerrainLayer");function fA(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.start,n=void 0===r?0:r,i=t.end,a=void 0===i?e.length:i,o=t.size||2,s=0,u=n,c=a-o;u<a;u+=o)s+=(e[u]-e[c])*(e[u+1]+e[c+1]),c=u;return s/2}function hA(e,t,r,n,i,a){var o,s;if(void 0===a&&(a=fA(e,{start:t,end:r,size:n})),i===a<0)for(o=t;o<r;o+=n)s=RA(o,e[o],e[o+1],s);else for(o=r-n;o>=t;o-=n)s=RA(o,e[o],e[o+1],s);return s&&TA(s,s.next)&&(FA(s),s=s.next),s}function dA(e,t){if(!e)return e;t||(t=e);var r,n=e;do{if(r=!1,n.steiner||!TA(n,n.next)&&0!==EA(n.prev,n,n.next))n=n.next;else{if(FA(n),(n=t=n.prev)===n.next)break;r=!0}}while(r||n!==t);return t}function pA(e,t,r,n,i,a,o){if(e){!o&&a&&function(e,t,r,n){var i=e;do{null===i.z&&(i.z=_A(i.x,i.y,t,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,function(e){var t,r,n,i,a,o,s,u,c=1;do{for(i=e,e=null,u=null,n=0;i;){for(n++,o=i,a=0,r=0;r<c&&(a++,o=o.nextZ);r++);for(s=c;a>0||s>0&&o;)0!==a&&(0===s||!o||i.z<=o.z)?(t=i,i=i.nextZ,a--):(t=o,o=o.nextZ,s--),u?u.nextZ=t:e=t,t.prevZ=u,u=t;i=o}u.nextZ=null,c*=2}while(n>1)}(i)}(e,n,i,a);for(var s,u,c=e;e.prev!==e.next;)if(s=e.prev,u=e.next,a?yA(e,n,i,a):vA(e))t.push(s.i/r),t.push(e.i/r),t.push(u.i/r),FA(e),e=u.next,c=u.next;else if((e=u)===c){o?1===o?pA(e=gA(dA(e),t,r),t,r,n,i,a,2):2===o&&mA(e,t,r,n,i,a):pA(dA(e),t,r,n,i,a,1);break}}}function vA(e){var t=e.prev,r=e,n=e.next;if(EA(t,r,n)>=0)return!1;for(var i=e.next.next;i!==e.prev;){if(CA(t.x,t.y,r.x,r.y,n.x,n.y,i.x,i.y)&&EA(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function yA(e,t,r,n){var i=e.prev,a=e,o=e.next;if(EA(i,a,o)>=0)return!1;for(var s=i.x<a.x?i.x<o.x?i.x:o.x:a.x<o.x?a.x:o.x,u=i.y<a.y?i.y<o.y?i.y:o.y:a.y<o.y?a.y:o.y,c=i.x>a.x?i.x>o.x?i.x:o.x:a.x>o.x?a.x:o.x,l=i.y>a.y?i.y>o.y?i.y:o.y:a.y>o.y?a.y:o.y,f=_A(s,u,t,r,n),h=_A(c,l,t,r,n),d=e.prevZ,p=e.nextZ;d&&d.z>=f&&p&&p.z<=h;){if(d!==e.prev&&d!==e.next&&CA(i.x,i.y,a.x,a.y,o.x,o.y,d.x,d.y)&&EA(d.prev,d,d.next)>=0)return!1;if(d=d.prevZ,p!==e.prev&&p!==e.next&&CA(i.x,i.y,a.x,a.y,o.x,o.y,p.x,p.y)&&EA(p.prev,p,p.next)>=0)return!1;p=p.nextZ}for(;d&&d.z>=f;){if(d!==e.prev&&d!==e.next&&CA(i.x,i.y,a.x,a.y,o.x,o.y,d.x,d.y)&&EA(d.prev,d,d.next)>=0)return!1;d=d.prevZ}for(;p&&p.z<=h;){if(p!==e.prev&&p!==e.next&&CA(i.x,i.y,a.x,a.y,o.x,o.y,p.x,p.y)&&EA(p.prev,p,p.next)>=0)return!1;p=p.nextZ}return!0}function gA(e,t,r){var n=e;do{var i=n.prev,a=n.next.next;!TA(i,a)&&SA(i,n,n.next,a)&&IA(i,a)&&IA(a,i)&&(t.push(i.i/r),t.push(n.i/r),t.push(a.i/r),FA(n),FA(n.next),n=e=a),n=n.next}while(n!==e);return dA(n)}function mA(e,t,r,n,i,a){var o=e;do{for(var s=o.next.next;s!==o.prev;){if(o.i!==s.i&&OA(o,s)){var u=PA(o,s);return o=dA(o,o.next),u=dA(u,u.next),pA(o,t,r,n,i,a),void pA(u,t,r,n,i,a)}s=s.next}o=o.next}while(o!==e)}function bA(e,t,r,n,i){var a,o,s,u=[];for(a=0,o=t.length;a<o;a++)(s=hA(e,t[a]*n,a<o-1?t[a+1]*n:e.length,n,!1,i&&i[a+1]))===s.next&&(s.steiner=!0),u.push(xA(s));for(u.sort(AA),a=0;a<u.length;a++)BA(u[a],r),r=dA(r,r.next);return r}function AA(e,t){return e.x-t.x}function BA(e,t){if(t=function(e,t){var r,n=t,i=e.x,a=e.y,o=-1/0;do{if(a<=n.y&&a>=n.next.y&&n.next.y!==n.y){var s=n.x+(a-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=i&&s>o){if(o=s,s===i){if(a===n.y)return n;if(a===n.next.y)return n.next}r=n.x<n.next.x?n:n.next}}n=n.next}while(n!==t);if(!r)return null;if(i===o)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&&CA(a<f?i:o,a,l,f,a<f?o:i,a,n.x,n.y)&&(u=Math.abs(a-n.y)/(i-n.x),IA(n,e)&&(u<h||u===h&&(n.x>r.x||n.x===r.x&&wA(r,n)))&&(r=n,h=u)),n=n.next}while(n!==c);return r}(e,t)){var r=PA(t,e);dA(t,t.next),dA(r,r.next)}}function wA(e,t){return EA(e.prev,e,t.prev)<0&&EA(t.next,e,e.next)<0}function _A(e,t,r,n,i){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-r)*i)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-n)*i)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function xA(e){var t=e,r=e;do{(t.x<r.x||t.x===r.x&&t.y<r.y)&&(r=t),t=t.next}while(t!==e);return r}function CA(e,t,r,n,i,a,o,s){return(i-o)*(t-s)-(e-o)*(a-s)>=0&&(e-o)*(n-s)-(r-o)*(t-s)>=0&&(r-o)*(a-s)-(i-o)*(n-s)>=0}function OA(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var r=e;do{if(r.i!==e.i&&r.next.i!==e.i&&r.i!==t.i&&r.next.i!==t.i&&SA(r,r.next,e,t))return!0;r=r.next}while(r!==e);return!1}(e,t)&&(IA(e,t)&&IA(t,e)&&function(e,t){var r=e,n=!1,i=(e.x+t.x)/2,a=(e.y+t.y)/2;do{r.y>a!=r.next.y>a&&r.next.y!==r.y&&i<(r.next.x-r.x)*(a-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==e);return n}(e,t)&&(EA(e.prev,e,t.prev)||EA(e,t.prev,t))||TA(e,t)&&EA(e.prev,e,e.next)>0&&EA(t.prev,t,t.next)>0)}function EA(e,t,r){return(t.y-e.y)*(r.x-t.x)-(t.x-e.x)*(r.y-t.y)}function TA(e,t){return e.x===t.x&&e.y===t.y}function SA(e,t,r,n){var i=MA(EA(e,t,r)),a=MA(EA(e,t,n)),o=MA(EA(r,n,e)),s=MA(EA(r,n,t));return i!==a&&o!==s||(!(0!==i||!kA(e,r,t))||(!(0!==a||!kA(e,n,t))||(!(0!==o||!kA(r,e,n))||!(0!==s||!kA(r,t,n)))))}function kA(e,t,r){return t.x<=Math.max(e.x,r.x)&&t.x>=Math.min(e.x,r.x)&&t.y<=Math.max(e.y,r.y)&&t.y>=Math.min(e.y,r.y)}function MA(e){return e>0?1:e<0?-1:0}function IA(e,t){return EA(e.prev,e,e.next)<0?EA(e,t,e.next)>=0&&EA(e,e.prev,t)>=0:EA(e,t,e.prev)<0||EA(e,e.next,t)<0}function PA(e,t){var r=new DA(e.i,e.x,e.y),n=new DA(t.i,t.x,t.y),i=e.next,a=t.prev;return e.next=t,t.prev=e,r.next=i,i.prev=r,n.next=r,r.prev=n,a.next=n,n.prev=a,n}function RA(e,t,r,n){var i=new DA(e,t,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 FA(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function DA(e,t,r){this.i=e,this.x=t,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function LA(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return jA(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return jA(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function jA(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function GA(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function UA(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?GA(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):GA(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function NA(e,t,r){var n=HA(e),i=Object.keys(n).filter((function(e){return n[e]!==Array}));return function(e,t,r){for(var n=t.pointPositionsCount,i=t.pointFeaturesCount,a=t.linePositionsCount,o=t.linePathsCount,s=t.lineFeaturesCount,u=t.polygonPositionsCount,c=t.polygonObjectsCount,l=t.polygonRingsCount,f=t.polygonFeaturesCount,h=t.propArrayTypes,d=t.coordLength,p=r.numericPropKeys,v=void 0===p?[]:p,y=r.PositionDataType,g=void 0===y?Float32Array:y,m=(e[0]&&"id"in e[0]),b=e.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:[]},B={type:"LineString",pathIndices:a>65535?new Uint32Array(o+1):new Uint16Array(o+1),positions:new g(a*d),globalFeatureIds:new b(a),featureIds:s>65535?new Uint32Array(a):new Uint16Array(a),numericProps:{},properties:[],fields:[]},w={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,B,w];_<x.length;_++){var C,O=x[_],E=LA(v);try{for(E.s();!(C=E.n()).done;){var T=C.value,S=h[T];O.numericProps[T]=new S(O.positions.length/d)}}catch(e){E.e(e)}finally{E.f()}}B.pathIndices[o]=a,w.polygonIndices[c]=u,w.primitivePolygonIndices[l]=u;var k,M={pointPosition:0,pointFeature:0,linePosition:0,linePath:0,lineFeature:0,polygonPosition:0,polygonObject:0,polygonRing:0,polygonFeature:0,feature:0},I=LA(e);try{for(I.s();!(k=I.n()).done;){var P=k.value,R=P.geometry,F=P.properties||{};switch(R.type){case"Point":JA(R,A,M,d,F),A.properties.push(QA(F,v)),m&&A.fields.push({id:P.id}),M.pointFeature++;break;case"LineString":VA(R,B,M,d,F),B.properties.push(QA(F,v)),m&&B.fields.push({id:P.id}),M.lineFeature++;break;case"Polygon":zA(R,w,M,d,F),w.properties.push(QA(F,v)),m&&w.fields.push({id:P.id}),M.polygonFeature++;break;default:throw new Error("Invalid geometry type")}M.feature++}}catch(e){I.e(e)}finally{I.f()}return function(e,t,r,n){return{points:UA(UA({},e),{},{positions:{value:e.positions,size:n},globalFeatureIds:{value:e.globalFeatureIds,size:1},featureIds:{value:e.featureIds,size:1},numericProps:qA(e.numericProps,1)}),lines:UA(UA({},t),{},{positions:{value:t.positions,size:n},pathIndices:{value:t.pathIndices,size:1},globalFeatureIds:{value:t.globalFeatureIds,size:1},featureIds:{value:t.featureIds,size:1},numericProps:qA(t.numericProps,1)}),polygons:UA(UA({},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:qA(r.numericProps,1)})}}(A,B,w,d)}(e,UA({propArrayTypes:n},t),{numericPropKeys:r&&r.numericPropKeys||i,PositionDataType:r?r.PositionDataType:Float32Array})}function HA(e){var t,r={},n=LA(e);try{for(n.s();!(t=n.n()).done;){var i=t.value;if(i.properties)for(var a in i.properties){var o=i.properties[a];r[a]=WA(o,r[a])}}}catch(e){n.e(e)}finally{n.f()}return r}function JA(e,t,r,n,i){t.positions.set(e.data,r.pointPosition*n);var a=e.data.length/n;XA(t,i,r.pointPosition,a),t.globalFeatureIds.fill(r.feature,r.pointPosition,r.pointPosition+a),t.featureIds.fill(r.pointFeature,r.pointPosition,r.pointPosition+a),r.pointPosition+=a}function VA(e,t,r,n,i){t.positions.set(e.data,r.linePosition*n);var a=e.data.length/n;XA(t,i,r.linePosition,a),t.globalFeatureIds.fill(r.feature,r.linePosition,r.linePosition+a),t.featureIds.fill(r.lineFeature,r.linePosition,r.linePosition+a);for(var o=0,s=e.indices.length;o<s;++o){var u=e.indices[o],c=o===s-1?e.data.length:e.indices[o+1];t.pathIndices[r.linePath++]=r.linePosition,r.linePosition+=(c-u)/n}}function zA(e,t,r,n,i){t.positions.set(e.data,r.polygonPosition*n);var a=e.data.length/n;XA(t,i,r.polygonPosition,a),t.globalFeatureIds.fill(r.feature,r.polygonPosition,r.polygonPosition+a),t.featureIds.fill(r.polygonFeature,r.polygonPosition,r.polygonPosition+a);for(var o=0,s=e.indices.length;o<s;++o){var u=r.polygonPosition;t.polygonIndices[r.polygonObject++]=u;for(var c=e.areas[o],l=e.indices[o],f=e.indices[o+1],h=0,d=l.length;h<d;++h){var p=l[h],v=h===d-1?void 0===f?e.data.length:f[0]:l[h+1];t.primitivePolygonIndices[r.polygonRing++]=r.polygonPosition,r.polygonPosition+=(v-p)/n}KA(t,c,l,{startPosition:u,endPosition:r.polygonPosition,coordLength:n})}}function KA(e,t,r,n){for(var i=n.startPosition,a=n.endPosition,o=n.coordLength,s=i*o,u=a*o,c=e.positions.subarray(s,u),l=r[0],f=function(e,t){var r,n,i,a,o,s,u,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2,l=arguments.length>3?arguments[3]:void 0,f=t&&t.length,h=f?t[0]*c:e.length,d=hA(e,0,h,c,!0,l&&l[0]),p=[];if(!d||d.next===d.prev)return p;if(f&&(d=bA(e,t,d,c,l)),e.length>80*c){a=n=e[0],o=i=e[1];for(var v=c;v<h;v+=c)(s=e[v])<a&&(a=s),(u=e[v+1])<o&&(o=u),s>n&&(n=s),u>i&&(i=u);r=0!==(r=Math.max(n-a,i-o))?1/r:0}return pA(d,p,c,a,o,r),p}(c,r.slice(1).map((function(e){return(e-l)/o})),o,t),h=0,d=f.length;h<d;++h)e.triangles.push(i+f[h])}function qA(e,t){var r={};for(var n in e)r[n]={value:e[n],size:t};return r}function XA(e,t,r,n){for(var i in e.numericProps)if(i in t){var a=t[i];e.numericProps[i].fill(a,r,r+n)}}function QA(e,t){var r={};for(var n in e)t.includes(n)||(r[n]=e[n]);return r}function WA(e,t){return t!==Array&&Number.isFinite(e)?t===Float64Array||Math.fround(e)!==e?Float64Array:Float32Array:Array}var ZA=r(41),YA=r.n(ZA);function $A(e){for(var t,r,n=0,i=0,a=e.length-1;i<e.length;a=i++)t=e[i],n+=((r=e[a])[0]-t[0])*(t[1]+r[1]);return n}function eB(e,t,r){t&&r&&(1===e?t.id=r.readVarint():2===e?function(e,t){var r=e.readVarint()+e.pos;for(;e.pos<r;){var n=t._keys[e.readVarint()],i=t._values[e.readVarint()];t.properties[n]=i}}(r,t):3===e?t.type=r.readVarint():4===e&&(t._geometry=r.pos))}var tB=function(){function e(t,r,n,i,a){h()(this,e),Hn(this,"properties",void 0),Hn(this,"extent",void 0),Hn(this,"type",void 0),Hn(this,"id",void 0),Hn(this,"_pbf",void 0),Hn(this,"_geometry",void 0),Hn(this,"_keys",void 0),Hn(this,"_values",void 0),this.properties={},this.extent=n,this.type=0,this.id=null,this._pbf=t,this._geometry=-1,this._keys=i,this._values=a,t.readFields(eB,this,r)}return C()(e,[{key:"loadGeometry",value:function(){var e=this._pbf;e.pos=this._geometry;for(var t,r=e.readVarint()+e.pos,n=1,i=0,a=0,o=0,s=[];e.pos<r;){if(i<=0){var u=e.readVarint();n=7&u,i=u>>3}if(i--,1===n||2===n)a+=e.readSVarint(),o+=e.readSVarint(),1===n&&(t&&s.push(t),t=[]),t&&t.push([a,o]);else{if(7!==n)throw new Error("unknown command ".concat(n));t&&t.push(t[0].slice())}}return t&&s.push(t),s}},{key:"bbox",value:function(){var e=this._pbf;e.pos=this._geometry;for(var t=e.readVarint()+e.pos,r=1,n=0,i=0,a=0,o=1/0,s=-1/0,u=1/0,c=-1/0;e.pos<t;){if(n<=0){var l=e.readVarint();r=7&l,n=l>>3}if(n--,1===r||2===r)(i+=e.readSVarint())<o&&(o=i),i>s&&(s=i),(a+=e.readSVarint())<u&&(u=a),a>c&&(c=a);else if(7!==r)throw new Error("unknown command ".concat(r))}return[o,u,s,c]}},{key:"_toGeoJSON",value:function(t){var r,n,i=this.loadGeometry(),a=e.types[this.type];switch(this.type){case 1:var o=[];for(r=0;r<i.length;r++)o[r]=i[r][0];t(i=o,this);break;case 2:for(r=0;r<i.length;r++)t(i[r],this);break;case 3:for(i=function(e){var t=e.length;if(t<=1)return[e];for(var r,n,i=[],a=0;a<t;a++){var o=$A(e[a]);0!==o&&(void 0===n&&(n=o<0),n===o<0?(r&&i.push(r),r=[e[a]]):r&&r.push(e[a]))}return r&&i.push(r),i}(i),r=0;r<i.length;r++)for(n=0;n<i[r].length;n++)t(i[r][n],this)}1===i.length?i=i[0]:a="Multi".concat(a);var s={type:"Feature",geometry:{type:a,coordinates:i},properties:this.properties};return null!==this.id&&(s.id=this.id),s}},{key:"toGeoJSON",value:function(e){if("function"==typeof e)return this._toGeoJSON(e);var t=e.x,r=e.y,n=e.z,i=this.extent*Math.pow(2,n),a=this.extent*t,o=this.extent*r;return this._toGeoJSON((function(e){for(var t=0;t<e.length;t++){var r=e[t];r[0]=360*(r[0]+a)/i-180;var n=180-360*(r[1]+o)/i;r[1]=360/Math.PI*Math.atan(Math.exp(n*Math.PI/180))-90}}))}}],[{key:"types",get:function(){return["Unknown","Point","LineString","Polygon"]}}]),e}(),rB=function(){function e(t,r){h()(this,e),Hn(this,"version",void 0),Hn(this,"name",void 0),Hn(this,"extent",void 0),Hn(this,"length",void 0),Hn(this,"_pbf",void 0),Hn(this,"_keys",void 0),Hn(this,"_values",void 0),Hn(this,"_features",void 0),this.version=1,this.name="",this.extent=4096,this.length=0,this._pbf=t,this._keys=[],this._values=[],this._features=[],t.readFields(nB,this,r),this.length=this._features.length}return C()(e,[{key:"feature",value:function(e){if(e<0||e>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[e];var t=this._pbf.readVarint()+this._pbf.pos;return new tB(this._pbf,t,this.extent,this._keys,this._values)}}]),e}();function nB(e,t,r){t&&r&&(15===e?t.version=r.readVarint():1===e?t.name=r.readString():5===e?t.extent=r.readVarint():2===e?t._features.push(r.pos):3===e?t._keys.push(r.readString()):4===e&&t._values.push(function(e){var t=null,r=e.readVarint()+e.pos;for(;e.pos<r;){var n=e.readVarint()>>3;t=1===n?e.readString():2===n?e.readFloat():3===n?e.readDouble():4===n?e.readVarint64():5===n?e.readVarint():6===n?e.readSVarint():7===n?e.readBoolean():null}return t}(r)))}var iB,aB,oB,sB,uB,cB,lB,fB=function e(t,r){h()(this,e),Hn(this,"layers",void 0),this.layers=t.readFields(hB,{},r)};function hB(e,t,r){if(3===e&&r){var n=new rB(r,r.readVarint()+r.pos);n.length&&t&&(t[n.name]=n)}}function dB(e){var t=e.indices.length;if(t<=1)return{type:"Polygon",data:e.data,areas:[[fA(e.data)]],indices:[e.indices]};for(var r,n,i,a=[],o=[],s=[],u=[],c=0,l=0;l<t;l++){i=e.indices[l]-c,n=e.indices[l+1]-c||e.data.length;var f=fA(e.data.slice(i,n));if(0!==f)void 0===r&&(r=f<0),r===f<0?(u.length&&(a.push(s),o.push(u)),u=[i],s=[f]):(s.push(f),u.push(i));else{var h=e.data.slice(0,i),d=e.data.slice(n);e.data=h.concat(d),c+=n-i}}return s&&a.push(s),u.length&&o.push(u),{type:"Polygon",areas:a,indices:o,data:e.data}}function pB(e,t,r){t&&r&&(1===e?t.id=r.readVarint():2===e?function(e,t){var r=e.readVarint()+e.pos;for(;e.pos<r;){var n=t._keys[e.readVarint()],i=t._values[e.readVarint()];t.properties[n]=i}}(r,t):3===e?t.type=r.readVarint():4===e&&(t._geometry=r.pos))}function vB(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return yB(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return yB(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function yB(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function gB(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function mB(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?gB(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):gB(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var bB=function(){function e(t,r,n,i,a,o){h()(this,e),Hn(this,"properties",void 0),Hn(this,"extent",void 0),Hn(this,"type",void 0),Hn(this,"id",void 0),Hn(this,"_pbf",void 0),Hn(this,"_geometry",void 0),Hn(this,"_keys",void 0),Hn(this,"_values",void 0),Hn(this,"_geometryInfo",void 0),this.properties={},this.extent=n,this.type=0,this.id=null,this._pbf=t,this._geometry=-1,this._keys=i,this._values=a,this._geometryInfo=o,t.readFields(pB,this,r)}return C()(e,[{key:"loadGeometry",value:function(){var e=this._pbf;e.pos=this._geometry,iB=e.readVarint()+e.pos,aB=1,sB=0,uB=0,cB=0,lB=0;for(var t=[],r=[];e.pos<iB;)if(sB<=0&&(oB=e.readVarint(),aB=7&oB,sB=oB>>3),sB--,1===aB||2===aB)uB+=e.readSVarint(),cB+=e.readSVarint(),1===aB&&t.push(lB),r.push(uB,cB),lB+=2;else{if(7!==aB)throw new Error("unknown command ".concat(aB));if(lB>0){var n=t[t.length-1];r.push(r[n],r[n+1]),lB+=2}}return{data:r,indices:t}}},{key:"_toBinaryCoordinates",value:function(e){var t,r=this.loadGeometry();e(r.data,this);switch(this.type){case 1:this._geometryInfo.pointFeaturesCount++,this._geometryInfo.pointPositionsCount+=r.indices.length,t=mB({type:"Point"},r);break;case 2:this._geometryInfo.lineFeaturesCount++,this._geometryInfo.linePathsCount+=r.indices.length,this._geometryInfo.linePositionsCount+=r.data.length/2,t=mB({type:"LineString"},r);break;case 3:t=dB(r),this._geometryInfo.polygonFeaturesCount++,this._geometryInfo.polygonObjectsCount+=t.indices.length;var n,i=vB(t.indices);try{for(i.s();!(n=i.n()).done;){var a=n.value;this._geometryInfo.polygonRingsCount+=a.length}}catch(e){i.e(e)}finally{i.f()}this._geometryInfo.polygonPositionsCount+=t.data.length/2;break;default:throw new Error("Invalid geometry type: ".concat(this.type))}var o={type:"Feature",geometry:t,properties:this.properties};return null!==this.id&&(o.id=this.id),o}},{key:"toBinaryCoordinates",value:function(e){if("function"==typeof e)return this._toBinaryCoordinates(e);var t=e.x,r=e.y,n=e.z,i=this.extent*Math.pow(2,n),a=this.extent*t,o=this.extent*r;return this._toBinaryCoordinates((function(e){return function(e,t,r,n){for(var i=0,a=e.length;i<a;i+=2){e[i]=360*(e[i]+t)/n-180;var o=180-360*(e[i+1]+r)/n;e[i+1]=360/Math.PI*Math.atan(Math.exp(o*Math.PI/180))-90}}(e,a,o,i)}))}}]),e}(),AB=function(){function e(t,r){h()(this,e),Hn(this,"version",void 0),Hn(this,"name",void 0),Hn(this,"extent",void 0),Hn(this,"length",void 0),Hn(this,"_pbf",void 0),Hn(this,"_keys",void 0),Hn(this,"_values",void 0),Hn(this,"_features",void 0),this.version=1,this.name="",this.extent=4096,this.length=0,this._pbf=t,this._keys=[],this._values=[],this._features=[],t.readFields(BB,this,r),this.length=this._features.length}return C()(e,[{key:"feature",value:function(e,t){if(e<0||e>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[e];var r=this._pbf.readVarint()+this._pbf.pos;return new bB(this._pbf,r,this.extent,this._keys,this._values,t)}}]),e}();function BB(e,t,r){t&&r&&(15===e?t.version=r.readVarint():1===e?t.name=r.readString():5===e?t.extent=r.readVarint():2===e?t._features.push(r.pos):3===e?t._keys.push(r.readString()):4===e&&t._values.push(function(e){var t=null,r=e.readVarint()+e.pos;for(;e.pos<r;){var n=e.readVarint()>>3;t=1===n?e.readString():2===n?e.readFloat():3===n?e.readDouble():4===n?e.readVarint64():5===n?e.readVarint():6===n?e.readSVarint():7===n?e.readBoolean():null}return t}(r)))}var wB=function e(t,r){h()(this,e),Hn(this,"layers",void 0),this.layers=t.readFields(_B,{},r)};function _B(e,t,r){if(3===e&&r){var n=new AB(r,r.readVarint()+r.pos);n.length&&t&&(t[n.name]=n)}}function xB(e,t){var r,n,i=function(e){var t;if(null==e||!e.mvt)throw new Error("mvt options required");var r="wgs84"===(null===(t=e.mvt)||void 0===t?void 0:t.coordinates),n=e.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 e.mvt}(t),a=(null==t?void 0:null===(r=t.gis)||void 0===r?void 0:r.format)||(null==t?void 0:null===(n=t.mvt)||void 0===n?void 0:n.shape);switch(a){case"columnar-table":return{shape:"columnar-table",data:CB(e,i)};case"geojson-row-table":return{shape:"geojson-row-table",data:OB(e,i)};case"geojson":return OB(e,i);case"binary-geometry":case"binary":return CB(e,i);default:throw new Error(a)}}function CB(e,t){var r=function(e,t){var r=[],n={coordLength:2,pointPositionsCount:0,pointFeaturesCount:0,linePositionsCount:0,linePathsCount:0,lineFeaturesCount:0,polygonPositionsCount:0,polygonObjectsCount:0,polygonRingsCount:0,polygonFeaturesCount:0};if(e.byteLength<=0)return[r,n];var i=new wB(new YA.a(e));return(t&&Array.isArray(t.layers)?t.layers:Object.keys(i.layers)).forEach((function(e){var a=i.layers[e];if(a)for(var o=0;o<a.length;o++){var s=TB(a.feature(o,n),t,e);r.push(s)}})),[r,n]}(e,t),n=M()(r,2),i=NA(n[0],n[1]);return i.byteLength=e.byteLength,i}function OB(e,t){if(e.byteLength<=0)return[];var r=[],n=new fB(new YA.a(e));return(Array.isArray(t.layers)?t.layers:Object.keys(n.layers)).forEach((function(e){var i=n.layers[e];if(i)for(var a=0;a<i.length;a++){var o=EB(i.feature(a),t,e);r.push(o)}})),r}function EB(e,t,r){var n=e.toGeoJSON("wgs84"===t.coordinates?t.tileIndex:SB);return t.layerProperty&&(n.properties[t.layerProperty]=r),n}function TB(e,t,r){var n=e.toBinaryCoordinates("wgs84"===t.coordinates?t.tileIndex:kB);return t.layerProperty&&n.properties&&(n.properties[t.layerProperty]=r),n}function SB(e,t){for(var r=t.extent,n=0;n<e.length;n++){var i=e[n];i[0]/=r,i[1]/=r}}function kB(e,t){for(var r=t.extent,n=0,i=e.length;n<i;++n)e[n]/=r}function MB(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function IB(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?MB(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):MB(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var PB,RB={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}}};IB(IB({},RB),{},{parse:(PB=Me()(Pe.a.mark((function e(t,r){return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",xB(t,r));case 1:case"end":return e.stop()}}),e)}))),function(e,t){return PB.apply(this,arguments)}),parseSync:xB,binary:!0});function FB(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function DB(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return LB(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return LB(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function LB(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function jB(e,t){var r=null==t?void 0:t.globalFeatureId;return void 0!==r?function(e,t){var r,n=DB(NB(e));try{for(n.s();!(r=n.n()).done;){for(var i=r.value,a=0,o=i.featureIds.value[0],s=0;s<i.featureIds.value.length;s++){var u=i.featureIds.value[s];if(u!==o){if(t===i.globalFeatureIds.value[a])return HB(i,a,s);a=s,o=u}}if(t===i.globalFeatureIds.value[a])return HB(i,a,i.featureIds.value.length)}}catch(e){n.e(e)}finally{n.f()}throw new Error("featureId:".concat(t," not found"))}(e,r):GB(e,null==t?void 0:t.type)}function GB(e,t){return function(e){var t,r=[],n=DB(e);try{for(n.s();!(t=n.n()).done;){var i=t.value;if(0!==i.featureIds.value.length){for(var a=0,o=i.featureIds.value[0],s=0;s<i.featureIds.value.length;s++){var u=i.featureIds.value[s];u!==o&&(r.push(HB(i,a,s)),a=s,o=u)}r.push(HB(i,a,i.featureIds.value.length))}}}catch(e){n.e(e)}finally{n.f()}return r}(NB(e,t))}function UB(e,t,r){switch(e.type){case"Point":return function(e,t,r){var n=JB(e.positions,t,r);if(n.length>1)return{type:"MultiPoint",coordinates:n};return{type:"Point",coordinates:n[0]}}(e,t,r);case"LineString":return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1/0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1/0,n=e.positions,i=e.pathIndices.value.filter((function(e){return e>=t&&e<=r})),a=i.length>2;if(!a){var o=JB(n,i[0],i[1]);return{type:"LineString",coordinates:o}}for(var s=[],u=0;u<i.length-1;u++){var c=JB(n,i[u],i[u+1]);s.push(c)}return{type:"MultiLineString",coordinates:s}}(e,t,r);case"Polygon":return function e(t){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=t.positions,a=t.polygonIndices.value.filter((function(e){return e>=r&&e<=n})),o=t.primitivePolygonIndices.value.filter((function(e){return e>=r&&e<=n})),s=a.length>2;if(!s){for(var u=[],c=0;c<o.length-1;c++){var l=o[c],f=o[c+1],h=JB(i,l,f);u.push(h)}return{type:"Polygon",coordinates:u}}for(var d=[],p=0;p<a.length-1;p++){var v=a[p],y=a[p+1],g=e(t,v,y).coordinates;d.push(g)}return{type:"MultiPolygon",coordinates:d}}(e,t,r);default:var n=e;throw new Error("Unsupported geometry type: ".concat(null==n?void 0:n.type))}}function NB(e,t){if(!Boolean(e.points||e.lines||e.polygons))return e.type=t||function(e){if(e.pathIndices)return"LineString";if(e.polygonIndices)return"Polygon";return"Point"}(e),[e];var r=[];return e.points&&(e.points.type="Point",r.push(e.points)),e.lines&&(e.lines.type="LineString",r.push(e.lines)),e.polygons&&(e.polygons.type="Polygon",r.push(e.polygons)),r}function HB(e,t,r){return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?FB(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):FB(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({type:"Feature",geometry:UB(e,t,r),properties:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=(arguments.length>2&&arguments[2],Object.assign({},e.properties[e.featureIds.value[t]]));for(var n in e.numericProps)r[n]=e.numericProps[n].value[t];return r}(e,t,r)},function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;arguments.length>2&&arguments[2];return e.fields&&e.fields[e.featureIds.value[t]]}(e,t,r))}function JB(e,t,r){t=t||0,r=r||e.value.length/e.size;for(var n=[],i=t;i<r;i++){for(var a=Array(),o=i*e.size;o<(i+1)*e.size;o++)a.push(Number(e.value[o]));n.push(a)}return n}function VB(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function zB(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?VB(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):VB(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var KB={Point:qB,MultiPoint:function(e,t,r){return XB(e,t,r)},LineString:QB,MultiLineString:function(e,t,r){return e.map((function(e){return QB(e,t,r)}))},Polygon:WB,MultiPolygon:function(e,t,r){return e.map((function(e){return WB(e,t,r)}))}};function qB(e,t,r){var n=M()(e,2),i=n[0],a=n[1],o=M()(t,2),s=o[0],u=o[1],c=ft(s[0],u[0],i),l=ft(s[1],u[1],a);return r.unprojectFlat([c,l])}function XB(e,t,r){return e.map((function(e){return qB(e,t,r)}))}function QB(e,t,r){return XB(e,t,r)}function WB(e,t,r){return e.map((function(e){return XB(e,t,r)}))}function ZB(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return YB(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return YB(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function YB(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var $B=["points","lines","polygons"];function ew(e,t,r,n){var i=e.featureIds.value;if(!i.length)return-1;var a=0,o=i[i.length-1]+1;if(n){var s=function(e,t){if(!e.__layers){for(var r={},n=e.properties,i=0;i<n.length;i++){var a=n[i].layerName;a&&(r[a]?r[a][1]=i:r[a]=[i,i])}e.__layers=r}return e.__layers[t]}(e,n);if(!s)return-1;a=s[0],o=s[1]+1}var u=-1;if(t in e.numericProps){var c=e.numericProps[t].value.findIndex((function(e,t){return e===r&&i[t]>=a&&i[t]<o}));return c>=0?e.globalFeatureIds.value[c]:-1}return t?u=tw(e.properties,(function(e){return e[t]===r}),a,o):e.fields&&(u=tw(e.fields,(function(e){return e.id===r}),a,o)),u>=0?function(e,t){if(!e.__ids){for(var r=[],n=e.featureIds.value,i=e.globalFeatureIds.value,a=0;a<n.length;a++)r[n[a]]=i[a];e.__ids=r}return e.__ids[t]}(e,u):-1}function tw(e,t,r,n){for(var i=r;i<n;i++)if(t(e[i],i))return i;return-1}function rw(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return nw(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return nw(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function nw(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function iw(e){var t=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(e){return!1}}();return function(){var r,n=m()(e);if(t){var i=m()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return y()(this,r)}}function aw(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ow(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?aw(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):aw(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var sw=ow(ow({},B.GeoJsonLayer.defaultProps),{},{onDataLoad:{type:"function",value:null,optional:!0,compare:!1},uniqueIdProperty:"",highlightedFeatureId:null,loaders:[RB],binary:!0}),uw=function(e){p()(n,e);var t,r=iw(n);function n(){return h()(this,n),r.apply(this,arguments)}return C()(n,[{key:"initializeState",value:function(){ci()(m()(n.prototype),"initializeState",this).call(this);var e=void 0===this.context.viewport.resolution&&this.props.binary;this.setState({binary:e,data:null,tileJSON:null})}},{key:"isLoaded",get:function(){return this.state&&this.state.data&&this.state.tileset&&ci()(m()(n.prototype),"isLoaded",this)}},{key:"updateState",value:function(e){var t,r=e.props,i=e.oldProps,a=e.context,o=e.changeFlags;o.dataChanged&&this._updateTileData(),null!==(t=this.state)&&void 0!==t&&t.data&&(ci()(m()(n.prototype),"updateState",this).call(this,{props:r,oldProps:i,context:a,changeFlags:o}),this._setWGS84PropertyForTiles());var s=r.highlightColor;s!==i.highlightColor&&Array.isArray(s)&&this.setState({highlightColor:s})}},{key:"_updateTileData",value:(t=Me()(Pe.a.mark((function e(){var t,r,n,i,a;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=this.props.data,r=null,"string"!=typeof t||/(?=.*{z})(?=.*{x})(?=.*({y}|{-y}))/.test(t)){e.next=18;break}return n=this.props,i=n.onDataLoad,a=n.fetch,this.setState({data:null,tileJSON:null}),e.prev=5,e.next=8,a(t,{propName:"data",layer:this,loaders:[]});case 8:r=e.sent,e.next=15;break;case 11:e.prev=11,e.t0=e.catch(5),this.raiseError(e.t0,"loading TileJSON"),t=null;case 15:i&&i(r,{propName:"data",layer:this}),e.next=19;break;case 18:t.tilejson&&(r=t);case 19:r&&(t=r.tiles),this.setState({data:t,tileJSON:r});case 21:case"end":return e.stop()}}),e,this,[[5,11]])}))),function(){return t.apply(this,arguments)})},{key:"_getTilesetOptions",value:function(){var e=ci()(m()(n.prototype),"_getTilesetOptions",this).call(this),t=this.state.tileJSON,r=this.props,i=r.minZoom,a=r.maxZoom;return t&&(Number.isFinite(t.minzoom)&&t.minzoom>i&&(e.minZoom=t.minzoom),Number.isFinite(t.maxzoom)&&(!Number.isFinite(a)||t.maxzoom<a)&&(e.maxZoom=t.maxzoom)),e}},{key:"renderLayers",value:function(){var e;return null!==(e=this.state)&&void 0!==e&&e.data?ci()(m()(n.prototype),"renderLayers",this).call(this):null}},{key:"getTileData",value:function(e){var t,r=this.state,n=r.data,i=r.binary,a=e.index,o=e.signal,s=Rn(n,e);if(!s)return Promise.reject("Invalid URL");var u=this.getLoadOptions();return(0,this.props.fetch)(s,{propName:"data",layer:this,loadOptions:u=ow(ow({},u),{},{mimeType:"application/x-protobuf",mvt:ow(ow({},null===(t=u)||void 0===t?void 0:t.mvt),{},{coordinates:this.context.viewport.resolution?"wgs84":"local",tileIndex:a}),gis:i?{format:"binary"}:{}}),signal:o})}},{key:"renderSubLayers",value:function(e){var t=e.tile.index,r=t.x,i=t.y,a=t.z,o=Math.pow(2,a),s=512/o,u=-s,c=512*r/o,l=512*(1-i/o),f=(new Wr).scale([s,u,1]);e.autoHighlight=!1,this.context.viewport.resolution||(e.modelMatrix=f,e.coordinateOrigin=[c,l,0],e.coordinateSystem=B.COORDINATE_SYSTEM.CARTESIAN,e.extensions=[].concat(De()(e.extensions||[]),[new B.ClipExtension]));var h=ci()(m()(n.prototype),"renderSubLayers",this).call(this,e);return!this.state.binary||h instanceof B.GeoJsonLayer||B.log.warn("renderSubLayers() must return GeoJsonLayer when using binary:true")(),h}},{key:"_updateAutoHighlight",value:function(e){var t,r,n=this.props.uniqueIdProperty,i=this.state,a=i.hoveredFeatureId,o=i.hoveredFeatureLayerName,s=e.object;s&&(t=cw(s,n),r=lw(s));var u=this.props.highlightColor;"function"==typeof u&&(u=u(e)),a===t&&o===r||this.setState({highlightColor:u,hoveredFeatureId:t,hoveredFeatureLayerName:r})}},{key:"getPickingInfo",value:function(e){var t=ci()(m()(n.prototype),"getPickingInfo",this).call(this,e),r=Boolean(this.context.viewport.resolution);if(this.state.binary&&-1!==t.index){var i=e.sourceLayer.props.data;t.object=jB(i,{globalFeatureId:t.index})}return t.object&&!r&&(t.object=hw(t.object,t.tile.bbox,this.context.viewport)),t}},{key:"getSubLayerPropsByTile",value:function(e){return{highlightedObjectIndex:this.getHighlightedObjectIndex(e),highlightColor:this.state.highlightColor}}},{key:"getHighlightedObjectIndex",value:function(e){var t=this.state,r=t.hoveredFeatureId,n=t.hoveredFeatureLayerName,i=t.binary,a=this.props,o=a.uniqueIdProperty,s=a.highlightedFeatureId,u=e.content,c=fw(s);if(!(fw(r)||c))return-1;var l=c?s:r;return Array.isArray(u)?u.findIndex((function(e){var t=cw(e,o)===l,r=c||lw(e)===n;return t&&r})):u&&i?function(e,t,r,n){var i,a=ZB($B);try{for(a.s();!(i=a.n()).done;){var o=i.value,s=e[o]&&ew(e[o],t,r,n);if(s>=0)return s}}catch(e){a.e(e)}finally{a.f()}return-1}(u,o,l,c?"":n):-1}},{key:"_pickObjects",value:function(e){var t=this.context,r=t.deck,n=t.viewport,i=n.width,a=n.height,o=n.x,s=n.y,u=[this.id];return r.pickObjects({x:o,y:s,width:i,height:a,layerIds:u,maxObjects:e})}},{key:"getRenderedFeatures",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,r=this._pickObjects(t),n=new Set,i=[],a=rw(r);try{for(a.s();!(e=a.n()).done;){var o=e.value,s=cw(o.object,this.props.uniqueIdProperty);void 0===s?i.push(o.object):n.has(s)||(n.add(s),i.push(o.object))}}catch(e){a.e(e)}finally{a.f()}return i}},{key:"_setWGS84PropertyForTiles",value:function(){var e=this;this.state.tileset.selectedTiles.forEach((function(t){t.hasOwnProperty("dataInWGS84")||Object.defineProperty(t,"dataInWGS84",{get:function(){if(!t.content)return null;if(e.state.binary&&Array.isArray(t.content)&&!t.content.length)return[];var r,n=t.bbox;if(void 0===t._contentWGS84&&(r=n,Number.isFinite(r.west)&&Number.isFinite(r.north)&&Number.isFinite(r.east)&&Number.isFinite(r.south))){var i=e.state.binary?jB(t.content):t.content;t._contentWGS84=i.map((function(t){return hw(t,n,e.context.viewport)}))}return t._contentWGS84}})}))}}]),n}(si);function cw(e,t){return e.properties&&t?e.properties[t]:"id"in e?e.id:void 0}function lw(e){var t;return(null===(t=e.properties)||void 0===t?void 0:t.layerName)||null}function fw(e){return null!=e&&""!==e}function hw(e,t,r){var n=ow(ow({},e),{},{geometry:{type:e.geometry.type}});return Object.defineProperty(n.geometry,"coordinates",{get:function(){return function(e,t,r){var n=[r.projectFlat([t.west,t.north]),r.projectFlat([t.east,t.south])];return zB(zB({},e),{},{coordinates:KB[e.type](e.coordinates,n,r)})}(e.geometry,t,r).coordinates}}),n}A()(uw,"layerName","MVTLayer"),A()(uw,"defaultProps",sw);for(var dw={},pw=0;pw<"0123456789bcdefghjkmnpqrstuvwxyz".length;pw++)dw["0123456789bcdefghjkmnpqrstuvwxyz".charAt(pw)]=pw;function vw(e){var t=function(e){for(var t,r=!0,n=90,i=-90,a=180,o=-180,s=0,u=0,c=e.length;u<c;u++){var l=e[u].toLowerCase();s=dw[l];for(var f=4;f>=0;f--){var h=s>>f&1;r?(t=(a+o)/2,1===h?o=t:a=t):(t=(n+i)/2,1===h?i=t:n=t),r=!r}}return[i,o,n,a]}(e),r=M()(t,4),n=r[0],i=r[1],a=r[2],o=r[3];return[o,a,o,n,i,n,i,a,o,a]}function yw(e){var t=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(e){return!1}}();return function(){var r,n=m()(e);if(t){var i=m()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return y()(this,r)}}var gw=function(e){p()(r,e);var t=yw(r);function r(){return h()(this,r),t.apply(this,arguments)}return C()(r,[{key:"indexToBounds",value:function(){var e=this.props,t=e.data,r=e.getGeohash;return{data:t,_normalize:!1,positionFormat:"XY",getPolygon:function(e,t){return vw(r(e,t))}}}}]),r}(S);A()(gw,"layerName","GeohashLayer"),A()(gw,"defaultProps",{getGeohash:{type:"accessor",value:function(e){return e.geohash}}}),r.d(t,"GreatCircleLayer",(function(){return _})),r.d(t,"S2Layer",(function(){return J})),r.d(t,"QuadkeyLayer",(function(){return Se})),r.d(t,"TileLayer",(function(){return si})),r.d(t,"TripsLayer",(function(){return di})),r.d(t,"H3ClusterLayer",(function(){return Pi})),r.d(t,"H3HexagonLayer",(function(){return Si})),r.d(t,"Tile3DLayer",(function(){return tA})),r.d(t,"TerrainLayer",(function(){return lA})),r.d(t,"MVTLayer",(function(){return uw})),r.d(t,"GeohashLayer",(function(){return gw})),r.d(t,"_GeoCellLayer",(function(){return S})),r.d(t,"_getURLFromTemplate",(function(){return Rn})),r.d(t,"_Tileset2D",(function(){return ei})),r.d(t,"_Tile2DHeader",(function(){return Re}))}])}));
|
|
6
|
+
*/i=[],void 0===(a="function"==typeof(n=function(){"use strict";function e(e,t,r){this.low=0|e,this.high=0|t,this.unsigned=!!r}function t(e){return!0===(e&&e.__isLong__)}e.prototype.__isLong__,Object.defineProperty(e.prototype,"__isLong__",{value:!0,enumerable:!1,configurable:!1}),e.isLong=t;var r={},n={};function i(e,t){var i,a,s;return t?(s=0<=(e>>>=0)&&e<256)&&(a=n[e])?a:(i=o(e,(0|e)<0?-1:0,!0),s&&(n[e]=i),i):(s=-128<=(e|=0)&&e<128)&&(a=r[e])?a:(i=o(e,e<0?-1:0,!1),s&&(r[e]=i),i)}function a(e,t){if(isNaN(e)||!isFinite(e))return t?v:p;if(t){if(e<0)return v;if(e>=f)return A}else{if(e<=-h)return B;if(e+1>=h)return b}return e<0?a(-e,t).neg():o(e%l|0,e/l|0,t)}function o(t,r,n){return new e(t,r,n)}e.fromInt=i,e.fromNumber=a,e.fromBits=o;var s=Math.pow;function u(e,t,r){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return p;if("number"==typeof t?(r=t,t=!1):t=!!t,(r=r||10)<2||36<r)throw RangeError("radix");var n;if((n=e.indexOf("-"))>0)throw Error("interior hyphen");if(0===n)return u(e.substring(1),t,r).neg();for(var i=a(s(r,8)),o=p,c=0;c<e.length;c+=8){var l=Math.min(8,e.length-c),f=parseInt(e.substring(c,c+l),r);if(l<8){var h=a(s(r,l));o=o.mul(h).add(a(f))}else o=(o=o.mul(i)).add(a(f))}return o.unsigned=t,o}function c(t){return t instanceof e?t:"number"==typeof t?a(t):"string"==typeof t?u(t):o(t.low,t.high,t.unsigned)}e.fromString=u,e.fromValue=c;var l=4294967296,f=l*l,h=f/2,d=i(1<<24),p=i(0);e.ZERO=p;var v=i(0,!0);e.UZERO=v;var y=i(1);e.ONE=y;var g=i(1,!0);e.UONE=g;var m=i(-1);e.NEG_ONE=m;var b=o(-1,2147483647,!1);e.MAX_VALUE=b;var A=o(-1,-1,!0);e.MAX_UNSIGNED_VALUE=A;var B=o(0,-2147483648,!1);e.MIN_VALUE=B;var w=e.prototype;return w.toInt=function(){return this.unsigned?this.low>>>0:this.low},w.toNumber=function(){return this.unsigned?(this.high>>>0)*l+(this.low>>>0):this.high*l+(this.low>>>0)},w.toString=function(e){if((e=e||10)<2||36<e)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(B)){var t=a(e),r=this.div(t),n=r.mul(t).sub(this);return r.toString(e)+n.toInt().toString(e)}return"-"+this.neg().toString(e)}for(var i=a(s(e,6),this.unsigned),o=this,u="";;){var c=o.div(i),l=(o.sub(c.mul(i)).toInt()>>>0).toString(e);if((o=c).isZero())return l+u;for(;l.length<6;)l="0"+l;u=""+l+u}},w.getHighBits=function(){return this.high},w.getHighBitsUnsigned=function(){return this.high>>>0},w.getLowBits=function(){return this.low},w.getLowBitsUnsigned=function(){return this.low>>>0},w.getNumBitsAbs=function(){if(this.isNegative())return this.eq(B)?64:this.neg().getNumBitsAbs();for(var e=0!=this.high?this.high:this.low,t=31;t>0&&0==(e&1<<t);t--);return 0!=this.high?t+33:t+1},w.isZero=function(){return 0===this.high&&0===this.low},w.isNegative=function(){return!this.unsigned&&this.high<0},w.isPositive=function(){return this.unsigned||this.high>=0},w.isOdd=function(){return 1==(1&this.low)},w.isEven=function(){return 0==(1&this.low)},w.equals=function(e){return t(e)||(e=c(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&this.high===e.high&&this.low===e.low},w.eq=w.equals,w.notEquals=function(e){return!this.eq(e)},w.neq=w.notEquals,w.lessThan=function(e){return this.comp(e)<0},w.lt=w.lessThan,w.lessThanOrEqual=function(e){return this.comp(e)<=0},w.lte=w.lessThanOrEqual,w.greaterThan=function(e){return this.comp(e)>0},w.gt=w.greaterThan,w.greaterThanOrEqual=function(e){return this.comp(e)>=0},w.gte=w.greaterThanOrEqual,w.compare=function(e){if(t(e)||(e=c(e)),this.eq(e))return 0;var r=this.isNegative(),n=e.isNegative();return r&&!n?-1:!r&&n?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},w.comp=w.compare,w.negate=function(){return!this.unsigned&&this.eq(B)?B:this.not().add(y)},w.neg=w.negate,w.add=function(e){t(e)||(e=c(e));var r=this.high>>>16,n=65535&this.high,i=this.low>>>16,a=65535&this.low,s=e.high>>>16,u=65535&e.high,l=e.low>>>16,f=0,h=0,d=0,p=0;return d+=(p+=a+(65535&e.low))>>>16,h+=(d+=i+l)>>>16,f+=(h+=n+u)>>>16,f+=r+s,o((d&=65535)<<16|(p&=65535),(f&=65535)<<16|(h&=65535),this.unsigned)},w.subtract=function(e){return t(e)||(e=c(e)),this.add(e.neg())},w.sub=w.subtract,w.multiply=function(e){if(this.isZero())return p;if(t(e)||(e=c(e)),e.isZero())return p;if(this.eq(B))return e.isOdd()?B:p;if(e.eq(B))return this.isOdd()?B:p;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(d)&&e.lt(d))return a(this.toNumber()*e.toNumber(),this.unsigned);var r=this.high>>>16,n=65535&this.high,i=this.low>>>16,s=65535&this.low,u=e.high>>>16,l=65535&e.high,f=e.low>>>16,h=65535&e.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,o((g&=65535)<<16|(m&=65535),(v&=65535)<<16|(y&=65535),this.unsigned)},w.mul=w.multiply,w.divide=function(e){if(t(e)||(e=c(e)),e.isZero())throw Error("division by zero");if(this.isZero())return this.unsigned?v:p;var r,n,i;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return v;if(e.gt(this.shru(1)))return g;i=v}else{if(this.eq(B))return e.eq(y)||e.eq(m)?B:e.eq(B)?y:(r=this.shr(1).div(e).shl(1)).eq(p)?e.isNegative()?y:m:(n=this.sub(e.mul(r)),i=r.add(n.div(e)));if(e.eq(B))return this.unsigned?v:p;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();i=p}for(n=this;n.gte(e);){r=Math.max(1,Math.floor(n.toNumber()/e.toNumber()));for(var o=Math.ceil(Math.log(r)/Math.LN2),u=o<=48?1:s(2,o-48),l=a(r),f=l.mul(e);f.isNegative()||f.gt(n);)f=(l=a(r-=u,this.unsigned)).mul(e);l.isZero()&&(l=y),i=i.add(l),n=n.sub(f)}return i},w.div=w.divide,w.modulo=function(e){return t(e)||(e=c(e)),this.sub(this.div(e).mul(e))},w.mod=w.modulo,w.not=function(){return o(~this.low,~this.high,this.unsigned)},w.and=function(e){return t(e)||(e=c(e)),o(this.low&e.low,this.high&e.high,this.unsigned)},w.or=function(e){return t(e)||(e=c(e)),o(this.low|e.low,this.high|e.high,this.unsigned)},w.xor=function(e){return t(e)||(e=c(e)),o(this.low^e.low,this.high^e.high,this.unsigned)},w.shiftLeft=function(e){return t(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?o(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):o(0,this.low<<e-32,this.unsigned)},w.shl=w.shiftLeft,w.shiftRight=function(e){return t(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?o(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):o(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},w.shr=w.shiftRight,w.shiftRightUnsigned=function(e){if(t(e)&&(e=e.toInt()),0==(e&=63))return this;var r=this.high;return e<32?o(this.low>>>e|r<<32-e,r>>>e,this.unsigned):o(32===e?r:r>>>e-32,0,this.unsigned)},w.shru=w.shiftRightUnsigned,w.toSigned=function(){return this.unsigned?o(this.low,this.high,!1):this},w.toUnsigned=function(){return this.unsigned?this:o(this.low,this.high,!0)},w.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},w.toBytesLE=function(){var e=this.high,t=this.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24&255,255&e,e>>>8&255,e>>>16&255,e>>>24&255]},w.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24&255,e>>>16&255,e>>>8&255,255&e,t>>>24&255,t>>>16&255,t>>>8&255,255&t]},e})?n.apply(t,i):n)||(e.exports=a)},function(e,t,r){var n=r(51);e.exports=function(e){return new n(e)}},function(e,t){},,,function(e,t){e.exports=r},function(e,t,r){var n=r(96);e.exports=function(e){return function(){return new n(e.apply(this,arguments))}}},function(e,t){e.exports=function(e){var t;if("undefined"!=typeof Symbol){if(Symbol.asyncIterator&&null!=(t=e[Symbol.asyncIterator]))return t.call(e);if(Symbol.iterator&&null!=(t=e[Symbol.iterator]))return t.call(e)}throw new TypeError("Object is not async iterable")}},function(e,t,r){var n=r(72),i=r(73),a=r(48),o=r(74);e.exports=function(e){return n(e)||i(e)||a(e)||o()},e.exports.default=e.exports,e.exports.__esModule=!0},,,function(e,t){},function(e,t){function r(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(e.exports=r=function(e){return typeof e},e.exports.default=e.exports,e.exports.__esModule=!0):(e.exports=r=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.default=e.exports,e.exports.__esModule=!0),r(t)}e.exports=r,e.exports.default=e.exports,e.exports.__esModule=!0},,function(e,t){},function(e,t,r){"use strict";e.exports=i;var n=r(97);function i(e){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(e)?e:new Uint8Array(e||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 a="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function o(e){return e.type===i.Bytes?e.readVarint()+e.pos:e.pos+1}function s(e,t,r){return r?4294967296*t+(e>>>0):4294967296*(t>>>0)+(e>>>0)}function u(e,t,r){var n=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.floor(Math.log(t)/(7*Math.LN2));r.realloc(n);for(var i=r.pos-1;i>=e;i--)r.buf[i+n]=r.buf[i]}function c(e,t){for(var r=0;r<e.length;r++)t.writeVarint(e[r])}function l(e,t){for(var r=0;r<e.length;r++)t.writeSVarint(e[r])}function f(e,t){for(var r=0;r<e.length;r++)t.writeFloat(e[r])}function h(e,t){for(var r=0;r<e.length;r++)t.writeDouble(e[r])}function d(e,t){for(var r=0;r<e.length;r++)t.writeBoolean(e[r])}function p(e,t){for(var r=0;r<e.length;r++)t.writeFixed32(e[r])}function v(e,t){for(var r=0;r<e.length;r++)t.writeSFixed32(e[r])}function y(e,t){for(var r=0;r<e.length;r++)t.writeFixed64(e[r])}function g(e,t){for(var r=0;r<e.length;r++)t.writeSFixed64(e[r])}function m(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+16777216*e[t+3]}function b(e,t,r){e[r]=t,e[r+1]=t>>>8,e[r+2]=t>>>16,e[r+3]=t>>>24}function A(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+(e[t+3]<<24)}i.prototype={destroy:function(){this.buf=null},readFields:function(e,t,r){for(r=r||this.length;this.pos<r;){var n=this.readVarint(),i=n>>3,a=this.pos;this.type=7&n,e(i,t,this),this.pos===a&&this.skip(n)}return t},readMessage:function(e,t){return this.readFields(e,t,this.readVarint()+this.pos)},readFixed32:function(){var e=m(this.buf,this.pos);return this.pos+=4,e},readSFixed32:function(){var e=A(this.buf,this.pos);return this.pos+=4,e},readFixed64:function(){var e=m(this.buf,this.pos)+4294967296*m(this.buf,this.pos+4);return this.pos+=8,e},readSFixed64:function(){var e=m(this.buf,this.pos)+4294967296*A(this.buf,this.pos+4);return this.pos+=8,e},readFloat:function(){var e=n.read(this.buf,this.pos,!0,23,4);return this.pos+=4,e},readDouble:function(){var e=n.read(this.buf,this.pos,!0,52,8);return this.pos+=8,e},readVarint:function(e){var t,r,n=this.buf;return t=127&(r=n[this.pos++]),r<128?t:(t|=(127&(r=n[this.pos++]))<<7,r<128?t:(t|=(127&(r=n[this.pos++]))<<14,r<128?t:(t|=(127&(r=n[this.pos++]))<<21,r<128?t:function(e,t,r){var n,i,a=r.buf;if(i=a[r.pos++],n=(112&i)>>4,i<128)return s(e,n,t);if(i=a[r.pos++],n|=(127&i)<<3,i<128)return s(e,n,t);if(i=a[r.pos++],n|=(127&i)<<10,i<128)return s(e,n,t);if(i=a[r.pos++],n|=(127&i)<<17,i<128)return s(e,n,t);if(i=a[r.pos++],n|=(127&i)<<24,i<128)return s(e,n,t);if(i=a[r.pos++],n|=(1&i)<<31,i<128)return s(e,n,t);throw new Error("Expected varint not more than 10 bytes")}(t|=(15&(r=n[this.pos]))<<28,e,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var e=this.readVarint();return e%2==1?(e+1)/-2:e/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var e=this.readVarint()+this.pos,t=this.pos;return this.pos=e,e-t>=12&&a?function(e,t,r){return a.decode(e.subarray(t,r))}(this.buf,t,e):function(e,t,r){var n="",i=t;for(;i<r;){var a,o,s,u=e[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&(a=e[i+1]))&&(c=(31&u)<<6|63&a)<=127&&(c=null):3===l?(a=e[i+1],o=e[i+2],128==(192&a)&&128==(192&o)&&((c=(15&u)<<12|(63&a)<<6|63&o)<=2047||c>=55296&&c<=57343)&&(c=null)):4===l&&(a=e[i+1],o=e[i+2],s=e[i+3],128==(192&a)&&128==(192&o)&&128==(192&s)&&((c=(15&u)<<18|(63&a)<<12|(63&o)<<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,t,e)},readBytes:function(){var e=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,e);return this.pos=e,t},readPackedVarint:function(e,t){if(this.type!==i.Bytes)return e.push(this.readVarint(t));var r=o(this);for(e=e||[];this.pos<r;)e.push(this.readVarint(t));return e},readPackedSVarint:function(e){if(this.type!==i.Bytes)return e.push(this.readSVarint());var t=o(this);for(e=e||[];this.pos<t;)e.push(this.readSVarint());return e},readPackedBoolean:function(e){if(this.type!==i.Bytes)return e.push(this.readBoolean());var t=o(this);for(e=e||[];this.pos<t;)e.push(this.readBoolean());return e},readPackedFloat:function(e){if(this.type!==i.Bytes)return e.push(this.readFloat());var t=o(this);for(e=e||[];this.pos<t;)e.push(this.readFloat());return e},readPackedDouble:function(e){if(this.type!==i.Bytes)return e.push(this.readDouble());var t=o(this);for(e=e||[];this.pos<t;)e.push(this.readDouble());return e},readPackedFixed32:function(e){if(this.type!==i.Bytes)return e.push(this.readFixed32());var t=o(this);for(e=e||[];this.pos<t;)e.push(this.readFixed32());return e},readPackedSFixed32:function(e){if(this.type!==i.Bytes)return e.push(this.readSFixed32());var t=o(this);for(e=e||[];this.pos<t;)e.push(this.readSFixed32());return e},readPackedFixed64:function(e){if(this.type!==i.Bytes)return e.push(this.readFixed64());var t=o(this);for(e=e||[];this.pos<t;)e.push(this.readFixed64());return e},readPackedSFixed64:function(e){if(this.type!==i.Bytes)return e.push(this.readSFixed64());var t=o(this);for(e=e||[];this.pos<t;)e.push(this.readSFixed64());return e},skip:function(e){var t=7&e;if(t===i.Varint)for(;this.buf[this.pos++]>127;);else if(t===i.Bytes)this.pos=this.readVarint()+this.pos;else if(t===i.Fixed32)this.pos+=4;else{if(t!==i.Fixed64)throw new Error("Unimplemented type: "+t);this.pos+=8}},writeTag:function(e,t){this.writeVarint(e<<3|t)},realloc:function(e){for(var t=this.length||16;t<this.pos+e;)t*=2;if(t!==this.length){var r=new Uint8Array(t);r.set(this.buf),this.buf=r,this.length=t}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(e){this.realloc(4),b(this.buf,e,this.pos),this.pos+=4},writeSFixed32:function(e){this.realloc(4),b(this.buf,e,this.pos),this.pos+=4},writeFixed64:function(e){this.realloc(8),b(this.buf,-1&e,this.pos),b(this.buf,Math.floor(e*(1/4294967296)),this.pos+4),this.pos+=8},writeSFixed64:function(e){this.realloc(8),b(this.buf,-1&e,this.pos),b(this.buf,Math.floor(e*(1/4294967296)),this.pos+4),this.pos+=8},writeVarint:function(e){(e=+e||0)>268435455||e<0?function(e,t){var r,n;e>=0?(r=e%4294967296|0,n=e/4294967296|0):(n=~(-e/4294967296),4294967295^(r=~(-e%4294967296))?r=r+1|0:(r=0,n=n+1|0));if(e>=0x10000000000000000||e<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");t.realloc(10),function(e,t,r){r.buf[r.pos++]=127&e|128,e>>>=7,r.buf[r.pos++]=127&e|128,e>>>=7,r.buf[r.pos++]=127&e|128,e>>>=7,r.buf[r.pos++]=127&e|128,e>>>=7,r.buf[r.pos]=127&e}(r,0,t),function(e,t){var r=(7&e)<<4;if(t.buf[t.pos++]|=r|((e>>>=3)?128:0),!e)return;if(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),!e)return;if(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),!e)return;if(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),!e)return;if(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),!e)return;t.buf[t.pos++]=127&e}(n,t)}(e,this):(this.realloc(4),this.buf[this.pos++]=127&e|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=e>>>7&127))))},writeSVarint:function(e){this.writeVarint(e<0?2*-e-1:2*e)},writeBoolean:function(e){this.writeVarint(Boolean(e))},writeString:function(e){e=String(e),this.realloc(4*e.length),this.pos++;var t=this.pos;this.pos=function(e,t,r){for(var n,i,a=0;a<t.length;a++){if((n=t.charCodeAt(a))>55295&&n<57344){if(!i){n>56319||a+1===t.length?(e[r++]=239,e[r++]=191,e[r++]=189):i=n;continue}if(n<56320){e[r++]=239,e[r++]=191,e[r++]=189,i=n;continue}n=i-55296<<10|n-56320|65536,i=null}else i&&(e[r++]=239,e[r++]=191,e[r++]=189,i=null);n<128?e[r++]=n:(n<2048?e[r++]=n>>6|192:(n<65536?e[r++]=n>>12|224:(e[r++]=n>>18|240,e[r++]=n>>12&63|128),e[r++]=n>>6&63|128),e[r++]=63&n|128)}return r}(this.buf,e,this.pos);var r=this.pos-t;r>=128&&u(t,r,this),this.pos=t-1,this.writeVarint(r),this.pos+=r},writeFloat:function(e){this.realloc(4),n.write(this.buf,e,this.pos,!0,23,4),this.pos+=4},writeDouble:function(e){this.realloc(8),n.write(this.buf,e,this.pos,!0,52,8),this.pos+=8},writeBytes:function(e){var t=e.length;this.writeVarint(t),this.realloc(t);for(var r=0;r<t;r++)this.buf[this.pos++]=e[r]},writeRawMessage:function(e,t){this.pos++;var r=this.pos;e(t,this);var n=this.pos-r;n>=128&&u(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(e,t,r){this.writeTag(e,i.Bytes),this.writeRawMessage(t,r)},writePackedVarint:function(e,t){t.length&&this.writeMessage(e,c,t)},writePackedSVarint:function(e,t){t.length&&this.writeMessage(e,l,t)},writePackedBoolean:function(e,t){t.length&&this.writeMessage(e,d,t)},writePackedFloat:function(e,t){t.length&&this.writeMessage(e,f,t)},writePackedDouble:function(e,t){t.length&&this.writeMessage(e,h,t)},writePackedFixed32:function(e,t){t.length&&this.writeMessage(e,p,t)},writePackedSFixed32:function(e,t){t.length&&this.writeMessage(e,v,t)},writePackedFixed64:function(e,t){t.length&&this.writeMessage(e,y,t)},writePackedSFixed64:function(e,t){t.length&&this.writeMessage(e,g,t)},writeBytesField:function(e,t){this.writeTag(e,i.Bytes),this.writeBytes(t)},writeFixed32Field:function(e,t){this.writeTag(e,i.Fixed32),this.writeFixed32(t)},writeSFixed32Field:function(e,t){this.writeTag(e,i.Fixed32),this.writeSFixed32(t)},writeFixed64Field:function(e,t){this.writeTag(e,i.Fixed64),this.writeFixed64(t)},writeSFixed64Field:function(e,t){this.writeTag(e,i.Fixed64),this.writeSFixed64(t)},writeVarintField:function(e,t){this.writeTag(e,i.Varint),this.writeVarint(t)},writeSVarintField:function(e,t){this.writeTag(e,i.Varint),this.writeSVarint(t)},writeStringField:function(e,t){this.writeTag(e,i.Bytes),this.writeString(t)},writeFloatField:function(e,t){this.writeTag(e,i.Fixed32),this.writeFloat(t)},writeDoubleField:function(e,t){this.writeTag(e,i.Fixed64),this.writeDouble(t)},writeBooleanField:function(e,t){this.writeVarintField(e,Boolean(t))}}},,,,,function(e,t){function r(t,n){return e.exports=r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},r(t,n)}e.exports=r},function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){var n=r(47);e.exports=function(e,t){if(e){if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){},function(e,t){e.exports=function(e){this.wrapped=e}},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){function r(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}e.exports=function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){var n=r(89),i=r(90),a=r(91),o=r(93);e.exports=function(e,t){return n(e)||i(e,t)||a(e,t)||o()},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){function r(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}e.exports=function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){var n=r(46);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(e){return!1}}function a(t,r,o){return i()?e.exports=a=Reflect.construct:e.exports=a=function(e,t,r){var i=[null];i.push.apply(i,t);var a=new(Function.bind.apply(e,i));return r&&n(a,r.prototype),a},a.apply(null,arguments)}e.exports=a},function(e,t,r){var n=r(98),i=globalThis.deck||{};if(!i.LineLayer)throw new Error("@deck.gl/layers is not found");e.exports=Object.assign(i,n)},,,,,,,,,,function(e,t){e.exports=function(e){if(Array.isArray(e))return e}},function(e,t){e.exports=function(e,t){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)){var r=[],n=!0,i=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(n=(o=s.next()).done)&&(r.push(o.value),!t||r.length!==t);n=!0);}catch(e){i=!0,a=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw a}}return r}}},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}},function(e,t,r){var n=r(47);e.exports=function(e){if(Array.isArray(e))return n(e)},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.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.")},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e){if(Array.isArray(e))return e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,a=[],o=!0,s=!1;try{for(r=r.call(e);!(o=(n=r.next()).done)&&(a.push(n.value),!t||a.length!==t);o=!0);}catch(e){s=!0,i=e}finally{try{o||null==r.return||r.return()}finally{if(s)throw i}}return a}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.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.")},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t<e.length;t++)r[t]=e[t];return r}}},function(e,t){e.exports=function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}},function(e,t){function r(t,n){return e.exports=r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},e.exports.default=e.exports,e.exports.__esModule=!0,r(t,n)}e.exports=r,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){var n=r(49);e.exports=function(e){if(Array.isArray(e))return n(e)},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){var n=r(49);e.exports=function(e,t){if(e){if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.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.")},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){var n=function(e){"use strict";var t=Object.prototype,r=t.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",a=n.asyncIterator||"@@asyncIterator",o=n.toStringTag||"@@toStringTag";function s(e,t,r,n){var i=t&&t.prototype instanceof l?t:l,a=Object.create(i.prototype),o=new w(n||[]);return a._invoke=function(e,t,r){var n="suspendedStart";return function(i,a){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw a;return x()}for(r.method=i,r.arg=a;;){var o=r.delegate;if(o){var s=b(o,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(e,t,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)}}}(e,r,o),a}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.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!==t&&r.call(v,i)&&(d=v);var y=h.prototype=l.prototype=Object.create(d);function g(e){["next","throw","return"].forEach((function(t){e[t]=function(e){return this._invoke(t,e)}}))}function m(e){var t;this._invoke=function(n,i){function a(){return new Promise((function(t,a){!function t(n,i,a,o){var s=u(e[n],e,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(e){t("next",e,a,o)}),(function(e){t("throw",e,a,o)})):Promise.resolve(l).then((function(e){c.value=e,a(c)}),(function(e){return t("throw",e,a,o)}))}o(s.arg)}(n,i,t,a)}))}return t=t?t.then(a,a):a()}}function b(e,t){var r=e.iterator[t.method];if(void 0===r){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,b(e,t),"throw"===t.method))return c;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return c}var n=u(r,e.iterator,t.arg);if("throw"===n.type)return t.method="throw",t.arg=n.arg,t.delegate=null,c;var i=n.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,c):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,c)}function A(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function B(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function w(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(A,this),this.reset(!0)}function _(e){if(e){var t=e[i];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:x}}function x(){return{value:void 0,done:!0}}return f.prototype=y.constructor=h,h.constructor=f,h[o]=f.displayName="GeneratorFunction",e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,o in e||(e[o]="GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},g(m.prototype),m.prototype[a]=function(){return this},e.AsyncIterator=m,e.async=function(t,r,n,i){var a=new m(s(t,r,n,i));return e.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},g(y),y[o]="Generator",y[i]=function(){return this},y.toString=function(){return"[object Generator]"},e.keys=function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function r(){for(;t.length;){var n=t.pop();if(n in e)return r.value=n,r.done=!1,r}return r.done=!0,r}},e.values=_,w.prototype={constructor:w,reset:function(e){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),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return o.type="throw",o.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],o=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var s=r.call(a,"catchLoc"),u=r.call(a,"finallyLoc");if(s&&u){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(e,t){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 a=i;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=e,o.arg=t,a?(this.method="next",this.next=a.finallyLoc,c):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),c},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),B(r),c}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;B(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:_(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),c}},e}(e.exports);try{regeneratorRuntime=n}catch(e){Function("r","regeneratorRuntime = r")(n)}},function(e,t,r){var n=r(5);e.exports=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=n(e)););return e}},function(e,t){e.exports=function(e){if(Array.isArray(e))return e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,a=[],o=!0,s=!1;try{for(r=r.call(e);!(o=(n=r.next()).done)&&(a.push(n.value),!t||a.length!==t);o=!0);}catch(e){s=!0,i=e}finally{try{o||null==r.return||r.return()}finally{if(s)throw i}}return a}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){var n=r(92);e.exports=function(e,t){if(e){if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.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.")},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){},function(e,t){},function(e,t,r){var n=r(51);function i(e){var t,r;function i(t,r){try{var o=e[t](r),s=o.value,u=s instanceof n;Promise.resolve(u?s.wrapped:s).then((function(e){u?i("return"===t?"return":"next",e):a(o.done?"return":"normal",e)}),(function(e){i("throw",e)}))}catch(e){a("throw",e)}}function a(e,n){switch(e){case"return":t.resolve({value:n,done:!0});break;case"throw":t.reject(n);break;default:t.resolve({value:n,done:!1})}(t=t.next)?i(t.key,t.arg):r=null}this._invoke=function(e,n){return new Promise((function(a,o){var s={key:e,arg:n,resolve:a,reject:o,next:null};r?r=r.next=s:(t=r=s,i(e,n))}))},"function"!=typeof e.return&&(this.return=void 0)}"function"==typeof Symbol&&Symbol.asyncIterator&&(i.prototype[Symbol.asyncIterator]=function(){return this}),i.prototype.next=function(e){return this._invoke("next",e)},i.prototype.throw=function(e){return this._invoke("throw",e)},i.prototype.return=function(e){return this._invoke("return",e)},e.exports=i},function(e,t){t.read=function(e,t,r,n,i){var a,o,s=8*i-n-1,u=(1<<s)-1,c=u>>1,l=-7,f=r?i-1:0,h=r?-1:1,d=e[t+f];for(f+=h,a=d&(1<<-l)-1,d>>=-l,l+=s;l>0;a=256*a+e[t+f],f+=h,l-=8);for(o=a&(1<<-l)-1,a>>=-l,l+=n;l>0;o=256*o+e[t+f],f+=h,l-=8);if(0===a)a=1-c;else{if(a===u)return o?NaN:1/0*(d?-1:1);o+=Math.pow(2,n),a-=c}return(d?-1:1)*o*Math.pow(2,a-n)},t.write=function(e,t,r,n,i,a){var o,s,u,c=8*a-i-1,l=(1<<c)-1,f=l>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:a-1,p=n?1:-1,v=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=l):(o=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-o))<1&&(o--,u*=2),(t+=o+f>=1?h/u:h*Math.pow(2,1-f))*u>=2&&(o++,u/=2),o+f>=l?(s=0,o=l):o+f>=1?(s=(t*u-1)*Math.pow(2,i),o+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,i),o=0));i>=8;e[r+d]=255&s,d+=p,s/=256,i-=8);for(o=o<<i|s,c+=i;c>0;e[r+d]=255&o,d+=p,o/=256,c-=8);e[r+d-p]|=128*v}},function(e,t,r){"use strict";r.r(t);var n={};r.r(n),r.d(n,"filename",(function(){return Cl})),r.d(n,"dirname",(function(){return Ol})),r.d(n,"join",(function(){return El}));var i={};r.r(i),r.d(i,"name",(function(){return tg})),r.d(i,"decode",(function(){return rg}));var a={};r.r(a),r.d(a,"name",(function(){return fg})),r.d(a,"preprocess",(function(){return hg}));var o={};r.r(o),r.d(o,"name",(function(){return vg})),r.d(o,"preprocess",(function(){return yg}));var s={};r.r(s),r.d(s,"name",(function(){return xg})),r.d(s,"preprocess",(function(){return Cg})),r.d(s,"decode",(function(){return Og})),r.d(s,"encode",(function(){return Tg}));var u={};r.r(u),r.d(u,"name",(function(){return Dg})),r.d(u,"decode",(function(){return Lg})),r.d(u,"encode",(function(){return Gg}));var c={};r.r(c),r.d(c,"name",(function(){return Jg})),r.d(c,"decode",(function(){return Vg})),r.d(c,"encode",(function(){return Kg}));var l={};r.r(l),r.d(l,"name",(function(){return Qg})),r.d(l,"decode",(function(){return Wg})),r.d(l,"encode",(function(){return Yg}));var f=r(2),h=r.n(f),d=r(6),p=r.n(d),v=r(11),y=r.n(v),g=r(5),m=r.n(g),b=r(0),A=r.n(b),B=r(10);function w(e){var t=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(e){return!1}}();return function(){var r,n=m()(e);if(t){var i=m()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return y()(this,r)}}var _=function(e){p()(r,e);var t=w(r);function r(){return h()(this,r),t.apply(this,arguments)}return r}(B.ArcLayer);A()(_,"layerName","GreatCircleLayer"),A()(_,"defaultProps",{getHeight:{type:"accessor",value:0},greatCircle:!0});var x=r(3),C=r.n(x);function O(e){var t=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(e){return!1}}();return function(){var r,n=m()(e);if(t){var i=m()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return y()(this,r)}}function E(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}var T=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?E(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):E(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},B.PolygonLayer.defaultProps),S=function(e){p()(r,e);var t=O(r);function r(){return h()(this,r),t.apply(this,arguments)}return C()(r,[{key:"indexToBounds",value:function(){return null}},{key:"renderLayers",value:function(){var e=this.props,t=e.elevationScale,r=e.extruded,n=e.wireframe,i=e.filled,a=e.stroked,o=e.lineWidthUnits,s=e.lineWidthScale,u=e.lineWidthMinPixels,c=e.lineWidthMaxPixels,l=e.lineJointRounded,f=e.lineMiterLimit,h=e.lineDashJustified,d=e.getElevation,p=e.getFillColor,v=e.getLineColor,y=e.getLineWidth,g=this.props,m=g.updateTriggers,b=g.material,A=g.transitions;return new(this.getSubLayerClass("cell",B.PolygonLayer))({filled:i,wireframe:n,extruded:r,elevationScale:t,stroked:a,lineWidthUnits:o,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}(B.CompositeLayer);A()(S,"layerName","GeoCellLayer"),A()(S,"defaultProps",T);var k=r(7),M=r.n(k),I=r(26),P=r.n(I),R=180/Math.PI;function F(e,t,r){var n=1<<t;return[(e[0]+r[0])/n,(e[1]+r[1])/n]}function D(e){return e>=.5?1/3*(4*e*e-1):1/3*(1-4*(1-e)*(1-e))}function L(e){return[D(e[0]),D(e[1])]}function j(e,t){var r=M()(t,2),n=r[0],i=r[1];switch(e){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 G(e,t,r,n){if(0===n){1===r&&(t[0]=e-1-t[0],t[1]=e-1-t[1]);var i=t[0];t[0]=t[1],t[1]=i}}function U(e){if("string"==typeof e){if(e.indexOf("/")>0)return e;e=function(e){var t=e.padEnd(16,"0");return P.a.fromString(t,16)}(e)}return function(e){for(var t=P.a.fromString(e,!0,10).toString(2);t.length<64;)t="0"+t;for(var r=t.lastIndexOf("1"),n=t.substring(0,3),i=t.substring(3,r),a=i.length/2,o=P.a.fromString(n,!0,2).toString(10),s=P.a.fromString(i,!0,2).toString(4);s.length<a;)s="0"+s;return"".concat(o,"/").concat(s)}(e.toString())}function N(e){return function(e){for(var t,r,n,i,a,o,s=e.face,u=e.ij,c=e.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 B=j(s,L(F(u,c,y))),w=(t=B,r=void 0,n=void 0,i=void 0,a=void 0,o=void 0,r=M()(t,3),n=r[0],i=r[1],a=r[2],o=Math.atan2(a,Math.sqrt(n*n+i*i)),[Math.atan2(i,n)*R,o*R]);Math.abs(w[1])>89.999&&(w[0]=p);var _=w[0]-p;w[0]+=_>180?-360:_<-180?360:0,h[d++]=w[0],h[d++]=w[1],p=w[0]}return h[d++]=h[0],h[d++]=h[1],h}(function(e){for(var t,r=e.split("/"),n=parseInt(r[0],10),i=r[1],a=i.length,o=[0,0],s=a-1;s>=0;s--){t=a-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,t-1);G(f,o,c,l),o[0]+=f*c,o[1]+=f*l}if(n%2==1){var h=o[0];o[0]=o[1],o[1]=h}return{face:n,ij:o,level:t}}(U(e)))}function H(e){var t=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(e){return!1}}();return function(){var r,n=m()(e);if(t){var i=m()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return y()(this,r)}}var J=function(e){p()(r,e);var t=H(r);function r(){return h()(this,r),t.apply(this,arguments)}return C()(r,[{key:"indexToBounds",value:function(){var e=this.props,t=e.data,r=e.getS2Token;return{data:t,_normalize:!1,positionFormat:"XY",getPolygon:function(e,t){return N(r(e,t))}}}}]),r}(S);A()(J,"layerName","S2Layer"),A()(J,"defaultProps",{getS2Token:{type:"accessor",value:function(e){return e.token}}});r(34);var V=r(20),z=r.n(V);r(52),r(53);var K="undefined"!=typeof Float32Array?Float32Array:Array;Math.random;Math.PI;function q(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e}function X(e){var t=e[0],r=e[1],n=e[2],i=e[3];return Math.hypot(t,r,n,i)}function Q(e){var t=e[0],r=e[1],n=e[2],i=e[3];return t*t+r*r+n*n+i*i}function W(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3];return e[0]=r[0]*n+r[4]*i+r[8]*a+r[12]*o,e[1]=r[1]*n+r[5]*i+r[9]*a+r[13]*o,e[2]=r[2]*n+r[6]*i+r[10]*a+r[14]*o,e[3]=r[3]*n+r[7]*i+r[11]*a+r[15]*o,e}function Z(e,t,r){var n=t[0],i=t[1],a=t[2],o=r[0],s=r[1],u=r[2],c=r[3],l=c*n+s*a-u*i,f=c*i+u*n-o*a,h=c*a+o*i-s*n,d=-o*n-s*i-u*a;return e[0]=l*c+d*-o+f*-u-h*-s,e[1]=f*c+d*-s+h*-o-l*-u,e[2]=h*c+d*-u+l*-s-f*-o,e[3]=t[3],e}Math.hypot||(Math.hypot=function(){for(var e=0,t=arguments.length;t--;)e+=arguments[t]*arguments[t];return Math.sqrt(e)});var Y,$;Y=new K(4),K!=Float32Array&&(Y[0]=0,Y[1]=0,Y[2]=0,Y[3]=0),$=Y;Math.log2;function ee(e,t){var r=t[0],n=t[1],i=t[2],a=t[3],o=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],v=t[13],y=t[14],g=t[15],m=r*s-n*o,b=r*u-i*o,A=r*c-a*o,B=n*u-i*s,w=n*c-a*s,_=i*c-a*u,x=l*v-f*p,C=l*y-h*p,O=l*g-d*p,E=f*y-h*v,T=f*g-d*v,S=h*g-d*y,k=m*S-b*T+A*E+B*O-w*C+_*x;return k?(k=1/k,e[0]=(s*S-u*T+c*E)*k,e[1]=(i*T-n*S-a*E)*k,e[2]=(v*_-y*w+g*B)*k,e[3]=(h*w-f*_-d*B)*k,e[4]=(u*O-o*S-c*C)*k,e[5]=(r*S-i*O+a*C)*k,e[6]=(y*A-p*_-g*b)*k,e[7]=(l*_-h*A+d*b)*k,e[8]=(o*T-s*O+c*x)*k,e[9]=(n*O-r*T-a*x)*k,e[10]=(p*w-v*A+g*m)*k,e[11]=(f*A-l*w-d*m)*k,e[12]=(s*C-o*E-u*x)*k,e[13]=(r*E-n*C+i*x)*k,e[14]=(v*b-p*B-y*m)*k,e[15]=(l*B-f*b+h*m)*k,e):null}function te(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],u=t[5],c=t[6],l=t[7],f=t[8],h=t[9],d=t[10],p=t[11],v=t[12],y=t[13],g=t[14],m=t[15],b=r[0],A=r[1],B=r[2],w=r[3];return e[0]=b*n+A*s+B*f+w*v,e[1]=b*i+A*u+B*h+w*y,e[2]=b*a+A*c+B*d+w*g,e[3]=b*o+A*l+B*p+w*m,b=r[4],A=r[5],B=r[6],w=r[7],e[4]=b*n+A*s+B*f+w*v,e[5]=b*i+A*u+B*h+w*y,e[6]=b*a+A*c+B*d+w*g,e[7]=b*o+A*l+B*p+w*m,b=r[8],A=r[9],B=r[10],w=r[11],e[8]=b*n+A*s+B*f+w*v,e[9]=b*i+A*u+B*h+w*y,e[10]=b*a+A*c+B*d+w*g,e[11]=b*o+A*l+B*p+w*m,b=r[12],A=r[13],B=r[14],w=r[15],e[12]=b*n+A*s+B*f+w*v,e[13]=b*i+A*u+B*h+w*y,e[14]=b*a+A*c+B*d+w*g,e[15]=b*o+A*l+B*p+w*m,e}function re(e,t,r){var n,i,a,o,s,u,c,l,f,h,d,p,v=r[0],y=r[1],g=r[2];return t===e?(e[12]=t[0]*v+t[4]*y+t[8]*g+t[12],e[13]=t[1]*v+t[5]*y+t[9]*g+t[13],e[14]=t[2]*v+t[6]*y+t[10]*g+t[14],e[15]=t[3]*v+t[7]*y+t[11]*g+t[15]):(n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],u=t[5],c=t[6],l=t[7],f=t[8],h=t[9],d=t[10],p=t[11],e[0]=n,e[1]=i,e[2]=a,e[3]=o,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]=n*v+s*y+f*g+t[12],e[13]=i*v+u*y+h*g+t[13],e[14]=a*v+c*y+d*g+t[14],e[15]=o*v+l*y+p*g+t[15]),e}function ne(e,t,r){var n=r[0],i=r[1],a=r[2];return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*i,e[5]=t[5]*i,e[6]=t[6]*i,e[7]=t[7]*i,e[8]=t[8]*a,e[9]=t[9]*a,e[10]=t[10]*a,e[11]=t[11]*a,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function ie(e,t,r){var n=Math.sin(r),i=Math.cos(r),a=t[4],o=t[5],s=t[6],u=t[7],c=t[8],l=t[9],f=t[10],h=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=a*i+c*n,e[5]=o*i+l*n,e[6]=s*i+f*n,e[7]=u*i+h*n,e[8]=c*i-a*n,e[9]=l*i-o*n,e[10]=f*i-s*n,e[11]=h*i-u*n,e}function ae(e,t,r){var n=Math.sin(r),i=Math.cos(r),a=t[0],o=t[1],s=t[2],u=t[3],c=t[4],l=t[5],f=t[6],h=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*i+c*n,e[1]=o*i+l*n,e[2]=s*i+f*n,e[3]=u*i+h*n,e[4]=c*i-a*n,e[5]=l*i-o*n,e[6]=f*i-s*n,e[7]=h*i-u*n,e}function oe(e,t){var r=t[0],n=t[1],i=t[2],a=t[4],o=t[5],s=t[6],u=t[8],c=t[9],l=t[10];return e[0]=Math.hypot(r,n,i),e[1]=Math.hypot(a,o,s),e[2]=Math.hypot(u,c,l),e}var se=function(e,t,r,n,i){var a,o=1/Math.tan(t/2);return e[0]=o/r,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=o,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,null!=i&&i!==1/0?(a=1/(n-i),e[10]=(i+n)*a,e[14]=2*i*n*a):(e[10]=-1,e[14]=-2*n),e};var ue=function(e,t,r,n,i,a,o){var s=1/(t-r),u=1/(n-i),c=1/(a-o);return e[0]=-2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*u,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*c,e[11]=0,e[12]=(t+r)*s,e[13]=(i+n)*u,e[14]=(o+a)*c,e[15]=1,e};function ce(e,t,r){var n=t[0],i=t[1];return e[0]=r[0]*n+r[3]*i+r[6],e[1]=r[1]*n+r[4]*i+r[7],e}function le(e,t,r){var n=t[0],i=t[1];return e[0]=r[0]*n+r[4]*i+r[12],e[1]=r[1]*n+r[5]*i+r[13],e}!function(){var e=function(){var e=new K(2);return K!=Float32Array&&(e[0]=0,e[1]=0),e}()}();function fe(){var e=new K(3);return K!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function he(e){var t=e[0],r=e[1],n=e[2];return Math.hypot(t,r,n)}function de(e,t,r){var n=new K(3);return n[0]=e,n[1]=t,n[2]=r,n}function pe(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function ve(e,t,r){var n=t[0],i=t[1],a=t[2],o=r[0],s=r[1],u=r[2];return e[0]=i*u-a*s,e[1]=a*o-n*u,e[2]=n*s-i*o,e}function ye(e,t,r){var n=t[0],i=t[1],a=t[2],o=r[3]*n+r[7]*i+r[11]*a+r[15];return o=o||1,e[0]=(r[0]*n+r[4]*i+r[8]*a+r[12])/o,e[1]=(r[1]*n+r[5]*i+r[9]*a+r[13])/o,e[2]=(r[2]*n+r[6]*i+r[10]*a+r[14])/o,e}function ge(e,t,r){var n=t[0],i=t[1],a=t[2];return e[0]=n*r[0]+i*r[3]+a*r[6],e[1]=n*r[1]+i*r[4]+a*r[7],e[2]=n*r[2]+i*r[5]+a*r[8],e}function me(e,t,r){var n=r[0],i=r[1],a=r[2],o=r[3],s=t[0],u=t[1],c=t[2],l=i*c-a*u,f=a*s-n*c,h=n*u-i*s,d=i*h-a*f,p=a*l-n*h,v=n*f-i*l,y=2*o;return l*=y,f*=y,h*=y,d*=2,p*=2,v*=2,e[0]=s+l+d,e[1]=u+f+p,e[2]=c+h+v,e}var be=he;!function(){var e=fe()}();function Ae(e,t){if(!e)throw new Error(t||"@math.gl/web-mercator: assertion failed.")}var Be=Math.PI,we=Be/4,_e=Be/180,xe=180/Be;function Ce(e){var t=z()(e,2),r=t[0],n=t[1];Ae(Number.isFinite(r)),Ae(Number.isFinite(n)&&n>=-90&&n<=90,"invalid latitude");var i=n*_e;return[512*(r*_e+Be)/(2*Be),512*(Be+Math.log(Math.tan(we+.5*i)))/(2*Be)]}function Oe(e){var t=z()(e,2),r=t[0],n=t[1],i=r/512*(2*Be)-Be,a=2*(Math.atan(Math.exp(n/512*(2*Be)-Be))-we);return[i*xe,a*xe]}Math.PI;r(54);function Ee(e){var t=function(e){for(var t=0,r=0,n=1<<e.length,i=n/512,a=0;a<e.length;a++){n>>=1;var o=parseInt(e[a]);o%2&&(t|=n),o>1&&(r|=n)}return[[t/i,512-r/i],[(t+.99)/i,512-(r+.99)/i]]}(e),r=M()(t,2),n=r[0],i=r[1],a=Oe(n),o=M()(a,2),s=o[0],u=o[1],c=Oe(i),l=M()(c,2),f=l[0],h=l[1];return[f,u,f,h,s,h,s,u,f,u]}function Te(e){var t=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(e){return!1}}();return function(){var r,n=m()(e);if(t){var i=m()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return y()(this,r)}}var Se=function(e){p()(r,e);var t=Te(r);function r(){return h()(this,r),t.apply(this,arguments)}return C()(r,[{key:"indexToBounds",value:function(){var e=this.props,t=e.data,r=e.getQuadkey;return{data:t,_normalize:!1,positionFormat:"XY",getPolygon:function(e,t){return Ee(r(e,t))}}}}]),r}(S);A()(Se,"layerName","QuadkeyLayer"),A()(Se,"defaultProps",{getQuadkey:{type:"accessor",value:function(e){return e.quadkey}}});var ke=r(4),Me=r.n(ke),Ie=r(1),Pe=r.n(Ie),Re=function(){function e(t){h()(this,e),A()(this,"index",void 0),A()(this,"isVisible",void 0),A()(this,"isSelected",void 0),A()(this,"parent",void 0),A()(this,"children",void 0),A()(this,"content",void 0),A()(this,"state",void 0),A()(this,"layers",void 0),A()(this,"id",void 0),A()(this,"bbox",void 0),A()(this,"zoom",void 0),A()(this,"userData",void 0),A()(this,"_abortController",void 0),A()(this,"_loader",void 0),A()(this,"_loaderId",void 0),A()(this,"_isLoaded",void 0),A()(this,"_isCancelled",void 0),A()(this,"_needsReload",void 0),this.index=t,this.isVisible=!1,this.isSelected=!1,this.parent=null,this.children=[],this.content=null,this._loader=void 0,this._abortController=null,this._loaderId=0,this._isLoaded=!1,this._isCancelled=!1,this._needsReload=!1}var t;return C()(e,[{key:"data",get:function(){var e=this;return this.isLoading&&this._loader?this._loader.then((function(){return e.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 e=this.content?this.content.byteLength:0;return Number.isFinite(e)||B.log.error("byteLength not defined in tile data")(),e}},{key:"_loadData",value:(t=Me()(Pe.a.mark((function e(t){var r,n,i,a,o,s,u,c,l,f,h,d,p,v;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.getData,n=t.requestScheduler,i=t.onLoad,a=t.onError,o=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,e.next=7,n.scheduleRequest(this,(function(e){return e.isSelected?1:-1}));case 7:if(d=e.sent){e.next=11;break}return this._isCancelled=!0,e.abrupt("return");case 11:if(!this._isCancelled){e.next=14;break}return d.done(),e.abrupt("return");case 14:return p=null,e.prev=15,e.next=18,r({index:o,id:s,bbox:u,userData:c,zoom:l,signal:h});case 18:p=e.sent,e.next=24;break;case 21:e.prev=21,e.t0=e.catch(15),v=e.t0||!0;case 24:return e.prev=24,d.done(),e.finish(24);case 27:if(f===this._loaderId){e.next=29;break}return e.abrupt("return");case 29:if(this._loader=void 0,this.content=p,!this._isCancelled||p){e.next=34;break}return this._isLoaded=!1,e.abrupt("return");case 34:this._isLoaded=!0,this._isCancelled=!1,v?a(v,this):i(this);case 37:case"end":return e.stop()}}),e,this,[[15,21,24,27]])}))),function(e){return t.apply(this,arguments)})},{key:"loadData",value:function(e){return this._isLoaded=!1,this._isCancelled=!1,this._needsReload=!1,this._loaderId++,this._loader=this._loadData(e),this._loader}},{key:"setNeedsReload",value:function(){this.isLoading&&(this.abort(),this._loader=void 0),this._needsReload=!0}},{key:"abort",value:function(){var e;this.isLoaded||(this._isCancelled=!0,null===(e=this._abortController)||void 0===e||e.abort())}}]),e}(),Fe=r(8),De=r.n(Fe),Le=-1,je=0,Ge=1,Ue=r(21),Ne=r.n(Ue),He=r(22),Je=r.n(He);function Ve(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var ze=r(16),Ke=r.n(ze),qe=r(17),Xe=r.n(qe),Qe=r(18),We=r.n(Qe),Ze=r(19),Ye=r.n(Ze),$e=r(14),et=r.n($e);r(38);function tt(e,t){if(!e)throw new Error("math.gl assertion ".concat(t))}var rt=1/Math.PI*180,nt=1/180*Math.PI,it={EPSILON:1e-12,debug:!1,precision:4,printTypes:!1,printDegrees:!1,printRowMajor:!0};function at(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.precision,n=void 0===r?it.precision:r;return e=dt(e),"".concat(parseFloat(e.toPrecision(n)))}function ot(e){return Array.isArray(e)||ArrayBuffer.isView(e)&&!(e instanceof DataView)}function st(e){return function(e,t){return pt(e,(function(e){return e*nt}),t)}(e)}function ut(e){return ct(e)}function ct(e,t){return pt(e,(function(e){return e*rt}),t)}function lt(e,t,r){return pt(e,(function(e){return Math.max(t,Math.min(r,e))}))}function ft(e,t,r){return ot(e)?e.map((function(e,n){return ft(e,t[n],r)})):r*t+(1-r)*e}function ht(e,t,r){var n=it.EPSILON;r&&(it.EPSILON=r);try{if(e===t)return!0;if(ot(e)&&ot(t)){if(e.length!==t.length)return!1;for(var i=0;i<e.length;++i)if(!ht(e[i],t[i]))return!1;return!0}return e&&e.equals?e.equals(t):t&&t.equals?t.equals(e):"number"==typeof e&&"number"==typeof t&&Math.abs(e-t)<=it.EPSILON*Math.max(1,Math.abs(e),Math.abs(t))}finally{it.EPSILON=n}}function dt(e){return Math.round(e/it.EPSILON)*it.EPSILON}function pt(e,t,r){if(ot(e)){var n=e;r=r||function(e){return e.clone?e.clone():new Array(e.length)}(n);for(var i=0;i<r.length&&i<n.length;++i)r[i]=t(e[i],i,r);return r}return t(e)}function vt(e){var t=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(e){return!1}}();return function(){var r,n=et()(e);if(t){var i=et()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Ye()(this,r)}}var yt=function(e){We()(r,e);var t=vt(r);function r(){return Ke()(this,r),t.apply(this,arguments)}return Xe()(r,[{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"fromArray",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=0;r<this.ELEMENTS;++r)this[r]=e[r+t];return this.check()}},{key:"toArray",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=0;r<this.ELEMENTS;++r)e[t+r]=this[r];return e}},{key:"from",value:function(e){return Array.isArray(e)?this.copy(e):this.fromObject(e)}},{key:"to",value:function(e){return e===this?this:ot(e)?this.toArray(e):this.toObject(e)}},{key:"toTarget",value:function(e){return e?this.to(e):this}},{key:"toFloat32Array",value:function(){return new Float32Array(this)}},{key:"toString",value:function(){return this.formatString(it)}},{key:"formatString",value:function(e){for(var t="",r=0;r<this.ELEMENTS;++r)t+=(r>0?", ":"")+at(this[r],e);return"".concat(e.printTypes?this.constructor.name:"","[").concat(t,"]")}},{key:"equals",value:function(e){if(!e||this.length!==e.length)return!1;for(var t=0;t<this.ELEMENTS;++t)if(!ht(this[t],e[t]))return!1;return!0}},{key:"exactEquals",value:function(e){if(!e||this.length!==e.length)return!1;for(var t=0;t<this.ELEMENTS;++t)if(this[t]!==e[t])return!1;return!0}},{key:"negate",value:function(){for(var e=0;e<this.ELEMENTS;++e)this[e]=-this[e];return this.check()}},{key:"lerp",value:function(e,t,r){if(void 0===r)return this.lerp(this,e,t);for(var n=0;n<this.ELEMENTS;++n){var i=e[n];this[n]=i+r*(t[n]-i)}return this.check()}},{key:"min",value:function(e){for(var t=0;t<this.ELEMENTS;++t)this[t]=Math.min(e[t],this[t]);return this.check()}},{key:"max",value:function(e){for(var t=0;t<this.ELEMENTS;++t)this[t]=Math.max(e[t],this[t]);return this.check()}},{key:"clamp",value:function(e,t){for(var r=0;r<this.ELEMENTS;++r)this[r]=Math.min(Math.max(this[r],e[r]),t[r]);return this.check()}},{key:"add",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];for(var n=0,i=t;n<i.length;n++)for(var a=i[n],o=0;o<this.ELEMENTS;++o)this[o]+=a[o];return this.check()}},{key:"subtract",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];for(var n=0,i=t;n<i.length;n++)for(var a=i[n],o=0;o<this.ELEMENTS;++o)this[o]-=a[o];return this.check()}},{key:"scale",value:function(e){if("number"==typeof e)for(var t=0;t<this.ELEMENTS;++t)this[t]*=e;else for(var r=0;r<this.ELEMENTS&&r<e.length;++r)this[r]*=e[r];return this.check()}},{key:"multiplyByScalar",value:function(e){for(var t=0;t<this.ELEMENTS;++t)this[t]*=e;return this.check()}},{key:"check",value:function(){if(it.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 e=this.length===this.ELEMENTS,t=0;t<this.ELEMENTS;++t)e=e&&Number.isFinite(this[t]);return e}},{key:"sub",value:function(e){return this.subtract(e)}},{key:"setScalar",value:function(e){for(var t=0;t<this.ELEMENTS;++t)this[t]=e;return this.check()}},{key:"addScalar",value:function(e){for(var t=0;t<this.ELEMENTS;++t)this[t]+=e;return this.check()}},{key:"subScalar",value:function(e){return this.addScalar(-e)}},{key:"multiplyScalar",value:function(e){for(var t=0;t<this.ELEMENTS;++t)this[t]*=e;return this.check()}},{key:"divideScalar",value:function(e){return this.multiplyByScalar(1/e)}},{key:"clampScalar",value:function(e,t){for(var r=0;r<this.ELEMENTS;++r)this[r]=Math.min(Math.max(this[r],e),t);return this.check()}},{key:"elements",get:function(){return this}}]),r}(function(e){function t(){var t=Reflect.construct(e,Array.from(arguments));return Object.setPrototypeOf(t,Object.getPrototypeOf(this)),t}return t.prototype=Object.create(e.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e,t}(Array));function gt(e,t){if(e.length!==t)return!1;for(var r=0;r<e.length;++r)if(!Number.isFinite(e[r]))return!1;return!0}function mt(e){if(!Number.isFinite(e))throw new Error("Invalid number ".concat(e));return e}function bt(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(it.debug&&!gt(e,t))throw new Error("math.gl: ".concat(r," some fields set to invalid numbers'"));return e}function At(e){var t=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(e){return!1}}();return function(){var r,n=et()(e);if(t){var i=et()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Ye()(this,r)}}var Bt=function(e){We()(r,e);var t=At(r);function r(){return Ke()(this,r),t.apply(this,arguments)}return Xe()(r,[{key:"x",get:function(){return this[0]},set:function(e){this[0]=mt(e)}},{key:"y",get:function(){return this[1]},set:function(e){this[1]=mt(e)}},{key:"len",value:function(){return Math.sqrt(this.lengthSquared())}},{key:"magnitude",value:function(){return this.len()}},{key:"lengthSquared",value:function(){for(var e=0,t=0;t<this.ELEMENTS;++t)e+=this[t]*this[t];return e}},{key:"magnitudeSquared",value:function(){return this.lengthSquared()}},{key:"distance",value:function(e){return Math.sqrt(this.distanceSquared(e))}},{key:"distanceSquared",value:function(e){for(var t=0,r=0;r<this.ELEMENTS;++r){var n=this[r]-e[r];t+=n*n}return mt(t)}},{key:"dot",value:function(e){for(var t=0,r=0;r<this.ELEMENTS;++r)t+=this[r]*e[r];return mt(t)}},{key:"normalize",value:function(){var e=this.magnitude();if(0!==e)for(var t=0;t<this.ELEMENTS;++t)this[t]/=e;return this.check()}},{key:"multiply",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];for(var n=0,i=t;n<i.length;n++)for(var a=i[n],o=0;o<this.ELEMENTS;++o)this[o]*=a[o];return this.check()}},{key:"divide",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];for(var n=0,i=t;n<i.length;n++)for(var a=i[n],o=0;o<this.ELEMENTS;++o)this[o]/=a[o];return this.check()}},{key:"lengthSq",value:function(){return this.lengthSquared()}},{key:"distanceTo",value:function(e){return this.distance(e)}},{key:"distanceToSquared",value:function(e){return this.distanceSquared(e)}},{key:"getComponent",value:function(e){return tt(e>=0&&e<this.ELEMENTS,"index is out of range"),mt(this[e])}},{key:"setComponent",value:function(e,t){return tt(e>=0&&e<this.ELEMENTS,"index is out of range"),this[e]=t,this.check()}},{key:"addVectors",value:function(e,t){return this.copy(e).add(t)}},{key:"subVectors",value:function(e,t){return this.copy(e).subtract(t)}},{key:"multiplyVectors",value:function(e,t){return this.copy(e).multiply(t)}},{key:"addScaledVector",value:function(e,t){return this.add(new this.constructor(e).multiplyScalar(t))}}]),r}(yt);function wt(e,t,r){var n=t[0],i=t[1],a=r[3]*n+r[7]*i||1;return e[0]=(r[0]*n+r[4]*i)/a,e[1]=(r[1]*n+r[5]*i)/a,e}function _t(e,t,r){var n=t[0],i=t[1],a=t[2],o=r[3]*n+r[7]*i+r[11]*a||1;return e[0]=(r[0]*n+r[4]*i+r[8]*a)/o,e[1]=(r[1]*n+r[5]*i+r[9]*a)/o,e[2]=(r[2]*n+r[6]*i+r[10]*a)/o,e}function xt(e,t,r){var n=t[0],i=t[1],a=t[2];return e[0]=r[0]*n+r[3]*i+r[6]*a,e[1]=r[1]*n+r[4]*i+r[7]*a,e[2]=r[2]*n+r[5]*i+r[8]*a,e[3]=t[3],e}function Ct(e){var t=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(e){return!1}}();return function(){var r,n=et()(e);if(t){var i=et()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Ye()(this,r)}}var Ot,Et=[0,0,0],Tt=function(e){We()(r,e);var t=Ct(r);function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return Ke()(this,r),e=t.call(this,-0,-0,-0),1===arguments.length&&ot(n)?e.copy(n):(it.debug&&(mt(n),mt(i),mt(a)),e[0]=n,e[1]=i,e[2]=a),e}return Xe()(r,[{key:"set",value:function(e,t,r){return this[0]=e,this[1]=t,this[2]=r,this.check()}},{key:"copy",value:function(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this.check()}},{key:"fromObject",value:function(e){return it.debug&&(mt(e.x),mt(e.y),mt(e.z)),this[0]=e.x,this[1]=e.y,this[2]=e.z,this.check()}},{key:"toObject",value:function(e){return e.x=this[0],e.y=this[1],e.z=this[2],e}},{key:"ELEMENTS",get:function(){return 3}},{key:"z",get:function(){return this[2]},set:function(e){this[2]=mt(e)}},{key:"angle",value:function(e){return r=e,n=(t=this)[0],i=t[1],a=t[2],o=r[0],s=r[1],u=r[2],c=Math.sqrt(n*n+i*i+a*a)*Math.sqrt(o*o+s*s+u*u),l=c&&pe(t,r)/c,Math.acos(Math.min(Math.max(l,-1),1));var t,r,n,i,a,o,s,u,c,l}},{key:"cross",value:function(e){return ve(this,this,e),this.check()}},{key:"rotateX",value:function(e){var t=e.radians,r=e.origin;return function(e,t,r,n){var i=[],a=[];i[0]=t[0]-r[0],i[1]=t[1]-r[1],i[2]=t[2]-r[2],a[0]=i[0],a[1]=i[1]*Math.cos(n)-i[2]*Math.sin(n),a[2]=i[1]*Math.sin(n)+i[2]*Math.cos(n),e[0]=a[0]+r[0],e[1]=a[1]+r[1],e[2]=a[2]+r[2]}(this,this,void 0===r?Et:r,t),this.check()}},{key:"rotateY",value:function(e){var t=e.radians,r=e.origin;return function(e,t,r,n){var i=[],a=[];i[0]=t[0]-r[0],i[1]=t[1]-r[1],i[2]=t[2]-r[2],a[0]=i[2]*Math.sin(n)+i[0]*Math.cos(n),a[1]=i[1],a[2]=i[2]*Math.cos(n)-i[0]*Math.sin(n),e[0]=a[0]+r[0],e[1]=a[1]+r[1],e[2]=a[2]+r[2]}(this,this,void 0===r?Et:r,t),this.check()}},{key:"rotateZ",value:function(e){var t=e.radians,r=e.origin;return function(e,t,r,n){var i=[],a=[];i[0]=t[0]-r[0],i[1]=t[1]-r[1],i[2]=t[2]-r[2],a[0]=i[0]*Math.cos(n)-i[1]*Math.sin(n),a[1]=i[0]*Math.sin(n)+i[1]*Math.cos(n),a[2]=i[2],e[0]=a[0]+r[0],e[1]=a[1]+r[1],e[2]=a[2]+r[2]}(this,this,void 0===r?Et:r,t),this.check()}},{key:"transform",value:function(e){return this.transformAsPoint(e)}},{key:"transformAsPoint",value:function(e){return ye(this,this,e),this.check()}},{key:"transformAsVector",value:function(e){return _t(this,this,e),this.check()}},{key:"transformByMatrix3",value:function(e){return ge(this,this,e),this.check()}},{key:"transformByMatrix2",value:function(e){return function(e,t,r){var n=t[0],i=t[1];e[0]=r[0]*n+r[2]*i,e[1]=r[1]*n+r[3]*i,e[2]=t[2]}(this,this,e),this.check()}},{key:"transformByQuaternion",value:function(e){return me(this,this,e),this.check()}}],[{key:"ZERO",get:function(){return Ot||(Ot=new r(0,0,0),Object.freeze(Ot)),Ot}}]),r}(Bt),St=new Tt,kt=new Tt,Mt=function(){function e(){var t=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;Ne()(this,e),Ve(this,"center",void 0),Ve(this,"halfDiagonal",void 0),Ve(this,"minimum",void 0),Ve(this,"maximum",void 0),n=n||St.copy(t).add(r).scale(.5),this.center=new Tt(n),this.halfDiagonal=new Tt(r).subtract(this.center),this.minimum=new Tt(t),this.maximum=new Tt(r)}return Je()(e,[{key:"clone",value:function(){return new e(this.minimum,this.maximum,this.center)}},{key:"equals",value:function(e){return this===e||Boolean(e)&&this.minimum.equals(e.minimum)&&this.maximum.equals(e.maximum)}},{key:"transform",value:function(e){return this.center.transformAsPoint(e),this.halfDiagonal.transform(e),this.minimum.transform(e),this.maximum.transform(e),this}},{key:"intersectPlane",value:function(e){var t=this.halfDiagonal,r=kt.from(e.normal),n=t.x*Math.abs(r.x)+t.y*Math.abs(r.y)+t.z*Math.abs(r.z),i=this.center.dot(r)+e.distance;return i-n>0?Ge:i+n<0?Le:je}},{key:"distanceTo",value:function(e){return Math.sqrt(this.distanceSquaredTo(e))}},{key:"distanceSquaredTo",value:function(e){var t,r=St.from(e).subtract(this.center),n=this.halfDiagonal,i=0;return(t=Math.abs(r.x)-n.x)>0&&(i+=t*t),(t=Math.abs(r.y)-n.y)>0&&(i+=t*t),(t=Math.abs(r.z)-n.z)>0&&(i+=t*t),i}}]),e}(),It=new Tt,Pt=new Tt,Rt=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[0,0,0],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;Ne()(this,e),Ve(this,"center",void 0),Ve(this,"radius",void 0),this.radius=-0,this.center=new Tt,this.fromCenterRadius(t,r)}return Je()(e,[{key:"fromCenterRadius",value:function(e,t){return this.center.from(e),this.radius=t,this}},{key:"fromCornerPoints",value:function(e,t){return t=It.from(t),this.center=(new Tt).from(e).add(t).scale(.5),this.radius=this.center.distance(t),this}},{key:"equals",value:function(e){return this===e||Boolean(e)&&this.center.equals(e.center)&&this.radius===e.radius}},{key:"clone",value:function(){return new e(this.center,this.radius)}},{key:"union",value:function(e){var t=this.center,r=this.radius,n=e.center,i=e.radius,a=It.copy(n).subtract(t),o=a.magnitude();if(r>=o+i)return this.clone();if(i>=o+r)return e.clone();var s=.5*(r+o+i);return Pt.copy(a).scale((-r+s)/o).add(t),this.center.copy(Pt),this.radius=s,this}},{key:"expand",value:function(e){var t=It.from(e).subtract(this.center).magnitude();return t>this.radius&&(this.radius=t),this}},{key:"transform",value:function(e){this.center.transform(e);var t=oe(It,e);return this.radius=Math.max(t[0],Math.max(t[1],t[2]))*this.radius,this}},{key:"distanceSquaredTo",value:function(e){var t=this.distanceTo(e);return t*t}},{key:"distanceTo",value:function(e){var t=It.from(e).subtract(this.center);return Math.max(0,t.len()-this.radius)}},{key:"intersectPlane",value:function(e){var t=this.center,r=this.radius,n=e.normal.dot(t)+e.distance;return n<-r?Le:n<r?je:Ge}}]),e}(),Ft=r(25),Dt=r.n(Ft);function Lt(e){var t=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(e){return!1}}();return function(){var r,n=et()(e);if(t){var i=et()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Ye()(this,r)}}var jt=function(e){We()(r,e);var t=Lt(r);function r(){return Ke()(this,r),t.apply(this,arguments)}return Xe()(r,[{key:"toString",value:function(){var e="[";if(it.printRowMajor){e+="row-major:";for(var t=0;t<this.RANK;++t)for(var r=0;r<this.RANK;++r)e+=" ".concat(this[r*this.RANK+t])}else{e+="column-major:";for(var n=0;n<this.ELEMENTS;++n)e+=" ".concat(this[n])}return e+="]"}},{key:"getElementIndex",value:function(e,t){return t*this.RANK+e}},{key:"getElement",value:function(e,t){return this[t*this.RANK+e]}},{key:"setElement",value:function(e,t,r){return this[t*this.RANK+e]=mt(r),this}},{key:"getColumn",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Array(this.RANK).fill(-0),r=e*this.RANK,n=0;n<this.RANK;++n)t[n]=this[r+n];return t}},{key:"setColumn",value:function(e,t){for(var r=e*this.RANK,n=0;n<this.RANK;++n)this[r+n]=t[n];return this}}]),r}(yt);function Gt(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],u=t[5],c=t[6],l=t[7],f=t[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 e[0]=h*n+d*o+p*c,e[1]=h*i+d*s+p*l,e[2]=h*a+d*u+p*f,e[3]=v*n+y*o+g*c,e[4]=v*i+y*s+g*l,e[5]=v*a+y*u+g*f,e[6]=m*n+b*o+A*c,e[7]=m*i+b*s+A*l,e[8]=m*a+b*u+A*f,e}function Ut(e,t,r){var n=r[0],i=r[1];return e[0]=n*t[0],e[1]=n*t[1],e[2]=n*t[2],e[3]=i*t[3],e[4]=i*t[4],e[5]=i*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}var Nt;function Ht(e){var t=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(e){return!1}}();return function(){var r,n=et()(e);if(t){var i=et()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Ye()(this,r)}}!function(e){e[e.COL0ROW0=0]="COL0ROW0",e[e.COL0ROW1=1]="COL0ROW1",e[e.COL0ROW2=2]="COL0ROW2",e[e.COL1ROW0=3]="COL1ROW0",e[e.COL1ROW1=4]="COL1ROW1",e[e.COL1ROW2=5]="COL1ROW2",e[e.COL2ROW0=6]="COL2ROW0",e[e.COL2ROW1=7]="COL2ROW1",e[e.COL2ROW2=8]="COL2ROW2"}(Nt||(Nt={}));var Jt,Vt,zt,Kt=Object.freeze([1,0,0,0,1,0,0,0,1]),qt=function(e){We()(r,e);var t=Ht(r);function r(e){for(var n,i=arguments.length,a=new Array(i>1?i-1:0),o=1;o<i;o++)a[o-1]=arguments[o];return Ke()(this,r),n=t.call(this,-0,-0,-0,-0,-0,-0,-0,-0,-0),1===arguments.length&&Array.isArray(e)?n.copy(e):a.length>0?n.copy([e].concat(a)):n.identity(),n}return Xe()(r,[{key:"ELEMENTS",get:function(){return 9}},{key:"RANK",get:function(){return 3}},{key:"INDICES",get:function(){return Nt}},{key:"copy",value:function(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this[4]=e[4],this[5]=e[5],this[6]=e[6],this[7]=e[7],this[8]=e[8],this.check()}},{key:"identity",value:function(){return this.copy(Kt)}},{key:"fromObject",value:function(e){return this.check()}},{key:"fromQuaternion",value:function(e){return function(e,t){var r=t[0],n=t[1],i=t[2],a=t[3],o=r+r,s=n+n,u=i+i,c=r*o,l=n*o,f=n*s,h=i*o,d=i*s,p=i*u,v=a*o,y=a*s,g=a*u;e[0]=1-f-p,e[3]=l-g,e[6]=h+y,e[1]=l+g,e[4]=1-c-p,e[7]=d-v,e[2]=h-y,e[5]=d+v,e[8]=1-c-f}(this,e),this.check()}},{key:"set",value:function(e,t,r,n,i,a,o,s,u){return this[0]=e,this[1]=t,this[2]=r,this[3]=n,this[4]=i,this[5]=a,this[6]=o,this[7]=s,this[8]=u,this.check()}},{key:"setRowMajor",value:function(e,t,r,n,i,a,o,s,u){return this[0]=e,this[1]=n,this[2]=o,this[3]=t,this[4]=i,this[5]=s,this[6]=r,this[7]=a,this[8]=u,this.check()}},{key:"determinant",value:function(){return t=(e=this)[0],r=e[1],n=e[2],i=e[3],a=e[4],o=e[5],s=e[6],u=e[7],c=e[8],t*(c*a-o*u)+r*(-c*i+o*s)+n*(u*i-a*s);var e,t,r,n,i,a,o,s,u,c}},{key:"transpose",value:function(){return function(e,t){if(e===t){var r=t[1],n=t[2],i=t[5];e[1]=t[3],e[2]=t[6],e[3]=r,e[5]=t[7],e[6]=n,e[7]=i}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8]}(this,this),this.check()}},{key:"invert",value:function(){return function(e,t){var r=t[0],n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],u=t[6],c=t[7],l=t[8],f=l*o-s*c,h=-l*a+s*u,d=c*a-o*u,p=r*f+n*h+i*d;p&&(p=1/p,e[0]=f*p,e[1]=(-l*n+i*c)*p,e[2]=(s*n-i*o)*p,e[3]=h*p,e[4]=(l*r-i*u)*p,e[5]=(-s*r+i*a)*p,e[6]=d*p,e[7]=(-c*r+n*u)*p,e[8]=(o*r-n*a)*p)}(this,this),this.check()}},{key:"multiplyLeft",value:function(e){return Gt(this,e,this),this.check()}},{key:"multiplyRight",value:function(e){return Gt(this,this,e),this.check()}},{key:"rotate",value:function(e){return function(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],u=t[5],c=t[6],l=t[7],f=t[8],h=Math.sin(r),d=Math.cos(r);e[0]=d*n+h*o,e[1]=d*i+h*s,e[2]=d*a+h*u,e[3]=d*o-h*n,e[4]=d*s-h*i,e[5]=d*u-h*a,e[6]=c,e[7]=l,e[8]=f}(this,this,e),this.check()}},{key:"scale",value:function(e){return Array.isArray(e)?Ut(this,this,e):Ut(this,this,[e,e]),this.check()}},{key:"translate",value:function(e){return function(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],u=t[5],c=t[6],l=t[7],f=t[8],h=r[0],d=r[1];e[0]=n,e[1]=i,e[2]=a,e[3]=o,e[4]=s,e[5]=u,e[6]=h*n+d*o+c,e[7]=h*i+d*s+l,e[8]=h*a+d*u+f}(this,this,e),this.check()}},{key:"transform",value:function(e,t){var r;switch(e.length){case 2:r=ce(t||[-0,-0],e,this);break;case 3:r=ge(t||[-0,-0,-0],e,this);break;case 4:r=xt(t||[-0,-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return bt(r,e.length),r}},{key:"transformVector",value:function(e,t){return this.transform(e,t)}},{key:"transformVector2",value:function(e,t){return this.transform(e,t)}},{key:"transformVector3",value:function(e,t){return this.transform(e,t)}}],[{key:"IDENTITY",get:function(){return function(){Vt||(Vt=new qt,Object.freeze(Vt));return Vt}()}},{key:"ZERO",get:function(){return function(){Jt||(Jt=new qt([0,0,0,0,0,0,0,0,0]),Object.freeze(Jt));return Jt}()}}]),r}(jt);function Xt(e){var t=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(e){return!1}}();return function(){var r,n=et()(e);if(t){var i=et()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Ye()(this,r)}}var Qt=function(e){We()(r,e);var t=Xt(r);function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return Ke()(this,r),e=t.call(this,-0,-0,-0,-0),ot(n)&&1===arguments.length?e.copy(n):(it.debug&&(mt(n),mt(i),mt(a),mt(o)),e[0]=n,e[1]=i,e[2]=a,e[3]=o),e}return Xe()(r,[{key:"set",value:function(e,t,r,n){return this[0]=e,this[1]=t,this[2]=r,this[3]=n,this.check()}},{key:"copy",value:function(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this.check()}},{key:"fromObject",value:function(e){return it.debug&&(mt(e.x),mt(e.y),mt(e.z),mt(e.w)),this[0]=e.x,this[1]=e.y,this[2]=e.z,this[3]=e.w,this}},{key:"toObject",value:function(e){return e.x=this[0],e.y=this[1],e.z=this[2],e.w=this[3],e}},{key:"ELEMENTS",get:function(){return 4}},{key:"z",get:function(){return this[2]},set:function(e){this[2]=mt(e)}},{key:"w",get:function(){return this[3]},set:function(e){this[3]=mt(e)}},{key:"transform",value:function(e){return ye(this,this,e),this.check()}},{key:"transformByMatrix3",value:function(e){return xt(this,this,e),this.check()}},{key:"transformByMatrix2",value:function(e){return function(e,t,r){var n=t[0],i=t[1];e[0]=r[0]*n+r[2]*i,e[1]=r[1]*n+r[3]*i,e[2]=t[2],e[3]=t[3]}(this,this,e),this.check()}},{key:"transformByQuaternion",value:function(e){return me(this,this,e),this.check()}},{key:"applyMatrix4",value:function(e){return e.transform(this,this),this}}],[{key:"ZERO",get:function(){return zt||(zt=new r(0,0,0,0),Object.freeze(zt)),zt}}]),r}(Bt);function Wt(){var e=new K(4);return K!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e[3]=1,e}function Zt(e,t,r){r*=.5;var n=Math.sin(r);return e[0]=n*t[0],e[1]=n*t[1],e[2]=n*t[2],e[3]=Math.cos(r),e}function Yt(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3],s=r[0],u=r[1],c=r[2],l=r[3];return e[0]=n*l+o*s+i*c-a*u,e[1]=i*l+o*u+a*s-n*c,e[2]=a*l+o*c+n*u-i*s,e[3]=o*l-n*s-i*u-a*c,e}function $t(e,t,r,n){var i,a,o,s,u,c=t[0],l=t[1],f=t[2],h=t[3],d=r[0],p=r[1],v=r[2],y=r[3];return(a=c*d+l*p+f*v+h*y)<0&&(a=-a,d=-d,p=-p,v=-v,y=-y),1-a>1e-6?(i=Math.acos(a),o=Math.sin(i),s=Math.sin((1-n)*i)/o,u=Math.sin(n*i)/o):(s=1-n,u=n),e[0]=s*c+u*d,e[1]=s*l+u*p,e[2]=s*f+u*v,e[3]=s*h+u*y,e}function er(e,t){var r,n=t[0]+t[4]+t[8];if(n>0)r=Math.sqrt(n+1),e[3]=.5*r,r=.5/r,e[0]=(t[5]-t[7])*r,e[1]=(t[6]-t[2])*r,e[2]=(t[1]-t[3])*r;else{var i=0;t[4]>t[0]&&(i=1),t[8]>t[3*i+i]&&(i=2);var a=(i+1)%3,o=(i+2)%3;r=Math.sqrt(t[3*i+i]-t[3*a+a]-t[3*o+o]+1),e[i]=.5*r,r=.5/r,e[3]=(t[3*a+o]-t[3*o+a])*r,e[a]=(t[3*a+i]+t[3*i+a])*r,e[o]=(t[3*o+i]+t[3*i+o])*r}return e}var tr,rr,nr,ir,ar,or,sr=function(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e},ur=q,cr=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]},lr=function(e,t,r,n){var i=t[0],a=t[1],o=t[2],s=t[3];return e[0]=i+n*(r[0]-i),e[1]=a+n*(r[1]-a),e[2]=o+n*(r[2]-o),e[3]=s+n*(r[3]-s),e},fr=X,hr=Q,dr=function(e,t){var r=t[0],n=t[1],i=t[2],a=t[3],o=r*r+n*n+i*i+a*a;return o>0&&(o=1/Math.sqrt(o)),e[0]=r*o,e[1]=n*o,e[2]=i*o,e[3]=a*o,e},pr=(tr=fe(),rr=de(1,0,0),nr=de(0,1,0),function(e,t,r){var n=pe(t,r);return n<-.999999?(ve(tr,rr,t),be(tr)<1e-6&&ve(tr,nr,t),function(e,t){var r=t[0],n=t[1],i=t[2],a=r*r+n*n+i*i;a>0&&(a=1/Math.sqrt(a)),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a}(tr,tr),Zt(e,tr,Math.PI),e):n>.999999?(e[0]=0,e[1]=0,e[2]=0,e[3]=1,e):(ve(tr,t,r),e[0]=tr[0],e[1]=tr[1],e[2]=tr[2],e[3]=1+n,dr(e,e))});ir=Wt(),ar=Wt(),or=function(){var e=new K(9);return K!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1,e}();function vr(e){var t=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(e){return!1}}();return function(){var r,n=et()(e);if(t){var i=et()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Ye()(this,r)}}var yr=[0,0,0,1],gr=function(e){We()(r,e);var t=vr(r);function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;return Ke()(this,r),e=t.call(this,-0,-0,-0,-0),Array.isArray(n)&&1===arguments.length?e.copy(n):e.set(n,i,a,o),e}return Xe()(r,[{key:"copy",value:function(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this.check()}},{key:"set",value:function(e,t,r,n){return this[0]=e,this[1]=t,this[2]=r,this[3]=n,this.check()}},{key:"fromObject",value:function(e){return this[0]=e.x,this[1]=e.y,this[2]=e.z,this[3]=e.w,this.check()}},{key:"fromMatrix3",value:function(e){return er(this,e),this.check()}},{key:"fromAxisRotation",value:function(e,t){return Zt(this,e,t),this.check()}},{key:"identity",value:function(){return function(e){e[0]=0,e[1]=0,e[2]=0,e[3]=1}(this),this.check()}},{key:"setAxisAngle",value:function(e,t){return this.fromAxisRotation(e,t)}},{key:"ELEMENTS",get:function(){return 4}},{key:"x",get:function(){return this[0]},set:function(e){this[0]=mt(e)}},{key:"y",get:function(){return this[1]},set:function(e){this[1]=mt(e)}},{key:"z",get:function(){return this[2]},set:function(e){this[2]=mt(e)}},{key:"w",get:function(){return this[3]},set:function(e){this[3]=mt(e)}},{key:"len",value:function(){return fr(this)}},{key:"lengthSquared",value:function(){return hr(this)}},{key:"dot",value:function(e){return cr(this,e)}},{key:"rotationTo",value:function(e,t){return pr(this,e,t),this.check()}},{key:"add",value:function(e){return sr(this,this,e),this.check()}},{key:"calculateW",value:function(){return function(e,t){var r=t[0],n=t[1],i=t[2];e[0]=r,e[1]=n,e[2]=i,e[3]=Math.sqrt(Math.abs(1-r*r-n*n-i*i))}(this,this),this.check()}},{key:"conjugate",value:function(){return function(e,t){e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3]}(this,this),this.check()}},{key:"invert",value:function(){return function(e,t){var r=t[0],n=t[1],i=t[2],a=t[3],o=r*r+n*n+i*i+a*a,s=o?1/o:0;e[0]=-r*s,e[1]=-n*s,e[2]=-i*s,e[3]=a*s}(this,this),this.check()}},{key:"lerp",value:function(e,t,r){return void 0===r?this.lerp(this,e,t):(lr(this,e,t,r),this.check())}},{key:"multiplyRight",value:function(e){return Yt(this,this,e),this.check()}},{key:"multiplyLeft",value:function(e){return Yt(this,e,this),this.check()}},{key:"normalize",value:function(){var e=this.len(),t=e>0?1/e:0;return this[0]=this[0]*t,this[1]=this[1]*t,this[2]=this[2]*t,this[3]=this[3]*t,0===e&&(this[3]=1),this.check()}},{key:"rotateX",value:function(e){return function(e,t,r){r*=.5;var n=t[0],i=t[1],a=t[2],o=t[3],s=Math.sin(r),u=Math.cos(r);e[0]=n*u+o*s,e[1]=i*u+a*s,e[2]=a*u-i*s,e[3]=o*u-n*s}(this,this,e),this.check()}},{key:"rotateY",value:function(e){return function(e,t,r){r*=.5;var n=t[0],i=t[1],a=t[2],o=t[3],s=Math.sin(r),u=Math.cos(r);e[0]=n*u-a*s,e[1]=i*u+o*s,e[2]=a*u+n*s,e[3]=o*u-i*s}(this,this,e),this.check()}},{key:"rotateZ",value:function(e){return function(e,t,r){r*=.5;var n=t[0],i=t[1],a=t[2],o=t[3],s=Math.sin(r),u=Math.cos(r);e[0]=n*u+i*s,e[1]=i*u-n*s,e[2]=a*u+o*s,e[3]=o*u-a*s}(this,this,e),this.check()}},{key:"scale",value:function(e){return ur(this,this,e),this.check()}},{key:"slerp",value:function(e,t,r){var n,i,a;switch(arguments.length){case 1:var o=e.start;n=void 0===o?yr:o,i=e.target,a=e.ratio;break;case 2:n=this,i=e,a=t;break;default:n=e,i=t,a=r}return $t(this,n,i,a),this.check()}},{key:"transformVector4",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Qt;return Z(t,e,this),bt(t,4)}},{key:"lengthSq",value:function(){return this.lengthSquared()}},{key:"setFromAxisAngle",value:function(e,t){return this.setAxisAngle(e,t)}},{key:"premultiply",value:function(e){return this.multiplyLeft(e)}},{key:"multiply",value:function(e){return this.multiplyRight(e)}}]),r}(yt),mr=new Tt,br=new Tt,Ar=new Tt,Br=new Tt,wr=new Tt,_r=new Tt,xr=new Tt,Cr=0,Or=1,Er=2,Tr=3,Sr=4,kr=5,Mr=6,Ir=7,Pr=8,Rr=function(){function e(){var t=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];Ne()(this,e),Ve(this,"center",void 0),Ve(this,"halfAxes",void 0),this.center=(new Tt).from(t),this.halfAxes=new qt(r)}return Je()(e,[{key:"halfSize",get:function(){var e=this.halfAxes.getColumn(0),t=this.halfAxes.getColumn(1),r=this.halfAxes.getColumn(2);return[new Tt(e).len(),new Tt(t).len(),new Tt(r).len()]}},{key:"quaternion",get:function(){var e=this.halfAxes.getColumn(0),t=this.halfAxes.getColumn(1),r=this.halfAxes.getColumn(2),n=new Tt(e).normalize(),i=new Tt(t).normalize(),a=new Tt(r).normalize();return(new gr).fromMatrix3(new qt([].concat(Dt()(n),Dt()(i),Dt()(a))))}},{key:"fromCenterHalfSizeQuaternion",value:function(e,t,r){var n=new gr(r),i=(new qt).fromQuaternion(n);return i[0]=i[0]*t[0],i[1]=i[1]*t[0],i[2]=i[2]*t[0],i[3]=i[3]*t[1],i[4]=i[4]*t[1],i[5]=i[5]*t[1],i[6]=i[6]*t[2],i[7]=i[7]*t[2],i[8]=i[8]*t[2],this.center=(new Tt).from(e),this.halfAxes=i,this}},{key:"clone",value:function(){return new e(this.center,this.halfAxes)}},{key:"equals",value:function(e){return this===e||Boolean(e)&&this.center.equals(e.center)&&this.halfAxes.equals(e.halfAxes)}},{key:"getBoundingSphere",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Rt,t=this.halfAxes,r=t.getColumn(0,Ar),n=t.getColumn(1,Br),i=t.getColumn(2,wr),a=mr.copy(r).add(n).add(i);return e.center.copy(this.center),e.radius=a.magnitude(),e}},{key:"intersectPlane",value:function(e){var t=this.center,r=e.normal,n=this.halfAxes,i=r.x,a=r.y,o=r.z,s=Math.abs(i*n[Cr]+a*n[Or]+o*n[Er])+Math.abs(i*n[Tr]+a*n[Sr]+o*n[kr])+Math.abs(i*n[Mr]+a*n[Ir]+o*n[Pr]),u=r.dot(t)+e.distance;return u<=-s?Le:u>=s?Ge:je}},{key:"distanceTo",value:function(e){return Math.sqrt(this.distanceSquaredTo(e))}},{key:"distanceSquaredTo",value:function(e){var t=br.from(e).subtract(this.center),r=this.halfAxes,n=r.getColumn(0,Ar),i=r.getColumn(1,Br),a=r.getColumn(2,wr),o=n.magnitude(),s=i.magnitude(),u=a.magnitude();n.normalize(),i.normalize(),a.normalize();var c,l=0;return(c=Math.abs(t.dot(n))-o)>0&&(l+=c*c),(c=Math.abs(t.dot(i))-s)>0&&(l+=c*c),(c=Math.abs(t.dot(a))-u)>0&&(l+=c*c),l}},{key:"computePlaneDistances",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[-0,-0],n=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY,a=this.center,o=this.halfAxes,s=o.getColumn(0,Ar),u=o.getColumn(1,Br),c=o.getColumn(2,wr),l=_r.copy(s).add(u).add(c).add(a),f=xr.copy(l).subtract(e),h=t.dot(f);return n=Math.min(h,n),i=Math.max(h,i),l.copy(a).add(s).add(u).subtract(c),f.copy(l).subtract(e),h=t.dot(f),n=Math.min(h,n),i=Math.max(h,i),l.copy(a).add(s).subtract(u).add(c),f.copy(l).subtract(e),h=t.dot(f),n=Math.min(h,n),i=Math.max(h,i),l.copy(a).add(s).subtract(u).subtract(c),f.copy(l).subtract(e),h=t.dot(f),n=Math.min(h,n),i=Math.max(h,i),a.copy(l).subtract(s).add(u).add(c),f.copy(l).subtract(e),h=t.dot(f),n=Math.min(h,n),i=Math.max(h,i),a.copy(l).subtract(s).add(u).subtract(c),f.copy(l).subtract(e),h=t.dot(f),n=Math.min(h,n),i=Math.max(h,i),a.copy(l).subtract(s).subtract(u).add(c),f.copy(l).subtract(e),h=t.dot(f),n=Math.min(h,n),i=Math.max(h,i),a.copy(l).subtract(s).subtract(u).subtract(c),f.copy(l).subtract(e),h=t.dot(f),n=Math.min(h,n),i=Math.max(h,i),r[0]=n,r[1]=i,r}},{key:"transform",value:function(e){this.center.transformAsPoint(e);var t=this.halfAxes.getColumn(0,Ar);t.transformAsPoint(e);var r=this.halfAxes.getColumn(1,Br);r.transformAsPoint(e);var n=this.halfAxes.getColumn(2,wr);return n.transformAsPoint(e),this.halfAxes=new qt([].concat(Dt()(t),Dt()(r),Dt()(n))),this}},{key:"getTransform",value:function(){throw new Error("not implemented")}}]),e}(),Fr=new Tt,Dr=new Tt,Lr=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[0,0,1],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;Ne()(this,e),Ve(this,"normal",void 0),Ve(this,"distance",void 0),this.normal=new Tt,this.distance=-0,this.fromNormalDistance(t,r)}return Je()(e,[{key:"fromNormalDistance",value:function(e,t){return tt(Number.isFinite(t)),this.normal.from(e).normalize(),this.distance=t,this}},{key:"fromPointNormal",value:function(e,t){e=Fr.from(e),this.normal.from(t).normalize();var r=-this.normal.dot(e);return this.distance=r,this}},{key:"fromCoefficients",value:function(e,t,r,n){return this.normal.set(e,t,r),tt(ht(this.normal.len(),1)),this.distance=n,this}},{key:"clone",value:function(){return new e(this.normal,this.distance)}},{key:"equals",value:function(e){return ht(this.distance,e.distance)&&ht(this.normal,e.normal)}},{key:"getPointDistance",value:function(e){return this.normal.dot(e)+this.distance}},{key:"transform",value:function(e){var t=Dr.copy(this.normal).transformAsVector(e).normalize(),r=this.normal.scale(-this.distance).transform(e);return this.fromPointNormal(r,t)}},{key:"projectPointOntoPlane",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];e=Fr.from(e);var r=this.getPointDistance(e),n=Dr.copy(this.normal).scale(r);return e.subtract(n).to(t)}}]),e}();function jr(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return Gr(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Gr(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function Gr(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Ur,Nr=[new Tt([1,0,0]),new Tt([0,1,0]),new Tt([0,0,1])],Hr=new Tt,Jr=new Tt,Vr=(new Lr(new Tt(1,0,0),0),function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];Ne()(this,e),Ve(this,"planes",void 0),this.planes=t}return Je()(e,[{key:"fromBoundingSphere",value:function(e){this.planes.length=2*Nr.length;var t,r=e.center,n=e.radius,i=0,a=jr(Nr);try{for(a.s();!(t=a.n()).done;){var o=t.value,s=this.planes[i],u=this.planes[i+1];s||(s=this.planes[i]=new Lr),u||(u=this.planes[i+1]=new Lr);var c=Hr.copy(o).scale(-n).add(r);o.dot(c);s.fromPointNormal(c,o);var l=Hr.copy(o).scale(n).add(r),f=Jr.copy(o).negate();f.dot(l);u.fromPointNormal(l,f),i+=2}}catch(e){a.e(e)}finally{a.f()}return this}},{key:"computeVisibility",value:function(e){var t,r=Ge,n=jr(this.planes);try{for(n.s();!(t=n.n()).done;){var i=t.value;switch(e.intersectPlane(i)){case Le:return Le;case je:r=je}}}catch(e){n.e(e)}finally{n.f()}return r}},{key:"computeVisibilityWithPlaneMask",value:function(t,r){if(tt(Number.isFinite(r),"parentPlaneMask is required."),r===e.MASK_OUTSIDE||r===e.MASK_INSIDE)return r;for(var n=e.MASK_INSIDE,i=this.planes,a=0;a<this.planes.length;++a){var o=a<31?1<<a:0;if(!(a<31&&0==(r&o))){var s=i[a],u=t.intersectPlane(s);if(u===Le)return e.MASK_OUTSIDE;u===je&&(n|=o)}}return n}}]),e}());function zr(e){var t=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(e){return!1}}();return function(){var r,n=et()(e);if(t){var i=et()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Ye()(this,r)}}Ve(Vr,"MASK_OUTSIDE",4294967295),Ve(Vr,"MASK_INSIDE",0),Ve(Vr,"MASK_INDETERMINATE",2147483647),function(e){e[e.COL0ROW0=0]="COL0ROW0",e[e.COL0ROW1=1]="COL0ROW1",e[e.COL0ROW2=2]="COL0ROW2",e[e.COL0ROW3=3]="COL0ROW3",e[e.COL1ROW0=4]="COL1ROW0",e[e.COL1ROW1=5]="COL1ROW1",e[e.COL1ROW2=6]="COL1ROW2",e[e.COL1ROW3=7]="COL1ROW3",e[e.COL2ROW0=8]="COL2ROW0",e[e.COL2ROW1=9]="COL2ROW1",e[e.COL2ROW2=10]="COL2ROW2",e[e.COL2ROW3=11]="COL2ROW3",e[e.COL3ROW0=12]="COL3ROW0",e[e.COL3ROW1=13]="COL3ROW1",e[e.COL3ROW2=14]="COL3ROW2",e[e.COL3ROW3=15]="COL3ROW3"}(Ur||(Ur={}));var Kr,qr,Xr=45*Math.PI/180,Qr=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),Wr=function(e){We()(r,e);var t=zr(r);function r(e){var n;return Ke()(this,r),n=t.call(this,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0),1===arguments.length&&Array.isArray(e)?n.copy(e):n.identity(),n}return Xe()(r,[{key:"ELEMENTS",get:function(){return 16}},{key:"RANK",get:function(){return 4}},{key:"INDICES",get:function(){return Ur}},{key:"copy",value:function(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this[4]=e[4],this[5]=e[5],this[6]=e[6],this[7]=e[7],this[8]=e[8],this[9]=e[9],this[10]=e[10],this[11]=e[11],this[12]=e[12],this[13]=e[13],this[14]=e[14],this[15]=e[15],this.check()}},{key:"set",value:function(e,t,r,n,i,a,o,s,u,c,l,f,h,d,p,v){return this[0]=e,this[1]=t,this[2]=r,this[3]=n,this[4]=i,this[5]=a,this[6]=o,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(e,t,r,n,i,a,o,s,u,c,l,f,h,d,p,v){return this[0]=e,this[1]=i,this[2]=u,this[3]=h,this[4]=t,this[5]=a,this[6]=c,this[7]=d,this[8]=r,this[9]=o,this[10]=l,this[11]=p,this[12]=n,this[13]=s,this[14]=f,this[15]=v,this.check()}},{key:"toRowMajor",value:function(e){return e[0]=this[0],e[1]=this[4],e[2]=this[8],e[3]=this[12],e[4]=this[1],e[5]=this[5],e[6]=this[9],e[7]=this[13],e[8]=this[2],e[9]=this[6],e[10]=this[10],e[11]=this[14],e[12]=this[3],e[13]=this[7],e[14]=this[11],e[15]=this[15],e}},{key:"identity",value:function(){return this.copy(Qr)}},{key:"fromObject",value:function(e){return this.check()}},{key:"fromQuaternion",value:function(e){return function(e,t){var r=t[0],n=t[1],i=t[2],a=t[3],o=r+r,s=n+n,u=i+i,c=r*o,l=n*o,f=n*s,h=i*o,d=i*s,p=i*u,v=a*o,y=a*s,g=a*u;e[0]=1-f-p,e[1]=l+g,e[2]=h-y,e[3]=0,e[4]=l-g,e[5]=1-c-p,e[6]=d+v,e[7]=0,e[8]=h+y,e[9]=d-v,e[10]=1-c-f,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1}(this,e),this.check()}},{key:"frustum",value:function(e){var t=e.left,r=e.right,n=e.bottom,i=e.top,a=e.near,o=void 0===a?.1:a,s=e.far,u=void 0===s?500:s;return u===1/0?function(e,t,r,n,i,a){var o=2*a/(r-t),s=2*a/(i-n),u=(r+t)/(r-t),c=(i+n)/(i-n),l=-2*a;e[0]=o,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=s,e[6]=0,e[7]=0,e[8]=u,e[9]=c,e[10]=-1,e[11]=-1,e[12]=0,e[13]=0,e[14]=l,e[15]=0}(this,t,r,n,i,o):function(e,t,r,n,i,a,o){var s=1/(r-t),u=1/(i-n),c=1/(a-o);e[0]=2*a*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=2*a*u,e[6]=0,e[7]=0,e[8]=(r+t)*s,e[9]=(i+n)*u,e[10]=(o+a)*c,e[11]=-1,e[12]=0,e[13]=0,e[14]=o*a*2*c,e[15]=0}(this,t,r,n,i,o,u),this.check()}},{key:"lookAt",value:function(e){var t=e.eye,r=e.center,n=void 0===r?[0,0,0]:r,i=e.up;return function(e,t,r,n){var i,a,o,s,u,c,l,f,h,d,p=t[0],v=t[1],y=t[2],g=n[0],m=n[1],b=n[2],A=r[0],B=r[1],w=r[2];Math.abs(p-A)<1e-6&&Math.abs(v-B)<1e-6&&Math.abs(y-w)<1e-6?function(e){e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1}(e):(l=p-A,f=v-B,h=y-w,i=m*(h*=d=1/Math.hypot(l,f,h))-b*(f*=d),a=b*(l*=d)-g*h,o=g*f-m*l,(d=Math.hypot(i,a,o))?(i*=d=1/d,a*=d,o*=d):(i=0,a=0,o=0),s=f*o-h*a,u=h*i-l*o,c=l*a-f*i,(d=Math.hypot(s,u,c))?(s*=d=1/d,u*=d,c*=d):(s=0,u=0,c=0),e[0]=i,e[1]=s,e[2]=l,e[3]=0,e[4]=a,e[5]=u,e[6]=f,e[7]=0,e[8]=o,e[9]=c,e[10]=h,e[11]=0,e[12]=-(i*p+a*v+o*y),e[13]=-(s*p+u*v+c*y),e[14]=-(l*p+f*v+h*y),e[15]=1)}(this,t,n,void 0===i?[0,1,0]:i),this.check()}},{key:"ortho",value:function(e){var t=e.left,r=e.right,n=e.bottom,i=e.top,a=e.near,o=void 0===a?.1:a,s=e.far;return ue(this,t,r,n,i,o,void 0===s?500:s),this.check()}},{key:"orthographic",value:function(e){var t=e.fovy,r=void 0===t?Xr:t,n=e.aspect,i=void 0===n?1:n,a=e.focalDistance,o=void 0===a?1:a,s=e.near,u=void 0===s?.1:s,c=e.far,l=void 0===c?500:c;Zr(r);var f=r/2,h=o*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(e){var t=e.fovy,r=void 0===t?45*Math.PI/180:t,n=e.aspect,i=void 0===n?1:n,a=e.near,o=void 0===a?.1:a,s=e.far,u=void 0===s?500:s;return Zr(r),se(this,r,i,o,u),this.check()}},{key:"determinant",value:function(){return t=(e=this)[0],r=e[1],n=e[2],i=e[3],a=e[4],o=e[5],s=e[6],u=e[7],c=e[8],l=e[9],f=e[10],h=e[11],d=e[12],p=e[13],v=e[14],y=e[15],(t*o-r*a)*(f*y-h*v)-(t*s-n*a)*(l*y-h*p)+(t*u-i*a)*(l*v-f*p)+(r*s-n*o)*(c*y-h*d)-(r*u-i*o)*(c*v-f*d)+(n*u-i*s)*(c*p-l*d);var e,t,r,n,i,a,o,s,u,c,l,f,h,d,p,v,y}},{key:"getScale",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[-0,-0,-0];return e[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),e[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),e[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),e}},{key:"getTranslation",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[-0,-0,-0];return e[0]=this[12],e[1]=this[13],e[2]=this[14],e}},{key:"getRotation",value:function(e,t){e=e||[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],t=t||[-0,-0,-0];var r=this.getScale(t),n=1/r[0],i=1/r[1],a=1/r[2];return e[0]=this[0]*n,e[1]=this[1]*i,e[2]=this[2]*a,e[3]=0,e[4]=this[4]*n,e[5]=this[5]*i,e[6]=this[6]*a,e[7]=0,e[8]=this[8]*n,e[9]=this[9]*i,e[10]=this[10]*a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}},{key:"getRotationMatrix3",value:function(e,t){e=e||[-0,-0,-0,-0,-0,-0,-0,-0,-0],t=t||[-0,-0,-0];var r=this.getScale(t),n=1/r[0],i=1/r[1],a=1/r[2];return e[0]=this[0]*n,e[1]=this[1]*i,e[2]=this[2]*a,e[3]=this[4]*n,e[4]=this[5]*i,e[5]=this[6]*a,e[6]=this[8]*n,e[7]=this[9]*i,e[8]=this[10]*a,e}},{key:"transpose",value:function(){return function(e,t){if(e===t){var r=t[1],n=t[2],i=t[3],a=t[6],o=t[7],s=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=r,e[6]=t[9],e[7]=t[13],e[8]=n,e[9]=a,e[11]=t[14],e[12]=i,e[13]=o,e[14]=s}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15]}(this,this),this.check()}},{key:"invert",value:function(){return ee(this,this),this.check()}},{key:"multiplyLeft",value:function(e){return te(this,e,this),this.check()}},{key:"multiplyRight",value:function(e){return te(this,this,e),this.check()}},{key:"rotateX",value:function(e){return ie(this,this,e),this.check()}},{key:"rotateY",value:function(e){return function(e,t,r){var n=Math.sin(r),i=Math.cos(r),a=t[0],o=t[1],s=t[2],u=t[3],c=t[8],l=t[9],f=t[10],h=t[11];t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*i-c*n,e[1]=o*i-l*n,e[2]=s*i-f*n,e[3]=u*i-h*n,e[8]=a*n+c*i,e[9]=o*n+l*i,e[10]=s*n+f*i,e[11]=u*n+h*i}(this,this,e),this.check()}},{key:"rotateZ",value:function(e){return ae(this,this,e),this.check()}},{key:"rotateXYZ",value:function(e){return this.rotateX(e[0]).rotateY(e[1]).rotateZ(e[2])}},{key:"rotateAxis",value:function(e,t){return function(e,t,r,n){var i,a,o,s,u,c,l,f,h,d,p,v,y,g,m,b,A,B,w,_,x,C,O,E,T=n[0],S=n[1],k=n[2],M=Math.hypot(T,S,k);M<1e-6||(T*=M=1/M,S*=M,k*=M,i=Math.sin(r),o=1-(a=Math.cos(r)),s=t[0],u=t[1],c=t[2],l=t[3],f=t[4],h=t[5],d=t[6],p=t[7],v=t[8],y=t[9],g=t[10],m=t[11],b=T*T*o+a,A=S*T*o+k*i,B=k*T*o-S*i,w=T*S*o-k*i,_=S*S*o+a,x=k*S*o+T*i,C=T*k*o+S*i,O=S*k*o-T*i,E=k*k*o+a,e[0]=s*b+f*A+v*B,e[1]=u*b+h*A+y*B,e[2]=c*b+d*A+g*B,e[3]=l*b+p*A+m*B,e[4]=s*w+f*_+v*x,e[5]=u*w+h*_+y*x,e[6]=c*w+d*_+g*x,e[7]=l*w+p*_+m*x,e[8]=s*C+f*O+v*E,e[9]=u*C+h*O+y*E,e[10]=c*C+d*O+g*E,e[11]=l*C+p*O+m*E,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]))}(this,this,e,t),this.check()}},{key:"scale",value:function(e){return ne(this,this,Array.isArray(e)?e:[e,e,e]),this.check()}},{key:"translate",value:function(e){return re(this,this,e),this.check()}},{key:"transform",value:function(e,t){return 4===e.length?(bt(t=W(t||[-0,-0,-0,-0],e,this),4),t):this.transformAsPoint(e,t)}},{key:"transformAsPoint",value:function(e,t){var r;switch(e.length){case 2:r=le(t||[-0,-0],e,this);break;case 3:r=ye(t||[-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return bt(r,e.length),r}},{key:"transformAsVector",value:function(e,t){var r;switch(e.length){case 2:r=wt(t||[-0,-0],e,this);break;case 3:r=_t(t||[-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return bt(r,e.length),r}},{key:"transformPoint",value:function(e,t){return this.transformAsPoint(e,t)}},{key:"transformVector",value:function(e,t){return this.transformAsPoint(e,t)}},{key:"transformDirection",value:function(e,t){return this.transformAsVector(e,t)}},{key:"makeRotationX",value:function(e){return this.identity().rotateX(e)}},{key:"makeTranslation",value:function(e,t,r){return this.identity().translate([e,t,r])}}],[{key:"IDENTITY",get:function(){return function(){qr||(qr=new Wr,Object.freeze(qr));return qr}()}},{key:"ZERO",get:function(){return function(){Kr||(Kr=new Wr([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Object.freeze(Kr));return Kr}()}}]),r}(jt);function Zr(e){if(e>2*Math.PI)throw Error("expected radians")}new Tt,new Tt,new Tt,new Tt,new Tt;function Yr(e){var t=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(e){return!1}}();return function(){var r,n=et()(e);if(t){var i=et()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Ye()(this,r)}}var $r=function(e){We()(r,e);var t=Yr(r);function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return Ke()(this,r),e=t.call(this,2),ot(n)&&1===arguments.length?e.copy(n):(it.debug&&(mt(n),mt(i)),e[0]=n,e[1]=i),e}return Xe()(r,[{key:"set",value:function(e,t){return this[0]=e,this[1]=t,this.check()}},{key:"copy",value:function(e){return this[0]=e[0],this[1]=e[1],this.check()}},{key:"fromObject",value:function(e){return it.debug&&(mt(e.x),mt(e.y)),this[0]=e.x,this[1]=e.y,this.check()}},{key:"toObject",value:function(e){return e.x=this[0],e.y=this[1],e}},{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(e){return this.transformAsPoint(e)}},{key:"transformAsPoint",value:function(e){return le(this,this,e),this.check()}},{key:"transformAsVector",value:function(e){return wt(this,this,e),this.check()}},{key:"transformByMatrix3",value:function(e){return ce(this,this,e),this.check()}},{key:"transformByMatrix2x3",value:function(e){return function(e,t,r){var n=t[0],i=t[1];e[0]=r[0]*n+r[2]*i+r[4],e[1]=r[1]*n+r[3]*i+r[5]}(this,this,e),this.check()}},{key:"transformByMatrix2",value:function(e){return function(e,t,r){var n=t[0],i=t[1];e[0]=r[0]*n+r[2]*i,e[1]=r[1]*n+r[3]*i}(this,this,e),this.check()}}]),r}(Bt);new Tt,new Tt,new Tt,new Tt,new Tt,new Tt,new Tt,new Tt,new Tt,new Tt,new Tt,new Tt,Math.PI;var en=.1,tn=1e-12,rn=1e-15,nn=1e-20,an=(Math.PI,Math.PI,Math.PI,Math.PI,new qt),on=new qt,sn=new qt,un=new qt,cn=new qt;function ln(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=nn,n=10,i=0,a=0,o=on,s=sn;o.identity(),s.copy(e);for(var u=r*fn(s);a<n&&pn(s)>u;)vn(s,un),cn.copy(un).transpose(),s.multiplyRight(un),s.multiplyLeft(cn),o.multiplyRight(un),++i>2&&(++a,i=0);return t.unitary=o.toTarget(t.unitary),t.diagonal=s.toTarget(t.diagonal),t}function fn(e){for(var t=0,r=0;r<9;++r){var n=e[r];t+=n*n}return Math.sqrt(t)}var hn=[1,0,0],dn=[2,2,1];function pn(e){for(var t=0,r=0;r<3;++r){var n=e[an.getElementIndex(dn[r],hn[r])];t+=2*n*n}return Math.sqrt(t)}function vn(e,t){for(var r=rn,n=0,i=1,a=0;a<3;++a){var o=Math.abs(e[an.getElementIndex(dn[a],hn[a])]);o>n&&(i=a,n=o)}var s=hn[i],u=dn[i],c=1,l=0;if(Math.abs(e[an.getElementIndex(u,s)])>r){var f,h=(e[an.getElementIndex(u,u)]-e[an.getElementIndex(s,s)])/2/e[an.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 qt.IDENTITY.to(t),t[an.getElementIndex(s,s)]=t[an.getElementIndex(u,u)]=c,t[an.getElementIndex(u,s)]=l,t[an.getElementIndex(s,u)]=-l,t}function yn(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return gn(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return gn(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function gn(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var mn=new Tt,bn=new Tt,An=new Tt,Bn=new Tt,wn=new Tt,_n=new qt,xn={diagonal:new qt,unitary:new qt};function Cn(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return On(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return On(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function On(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var En=[[.5,.5],[0,0],[0,1],[1,0],[1,1]],Tn=En.concat([[0,.5],[.5,0],[1,.5],[.5,1]]),Sn=Tn.concat([[.25,.5],[.75,.5]]),kn=function(){function e(t,r,n){h()(this,e),A()(this,"x",void 0),A()(this,"y",void 0),A()(this,"z",void 0),A()(this,"childVisible",void 0),A()(this,"selected",void 0),A()(this,"_children",void 0),this.x=t,this.y=r,this.z=n}return C()(e,[{key:"children",get:function(){if(!this._children){var t=2*this.x,r=2*this.y,n=this.z+1;this._children=[new e(t,r,n),new e(t,r+1,n),new e(t+1,r,n),new e(t+1,r+1,n)]}return this._children}},{key:"update",value:function(e){var t=e.viewport,r=e.cullingVolume,n=e.elevationBounds,i=e.minZ,a=e.maxZ,o=e.bounds,s=e.offset,u=e.project,c=this.getBoundingVolume(n,s,u);if(o&&!this.insideBounds(o))return!1;if(r.computeVisibility(c)<0)return!1;if(!this.childVisible){var l=this.z;if(l<a&&l>=i){var f=c.distanceTo(t.cameraPosition)*t.scale/t.height;l+=Math.floor(Math.log2(f))}if(l>=a)return this.selected=!0,!0}this.selected=!1,this.childVisible=!0;var h,d=Cn(this.children);try{for(d.s();!(h=d.n()).done;){h.value.update(e)}}catch(e){d.e(e)}finally{d.f()}return!0}},{key:"getSelected",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];if(this.selected&&e.push(this),this._children){var t,r=Cn(this._children);try{for(r.s();!(t=r.n()).done;){var n=t.value;n.getSelected(e)}}catch(e){r.e(e)}finally{r.f()}}return e}},{key:"insideBounds",value:function(e){var t=M()(e,4),r=t[0],n=t[1],i=t[2],a=t[3],o=512/Math.pow(2,this.z);return this.x*o<i&&this.y*o<a&&(this.x+1)*o>r&&(this.y+1)*o>n}},{key:"getBoundingVolume",value:function(e,t,r){if(r){var n,i=[],a=Cn(this.z<1?Sn:this.z<2?Tn:En);try{for(a.s();!(n=a.n()).done;){var o=n.value,s=Ln(this.x+o[0],this.y+o[1],this.z);s[2]=e[0],i.push(r(s)),e[0]!==e[1]&&(s[2]=e[1],i.push(r(s)))}}catch(e){a.e(e)}finally{a.f()}return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Rr;if(!e||0===e.length)return t.halfAxes=new qt([0,0,0,0,0,0,0,0,0]),t.center=new Tt,t;var r,n=e.length,i=new Tt(0,0,0),a=yn(e);try{for(a.s();!(r=a.n()).done;){var o=r.value;i.add(o)}}catch(e){a.e(e)}finally{a.f()}var s=1/n;i.multiplyByScalar(s);var u,c=0,l=0,f=0,h=0,d=0,p=0,v=yn(e);try{for(v.s();!(u=v.n()).done;){var y=u.value,g=mn.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(e){v.e(e)}finally{v.f()}c*=s,l*=s,f*=s,h*=s,d*=s,p*=s;var m=_n;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=ln(m,xn),B=A.unitary,w=t.halfAxes.copy(B),_=w.getColumn(0,An),x=w.getColumn(1,Bn),C=w.getColumn(2,wn),O=-Number.MAX_VALUE,E=-Number.MAX_VALUE,T=-Number.MAX_VALUE,S=Number.MAX_VALUE,k=Number.MAX_VALUE,M=Number.MAX_VALUE,I=yn(e);try{for(I.s();!(b=I.n()).done;){var P=b.value;mn.copy(P),O=Math.max(mn.dot(_),O),E=Math.max(mn.dot(x),E),T=Math.max(mn.dot(C),T),S=Math.min(mn.dot(_),S),k=Math.min(mn.dot(x),k),M=Math.min(mn.dot(C),M)}}catch(e){I.e(e)}finally{I.f()}_=_.multiplyByScalar(.5*(S+O)),x=x.multiplyByScalar(.5*(k+E)),C=C.multiplyByScalar(.5*(M+T)),t.center.copy(_).add(x).add(C);var R=bn.set(O-S,E-k,T-M).multiplyByScalar(.5),F=new qt([R[0],0,0,0,R[1],0,0,0,R[2]]);return t.halfAxes.multiplyRight(F),t}(i)}var u=512/Math.pow(2,this.z),c=this.x*u+512*t,l=512-(this.y+1)*u;return new Mt([c,l,e[0]],[c+u,l+u,e[1]])}}]),e}();var Mn=[-1/0,-1/0,1/0,1/0],In={type:"url",value:null,validate:function(e,t){return t.optional&&null===e||"string"==typeof e||Array.isArray(e)&&e.every((function(e){return"string"==typeof e}))},equals:function(e,t){if(e===t)return!0;if(!Array.isArray(e)||!Array.isArray(t))return!1;var r=e.length;if(r!==t.length)return!1;for(var n=0;n<r;n++)if(e[n]!==t[n])return!1;return!0}};function Pn(e,t){var r=[t.transformAsPoint([e[0],e[1]]),t.transformAsPoint([e[2],e[1]]),t.transformAsPoint([e[0],e[3]]),t.transformAsPoint([e[2],e[3]])];return[Math.min.apply(Math,De()(r.map((function(e){return e[0]})))),Math.min.apply(Math,De()(r.map((function(e){return e[1]})))),Math.max.apply(Math,De()(r.map((function(e){return e[0]})))),Math.max.apply(Math,De()(r.map((function(e){return e[1]}))))]}function Rn(e,t){if(!e||!e.length)return null;var r,n=t.index,i=t.id;Array.isArray(e)&&(e=e[(r=i,Math.abs(r.split("").reduce((function(e,t){return(e<<5)-e+t.charCodeAt(0)|0}),0))%e.length)]);for(var a=e,o=0,s=Object.keys(n);o<s.length;o++){var u=s[o],c=new RegExp("{".concat(u,"}"),"g");a=a.replace(c,String(n[u]))}return Number.isInteger(n.y)&&Number.isInteger(n.z)&&(a=a.replace(/\{-y\}/g,String(Math.pow(2,n.z)-n.y-1))),a}function Fn(e){var t=e.viewport,r=e.z,n=void 0===r?0:r,i=e.cullRect;return(t.subViewports||[t]).map((function(e){return function e(t,r,n){if(!Array.isArray(r)){var i=n.x-t.x,a=n.y-t.y,o=n.width,s=n.height,u={targetZ:r},c=t.unproject([i,a],u),l=t.unproject([i+o,a],u),f=t.unproject([i,a+s],u),h=t.unproject([i+o,a+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=e(t,r[0],n),p=e(t,r[1],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])]}(e,n,i)}))}function Dn(e,t){return 512*Math.pow(2,e)/t}function Ln(e,t,r){var n=Dn(r,512),i=e/n*360-180,a=Math.PI-2*Math.PI*t/n;return[i,180/Math.PI*Math.atan(.5*(Math.exp(a)-Math.exp(-a)))]}function jn(e,t,r,n){var i=Dn(r,n);return[e/i*512,t/i*512]}function Gn(e,t,r,n){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:512;if(e.isGeospatial){var a=Ln(t,r,n),o=M()(a,2),s=o[0],u=o[1],c=Ln(t+1,r+1,n),l=M()(c,2),f=l[0],h=l[1];return{west:s,north:u,east:f,south:h}}var d=jn(t,r,n,i),p=M()(d,2),v=p[0],y=p[1],g=jn(t+1,r+1,n,i),m=M()(g,2),b=m[0],A=m[1];return{left:v,top:y,right:b,bottom:A}}function Un(e,t,r,n,i){for(var a=function(e,t,r){return r?Pn(e,r).map((function(e){return e*t/512})):e.map((function(e){return e*t/512}))}(function(e,t,r){var n;if(t&&2===t.length){var i=M()(t,2),a=i[0],o=i[1],s=e.getBounds({z:a}),u=e.getBounds({z:o});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=e.getBounds();return e.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])]}(e,null,n),Dn(t,r),i),o=M()(a,4),s=o[0],u=o[1],c=o[2],l=o[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:t});return f}function Nn(e){var t=e.viewport,r=e.maxZoom,n=e.minZoom,i=e.zRange,a=e.extent,o=e.tileSize,s=void 0===o?512:o,u=e.modelMatrix,c=e.modelMatrixInverse,l=e.zoomOffset,f=void 0===l?0:l,h=t.isGeospatial?Math.round(t.zoom+Math.log2(512/s))+f:Math.ceil(t.zoom)+f;if("number"==typeof n&&Number.isFinite(n)&&h<n){if(!a)return[];h=n}"number"==typeof r&&Number.isFinite(r)&&h>r&&(h=r);var d=a;return u&&c&&a&&!t.isGeospatial&&(d=Pn(a,u)),t.isGeospatial?function(e,t,r,n){var i=e instanceof B._GlobeViewport&&e.resolution?e.projectPosition:null,a=Object.values(e.getFrustumPlanes()).map((function(e){var t=e.normal,r=e.distance;return new Lr(t.clone().negate(),r)})),o=new Vr(a),s=e.distanceScales.unitsPerMeter[2],u=r&&r[0]*s||0,c=r&&r[1]*s||0,l=e instanceof B.WebMercatorViewport&&e.pitch<=60?t:0;if(n){var f=n,h=M()(f,4),d=h[0],p=h[1],v=h[2],y=Ce([d,h[3]]),g=Ce([v,p]);n=[y[0],512-y[1],g[0],512-g[1]]}var m=new kn(0,0,0),b={viewport:e,project:i,cullingVolume:o,elevationBounds:[u,c],minZ:l,maxZ:t,bounds:n,offset:0};if(m.update(b),e instanceof B.WebMercatorViewport&&e.subViewports&&e.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()}(t,h,i,a):Un(t,h,s,d||Mn,c)}function Hn(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Jn(){var e;if("undefined"!=typeof window&&window.performance)e=window.performance.now();else if("undefined"!=typeof process&&process.hrtime){var t=process.hrtime();e=1e3*t[0]+t[1]/1e6}else e=Date.now();return e}var Vn=function(){function e(t,r){h()(this,e),Hn(this,"name",void 0),Hn(this,"type",void 0),Hn(this,"sampleSize",1),Hn(this,"time",void 0),Hn(this,"count",void 0),Hn(this,"samples",void 0),Hn(this,"lastTiming",void 0),Hn(this,"lastSampleTime",void 0),Hn(this,"lastSampleCount",void 0),Hn(this,"_count",0),Hn(this,"_time",0),Hn(this,"_samples",0),Hn(this,"_startTime",0),Hn(this,"_timerPending",!1),this.name=t,this.type=r,this.reset()}return C()(e,[{key:"setSampleSize",value:function(e){return this.sampleSize=e,this}},{key:"incrementCount",value:function(){return this.addCount(1),this}},{key:"decrementCount",value:function(){return this.subtractCount(1),this}},{key:"addCount",value:function(e){return this._count+=e,this._samples++,this._checkSampling(),this}},{key:"subtractCount",value:function(e){return this._count-=e,this._samples++,this._checkSampling(),this}},{key:"addTime",value:function(e){return this._time+=e,this.lastTiming=e,this._samples++,this._checkSampling(),this}},{key:"timeStart",value:function(){return this._startTime=Jn(),this._timerPending=!0,this}},{key:"timeEnd",value:function(){return this._timerPending?(this.addTime(Jn()-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)}}]),e}(),zn=function(){function e(t){h()(this,e),Hn(this,"id",void 0),Hn(this,"stats",{}),this.id=t.id,this.stats={},this._initializeStats(t.stats),Object.seal(this)}return C()(e,[{key:"get",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"count";return this._getOrCreate({name:e,type:t})}},{key:"size",get:function(){return Object.keys(this.stats).length}},{key:"reset",value:function(){for(var e in this.stats)this.stats[e].reset();return this}},{key:"forEach",value:function(e){for(var t in this.stats)e(this.stats[t])}},{key:"getTable",value:function(){var e={};return this.forEach((function(t){e[t.name]={time:t.time||0,count:t.count||0,average:t.getAverageTime()||0,hz:t.getHz()||0}})),e}},{key:"_initializeStats",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];t.forEach((function(t){return e._getOrCreate(t)}))}},{key:"_getOrCreate",value:function(e){if(!e||!e.name)return null;var t=e.name,r=e.type;return this.stats[t]||(this.stats[t]=e instanceof Vn?e:new Vn(t,r)),this.stats[t]}}]),e}();function Kn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function qn(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Kn(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Kn(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Xn,Qn={id:"request-scheduler",throttleRequests:!0,maxRequests:6},Wn=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};h()(this,e),Hn(this,"props",void 0),Hn(this,"stats",void 0),Hn(this,"activeRequestCount",0),Hn(this,"requestQueue",[]),Hn(this,"requestMap",new Map),Hn(this,"deferredUpdate",null),this.props=qn(qn({},Qn),t),this.stats=new zn({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 C()(e,[{key:"scheduleRequest",value:function(e){var t=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(e))return this.requestMap.get(e);var r={handle:e,priority:0,getPriority:t},n=new Promise((function(e){return r.resolve=e,r}));return this.requestQueue.push(r),this.requestMap.set(e,n),this._issueNewRequests(),n}},{key:"_issueRequest",value:function(e){var t=this,r=e.handle,n=e.resolve,i=!1,a=function(){i||(i=!0,t.requestMap.delete(r),t.activeRequestCount--,t._issueNewRequests())};return this.activeRequestCount++,n?n({done:a}):Promise.resolve({done:a})}},{key:"_issueNewRequests",value:function(){var e=this;this.deferredUpdate||(this.deferredUpdate=setTimeout((function(){return e._issueNewRequestsAsync()}),0))}},{key:"_issueNewRequestsAsync",value:function(){this.deferredUpdate=null;var e=Math.max(this.props.maxRequests-this.activeRequestCount,0);if(0!==e){this._updateAllRequests();for(var t=0;t<e;++t){var r=this.requestQueue.shift();r&&this._issueRequest(r)}}}},{key:"_updateAllRequests",value:function(){for(var e=this.requestQueue,t=0;t<e.length;++t){var r=e[t];this._updateRequest(r)||(e.splice(t,1),this.requestMap.delete(r.handle),t--)}e.sort((function(e,t){return e.priority-t.priority}))}},{key:"_updateRequest",value:function(e){return e.priority=e.getPriority(e.handle),!(e.priority<0)||(e.resolve(null),!1)}}]),e}();function Zn(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return Yn(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Yn(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function Yn(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var $n=(Xn={},A()(Xn,"best-available",(function(e){var t,r=Zn(e);try{for(r.s();!(t=r.n()).done;){t.value.state=0}}catch(e){r.e(e)}finally{r.f()}var n,i=Zn(e);try{for(i.s();!(n=i.n()).done;){var a=n.value;a.isSelected&&!ti(a)&&ri(a)}}catch(e){i.e(e)}finally{i.f()}var o,s=Zn(e);try{for(s.s();!(o=s.n()).done;){var u=o.value;u.isVisible=Boolean(2&u.state)}}catch(e){s.e(e)}finally{s.f()}})),A()(Xn,"no-overlap",(function(e){var t,r=Zn(e);try{for(r.s();!(t=r.n()).done;){t.value.state=0}}catch(e){r.e(e)}finally{r.f()}var n,i=Zn(e);try{for(i.s();!(n=i.n()).done;){var a=n.value;a.isSelected&&ti(a)}}catch(e){i.e(e)}finally{i.f()}var o,s=Zn(Array.from(e).sort((function(e,t){return e.zoom-t.zoom})));try{for(s.s();!(o=s.n()).done;){var u=o.value;if(u.isVisible=Boolean(2&u.state),u.children&&(u.isVisible||1&u.state)){var c,l=Zn(u.children);try{for(l.s();!(c=l.n()).done;){c.value.state=1}}catch(e){l.e(e)}finally{l.f()}}else u.isSelected&&ri(u)}}catch(e){s.e(e)}finally{s.f()}})),A()(Xn,"never",(function(){})),Xn),ei=function(){function e(t){var r=this;h()(this,e),A()(this,"opts",void 0),A()(this,"_requestScheduler",void 0),A()(this,"_cache",void 0),A()(this,"_dirty",void 0),A()(this,"_tiles",void 0),A()(this,"_cacheByteSize",void 0),A()(this,"_viewport",void 0),A()(this,"_zRange",void 0),A()(this,"_selectedTiles",void 0),A()(this,"_frameNumber",void 0),A()(this,"_modelMatrix",void 0),A()(this,"_modelMatrixInverse",void 0),A()(this,"_maxZoom",void 0),A()(this,"_minZoom",void 0),A()(this,"onTileLoad",void 0),A()(this,"_getCullBounds",Object(B._memoize)(Fn)),this.opts=t,this.onTileLoad=function(e){r.opts.onTileLoad(e),r.opts.maxCacheByteSize&&(r._cacheByteSize+=e.byteLength,r._resizeCache())},this._requestScheduler=new Wn({maxRequests:t.maxRequests,throttleRequests:t.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 Wr,this._modelMatrixInverse=new Wr,this.setOptions(t)}return C()(e,[{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(e){return e.isLoaded}))}},{key:"needsReload",get:function(){return null!==this._selectedTiles&&this._selectedTiles.some((function(e){return e.needsReload}))}},{key:"setOptions",value:function(e){Object.assign(this.opts,e),Number.isFinite(e.maxZoom)&&(this._maxZoom=Math.floor(e.maxZoom)),Number.isFinite(e.minZoom)&&(this._minZoom=Math.ceil(e.minZoom))}},{key:"finalize",value:function(){var e,t=Zn(this._cache.values());try{for(t.s();!(e=t.n()).done;){var r=e.value;r.isLoading&&r.abort()}}catch(e){t.e(e)}finally{t.f()}this._cache.clear(),this._tiles=[],this._selectedTiles=null}},{key:"reloadAll",value:function(){var e,t=Zn(this._cache.keys());try{for(t.s();!(e=t.n()).done;){var r=e.value,n=this._cache.get(r);this._selectedTiles&&this._selectedTiles.includes(n)?n.setNeedsReload():this._cache.delete(r)}}catch(e){t.e(e)}finally{t.f()}}},{key:"update",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=r.zRange,i=r.modelMatrix,a=new Wr(i),o=!a.equals(this._modelMatrix);if(this._viewport&&e.equals(this._viewport)&&ht(this._zRange,n)&&!o)this.needsReload&&(this._selectedTiles=this._selectedTiles.map((function(e){return t._getTile(e.index,!0)})));else{o&&(this._modelMatrixInverse=a.clone().invert(),this._modelMatrix=a),this._viewport=e,this._zRange=n;var s=this.getTileIndices({viewport:e,maxZoom:this._maxZoom,minZoom:this._minZoom,zRange:n,modelMatrix:this._modelMatrix,modelMatrixInverse:this._modelMatrixInverse});this._selectedTiles=s.map((function(e){return t._getTile(e,!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(e,t){if(!e.isVisible)return!1;if(t&&this._viewport){var r,n=this._getCullBounds({viewport:this._viewport,z:this._zRange,cullRect:t}),i=e.bbox,a=Zn(n);try{for(a.s();!(r=a.n()).done;){var o=M()(r.value,4),s=o[0],u=o[1],c=o[2],l=o[3],f=void 0;if("west"in i)f=i.west<c&&i.east>s&&i.south<l&&i.north>u;else{var h=Math.min(i.top,i.bottom),d=Math.max(i.top,i.bottom);f=i.left<c&&i.right>s&&h<l&&d>u}if(f)return!0}}catch(e){a.e(e)}finally{a.f()}return!1}return!0}},{key:"getTileIndices",value:function(e){var t=e.viewport,r=e.maxZoom,n=e.minZoom,i=e.zRange,a=e.modelMatrix,o=e.modelMatrixInverse,s=this.opts;return Nn({viewport:t,maxZoom:r,minZoom:n,zRange:i,tileSize:s.tileSize,extent:s.extent,modelMatrix:a,modelMatrixInverse:o,zoomOffset:s.zoomOffset})}},{key:"getTileId",value:function(e){return"".concat(e.x,"-").concat(e.y,"-").concat(e.z)}},{key:"getTileZoom",value:function(e){return e.z}},{key:"getTileMetadata",value:function(e){var t=this.opts.tileSize;return{bbox:Gn(this._viewport,e.x,e.y,e.z,t)}}},{key:"getParentIndex",value:function(e){return{x:Math.floor(e.x/2),y:Math.floor(e.y/2),z:e.z-1}}},{key:"updateTileStates",value:function(){var e,t=this.opts.refinementStrategy||"best-available",r=new Array(this._cache.size),n=0,i=Zn(this._cache.values());try{for(i.s();!(e=i.n()).done;){var a=e.value;r[n++]=a.isVisible,a.isSelected=!1,a.isVisible=!1}}catch(e){i.e(e)}finally{i.f()}var o,s=Zn(this._selectedTiles);try{for(s.s();!(o=s.n()).done;){var u=o.value;u.isSelected=!0,u.isVisible=!0}}catch(e){s.e(e)}finally{s.f()}("function"==typeof t?t:$n[t])(Array.from(this._cache.values())),n=0;var c,l=Zn(this._cache.values());try{for(l.s();!(c=l.n()).done;){var f=c.value;if(r[n++]!==f.isVisible)return!0}}catch(e){l.e(e)}finally{l.f()}return!1}},{key:"_pruneRequests",value:function(){var e,t=this.opts.maxRequests,r=[],n=0,i=Zn(this._cache.values());try{for(i.s();!(e=i.n()).done;){var a=e.value;a.isLoading&&(n++,a.isSelected||a.isVisible||r.push(a))}}catch(e){i.e(e)}finally{i.f()}for(;t>0&&n>t&&r.length>0;){r.shift().abort(),n--}}},{key:"_rebuildTree",value:function(){var e,t=this._cache,r=Zn(t.values());try{for(r.s();!(e=r.n()).done;){var n=e.value;n.parent=null,n.children&&(n.children.length=0)}}catch(e){r.e(e)}finally{r.f()}var i,a=Zn(t.values());try{for(a.s();!(i=a.n()).done;){var o=i.value,s=this._getNearestAncestor(o);o.parent=s,null!=s&&s.children&&s.children.push(o)}}catch(e){a.e(e)}finally{a.f()}}},{key:"_resizeCache",value:function(){var e=this._cache,t=this.opts,r=t.maxCacheSize||(t.maxCacheByteSize?1/0:5*this.selectedTiles.length),n=t.maxCacheByteSize||1/0;if(e.size>r||this._cacheByteSize>n){var i,a=Zn(e);try{for(a.s();!(i=a.n()).done;){var o=M()(i.value,2),s=o[0],u=o[1];if(u.isVisible||u.isSelected||(this._cacheByteSize-=t.maxCacheByteSize?u.byteLength:0,e.delete(s),this.opts.onTileUnload(u)),e.size<=r&&this._cacheByteSize<=n)break}}catch(e){a.e(e)}finally{a.f()}this._rebuildTree(),this._dirty=!0}this._dirty&&(this._tiles=Array.from(this._cache.values()).sort((function(e,t){return e.zoom-t.zoom})),this._dirty=!1)}},{key:"_getTile",value:function(e,t){var r=this.getTileId(e),n=this._cache.get(r),i=!1;return!n&&t?(n=new Re(e),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(e){for(var t=this._minZoom,r=void 0===t?0:t,n=e.index;this.getTileZoom(n)>r;){n=this.getParentIndex(n);var i=this._getTile(n);if(i)return i}return null}}]),e}();function ti(e){for(var t=e;t;){if(t.isLoaded||t.content)return t.state|=2,!0;t=t.parent}return!1}function ri(e){var t,r=Zn(e.children);try{for(r.s();!(t=r.n()).done;){var n=t.value;n.isLoaded||n.content?n.state|=2:ri(n)}}catch(e){r.e(e)}finally{r.f()}}function ni(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ii(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ni(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ni(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function ai(e){var t=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(e){return!1}}();return function(){var r,n=m()(e);if(t){var i=m()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return y()(this,r)}}var oi={TilesetClass:ei,data:{type:"data",value:[]},dataComparator:In.equals,renderSubLayers:{type:"function",value:function(e){return new B.GeoJsonLayer(e)},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(e){},compare:!1},onTileUnload:{type:"function",value:function(e){},compare:!1},onTileError:{type:"function",value:function(e){return console.error(e)},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},si=function(e){p()(r,e);var t=ai(r);function r(){return h()(this,r),t.apply(this,arguments)}return C()(r,[{key:"initializeState",value:function(){this.state={tileset:null,isLoaded:!1}}},{key:"finalizeState",value:function(){var e,t;null===(e=this.state)||void 0===e||null===(t=e.tileset)||void 0===t||t.finalize()}},{key:"isLoaded",get:function(){var e,t;return null===(e=this.state)||void 0===e?void 0:null===(t=e.tileset)||void 0===t?void 0:t.selectedTiles.every((function(e){return e.isLoaded&&e.layers&&e.layers.every((function(e){return e.isLoaded}))}))}},{key:"shouldUpdateState",value:function(e){return e.changeFlags.somethingChanged}},{key:"updateState",value:function(e){var t=e.changeFlags,r=this.state.tileset,n=t.propsOrDataChanged||t.updateTriggersChanged,i=t.dataChanged||t.updateTriggersChanged&&(t.updateTriggersChanged.all||t.updateTriggersChanged.getTileData);r?n&&(r.setOptions(this._getTilesetOptions()),i?r.reloadAll():this.state.tileset.tiles.forEach((function(e){e.layers=null}))):(r=new this.props.TilesetClass(this._getTilesetOptions()),this.setState({tileset:r})),this._updateTileset()}},{key:"_getTilesetOptions",value:function(){var e=this.props,t=e.tileSize,r=e.maxCacheSize,n=e.maxCacheByteSize,i=e.refinementStrategy,a=e.extent;return{maxCacheSize:r,maxCacheByteSize:n,maxZoom:e.maxZoom,minZoom:e.minZoom,tileSize:t,refinementStrategy:i,extent:a,maxRequests:e.maxRequests,zoomOffset:e.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 e=this.state.tileset,t=this.props,r=t.zRange,n=t.modelMatrix,i=e.update(this.context.viewport,{zRange:r,modelMatrix:n}),a=e.isLoaded,o=this.state.isLoaded!==a,s=this.state.frameNumber!==i;a&&(o||s)&&this._onViewportLoad(),s&&this.setState({frameNumber:i}),this.state.isLoaded=a}},{key:"_onViewportLoad",value:function(){var e=this.state.tileset,t=this.props.onViewportLoad;t&&t(e.selectedTiles)}},{key:"_onTileLoad",value:function(e){this.props.onTileLoad(e),e.layers=null,this.setNeedsUpdate()}},{key:"_onTileError",value:function(e,t){this.props.onTileError(e),t.layers=null,this.setNeedsUpdate()}},{key:"_onTileUnload",value:function(e){this.props.onTileUnload(e)}},{key:"getTileData",value:function(e){var t=this.props,r=t.data,n=t.getTileData,i=t.fetch,a=e.signal;return e.url="string"==typeof r||Array.isArray(r)?Rn(r,e):null,n?n(e):i&&e.url?i(e.url,{propName:"data",layer:this,signal:a}):null}},{key:"renderSubLayers",value:function(e){return this.props.renderSubLayers(e)}},{key:"getSubLayerPropsByTile",value:function(e){return null}},{key:"getPickingInfo",value:function(e){var t=e.info,r=e.sourceLayer;return t.picked&&(t.tile=r.props.tile),t}},{key:"_updateAutoHighlight",value:function(e){e.sourceLayer&&e.sourceLayer.updateAutoHighlight(e)}},{key:"renderLayers",value:function(){var e=this;return this.state.tileset.tiles.map((function(t){var r=e.getSubLayerPropsByTile(t);if(t.isLoaded||t.content)if(t.layers)r&&t.layers[0]&&Object.keys(r).some((function(e){return t.layers[0].props[e]!==r[e]}))&&(t.layers=t.layers.map((function(e){return e.clone(r)})));else{var n=e.renderSubLayers(ii(ii({},e.props),{},{id:"".concat(e.id,"-").concat(t.id),data:t.content,_offset:0,tile:t}));t.layers=Object(B._flatten)(n,Boolean).map((function(e){return e.clone(ii({tile:t},r))}))}else;return t.layers}))}},{key:"filterSubLayer",value:function(e){var t=e.layer,r=e.cullRect,n=t.props.tile;return this.state.tileset.isTileVisible(n,r)}}]),r}(B.CompositeLayer);A()(si,"defaultProps",oi),A()(si,"layerName","TileLayer");var ui=r(15),ci=r.n(ui);function li(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function fi(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?li(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):li(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function hi(e){var t=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(e){return!1}}();return function(){var r,n=m()(e);if(t){var i=m()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return y()(this,r)}}var di=function(e){p()(r,e);var t=hi(r);function r(){return h()(this,r),t.apply(this,arguments)}return C()(r,[{key:"getShaders",value:function(){var e=ci()(m()(r.prototype),"getShaders",this).call(this);return e.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"},e}},{key:"initializeState",value:function(){ci()(m()(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(e){var t=this.props,n=t.fadeTrail,i=t.trailLength,a=t.currentTime;e.uniforms=fi(fi({},e.uniforms),{},{fadeTrail:n,trailLength:i,currentTime:a}),ci()(m()(r.prototype),"draw",this).call(this,e)}}]),r}(B.PathLayer);A()(di,"layerName","TripsLayer"),A()(di,"defaultProps",{fadeTrail:!0,trailLength:{type:"number",value:120,min:0},currentTime:{type:"number",value:0,min:0},getTimestamps:{type:"accessor",value:function(e){return e.timestamps}}});var pi=r(23),vi=r(12),yi=r.n(vi),gi=r(9),mi=r.n(gi);function bi(e){var t=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(e){return!1}}();return function(){var r,n=m()(e);if(t){var i=m()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return y()(this,r)}}function Ai(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Bi(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ai(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ai(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function wi(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return _i(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return _i(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function _i(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function xi(e,t){t=void 0===t?e[0][0]:t;var r,n=wi(e);try{for(n.s();!(r=n.n()).done;){var i=r.value,a=i[0]-t;a>180?i[0]-=360:a<-180&&(i[0]+=360)}}catch(e){n.e(e)}finally{n.f()}}function Ci(e,t,r){var n=Object(pi.h3ToGeo)(e),i=M()(n,2),a=i[0],o=i[1],s=t.length;xi(t,o);for(var u=t[0]===t[s-1]?s-1:s,c=0;c<u;c++)t[c][0]=ft(o,t[c][0],r),t[c][1]=ft(a,t[c][1],r)}function Oi(e,t,r){var n=e(t,r),i=Object(pi.h3ToGeo)(n),a=M()(i,2),o=a[0];return[a[1],o]}function Ei(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=Object(pi.h3ToGeoBoundary)(e,!0);return 1!==t?Ci(e,r,t):xi(r),r}var Ti=Bi(Bi({},B.PolygonLayer.defaultProps),{},{highPrecision:"auto",coverage:{type:"number",min:0,max:1,value:1},centerHexagon:null,getHexagon:{type:"accessor",value:function(e){return e.hexagon}},extruded:!0}),Si=function(e){p()(r,e);var t=bi(r);function r(){var e;h()(this,r);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return e=t.call.apply(t,[this].concat(i)),A()(yi()(e),"state",void 0),e}return C()(r,[{key:"initializeState",value:function(){r._checkH3Lib(),this.state={edgeLengthKM:0,resolution:-1}}},{key:"shouldUpdateState",value:function(e){var t=e.changeFlags;return this._shouldUseHighPrecision()?t.propsOrDataChanged:t.somethingChanged}},{key:"updateState",value:function(e){var t=e.props,r=e.changeFlags;if(!0!==t.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 e,t=-1,r=!1,n=!1,i=Object(B.createIterable)(this.props.data),a=i.iterable,o=i.objectInfo,s=wi(a);try{for(s.s();!(e=s.n()).done;){var u=e.value;o.index++;var c=this.props.getHexagon(u,o),l=Object(pi.h3GetResolution)(c);if(t<0){if(t=l,!this.props.highPrecision)break}else if(t!==l){n=!0;break}if(Object(pi.h3IsPentagon)(c)){r=!0;break}}}catch(e){s.e(e)}finally{s.f()}return{resolution:t,edgeLengthKM:t>=0?Object(pi.edgeLength)(t,"km"):0,hasMultipleRes:n,hasPentagon:r}}},{key:"_shouldUseHighPrecision",value:function(){if("auto"===this.props.highPrecision){var e=this.state,t=e.resolution,r=e.hasPentagon,n=e.hasMultipleRes,i=this.context.viewport;return Boolean(null==i?void 0:i.resolution)||n||r||t>=0&&t<=5}return this.props.highPrecision}},{key:"_updateVertices",value:function(e){if(!this._shouldUseHighPrecision()){var t=this.state,r=t.resolution,n=t.edgeLengthKM,i=t.centerHex;if(!(r<0)){var a=this.props.centerHexagon||Object(pi.geoToH3)(e.latitude,e.longitude,r);if(i!==a){if(i){var o=Object(pi.h3Distance)(i,a);if(o>=0&&o*n<10)return}var s=e.distanceScales.unitsPerMeter,u=Ei(a),c=Object(pi.h3ToGeo)(a),l=M()(c,2),f=l[0],h=l[1],d=e.projectFlat([h,f]),p=M()(d,2),v=p[0],y=p[1];u=u.map((function(t){var r=e.projectFlat(t);return[(r[0]-v)/s[0],(r[1]-y)/s[1]]})),this.setState({centerHex:a,vertices:u})}}}}},{key:"renderLayers",value:function(){return this._shouldUseHighPrecision()?this._renderPolygonLayer():this._renderColumnLayer()}},{key:"_getForwardProps",value:function(){var e=this.props,t=e.elevationScale,r=e.material,n=e.coverage,i=e.extruded,a=e.wireframe,o=e.stroked,s=e.filled,u=e.lineWidthUnits,c=e.lineWidthScale,l=e.lineWidthMinPixels,f=e.lineWidthMaxPixels,h=e.getFillColor,d=e.getElevation,p=e.getLineColor,v=e.getLineWidth,y=e.transitions,g=e.updateTriggers;return{elevationScale:t,extruded:i,coverage:n,wireframe:a,stroked:o,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 e=this.props,t=e.data,r=e.getHexagon,n=e.updateTriggers,i=e.coverage,a=this.getSubLayerClass("hexagon-cell-hifi",B.PolygonLayer),o=this._getForwardProps();return o.updateTriggers.getPolygon=function(e,t){return null==e?t:"object"===mi()(e)?Bi(Bi({},e),{},{coverage:t}):{getHexagon:e,coverage:t}}(n.getHexagon,i),new a(o,this.getSubLayerProps({id:"hexagon-cell-hifi",updateTriggers:o.updateTriggers}),{data:t,_normalize:!1,_windingOrder:"CCW",positionFormat:"XY",getPolygon:function(e,t){return function(e){var t,r=new Float64Array(2*e.length),n=0,i=wi(e);try{for(i.s();!(t=i.n()).done;){var a=t.value;r[n++]=a[0],r[n++]=a[1]}}catch(e){i.e(e)}finally{i.f()}return r}(Ei(r(e,t),i))}})}},{key:"_renderColumnLayer",value:function(){var e=this.props,t=e.data,r=e.getHexagon,n=e.updateTriggers,i=this.getSubLayerClass("hexagon-cell",B.ColumnLayer),a=this._getForwardProps();return a.updateTriggers.getPosition=n.getHexagon,new i(a,this.getSubLayerProps({id:"hexagon-cell",flatShading:!0,updateTriggers:a.updateTriggers}),{data:t,diskResolution:6,radius:1,vertices:this.state.vertices,getPosition:Oi.bind(null,r)})}}]),r}(B.CompositeLayer);function ki(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return Mi(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Mi(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function Mi(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Ii(e){var t=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(e){return!1}}();return function(){var r,n=m()(e);if(t){var i=m()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return y()(this,r)}}A()(Si,"defaultProps",Ti),A()(Si,"layerName","H3HexagonLayer"),A()(Si,"_checkH3Lib",(function(){}));var Pi=function(e){p()(r,e);var t=Ii(r);function r(){return h()(this,r),t.apply(this,arguments)}return C()(r,[{key:"initializeState",value:function(){Si._checkH3Lib()}},{key:"updateState",value:function(e){var t=e.props,r=e.changeFlags;if(r.dataChanged||r.updateTriggersChanged&&r.updateTriggersChanged.getHexagons){var n,i=t.data,a=t.getHexagons,o=[],s=Object(B.createIterable)(i),u=s.iterable,c=s.objectInfo,l=ki(u);try{for(l.s();!(n=l.n()).done;){var f=n.value;c.index++;var h,d=a(f,c),p=ki(Object(pi.h3SetToMultiPolygon)(d,!0));try{for(p.s();!(h=p.n()).done;){var v=h.value;o.push(this.getSubLayerRow({polygon:v},f,c.index))}}catch(e){p.e(e)}finally{p.f()}}}catch(e){l.e(e)}finally{l.f()}this.setState({polygons:o})}}},{key:"indexToBounds",value:function(){return{data:this.state.polygons,getPolygon:function(e){return e.polygon}}}}]),r}(S);A()(Pi,"layerName","H3ClusterLayer"),A()(Pi,"defaultProps",{getHexagons:{type:"accessor",value:function(e){return e.hexagons}}});var Ri=r(31);function Fi(){return!("object"===("undefined"==typeof process?"undefined":mi()(process))&&"[object process]"===String(process)&&!process.browser)||function(e){if("undefined"!=typeof window&&"object"===mi()(window.process)&&"renderer"===window.process.type)return!0;if("undefined"!=typeof process&&"object"===mi()(process.versions)&&Boolean(process.versions.electron))return!0;var t="object"===("undefined"==typeof navigator?"undefined":mi()(navigator))&&"string"==typeof navigator.userAgent&&navigator.userAgent,r=e||t;return!!(r&&r.indexOf("Electron")>=0)}()}Fi();function Di(e){try{var t=window[e],r="__storage_test__";return t.setItem(r,r),t.removeItem(r),t}catch(e){return null}}var Li,ji=function(){function e(t){h()(this,e);var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"sessionStorage";Hn(this,"storage",void 0),Hn(this,"id",void 0),Hn(this,"config",{}),this.storage=Di(n),this.id=t,this.config={},Object.assign(this.config,r),this._loadConfiguration()}return C()(e,[{key:"getConfiguration",value:function(){return this.config}},{key:"setConfiguration",value:function(e){return this.config={},this.updateConfiguration(e)}},{key:"updateConfiguration",value:function(e){if(Object.assign(this.config,e),this.storage){var t=JSON.stringify(this.config);this.storage.setItem(this.id,t)}return this}},{key:"_loadConfiguration",value:function(){var e={};if(this.storage){var t=this.storage.getItem(this.id);e=t?JSON.parse(t):{}}return Object.assign(this.config,e),this}}]),e}();function Gi(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:600,i=e.src.replace(/\(/g,"%28").replace(/\)/g,"%29");e.width>n&&(r=Math.min(r,n/e.width));var a=e.width*r,o=e.height*r,s=["font-size:1px;","padding:".concat(Math.floor(o/2),"px ").concat(Math.floor(a/2),"px;"),"line-height:".concat(o,"px;"),"background:url(".concat(i,");"),"background-size:".concat(a,"px ").concat(o,"px;"),"color:transparent;"].join("");return["".concat(t," %c+"),s]}function Ui(e){return"string"==typeof e?Li[e.toUpperCase()]||Li.WHITE:e}function Ni(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return Hi(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Hi(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function Hi(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Ji(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["constructor"],n=Object.getPrototypeOf(e),i=Object.getOwnPropertyNames(n),a=Ni(i);try{var o=function(){var n=t.value;"function"==typeof e[n]&&(r.find((function(e){return n===e}))||(e[n]=e[n].bind(e)))};for(a.s();!(t=a.n()).done;)o()}catch(e){a.e(e)}finally{a.f()}}function Vi(e,t){if(!e)throw new Error(t||"Assertion failed")}!function(e){e[e.BLACK=30]="BLACK",e[e.RED=31]="RED",e[e.GREEN=32]="GREEN",e[e.YELLOW=33]="YELLOW",e[e.BLUE=34]="BLUE",e[e.MAGENTA=35]="MAGENTA",e[e.CYAN=36]="CYAN",e[e.WHITE=37]="WHITE",e[e.BRIGHT_BLACK=90]="BRIGHT_BLACK",e[e.BRIGHT_RED=91]="BRIGHT_RED",e[e.BRIGHT_GREEN=92]="BRIGHT_GREEN",e[e.BRIGHT_YELLOW=93]="BRIGHT_YELLOW",e[e.BRIGHT_BLUE=94]="BRIGHT_BLUE",e[e.BRIGHT_MAGENTA=95]="BRIGHT_MAGENTA",e[e.BRIGHT_CYAN=96]="BRIGHT_CYAN",e[e.BRIGHT_WHITE=97]="BRIGHT_WHITE"}(Li||(Li={}));var zi={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":mi()(process))&&process},Ki=(globalThis,zi.window||zi.self||zi.global),qi=zi.process||{};console;function Xi(){var e,t,r;if(Fi&&"performance"in Ki)e=null==Ki?void 0:null===(t=Ki.performance)||void 0===t?void 0:null===(r=t.now)||void 0===r?void 0:r.call(t);else if("hrtime"in qi){var n,i=null==qi?void 0:null===(n=qi.hrtime)||void 0===n?void 0:n.call(qi);e=1e3*i[0]+i[1]/1e6}else e=Date.now();return e}var Qi={debug:Fi&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},Wi={enabled:!0,level:0};function Zi(){}var Yi={},$i={once:!0},ea=function(){function e(){h()(this,e);var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{id:""},r=t.id;Hn(this,"id",void 0),Hn(this,"VERSION","8.8.25"),Hn(this,"_startTs",Xi()),Hn(this,"_deltaTs",Xi()),Hn(this,"_storage",void 0),Hn(this,"userData",{}),Hn(this,"LOG_THROTTLE_TIMEOUT",0),this.id=r,this._storage=new ji("__probe-".concat(this.id,"__"),Wi),this.userData={},this.timeStamp("".concat(this.id," started")),Ji(this),Object.seal(this)}return C()(e,[{key:"level",get:function(){return this.getLevel()},set:function(e){this.setLevel(e)}},{key:"isEnabled",value:function(){return this._storage.config.enabled}},{key:"getLevel",value:function(){return this._storage.config.level}},{key:"getTotal",value:function(){return Number((Xi()-this._startTs).toPrecision(10))}},{key:"getDelta",value:function(){return Number((Xi()-this._deltaTs).toPrecision(10))}},{key:"priority",get:function(){return this.level},set:function(e){this.level=e}},{key:"getPriority",value:function(){return this.level}},{key:"enable",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this._storage.updateConfiguration({enabled:e}),this}},{key:"setLevel",value:function(e){return this._storage.updateConfiguration({level:e}),this}},{key:"get",value:function(e){return this._storage.config[e]}},{key:"set",value:function(e,t){this._storage.updateConfiguration(A()({},e,t))}},{key:"settings",value:function(){console.table?console.table(this._storage.config):console.log(this._storage.config)}},{key:"assert",value:function(e,t){Vi(e,t)}},{key:"warn",value:function(e){return this._getLogFunction(0,e,Qi.warn,arguments,$i)}},{key:"error",value:function(e){return this._getLogFunction(0,e,Qi.error,arguments)}},{key:"deprecated",value:function(e,t){return this.warn("`".concat(e,"` is deprecated and will be removed in a later version. Use `").concat(t,"` instead"))}},{key:"removed",value:function(e,t){return this.error("`".concat(e,"` has been removed. Use `").concat(t,"` instead"))}},{key:"probe",value:function(e,t){return this._getLogFunction(e,t,Qi.log,arguments,{time:!0,once:!0})}},{key:"log",value:function(e,t){return this._getLogFunction(e,t,Qi.debug,arguments)}},{key:"info",value:function(e,t){return this._getLogFunction(e,t,console.info,arguments)}},{key:"once",value:function(e,t){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(e,t,Qi.debug||Qi.info,arguments,$i)}},{key:"table",value:function(e,t,r){return t?this._getLogFunction(e,t,console.table||Zi,r&&[r],{tag:na(t)}):Zi}},{key:"image",value:function(e){var t=e.logLevel,n=e.priority,i=e.image,a=e.message,o=void 0===a?"":a,s=e.scale,u=void 0===s?1:s;return this._shouldLog(t||n)?Fi?function(e){var t=e.image,r=e.message,n=void 0===r?"":r,i=e.scale,a=void 0===i?1:i;if("string"==typeof t){var o=new Image;return o.onload=function(){var e,t=Gi(o,n,a);(e=console).log.apply(e,De()(t))},o.src=t,Zi}var s=t.nodeName||"";if("img"===s.toLowerCase()){var u;return(u=console).log.apply(u,De()(Gi(t,n,a))),Zi}if("canvas"===s.toLowerCase()){var c=new Image;return c.onload=function(){var e;return(e=console).log.apply(e,De()(Gi(c,n,a)))},c.src=t.toDataURL(),Zi}return Zi}({image:i,message:o,scale:u}):function(e){var t=e.image,n=(e.message,e.scale),i=void 0===n?1:n,a=null;try{a=r(95)}catch(e){}if(a)return function(){return a(t,{fit:"box",width:"".concat(Math.round(80*i),"%")}).then((function(e){return console.log(e)}))};return Zi}({image:i,message:o,scale:u}):Zi}},{key:"time",value:function(e,t){return this._getLogFunction(e,t,console.time?console.time:console.info)}},{key:"timeEnd",value:function(e,t){return this._getLogFunction(e,t,console.timeEnd?console.timeEnd:console.info)}},{key:"timeStamp",value:function(e,t){return this._getLogFunction(e,t,console.timeStamp||Zi)}},{key:"group",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{collapsed:!1},n=ra({logLevel:e,message:t,opts:r}),i=r.collapsed;return n.method=(i?console.groupCollapsed:console.group)||console.info,this._getLogFunction(n)}},{key:"groupCollapsed",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.group(e,t,Object.assign({},r,{collapsed:!0}))}},{key:"groupEnd",value:function(e){return this._getLogFunction(e,"",console.groupEnd||Zi)}},{key:"withGroup",value:function(e,t,r){this.group(e,t)();try{r()}finally{this.groupEnd(e)()}}},{key:"trace",value:function(){console.trace&&console.trace()}},{key:"_shouldLog",value:function(e){return this.isEnabled()&&this.getLevel()>=ta(e)}},{key:"_getLogFunction",value:function(e,t,r,n,i){if(this._shouldLog(e)){var a;i=ra({logLevel:e,message:t,args:n,opts:i}),Vi(r=r||i.method),i.total=this.getTotal(),i.delta=this.getDelta(),this._deltaTs=Xi();var o=i.tag||i.message;if(i.once){if(Yi[o])return Zi;Yi[o]=Xi()}return t=function(e,t,r){if("string"==typeof t){var n=r.time?function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8,r=Math.max(t-e.length,0);return"".concat(" ".repeat(r)).concat(e)}((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")):"";t=r.time?"".concat(e,": ").concat(n," ").concat(t):"".concat(e,": ").concat(t),i=t,a=r.color,o=r.background,Fi||"string"!=typeof i||(a&&(a=Ui(a),i="[".concat(a,"m").concat(i,"[39m")),o&&(a=Ui(o),i="[".concat(o+10,"m").concat(i,"[49m"))),t=i}var i,a,o;var s;return t}(this.id,i.message,i),(a=r).bind.apply(a,[console,t].concat(De()(i.args)))}return Zi}}]),e}();function ta(e){if(!e)return 0;var t;switch(mi()(e)){case"number":t=e;break;case"object":t=e.logLevel||e.priority||0;break;default:return 0}return Vi(Number.isFinite(t)&&t>=0),t}function ra(e){var t=e.logLevel,r=e.message;e.logLevel=ta(t);for(var n=e.args?Array.from(e.args):[];n.length&&n.shift()!==r;);switch(mi()(t)){case"string":case"function":void 0!==r&&n.unshift(r),e.message=t;break;case"object":Object.assign(e,t)}"function"==typeof e.message&&(e.message=e.message());var i=mi()(e.message);return Vi("string"===i||"object"===i),Object.assign(e,{args:n},e.opts)}function na(e){for(var t in e)for(var r in e[t])return r||"untitled";return"empty"}Hn(ea,"VERSION","8.8.25");var ia=new ea({id:"luma.gl"});function aa(e,t){if(!e)throw new Error(t||"luma.gl: assertion failed.")}function oa(e){return"undefined"!=typeof WebGLRenderingContext&&e instanceof WebGLRenderingContext||("undefined"!=typeof WebGL2RenderingContext&&e instanceof WebGL2RenderingContext||Boolean(e&&Number.isFinite(e._version)))}function sa(e){return"undefined"!=typeof WebGL2RenderingContext&&e instanceof WebGL2RenderingContext||Boolean(e&&2===e._version)}function ua(e){return aa(oa(e),"Invalid WebGLRenderingContext"),e}function ca(e){return aa(sa(e),"Requires WebGL2"),e}var la={};function fa(e,t){var r;la[e]=!0,void 0!==t&&(r=t,globalThis.console&&globalThis.console.error&&globalThis.console.error(r))}var ha=function e(t){var r=t.gl;this.ext=t,this.isAlive=!0,this.hasBeenBound=!1,this.elementArrayBuffer=null,this.attribs=new Array(t.maxVertexAttribs);for(var n=0;n<this.attribs.length;n++){var i=new e.VertexAttrib(r);this.attribs[n]=i}this.maxAttrib=0};(ha.VertexAttrib=function(e){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 da,pa=function(e){var t=this;this.gl=e,function(e){var t=e.getError;e.getError=function(){var r;do{0!==(r=t.apply(e))&&(la[r]=!0)}while(0!==r);for(r in la)if(la[r])return delete la[r],parseInt(r,10);return 0}}(e);var r=this.original={getParameter:e.getParameter,enableVertexAttribArray:e.enableVertexAttribArray,disableVertexAttribArray:e.disableVertexAttribArray,bindBuffer:e.bindBuffer,getVertexAttrib:e.getVertexAttrib,vertexAttribPointer:e.vertexAttribPointer};e.getParameter=function(e){return e===t.VERTEX_ARRAY_BINDING_OES?t.currentVertexArrayObject===t.defaultVertexArrayObject?null:t.currentVertexArrayObject:r.getParameter.apply(this,arguments)},e.enableVertexAttribArray=function(e){var n=t.currentVertexArrayObject;n.maxAttrib=Math.max(n.maxAttrib,e);var i=n.attribs[e];return i.enabled=!0,r.enableVertexAttribArray.apply(this,arguments)},e.disableVertexAttribArray=function(e){var n=t.currentVertexArrayObject;n.maxAttrib=Math.max(n.maxAttrib,e);var i=n.attribs[e];return i.enabled=!1,r.disableVertexAttribArray.apply(this,arguments)},e.bindBuffer=function(e,n){switch(e){case 34962:t.currentArrayBuffer=n;break;case 34963:t.currentVertexArrayObject.elementArrayBuffer=n}return r.bindBuffer.apply(this,arguments)},e.getVertexAttrib=function(e,n){var i=t.currentVertexArrayObject,a=i.attribs[e];switch(n){case 34975:return a.buffer;case 34338:return a.enabled;case 34339:return a.size;case 34340:return a.stride;case 34341:return a.type;case 34922:return a.normalized;default:return r.getVertexAttrib.apply(this,arguments)}},e.vertexAttribPointer=function(e,n,i,a,o,s){var u=t.currentVertexArrayObject;u.maxAttrib=Math.max(u.maxAttrib,e);var c=u.attribs[e];return c.buffer=t.currentArrayBuffer,c.size=n,c.type=i,c.normalized=a,c.stride=o,c.offset=s,c.recache(),r.vertexAttribPointer.apply(this,arguments)},e.instrumentExtension&&e.instrumentExtension(this,"OES_vertex_array_object"),e.canvas&&e.canvas.addEventListener("webglcontextrestored",(function(){var e;e="OESVertexArrayObject emulation library context restored",globalThis.console&&globalThis.console.log&&globalThis.console.log(e),t.reset_()}),!0),this.reset_()};pa.prototype.VERTEX_ARRAY_BINDING_OES=34229,pa.prototype.reset_=function(){if(void 0!==this.vertexArrayObjects)for(var e=0;e<this.vertexArrayObjects.length;++e)this.vertexArrayObjects.isAlive=!1;var t=this.gl;this.maxVertexAttribs=t.getParameter(34921),this.defaultVertexArrayObject=new ha(this),this.currentVertexArrayObject=null,this.currentArrayBuffer=null,this.vertexArrayObjects=[this.defaultVertexArrayObject],this.bindVertexArrayOES(null)},pa.prototype.createVertexArrayOES=function(){var e=new ha(this);return this.vertexArrayObjects.push(e),e},pa.prototype.deleteVertexArrayOES=function(e){e.isAlive=!1,this.vertexArrayObjects.splice(this.vertexArrayObjects.indexOf(e),1),this.currentVertexArrayObject===e&&this.bindVertexArrayOES(null)},pa.prototype.isVertexArrayOES=function(e){return!!(e&&e instanceof ha&&e.hasBeenBound&&e.ext===this)},pa.prototype.bindVertexArrayOES=function(e){var t=this.gl;if(!e||e.isAlive){var r=this.original,n=this.currentVertexArrayObject;this.currentVertexArrayObject=e||this.defaultVertexArrayObject,this.currentVertexArrayObject.hasBeenBound=!0;var i=this.currentVertexArrayObject;if(n!==i){n&&i.elementArrayBuffer===n.elementArrayBuffer||r.bindBuffer.call(t,34963,i.elementArrayBuffer);for(var a=this.currentArrayBuffer,o=Math.max(n?n.maxAttrib:0,i.maxAttrib),s=0;s<=o;s++){var u=i.attribs[s],c=n?n.attribs[s]:null;if(n&&u.enabled===c.enabled||(u.enabled?r.enableVertexAttribArray.call(t,s):r.disableVertexAttribArray.call(t,s)),u.enabled){var l=!1;n&&u.buffer===c.buffer||(a!==u.buffer&&(r.bindBuffer.call(t,34962,u.buffer),a=u.buffer),l=!0),(l||u.cached!==c.cached)&&r.vertexAttribPointer.call(t,s,u.size,u.type,u.normalized,u.stride,u.offset)}}this.currentArrayBuffer!==a&&r.bindBuffer.call(t,34962,this.currentArrayBuffer)}}else fa(1282,"bindVertexArrayOES: attempt to bind deleted arrayObject")};var va,ya=function(e){return sa(e)?void 0:0},ga=(da={},A()(da,3074,(function(e){return sa(e)?void 0:36064})),A()(da,35723,(function(e){return sa(e)?void 0:4352})),A()(da,35977,ya),A()(da,32937,ya),A()(da,36795,(function(e,t){var r=sa(e)?e.getExtension("EXT_disjoint_timer_query_webgl2"):e.getExtension("EXT_disjoint_timer_query");return r&&r.GPU_DISJOINT_EXT?t(r.GPU_DISJOINT_EXT):0})),A()(da,37445,(function(e,t){var r=e.getExtension("WEBGL_debug_renderer_info");return t(r&&r.UNMASKED_VENDOR_WEBGL||7936)})),A()(da,37446,(function(e,t){var r=e.getExtension("WEBGL_debug_renderer_info");return t(r&&r.UNMASKED_RENDERER_WEBGL||7937)})),A()(da,34047,(function(e,t){var r=e.luma.extensions.EXT_texture_filter_anisotropic;return r?t(r.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1})),A()(da,32883,ya),A()(da,35071,ya),A()(da,37447,ya),A()(da,36063,(function(e,t){if(!sa(e)){var r=e.getExtension("WEBGL_draw_buffers");return r?t(r.MAX_COLOR_ATTACHMENTS_WEBGL):0}})),A()(da,35379,ya),A()(da,35374,ya),A()(da,35377,ya),A()(da,34852,(function(e){if(!sa(e)){var t=e.getExtension("WEBGL_draw_buffers");return t?t.MAX_DRAW_BUFFERS_WEBGL:0}})),A()(da,36203,(function(e){return e.getExtension("OES_element_index")?2147483647:65535})),A()(da,33001,(function(e){return e.getExtension("OES_element_index")?16777216:65535})),A()(da,33e3,(function(e){return 16777216})),A()(da,37157,ya),A()(da,35373,ya),A()(da,35657,ya),A()(da,36183,ya),A()(da,37137,ya),A()(da,34045,ya),A()(da,35978,ya),A()(da,35979,ya),A()(da,35968,ya),A()(da,35376,ya),A()(da,35375,ya),A()(da,35659,ya),A()(da,37154,ya),A()(da,35371,ya),A()(da,35658,ya),A()(da,35076,ya),A()(da,35077,ya),A()(da,35380,ya),da);var ma,ba,Aa,Ba=(va={},A()(va,"OES_vertex_array_object",{meta:{suffix:"OES"},createVertexArray:function(){aa(!1,"VertexArray requires WebGL2 or OES_vertex_array_object extension")},deleteVertexArray:function(){},bindVertexArray:function(){},isVertexArray:function(){return!1}}),A()(va,"ANGLE_instanced_arrays",{meta:{suffix:"ANGLE"},vertexAttribDivisor:function(e,t){aa(0===t,"WebGL instanced rendering not supported")},drawElementsInstanced:function(){},drawArraysInstanced:function(){}}),A()(va,"WEBGL_draw_buffers",{meta:{suffix:"WEBGL"},drawBuffers:function(){aa(!1)}}),A()(va,"EXT_disjoint_timer_query",{meta:{suffix:"EXT"},createQuery:function(){aa(!1)},deleteQuery:function(){aa(!1)},beginQuery:function(){aa(!1)},endQuery:function(){},getQuery:function(e,t){return this.getQueryObject(e,t)},getQueryParameter:function(e,t){return this.getQueryObject(e,t)},getQueryObject:function(){}}),va),wa={readBuffer:function(e,t,r){sa(e)&&t(r)},getVertexAttrib:function(e,t,r,n){var i,a=function(e,t){return{webgl2:sa(e),ext:e.getExtension(t)}}(e,"ANGLE_instanced_arrays"),o=a.webgl2,s=a.ext;switch(n){case 35069:i=!!o&&void 0;break;case 35070:i=o||s?void 0:0}return void 0!==i?i:t(r,n)},getProgramParameter:function(e,t,r,n){if(!sa(e))switch(n){case 35967:return 35981;case 35971:case 35382:return 0}return t(r,n)},getInternalformatParameter:function(e,t,r,n,i){if(!sa(e))switch(i){case 32937:return new Int32Array([0])}return e.getInternalformatParameter(r,n,i)},getTexParameter:function(e,t,r,n){switch(n){case 34046:var i=e.luma.extensions.EXT_texture_filter_anisotropic;n=i&&i.TEXTURE_MAX_ANISOTROPY_EXT||34046}return t(r,n)},getParameter:function(e,t,r){var n=ga[r],i="function"==typeof n?n(e,t,r):n;return void 0!==i?i:t(r)},hint:function(e,t,r,n){return t(r,n)}};function _a(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return xa(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return xa(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function xa(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Ca(e,t){var r=t.extension,n=t.target,i=t.target2,a=Ba[r];aa(a);for(var o=a.meta,s=(void 0===o?{}:o).suffix,u=void 0===s?"":s,c=e.getExtension(r),l=function(){var t=h[f],r="".concat(t).concat(u),o=null;"meta"===t||"function"==typeof e[t]||(c&&"function"==typeof c[r]?o=function(){return c[r].apply(c,arguments)}:"function"==typeof a[t]&&(o=a[t].bind(n))),o&&(n[t]=o,i[t]=o)},f=0,h=Object.keys(a);f<h.length;f++)l()}globalThis.polyfillContext=function(e){e.luma=e.luma||{};var t=e.luma;return t.polyfilled||(!function(e){if("function"!=typeof e.createVertexArray){var t=e.getSupportedExtensions;e.getSupportedExtensions=function(){var e=t.call(this)||[];return e.indexOf("OES_vertex_array_object")<0&&e.push("OES_vertex_array_object"),e};var r=e.getExtension;e.getExtension=function(t){var n=r.call(this,t);return n||("OES_vertex_array_object"!==t?null:(e.__OESVertexArrayObject||(this.__OESVertexArrayObject=new pa(this)),this.__OESVertexArrayObject))}}}(e),function(e){e.luma.extensions={};var t,r=_a(e.getSupportedExtensions()||[]);try{for(r.s();!(t=r.n()).done;){var n=t.value;e.luma[n]=e.getExtension(n)}}catch(e){r.e(e)}finally{r.f()}}(e),function(e,t){var r,n=_a(Object.getOwnPropertyNames(t));try{for(n.s();!(r=n.n()).done;){var i=r.value;"overrides"!==i&&Ca(e,{extension:i,target:e.luma,target2:e})}}catch(e){n.e(e)}finally{n.f()}}(e,Ba),function(e,t){var r=t.target,n=t.target2;Object.keys(wa).forEach((function(t){if("function"==typeof wa[t]){var i=e[t]?e[t].bind(e):function(){},a=wa[t].bind(null,e,i);r[t]=a,n[t]=a}}))}(e,{target:t,target2:e}),t.polyfilled=!0),e};var Oa=(ma={},A()(ma,3042,!1),A()(ma,32773,new Float32Array([0,0,0,0])),A()(ma,32777,32774),A()(ma,34877,32774),A()(ma,32969,1),A()(ma,32968,0),A()(ma,32971,1),A()(ma,32970,0),A()(ma,3106,new Float32Array([0,0,0,0])),A()(ma,3107,[!0,!0,!0,!0]),A()(ma,2884,!1),A()(ma,2885,1029),A()(ma,2929,!1),A()(ma,2931,1),A()(ma,2932,513),A()(ma,2928,new Float32Array([0,1])),A()(ma,2930,!0),A()(ma,3024,!0),A()(ma,36006,null),A()(ma,2886,2305),A()(ma,33170,4352),A()(ma,2849,1),A()(ma,32823,!1),A()(ma,32824,0),A()(ma,10752,0),A()(ma,32938,1),A()(ma,32939,!1),A()(ma,3089,!1),A()(ma,3088,new Int32Array([0,0,1024,1024])),A()(ma,2960,!1),A()(ma,2961,0),A()(ma,2968,4294967295),A()(ma,36005,4294967295),A()(ma,2962,519),A()(ma,2967,0),A()(ma,2963,4294967295),A()(ma,34816,519),A()(ma,36003,0),A()(ma,36004,4294967295),A()(ma,2964,7680),A()(ma,2965,7680),A()(ma,2966,7680),A()(ma,34817,7680),A()(ma,34818,7680),A()(ma,34819,7680),A()(ma,2978,[0,0,1024,1024]),A()(ma,3333,4),A()(ma,3317,4),A()(ma,37440,!1),A()(ma,37441,!1),A()(ma,37443,37444),A()(ma,35723,4352),A()(ma,36010,null),A()(ma,35977,!1),A()(ma,3330,0),A()(ma,3332,0),A()(ma,3331,0),A()(ma,3314,0),A()(ma,32878,0),A()(ma,3316,0),A()(ma,3315,0),A()(ma,32877,0),ma),Ea=function(e,t,r){return t?e.enable(r):e.disable(r)},Ta=function(e,t,r){return e.hint(r,t)},Sa=function(e,t,r){return e.pixelStorei(r,t)};function ka(e){return Array.isArray(e)||ArrayBuffer.isView(e)}var Ma=(ba={},A()(ba,3042,Ea),A()(ba,32773,(function(e,t){return e.blendColor.apply(e,De()(t))})),A()(ba,32777,"blendEquation"),A()(ba,34877,"blendEquation"),A()(ba,32969,"blendFunc"),A()(ba,32968,"blendFunc"),A()(ba,32971,"blendFunc"),A()(ba,32970,"blendFunc"),A()(ba,3106,(function(e,t){return e.clearColor.apply(e,De()(t))})),A()(ba,3107,(function(e,t){return e.colorMask.apply(e,De()(t))})),A()(ba,2884,Ea),A()(ba,2885,(function(e,t){return e.cullFace(t)})),A()(ba,2929,Ea),A()(ba,2931,(function(e,t){return e.clearDepth(t)})),A()(ba,2932,(function(e,t){return e.depthFunc(t)})),A()(ba,2928,(function(e,t){return e.depthRange.apply(e,De()(t))})),A()(ba,2930,(function(e,t){return e.depthMask(t)})),A()(ba,3024,Ea),A()(ba,35723,Ta),A()(ba,36006,(function(e,t){var r=sa(e)?36009:36160;return e.bindFramebuffer(r,t)})),A()(ba,2886,(function(e,t){return e.frontFace(t)})),A()(ba,33170,Ta),A()(ba,2849,(function(e,t){return e.lineWidth(t)})),A()(ba,32823,Ea),A()(ba,32824,"polygonOffset"),A()(ba,10752,"polygonOffset"),A()(ba,35977,Ea),A()(ba,32938,"sampleCoverage"),A()(ba,32939,"sampleCoverage"),A()(ba,3089,Ea),A()(ba,3088,(function(e,t){return e.scissor.apply(e,De()(t))})),A()(ba,2960,Ea),A()(ba,2961,(function(e,t){return e.clearStencil(t)})),A()(ba,2968,(function(e,t){return e.stencilMaskSeparate(1028,t)})),A()(ba,36005,(function(e,t){return e.stencilMaskSeparate(1029,t)})),A()(ba,2962,"stencilFuncFront"),A()(ba,2967,"stencilFuncFront"),A()(ba,2963,"stencilFuncFront"),A()(ba,34816,"stencilFuncBack"),A()(ba,36003,"stencilFuncBack"),A()(ba,36004,"stencilFuncBack"),A()(ba,2964,"stencilOpFront"),A()(ba,2965,"stencilOpFront"),A()(ba,2966,"stencilOpFront"),A()(ba,34817,"stencilOpBack"),A()(ba,34818,"stencilOpBack"),A()(ba,34819,"stencilOpBack"),A()(ba,2978,(function(e,t){return e.viewport.apply(e,De()(t))})),A()(ba,3333,Sa),A()(ba,3317,Sa),A()(ba,37440,Sa),A()(ba,37441,Sa),A()(ba,37443,Sa),A()(ba,3330,Sa),A()(ba,3332,Sa),A()(ba,3331,Sa),A()(ba,36010,(function(e,t){return e.bindFramebuffer(36008,t)})),A()(ba,3314,Sa),A()(ba,32878,Sa),A()(ba,3316,Sa),A()(ba,3315,Sa),A()(ba,32877,Sa),A()(ba,"framebuffer",(function(e,t){var r=t&&"handle"in t?t.handle:t;return e.bindFramebuffer(36160,r)})),A()(ba,"blend",(function(e,t){return t?e.enable(3042):e.disable(3042)})),A()(ba,"blendColor",(function(e,t){return e.blendColor.apply(e,De()(t))})),A()(ba,"blendEquation",(function(e,t){t=ka(t)?t:[t,t],e.blendEquationSeparate.apply(e,De()(t))})),A()(ba,"blendFunc",(function(e,t){t=ka(t)&&2===t.length?[].concat(De()(t),De()(t)):t,e.blendFuncSeparate.apply(e,De()(t))})),A()(ba,"clearColor",(function(e,t){return e.clearColor.apply(e,De()(t))})),A()(ba,"clearDepth",(function(e,t){return e.clearDepth(t)})),A()(ba,"clearStencil",(function(e,t){return e.clearStencil(t)})),A()(ba,"colorMask",(function(e,t){return e.colorMask.apply(e,De()(t))})),A()(ba,"cull",(function(e,t){return t?e.enable(2884):e.disable(2884)})),A()(ba,"cullFace",(function(e,t){return e.cullFace(t)})),A()(ba,"depthTest",(function(e,t){return t?e.enable(2929):e.disable(2929)})),A()(ba,"depthFunc",(function(e,t){return e.depthFunc(t)})),A()(ba,"depthMask",(function(e,t){return e.depthMask(t)})),A()(ba,"depthRange",(function(e,t){return e.depthRange.apply(e,De()(t))})),A()(ba,"dither",(function(e,t){return t?e.enable(3024):e.disable(3024)})),A()(ba,"derivativeHint",(function(e,t){e.hint(35723,t)})),A()(ba,"frontFace",(function(e,t){return e.frontFace(t)})),A()(ba,"mipmapHint",(function(e,t){return e.hint(33170,t)})),A()(ba,"lineWidth",(function(e,t){return e.lineWidth(t)})),A()(ba,"polygonOffsetFill",(function(e,t){return t?e.enable(32823):e.disable(32823)})),A()(ba,"polygonOffset",(function(e,t){return e.polygonOffset.apply(e,De()(t))})),A()(ba,"sampleCoverage",(function(e,t){return e.sampleCoverage.apply(e,De()(t))})),A()(ba,"scissorTest",(function(e,t){return t?e.enable(3089):e.disable(3089)})),A()(ba,"scissor",(function(e,t){return e.scissor.apply(e,De()(t))})),A()(ba,"stencilTest",(function(e,t){return t?e.enable(2960):e.disable(2960)})),A()(ba,"stencilMask",(function(e,t){var r=t=ka(t)?t:[t,t],n=M()(r,2),i=n[0],a=n[1];e.stencilMaskSeparate(1028,i),e.stencilMaskSeparate(1029,a)})),A()(ba,"stencilFunc",(function(e,t){var r=t=ka(t)&&3===t.length?[].concat(De()(t),De()(t)):t,n=M()(r,6),i=n[0],a=n[1],o=n[2],s=n[3],u=n[4],c=n[5];e.stencilFuncSeparate(1028,i,a,o),e.stencilFuncSeparate(1029,s,u,c)})),A()(ba,"stencilOp",(function(e,t){var r=t=ka(t)&&3===t.length?[].concat(De()(t),De()(t)):t,n=M()(r,6),i=n[0],a=n[1],o=n[2],s=n[3],u=n[4],c=n[5];e.stencilOpSeparate(1028,i,a,o),e.stencilOpSeparate(1029,s,u,c)})),A()(ba,"viewport",(function(e,t){return e.viewport.apply(e,De()(t))})),ba);function Ia(e,t,r){return void 0!==t[e]?t[e]:r[e]}var Pa={blendEquation:function(e,t,r){return e.blendEquationSeparate(Ia(32777,t,r),Ia(34877,t,r))},blendFunc:function(e,t,r){return e.blendFuncSeparate(Ia(32969,t,r),Ia(32968,t,r),Ia(32971,t,r),Ia(32970,t,r))},polygonOffset:function(e,t,r){return e.polygonOffset(Ia(32824,t,r),Ia(10752,t,r))},sampleCoverage:function(e,t,r){return e.sampleCoverage(Ia(32938,t,r),Ia(32939,t,r))},stencilFuncFront:function(e,t,r){return e.stencilFuncSeparate(1028,Ia(2962,t,r),Ia(2967,t,r),Ia(2963,t,r))},stencilFuncBack:function(e,t,r){return e.stencilFuncSeparate(1029,Ia(34816,t,r),Ia(36003,t,r),Ia(36004,t,r))},stencilOpFront:function(e,t,r){return e.stencilOpSeparate(1028,Ia(2964,t,r),Ia(2965,t,r),Ia(2966,t,r))},stencilOpBack:function(e,t,r){return e.stencilOpSeparate(1029,Ia(34817,t,r),Ia(34818,t,r),Ia(34819,t,r))}},Ra={enable:function(e,t){return e(A()({},t,!0))},disable:function(e,t){return e(A()({},t,!1))},pixelStorei:function(e,t,r){return e(A()({},t,r))},hint:function(e,t,r){return e(A()({},t,r))},bindFramebuffer:function(e,t,r){var n;switch(t){case 36160:return e((n={},A()(n,36006,r),A()(n,36010,r),n));case 36009:return e(A()({},36006,r));case 36008:return e(A()({},36010,r));default:return null}},blendColor:function(e,t,r,n,i){return e(A()({},32773,new Float32Array([t,r,n,i])))},blendEquation:function(e,t){var r;return e((r={},A()(r,32777,t),A()(r,34877,t),r))},blendEquationSeparate:function(e,t,r){var n;return e((n={},A()(n,32777,t),A()(n,34877,r),n))},blendFunc:function(e,t,r){var n;return e((n={},A()(n,32969,t),A()(n,32968,r),A()(n,32971,t),A()(n,32970,r),n))},blendFuncSeparate:function(e,t,r,n,i){var a;return e((a={},A()(a,32969,t),A()(a,32968,r),A()(a,32971,n),A()(a,32970,i),a))},clearColor:function(e,t,r,n,i){return e(A()({},3106,new Float32Array([t,r,n,i])))},clearDepth:function(e,t){return e(A()({},2931,t))},clearStencil:function(e,t){return e(A()({},2961,t))},colorMask:function(e,t,r,n,i){return e(A()({},3107,[t,r,n,i]))},cullFace:function(e,t){return e(A()({},2885,t))},depthFunc:function(e,t){return e(A()({},2932,t))},depthRange:function(e,t,r){return e(A()({},2928,new Float32Array([t,r])))},depthMask:function(e,t){return e(A()({},2930,t))},frontFace:function(e,t){return e(A()({},2886,t))},lineWidth:function(e,t){return e(A()({},2849,t))},polygonOffset:function(e,t,r){var n;return e((n={},A()(n,32824,t),A()(n,10752,r),n))},sampleCoverage:function(e,t,r){var n;return e((n={},A()(n,32938,t),A()(n,32939,r),n))},scissor:function(e,t,r,n,i){return e(A()({},3088,new Int32Array([t,r,n,i])))},stencilMask:function(e,t){var r;return e((r={},A()(r,2968,t),A()(r,36005,t),r))},stencilMaskSeparate:function(e,t,r){return e(A()({},1028===t?2968:36005,r))},stencilFunc:function(e,t,r,n){var i;return e((i={},A()(i,2962,t),A()(i,2967,r),A()(i,2963,n),A()(i,34816,t),A()(i,36003,r),A()(i,36004,n),i))},stencilFuncSeparate:function(e,t,r,n,i){var a;return e((a={},A()(a,1028===t?2962:34816,r),A()(a,1028===t?2967:36003,n),A()(a,1028===t?2963:36004,i),a))},stencilOp:function(e,t,r,n){var i;return e((i={},A()(i,2964,t),A()(i,2965,r),A()(i,2966,n),A()(i,34817,t),A()(i,34818,r),A()(i,34819,n),i))},stencilOpSeparate:function(e,t,r,n,i){var a;return e((a={},A()(a,1028===t?2964:34817,r),A()(a,1028===t?2965:34818,n),A()(a,1028===t?2966:34819,i),a))},viewport:function(e,t,r,n,i){return e(A()({},2978,[t,r,n,i]))}},Fa=function(e,t){return e.isEnabled(t)},Da=(Aa={},A()(Aa,3042,Fa),A()(Aa,2884,Fa),A()(Aa,2929,Fa),A()(Aa,3024,Fa),A()(Aa,32823,Fa),A()(Aa,32926,Fa),A()(Aa,32928,Fa),A()(Aa,3089,Fa),A()(Aa,2960,Fa),A()(Aa,35977,Fa),Aa);function La(e){for(var t in e)return!1;return!0}function ja(e,t){if(e===t)return!0;var r=Array.isArray(e)||ArrayBuffer.isView(e),n=Array.isArray(t)||ArrayBuffer.isView(t);if(r&&n&&e.length===t.length){for(var i=0;i<e.length;++i)if(e[i]!==t[i])return!1;return!0}return!1}function Ga(e,t){var r=e[t].bind(e);e[t]=function(){var t=arguments.length<=0?void 0:arguments[0];return t in e.state.cache&&e.state.enable?e.state.cache[t]:r.apply(void 0,arguments)},Object.defineProperty(e[t],"name",{value:"".concat(t,"-from-cache"),configurable:!1})}function Ua(e,t,r){var n=e[t].bind(e);e[t]=function(){for(var t=arguments.length,i=new Array(t),a=0;a<t;a++)i[a]=arguments[a];var o=r.apply(void 0,[e.state._updateCache].concat(i)),s=o.valueChanged,u=o.oldValue;return s&&n.apply(void 0,i),u},Object.defineProperty(e[t],"name",{value:"".concat(t,"-to-cache"),configurable:!1})}function Na(e){var t=e.useProgram.bind(e);e.useProgram=function(r){e.state.program!==r&&(t(r),e.state.program=r)}}var Ha=function(){function e(t){h()(this,e);var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=r.copyState,i=void 0!==n&&n,a=r.log,o=void 0===a?function(){}:a;this.gl=t,this.program=null,this.stateStack=[],this.enable=!0,this.cache=i?Xa(t):Object.assign({},Oa),this.log=o,this._updateCache=this._updateCache.bind(this),Object.seal(this)}return C()(e,[{key:"push",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.stateStack.push({})}},{key:"pop",value:function(){aa(this.stateStack.length>0);var e=this.stateStack[this.stateStack.length-1];qa(this.gl,e),this.stateStack.pop()}},{key:"_updateCache",value:function(e){var t,r=!1,n=this.stateStack.length>0&&this.stateStack[this.stateStack.length-1];for(var i in e){aa(void 0!==i);var a=e[i],o=this.cache[i];ja(a,o)||(r=!0,t=o,!n||i in n||(n[i]=o),this.cache[i]=a)}return{valueChanged:r,oldValue:t}}}]),e}();function Ja(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.enable,n=void 0===r||r,i=t.copyState;if(aa(void 0!==i),!e.state){var a=globalThis.polyfillContext;for(var o in a&&a(e),e.state=new Ha(e,{copyState:i}),Na(e),Ra){var s=Ra[o];Ua(e,o,s)}Ga(e,"getParameter"),Ga(e,"isEnabled")}return e.state.enable=n,e}function Va(e){aa(e.state),e.state.pop()}function za(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return Ka(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ka(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function Ka(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function qa(e,t){if(aa(oa(e),"setParameters requires a WebGL context"),!La(t)){var r={};for(var n in t){var i=Number(n),a=Ma[n];a&&("string"==typeof a?r[a]=!0:a(e,t[n],i))}var o=e.state&&e.state.cache;if(o)for(var s in r){(0,Pa[s])(e,t,o)}}}function Xa(e,t){if("number"==typeof(t=t||Oa)){var r=t,n=Da[r];return n?n(e,r):e.getParameter(r)}var i,a={},o=za(Array.isArray(t)?t:Object.keys(t));try{for(o.s();!(i=o.n()).done;){var s=i.value,u=Da[s];a[s]=u?u(e,Number(s)):e.getParameter(Number(s))}}catch(e){o.e(e)}finally{o.f()}return a}function Qa(e,t,r){if(La(t))return r(e);var n,i=t.nocatch,a=void 0===i||i;if(function(e){e.state||Ja(e,{copyState:!1}),e.state.push()}(e),qa(e,t),a)n=r(e),Va(e);else try{n=r(e)}finally{Va(e)}return n}var Wa=Fi();var Za=function(){function e(){h()(this,e),this.stats=new Map}return C()(e,[{key:"get",value:function(e){return this.stats.has(e)||this.stats.set(e,new zn({id:e})),this.stats.get(e)}}]),e}(),Ya=new Za;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||(Fi()&&ia.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:ia,stats:Ya,globals:{modules:{},nodeIO:{}}});globalThis.luma;function $a(e,t){if(!e)throw new Error(t||"luma.gl: assertion failed.")}function eo(e,t){if("string"!=typeof t)return t;var r=Number(t);if(!isNaN(r))return r;var n=e[t=t.replace(/^.*\./,"")];return $a(void 0!==n,"Accessing undefined constant GL.".concat(t)),n}function to(e,t){for(var r in t=Number(t),e)if(e[r]===t)return"GL.".concat(r);return String(t)}var ro={};function no(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"id";ro[e]=ro[e]||1;var t=ro[e]++;return"".concat(e,"-").concat(t)}function io(e){return $a("number"==typeof e,"Input must be a number"),e&&0==(e&e-1)}function ao(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return oo(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return oo(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function oo(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var so="Resource subclass must define virtual methods",uo=function(e){function t(e){h()(this,t);var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};ua(e);var n=r.id,i=r.userData,a=void 0===i?{}:i;this.gl=e,this.gl2=e,this.id=n||no(this[Symbol.toStringTag]),this.userData=a,this._bound=!1,this._handle=r.handle,void 0===this._handle&&(this._handle=this._createHandle()),this.byteLength=0,this._initStats(),this._addStats()}return C()(t,[{key:e,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 e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.deleteChildren,r=void 0!==t&&t,n=this._handle&&this._deleteHandle(this._handle);return this._handle&&this._removeStats(),this._handle=null,n&&r&&n.filter(Boolean).forEach((function(e){return e.delete()})),this}},{key:"bind",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.handle;return"function"!=typeof t?(this._bindHandle(t),this):(this._bound?e=t():(this._bindHandle(this.handle),this._bound=!0,e=t(),this._bound=!1,this._bindHandle(null)),e)}},{key:"unbind",value:function(){this.bind(null)}},{key:"getParameter",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};$a(e=eo(this.gl,e));var r=this.constructor.PARAMETERS||{},n=r[e];if(n){var i=sa(this.gl),a=(!("webgl2"in n)||i)&&(!("extension"in n)||this.gl.getExtension(n.extension));if(!a){var o=n.webgl1,s="webgl2"in n?n.webgl2:n.webgl1,u=i?s:o;return u}}return this._getParameter(e,t)}},{key:"getParameters",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.parameters,n=t.keys,i=this.constructor.PARAMETERS||{},a=sa(this.gl),o={},s=r||Object.keys(i),u=ao(s);try{for(u.s();!(e=u.n()).done;){var c=e.value,l=i[c],f=l&&(!("webgl2"in l)||a)&&(!("extension"in l)||this.gl.getExtension(l.extension));if(f){var h=n?to(this.gl,c):c;o[h]=this.getParameter(c,t),n&&"GLenum"===l.type&&(o[h]=to(this.gl,o[h]))}}}catch(e){u.e(e)}finally{u.f()}return o}},{key:"setParameter",value:function(e,t){$a(e=eo(this.gl,e));var r=(this.constructor.PARAMETERS||{})[e];if(r){var n=sa(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&&(t=eo(t))}return this._setParameter(e,t),this}},{key:"setParameters",value:function(e){for(var t in e)this.setParameter(t,e[t]);return this}},{key:"stubRemovedMethods",value:function(e,t,r){return function(e,t,r,n){var i="See luma.gl ".concat(r," Upgrade Guide at https://luma.gl/docs/upgrade-guide"),a=Object.getPrototypeOf(e);n.forEach((function(e){a.methodName||(a[e]=function(){throw ia.removed("Calling removed method ".concat(t,".").concat(e,": "),i)(),new Error(e)})}))}(this,e,t,r)}},{key:"initialize",value:function(e){}},{key:"_createHandle",value:function(){throw new Error(so)}},{key:"_deleteHandle",value:function(){throw new Error(so)}},{key:"_bindHandle",value:function(e){throw new Error(so)}},{key:"_getOptsFromHandle",value:function(){throw new Error(so)}},{key:"_getParameter",value:function(e,t){throw new Error(so)}},{key:"_setParameter",value:function(e,t){throw new Error(so)}},{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 Za}},{key:"_addStats",value:function(){var e=this[Symbol.toStringTag],t=Ya.get("Resource Counts");t.get("Resources Created").incrementCount(),t.get("".concat(e,"s Created")).incrementCount(),t.get("".concat(e,"s Active")).incrementCount()}},{key:"_removeStats",value:function(){var e=this[Symbol.toStringTag];Ya.get("Resource Counts").get("".concat(e,"s Active")).decrementCount()}},{key:"_trackAllocatedMemory",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this[Symbol.toStringTag];this._doTrackAllocatedMemory(e,t),this._doTrackAllocatedMemory(e,t,this.gl.stats.get("Memory Usage"))}},{key:"_doTrackAllocatedMemory",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this[Symbol.toStringTag],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Ya.get("Memory Usage");r.get("GPU Memory").addCount(e),r.get("".concat(t," Memory")).addCount(e),this.byteLength=e}},{key:"_trackDeallocatedMemory",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this[Symbol.toStringTag];this._doTrackDeallocatedMemory(e),this._doTrackDeallocatedMemory(e,this.gl.stats.get("Memory Usage"))}},{key:"_doTrackDeallocatedMemory",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this[Symbol.toStringTag],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ya.get("Memory Usage");t.get("GPU Memory").subtractCount(this.byteLength),t.get("".concat(e," Memory")).subtractCount(this.byteLength),this.byteLength=0}}]),t}(Symbol.toStringTag),co=r(58),lo=r.n(co);function fo(e){switch(ArrayBuffer.isView(e)?e.constructor:e){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 ho(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.clamped,n=void 0===r||r;switch(e){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 po(e){var t=e.data,r=e.width,n=e.height,i=e.bytesPerPixel,a=void 0===i?4:i,o=e.temp,s=r*a;o=o||new Uint8Array(s);for(var u=0;u<n/2;++u){var c=u*s,l=(n-u-1)*s;o.set(t.subarray(c,c+s)),t.copyWithin(c,l,l+s),t.set(o,l)}}function vo(e){for(var t=e.data,r=e.width,n=e.height,i=Math.round(r/2),a=Math.round(n/2),o=new Uint8Array(i*a*4),s=0;s<a;s++)for(var u=0;u<i;u++)for(var c=0;c<4;c++)o[4*(s*i+u)+c]=t[4*(2*s*r+2*u)+c];return{data:o,width:i,height:a}}function yo(e,t,r){var n=r.removedProps,i=void 0===n?{}:n,a=r.deprecatedProps,o=void 0===a?{}:a,s=r.replacedProps,u=void 0===s?{}:s;for(var c in i)if(c in t){var l=i[c]?"".concat(e,".").concat(i[c]):"N/A";ia.removed("".concat(e,".").concat(c),l)()}for(var f in o)if(f in t){var h=o[f];ia.deprecated("".concat(e,".").concat(f),"".concat(e,".").concat(h))()}var d=null;for(var p in u)if(p in t){var v=u[p];ia.deprecated("".concat(e,".").concat(p),"".concat(e,".").concat(v))(),(d=d||Object.assign({},t))[v]=t[p],delete d[p]}return d||t}var go={offset:0,stride:0,type:5126,size:1,divisor:0,normalized:!1,integer:!1},mo={deprecatedProps:{instanced:"divisor",isInstanced:"divisor"}},bo=function(){function e(){var t=this;h()(this,e);for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];n.forEach((function(e){return t._assign(e)})),Object.freeze(this)}return C()(e,[{key:"toString",value:function(){return JSON.stringify(this)}},{key:"BYTES_PER_ELEMENT",get:function(){return e.getBytesPerElement(this)}},{key:"BYTES_PER_VERTEX",get:function(){return e.getBytesPerVertex(this)}},{key:"_assign",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return void 0!==(e=yo("Accessor",e,mo)).type&&(this.type=e.type,5124!==e.type&&5125!==e.type||(this.integer=!0)),void 0!==e.size&&(this.size=e.size),void 0!==e.offset&&(this.offset=e.offset),void 0!==e.stride&&(this.stride=e.stride),void 0!==e.normalized&&(this.normalized=e.normalized),void 0!==e.integer&&(this.integer=e.integer),void 0!==e.divisor&&(this.divisor=e.divisor),void 0!==e.buffer&&(this.buffer=e.buffer),void 0!==e.index&&("boolean"==typeof e.index?this.index=e.index?1:0:this.index=e.index),void 0!==e.instanced&&(this.divisor=e.instanced?1:0),void 0!==e.isInstanced&&(this.divisor=e.isInstanced?1:0),this}}],[{key:"getBytesPerElement",value:function(e){return ho(e.type||5126).BYTES_PER_ELEMENT}},{key:"getBytesPerVertex",value:function(e){return $a(e.size),ho(e.type||5126).BYTES_PER_ELEMENT*e.size}},{key:"resolve",value:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return lo()(e,[go].concat(r))}}]),e}();function Ao(e){var t=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(e){return!1}}();return function(){var r,n=m()(e);if(t){var i=m()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return y()(this,r)}}var Bo,wo,_o,xo={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"},Co={removedProps:{},replacedProps:{bytes:"byteLength"},deprecatedProps:xo},Oo={removedProps:xo},Eo=function(e,t){p()(n,e);var r=Ao(n);function n(e){var t;h()(this,n);var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(t=r.call(this,e,i)).stubRemovedMethods("Buffer","v6.0",["layout","setLayout","getIndexedParameter"]),t.target=i.target||(t.gl.webgl2?36662:34962),t.initialize(i),Object.seal(yi()(t)),t}return C()(n,[{key:t,get:function(){return"Buffer"}},{key:"getElementCount",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.accessor;return Math.round(this.byteLength/bo.getBytesPerElement(e))}},{key:"getVertexCount",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.accessor;return Math.round(this.byteLength/bo.getBytesPerVertex(e))}},{key:"initialize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return ArrayBuffer.isView(e)&&(e={data:e}),Number.isFinite(e)&&(e={byteLength:e}),e=yo("Buffer",e,Co),this.usage=e.usage||35044,this.debugData=null,this.setAccessor(Object.assign({},e,e.accessor)),e.data?this._setData(e.data,e.offset,e.byteLength):this._setByteLength(e.byteLength||0),this}},{key:"setProps",value:function(e){return"accessor"in(e=yo("Buffer",e,Oo))&&this.setAccessor(e.accessor),this}},{key:"setAccessor",value:function(e){return delete(e=Object.assign({},e)).buffer,this.accessor=new bo(e),this}},{key:"reallocate",value:function(e){return e>this.byteLength?(this._setByteLength(e),!0):(this.bytesUsed=e,!1)}},{key:"setData",value:function(e){return this.initialize(e)}},{key:"subData",value:function(e){ArrayBuffer.isView(e)&&(e={data:e});var t=e,r=t.data,n=t.offset,i=void 0===n?0:n,a=t.srcOffset,o=void 0===a?0:a,s=e.byteLength||e.length;$a(r);var u=this.gl.webgl2?36663:this.target;return this.gl.bindBuffer(u,this.handle),0!==o||void 0!==s?(ca(this.gl),this.gl.bufferSubData(this.target,i,r,o,s)):this.gl.bufferSubData(u,i,r),this.gl.bindBuffer(u,null),this.debugData=null,this._inferType(r),this}},{key:"copyData",value:function(e){var t=e.sourceBuffer,r=e.readOffset,n=void 0===r?0:r,i=e.writeOffset,a=void 0===i?0:i,o=e.size,s=this.gl;return ca(s),s.bindBuffer(36662,t.handle),s.bindBuffer(36663,this.handle),s.copyBufferSubData(36662,36663,n,a,o),s.bindBuffer(36662,null),s.bindBuffer(36663,null),this.debugData=null,this}},{key:"getData",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.dstData,r=void 0===t?null:t,n=e.srcByteOffset,i=void 0===n?0:n,a=e.dstOffset,o=void 0===a?0:a,s=e.length,u=void 0===s?0:s;ca(this.gl);var c,l,f=ho(this.accessor.type||5126,{clamped:!1}),h=this._getAvailableElementCount(i),d=o;r?c=(l=r.length)-d:l=d+(c=Math.min(h,u||h));var p=Math.min(h,c);return $a((u=u||p)<=p),r=r||new f(l),this.gl.bindBuffer(36662,this.handle),this.gl.getBufferSubData(36662,i,r,o,u),this.gl.bindBuffer(36662,null),r}},{key:"bind",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.target,r=void 0===t?this.target:t,n=e.index,i=void 0===n?this.accessor&&this.accessor.index:n,a=e.offset,o=void 0===a?0:a,s=e.size;return 35345===r||35982===r?void 0!==s?this.gl.bindBufferRange(r,i,this.handle,o,s):($a(0===o),this.gl.bindBufferBase(r,i,this.handle)):this.gl.bindBuffer(r,this.handle),this}},{key:"unbind",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.target,r=void 0===t?this.target:t,n=e.index,i=void 0===n?this.accessor&&this.accessor.index:n,a=35345===r||35982===r;return a?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(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.byteLength+t;$a(ArrayBuffer.isView(e)),this._trackDeallocatedMemory();var n=this._getTarget();this.gl.bindBuffer(n,this.handle),this.gl.bufferData(n,r,this.usage),this.gl.bufferSubData(n,t,e),this.gl.bindBuffer(n,null),this.debugData=e.slice(0,10),this.bytesUsed=r,this._trackAllocatedMemory(r);var i=fo(e);return $a(i),this.setAccessor(new bo(this.accessor,{type:i})),this}},{key:"_setByteLength",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.usage;$a(e>=0),this._trackDeallocatedMemory();var r=e;0===e&&(r=new Float32Array(0));var n=this._getTarget();return this.gl.bindBuffer(n,this.handle),this.gl.bufferData(n,r,t),this.gl.bindBuffer(n,null),this.usage=t,this.debugData=null,this.bytesUsed=e,this._trackAllocatedMemory(e),this}},{key:"_getTarget",value:function(){return this.gl.webgl2?36663:this.target}},{key:"_getAvailableElementCount",value:function(e){var t=e/ho(this.accessor.type||5126,{clamped:!1}).BYTES_PER_ELEMENT;return this.getElementCount()-t}},{key:"_inferType",value:function(e){this.accessor.type||this.setAccessor(new bo(this.accessor,{type:fo(e)}))}},{key:"_createHandle",value:function(){return this.gl.createBuffer()}},{key:"_deleteHandle",value:function(){this.gl.deleteBuffer(this.handle),this._trackDeallocatedMemory()}},{key:"_getParameter",value:function(e){this.gl.bindBuffer(this.target,this.handle);var t=this.gl.getBufferParameter(this.target,e);return this.gl.bindBuffer(this.target,null),t}},{key:"type",get:function(){return ia.deprecated("Buffer.type","Buffer.accessor.type")(),this.accessor.type}},{key:"bytes",get:function(){return ia.deprecated("Buffer.bytes","Buffer.byteLength")(),this.byteLength}},{key:"setByteLength",value:function(e){return ia.deprecated("setByteLength","reallocate")(),this.reallocate(e)}},{key:"updateAccessor",value:function(e){return ia.deprecated("updateAccessor(...)","setAccessor(new Accessor(buffer.accessor, ...)")(),this.accessor=new bo(this.accessor,e),this}}]),n}(uo,Symbol.toStringTag),To=(Bo={},A()(Bo,6407,{dataFormat:6407,types:[5121,33635]}),A()(Bo,6408,{dataFormat:6408,types:[5121,32819,32820]}),A()(Bo,6406,{dataFormat:6406,types:[5121]}),A()(Bo,6409,{dataFormat:6409,types:[5121]}),A()(Bo,6410,{dataFormat:6410,types:[5121]}),A()(Bo,33326,{dataFormat:6403,types:[5126],gl2:!0}),A()(Bo,33328,{dataFormat:33319,types:[5126],gl2:!0}),A()(Bo,34837,{dataFormat:6407,types:[5126],gl2:!0}),A()(Bo,34836,{dataFormat:6408,types:[5126],gl2:!0}),Bo),So=(wo={},A()(wo,6403,1),A()(wo,36244,1),A()(wo,33319,2),A()(wo,33320,2),A()(wo,6407,3),A()(wo,36248,3),A()(wo,6408,4),A()(wo,36249,4),A()(wo,6402,1),A()(wo,34041,1),A()(wo,6406,1),A()(wo,6409,1),A()(wo,6410,2),wo),ko=(_o={},A()(_o,5126,4),A()(_o,5125,4),A()(_o,5124,4),A()(_o,5123,2),A()(_o,5122,2),A()(_o,5131,2),A()(_o,5120,1),A()(_o,5121,1),_o);function Mo(e,t){var r=To[t];if(!r)return!1;if(void 0===r.gl1&&void 0===r.gl2)return!0;var n=sa(e)&&r.gl2||r.gl1;return"string"==typeof n?e.getExtension(n):n}function Io(e,t){var r=To[t];switch(r&&r.types[0]){case 5126:return e.getExtension("OES_texture_float_linear");case 5131:return e.getExtension("OES_texture_half_float_linear");default:return!0}}function Po(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return Ro(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ro(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function Ro(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Fo(e){var t=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(e){return!1}}();return function(){var r,n=m()(e);if(t){var i=m()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return y()(this,r)}}var Do=[9729,9728],Lo=globalThis.WebGLBuffer||function(){},jo=function(e,t){p()(n,e);var r=Fo(n);function n(e,t){var i;h()(this,n);var a=t.id,o=void 0===a?no("texture"):a,s=t.handle,u=t.target;return(i=r.call(this,e,{id:o,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 C()(n,[{key:t,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 e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.data;if(r instanceof Promise)return r.then((function(r){return e.initialize(Object.assign({},t,{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 e.initialize(t)})),this;var i=t.pixels,a=void 0===i?null:i,o=t.format,s=void 0===o?6408:o,u=t.border,c=void 0===u?0:u,l=t.recreate,f=void 0!==l&&l,h=t.parameters,d=void 0===h?{}:h,p=t.pixelStore,v=void 0===p?{}:p,y=t.textureUnit,g=void 0===y?void 0:y;r||(r=a);var m=t.width,b=t.height,A=t.dataFormat,B=t.type,w=t.compressed,_=void 0!==w&&w,x=t.mipmaps,C=void 0===x||x,O=t.depth,E=void 0===O?0:O,T=this._deduceParameters({format:s,type:B,dataFormat:A,compressed:_,data:r,width:m,height:b});return m=T.width,b=T.height,_=T.compressed,A=T.dataFormat,B=T.type,this.width=m,this.height=b,this.depth=E,this.format=s,this.type=B,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()&&(ia.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:B,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 e=this._video,t=e.video,r=e.parameters;if(e.lastTime===t.currentTime||t.readyState<HTMLVideoElement.HAVE_CURRENT_DATA)return;this.setSubImageData({data:t,parameters:r}),this.mipmaps&&this.generateMipmap(),this._video.lastTime=t.currentTime}}},{key:"resize",value:function(e){var t=e.height,r=e.width,n=e.mipmaps,i=void 0!==n&&n;return r!==this.width||t!==this.height?this.initialize({width:r,height:t,format:this.format,type:this.type,dataFormat:this.dataFormat,border:this.border,mipmaps:i}):this}},{key:"generateMipmap",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._isNPOT()?(ia.warn("texture: ".concat(this," is Non-Power-Of-Two, disabling mipmaping"))(),this):(this.mipmaps=!0,this.gl.bindTexture(this.target,this.handle),Qa(this.gl,t,(function(){e.gl.generateMipmap(e.target)})),this.gl.bindTexture(this.target,null),this)}},{key:"setImageData",value:function(e){this._trackDeallocatedMemory("Texture");var t=e.target,r=void 0===t?this.target:t,n=e.pixels,i=void 0===n?null:n,a=e.level,o=void 0===a?0:a,s=e.format,u=void 0===s?this.format:s,c=e.border,l=void 0===c?this.border:c,f=e.offset,h=void 0===f?0:f,d=e.parameters,p=void 0===d?{}:d,v=e.data,y=void 0===v?null:v,g=e.type,m=void 0===g?this.type:g,b=e.width,A=void 0===b?this.width:b,B=e.height,w=void 0===B?this.height:B,_=e.dataFormat,x=void 0===_?this.dataFormat:_,C=e.compressed,O=void 0!==C&&C;y||(y=i);var E=this._deduceParameters({format:u,type:m,dataFormat:x,compressed:O,data:y,width:A,height:w});m=E.type,x=E.dataFormat,O=E.compressed,A=E.width,w=E.height;var T=this.gl;T.bindTexture(this.target,this.handle);var S,k,I=this._getDataType({data:y,compressed:O});y=I.data,S=I.dataType;var P=0;if(Qa(this.gl,p,(function(){switch(S){case"null":T.texImage2D(r,o,u,A,w,l,x,m,y);break;case"typed-array":T.texImage2D(r,o,u,A,w,l,x,m,y,h);break;case"buffer":(k=ca(T)).bindBuffer(35052,y.handle||y),k.texImage2D(r,o,u,A,w,l,x,m,h),k.bindBuffer(35052,null);break;case"browser-object":sa(T)?T.texImage2D(r,o,u,A,w,l,x,m,y):T.texImage2D(r,o,u,x,m,y);break;case"compressed":var e,t=Po(y.entries());try{for(t.s();!(e=t.n()).done;){var n=M()(e.value,2),i=n[0],a=n[1];T.compressedTexImage2D(r,i,a.format,a.width,a.height,l,a.data),P+=a.levelSize}}catch(e){t.e(e)}finally{t.f()}break;default:$a(!1,"Unknown image data type")}})),"compressed"===S)this._trackAllocatedMemory(P,"Texture");else if(y&&y.byteLength)this._trackAllocatedMemory(y.byteLength,"Texture");else{var R=So[this.dataFormat]||4,F=ko[this.type]||1;this._trackAllocatedMemory(this.width*this.height*R*F,"Texture")}return this.loaded=!0,this}},{key:"setSubImageData",value:function(e){var t=this,r=e.target,n=void 0===r?this.target:r,i=e.pixels,a=void 0===i?null:i,o=e.data,s=void 0===o?null:o,u=e.x,c=void 0===u?0:u,l=e.y,f=void 0===l?0:l,h=e.width,d=void 0===h?this.width:h,p=e.height,v=void 0===p?this.height:p,y=e.level,g=void 0===y?0:y,m=e.format,b=void 0===m?this.format:m,A=e.type,B=void 0===A?this.type:A,w=e.dataFormat,_=void 0===w?this.dataFormat:w,x=e.compressed,C=void 0!==x&&x,O=e.offset,E=void 0===O?0:O,T=e.border,S=(void 0===T&&this.border,e.parameters),k=void 0===S?{}:S,M=this._deduceParameters({format:b,type:B,dataFormat:_,compressed:C,data:s,width:d,height:v});if(B=M.type,_=M.dataFormat,C=M.compressed,d=M.width,v=M.height,$a(0===this.depth,"texSubImage not supported for 3D textures"),s||(s=a),s&&s.data){var I=s;s=I.data,d=I.shape[0],v=I.shape[1]}s instanceof Eo&&(s=s.handle),this.gl.bindTexture(this.target,this.handle),Qa(this.gl,k,(function(){if(C)t.gl.compressedTexSubImage2D(n,g,c,f,d,v,b,s);else if(null===s)t.gl.texSubImage2D(n,g,c,f,d,v,_,B,null);else if(ArrayBuffer.isView(s))t.gl.texSubImage2D(n,g,c,f,d,v,_,B,s,E);else if(s instanceof Lo){var e=ca(t.gl);e.bindBuffer(35052,s),e.texSubImage2D(n,g,c,f,d,v,_,B,E),e.bindBuffer(35052,null)}else if(sa(t.gl)){ca(t.gl).texSubImage2D(n,g,c,f,d,v,_,B,s)}else t.gl.texSubImage2D(n,g,c,f,_,B,s)})),this.gl.bindTexture(this.target,null)}},{key:"copyFramebuffer",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return ia.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 e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.textureUnit,t=this.gl;return void 0!==e&&(this.textureUnit=e,t.activeTexture(33984+e)),t.bindTexture(this.target,this.handle),e}},{key:"unbind",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.textureUnit,t=this.gl;return void 0!==e&&(this.textureUnit=e,t.activeTexture(33984+e)),t.bindTexture(this.target,null),e}},{key:"_getDataType",value:function(e){var t=e.data,r=e.compressed;return void 0!==r&&r?{data:t,dataType:"compressed"}:null===t?{data:t,dataType:"null"}:ArrayBuffer.isView(t)?{data:t,dataType:"typed-array"}:t instanceof Eo?{data:t.handle,dataType:"buffer"}:t instanceof Lo?{data:t,dataType:"buffer"}:{data:t,dataType:"browser-object"}}},{key:"_deduceParameters",value:function(e){var t=e.format,r=e.data,n=e.width,i=e.height,a=e.dataFormat,o=e.type,s=e.compressed,u=To[t];a=a||u&&u.dataFormat,o=o||u&&u.types[0],s=s||u&&u.compressed;var c=this._deduceImageSize(r,n,i);return{dataFormat:a,type:o,compressed:s,width:n=c.width,height:i=c.height,format:t,data:r}}},{key:"_deduceImageSize",value:function(e,t,r){var n;return $a(n="undefined"!=typeof ImageData&&e instanceof ImageData?{width:e.width,height:e.height}:"undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement?{width:e.naturalWidth,height:e.naturalHeight}:"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement?{width:e.width,height:e.height}:"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap?{width:e.width,height:e.height}:"undefined"!=typeof HTMLVideoElement&&e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:e?{width:t,height:r}:{width:t>=0?t:1,height:r>=0?r:1},"Could not deduced texture size"),$a(void 0===t||n.width===t,"Deduced texture width does not match supplied width"),$a(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(e){switch(e){case 4096:return this.width;case 4097:return this.height;default:this.gl.bindTexture(this.target,this.handle);var t=this.gl.getTexParameter(this.target,e);return this.gl.bindTexture(this.target,null),t}}},{key:"_setParameter",value:function(e,t){switch(this.gl.bindTexture(this.target,this.handle),t=this._getNPOTParam(e,t),e){case 33082:case 33083:this.gl.texParameterf(this.handle,e,t);break;case 4096:case 4097:$a(!1);break;default:this.gl.texParameteri(this.target,e,t)}return this.gl.bindTexture(this.target,null),this}},{key:"_isNPOT",value:function(){return!sa(this.gl)&&(!(!this.width||!this.height)&&(!io(this.width)||!io(this.height)))}},{key:"_updateForNPOT",value:function(e){void 0===e[this.gl.TEXTURE_MIN_FILTER]&&(e[this.gl.TEXTURE_MIN_FILTER]=this.gl.LINEAR),void 0===e[this.gl.TEXTURE_WRAP_S]&&(e[this.gl.TEXTURE_WRAP_S]=this.gl.CLAMP_TO_EDGE),void 0===e[this.gl.TEXTURE_WRAP_T]&&(e[this.gl.TEXTURE_WRAP_T]=this.gl.CLAMP_TO_EDGE)}},{key:"_getNPOTParam",value:function(e,t){if(this._isNPOT())switch(e){case 10241:-1===Do.indexOf(t)&&(t=9729);break;case 10242:case 10243:33071!==t&&(t=33071)}return t}}],[{key:"isSupported",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.format,n=t.linearFiltering,i=!0;return r&&(i=(i=i&&Mo(e,r))&&(!n||Io(e,r))),i}}]),n}(uo,Symbol.toStringTag),Go="";function Uo(e,t){return $a("string"==typeof e),e=Go+e,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(e,".")))},i.crossOrigin=t&&t.crossOrigin||"anonymous",i.src=e}catch(e){n(e)}}))}function No(e){var t=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(e){return!1}}();return function(){var r,n=m()(e);if(t){var i=m()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return y()(this,r)}}var Ho,Jo=function(e,t){p()(n,e);var r=No(n);function n(e){var t;h()(this,n);var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return ua(e),(i instanceof Promise||"string"==typeof i)&&(i={data:i}),"string"==typeof i.data&&(i=Object.assign({},i,{data:Uo(i.data)})),(t=r.call(this,e,Object.assign({},i,{target:3553}))).initialize(i),Object.seal(yi()(t)),t}return C()(n,[{key:t,get:function(){return"Texture2D"}}],[{key:"isSupported",value:function(e,t){return jo.isSupported(e,t)}}]),n}(jo,Symbol.toStringTag),Vo="EXT_color_buffer_float",zo=(Ho={},A()(Ho,33189,{bpp:2}),A()(Ho,33190,{gl2:!0,bpp:3}),A()(Ho,36012,{gl2:!0,bpp:4}),A()(Ho,36168,{bpp:1}),A()(Ho,34041,{bpp:4}),A()(Ho,35056,{gl2:!0,bpp:4}),A()(Ho,36013,{gl2:!0,bpp:5}),A()(Ho,32854,{bpp:2}),A()(Ho,36194,{bpp:2}),A()(Ho,32855,{bpp:2}),A()(Ho,33321,{gl2:!0,bpp:1}),A()(Ho,33330,{gl2:!0,bpp:1}),A()(Ho,33329,{gl2:!0,bpp:1}),A()(Ho,33332,{gl2:!0,bpp:2}),A()(Ho,33331,{gl2:!0,bpp:2}),A()(Ho,33334,{gl2:!0,bpp:4}),A()(Ho,33333,{gl2:!0,bpp:4}),A()(Ho,33323,{gl2:!0,bpp:2}),A()(Ho,33336,{gl2:!0,bpp:2}),A()(Ho,33335,{gl2:!0,bpp:2}),A()(Ho,33338,{gl2:!0,bpp:4}),A()(Ho,33337,{gl2:!0,bpp:4}),A()(Ho,33340,{gl2:!0,bpp:8}),A()(Ho,33339,{gl2:!0,bpp:8}),A()(Ho,32849,{gl2:!0,bpp:3}),A()(Ho,32856,{gl2:!0,bpp:4}),A()(Ho,32857,{gl2:!0,bpp:4}),A()(Ho,36220,{gl2:!0,bpp:4}),A()(Ho,36238,{gl2:!0,bpp:4}),A()(Ho,36975,{gl2:!0,bpp:4}),A()(Ho,36214,{gl2:!0,bpp:8}),A()(Ho,36232,{gl2:!0,bpp:8}),A()(Ho,36226,{gl2:!0,bpp:16}),A()(Ho,36208,{gl2:!0,bpp:16}),A()(Ho,33325,{gl2:Vo,bpp:2}),A()(Ho,33327,{gl2:Vo,bpp:4}),A()(Ho,34842,{gl2:Vo,bpp:8}),A()(Ho,33326,{gl2:Vo,bpp:4}),A()(Ho,33328,{gl2:Vo,bpp:8}),A()(Ho,34836,{gl2:Vo,bpp:16}),A()(Ho,35898,{gl2:Vo,bpp:4}),Ho);function Ko(e){var t=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(e){return!1}}();return function(){var r,n=m()(e);if(t){var i=m()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return y()(this,r)}}function qo(e,t,r){var n=r[t];if(!n)return!1;var i=sa(e)&&n.gl2||n.gl1;return"string"==typeof i?e.getExtension(i):i}var Xo=function(e,t){p()(n,e);var r=Ko(n);function n(e){var t;h()(this,n);var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(t=r.call(this,e,i)).initialize(i),Object.seal(yi()(t)),t}return C()(n,[{key:t,get:function(){return"Renderbuffer"}},{key:"initialize",value:function(e){var t=e.format,r=e.width,n=void 0===r?1:r,i=e.height,a=void 0===i?1:i,o=e.samples,s=void 0===o?0:o;return $a(t,"Needs format"),this._trackDeallocatedMemory(),this.gl.bindRenderbuffer(36161,this.handle),0!==s&&sa(this.gl)?this.gl.renderbufferStorageMultisample(36161,s,t,n,a):this.gl.renderbufferStorage(36161,t,n,a),this.format=t,this.width=n,this.height=a,this.samples=s,this._trackAllocatedMemory(this.width*this.height*(this.samples||1)*zo[this.format].bpp),this}},{key:"resize",value:function(e){var t=e.width,r=e.height;return t!==this.width||r!==this.height?this.initialize({width:t,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(e){this.gl.bindRenderbuffer(36161,e)}},{key:"_syncHandle",value:function(e){this.format=this.getParameter(36164),this.width=this.getParameter(36162),this.height=this.getParameter(36163),this.samples=this.getParameter(36011)}},{key:"_getParameter",value:function(e){return this.gl.bindRenderbuffer(36161,this.handle),this.gl.getRenderbufferParameter(36161,e)}}],[{key:"isSupported",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{format:null},r=t.format;return!r||qo(e,r,zo)}},{key:"getSamplesForFormat",value:function(e,t){var r=t.format;return e.getInternalformatParameter(36161,r,32937)}}]),n}(uo,Symbol.toStringTag);function Qo(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.framebuffer,n=void 0===r?null:r,i=t.color,a=void 0===i?null:i,o=t.depth,s=void 0===o?null:o,u=t.stencil,c=void 0===u?null:u,l={};n&&(l.framebuffer=n);var f=0;a&&(f|=16384,!0!==a&&(l.clearColor=a)),s&&(f|=256,!0!==s&&(l.clearDepth=s)),c&&(f|=1024,!0!==s&&(l.clearStencil=s)),$a(0!==f,"clear: bad arguments"),Qa(e,l,(function(){e.clear(f)}))}function Wo(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.framebuffer,n=void 0===r?null:r,i=t.buffer,a=void 0===i?6144:i,o=t.drawBuffer,s=void 0===o?0:o,u=t.value,c=void 0===u?[0,0,0,0]:u;ca(e),Qa(e,{framebuffer:n},(function(){switch(a){case 6144:switch(c.constructor){case Int32Array:e.clearBufferiv(a,s,c);break;case Uint32Array:e.clearBufferuiv(a,s,c);break;case Float32Array:default:e.clearBufferfv(a,s,c)}break;case 6145:e.clearBufferfv(6145,0,[c]);break;case 6146:e.clearBufferiv(6146,0,[c]);break;case 34041:var t=M()(c,2),r=t[0],n=t[1];e.clearBufferfi(34041,0,r,n);break;default:$a(!1,"clear: bad arguments")}}))}function Zo(e){switch(e){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 $a(!1),0}}function Yo(e){var t=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(e){return!1}}();return function(){var r,n=m()(e);if(t){var i=m()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return y()(this,r)}}var $o=[34069,34070,34071,34072,34073,34074],es=function(e,t){p()(i,e);var r,n=Yo(i);function i(e){var t;h()(this,i);var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return ua(e),(t=n.call(this,e,Object.assign({},r,{target:34067}))).initialize(r),Object.seal(yi()(t)),t}return C()(i,[{key:t,get:function(){return"TextureCube"}},{key:"initialize",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.mipmaps,n=void 0===r||r,i=t.parameters,a=void 0===i?{}:i;return this.opts=t,this.setCubeMapImageData(t).then((function(){e.loaded=!0,n&&e.generateMipmap(t),e.setParameters(a)})),this}},{key:"subImage",value:function(e){var t=e.face,r=e.data,n=e.x,i=void 0===n?0:n,a=e.y,o=void 0===a?0:a,s=e.mipmapLevel,u=void 0===s?0:s;return this._subImage({target:t,data:r,x:i,y:o,mipmapLevel:u})}},{key:"setCubeMapImageData",value:(r=Me()(Pe.a.mark((function e(t){var r,n,i,a,o,s,u,c,l,f,h,d,p,v=this;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.width,n=t.height,i=t.pixels,a=t.data,o=t.border,s=void 0===o?0:o,u=t.format,c=void 0===u?6408:u,l=t.type,f=void 0===l?5121:l,h=this.gl,d=i||a,e.next=5,Promise.all($o.map((function(e){var t=d[e];return Promise.all(Array.isArray(t)?t:[t])})));case 5:p=e.sent,this.bind(),$o.forEach((function(e,t){p[t].length>1&&!1!==v.opts.mipmaps&&ia.warn("".concat(v.id," has mipmap and multiple LODs."))(),p[t].forEach((function(t,i){r&&n?h.texImage2D(e,i,c,r,n,s,c,f,t):h.texImage2D(e,i,c,c,f,t)}))})),this.unbind();case 9:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"setImageDataForFace",value:function(e){var t=this,r=e.face,n=e.width,i=e.height,a=e.pixels,o=e.data,s=e.border,u=void 0===s?0:s,c=e.format,l=void 0===c?6408:c,f=e.type,h=void 0===f?5121:f,d=this.gl,p=a||o;return this.bind(),p instanceof Promise?p.then((function(n){return t.setImageDataForFace(Object.assign({},e,{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}(jo,Symbol.toStringTag);function ts(e){var t=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(e){return!1}}();return function(){var r,n=m()(e);if(t){var i=m()(this).constructor;Reflect.construct(n,arguments,i)}else n.apply(this,arguments);return y()(this,r)}}es.FACES=$o;Symbol.toStringTag;function rs(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.sourceX,n=void 0===r?0:r,i=t.sourceY,a=void 0===i?0:i,o=t.sourceFormat,s=void 0===o?6408:o,u=t.sourceAttachment,c=void 0===u?36064:u,l=t.target,f=void 0===l?null:l,h=t.sourceWidth,d=t.sourceHeight,p=t.sourceType,v=is(e),y=v.framebuffer,g=v.deleteFramebuffer;$a(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),$a(A[c]),f=as(f,p=p||A[c].type,s,h,d),p=p||fo(f);var B=m.bindFramebuffer(36160,b);return m.readPixels(n,a,h,d,s,p,f),m.bindFramebuffer(36160,B||null),g&&y.delete(),f}function ns(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.sourceAttachment,n=void 0===r?36064:r,i=t.targetMaxHeight,a=void 0===i?Number.MAX_SAFE_INTEGER:i,o=rs(e,{sourceAttachment:n}),s=e.width,u=e.height;u>a;){var c=vo({data:o,width:s,height:u});o=c.data,s=c.width,u=c.height}po({data:o,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(o),f.putImageData(h,0,0),l.toDataURL()}function is(e){return e instanceof cs?{framebuffer:e,deleteFramebuffer:!1}:{framebuffer:(t=e,n=t.gl,i=t.width,a=t.height,o=t.id,new cs(n,Object.assign({},r,{id:"framebuffer-for-".concat(o),width:i,height:a,attachments:A()({},36064,t)}))),deleteFramebuffer:!0};var t,r,n,i,a,o}function as(e,t,r,n,i){return e||new(ho(t=t||5121,{clamped:!1}))(n*i*Zo(r))}function os(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return ss(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ss(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function ss(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function us(e){var t=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(e){return!1}}();return function(){var r,n=m()(e);if(t){var i=m()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return y()(this,r)}}var cs=function(e,t){p()(n,e);var r=us(n);function n(e){var t;h()(this,n);var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(t=r.call(this,e,i)).width=null,t.height=null,t.attachments={},t.readBuffer=36064,t.drawBuffers=[36064],t.ownResources=[],t.initialize(i),Object.seal(yi()(t)),t}return C()(n,[{key:t,get:function(){return"Framebuffer"}},{key:"MAX_COLOR_ATTACHMENTS",get:function(){var e=ca(this.gl);return e.getParameter(e.MAX_COLOR_ATTACHMENTS)}},{key:"MAX_DRAW_BUFFERS",get:function(){var e=ca(this.gl);return e.getParameter(e.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(e){var t=e.width,r=void 0===t?1:t,n=e.height,i=void 0===n?1:n,a=e.attachments,o=void 0===a?null:a,s=e.color,u=void 0===s||s,c=e.depth,l=void 0===c||c,f=e.stencil,h=void 0!==f&&f,d=e.check,p=void 0===d||d,v=e.readBuffer,y=void 0===v?void 0:v,g=e.drawBuffers,m=void 0===g?void 0:g;if($a(r>=0&&i>=0,"Width and height need to be integers"),this.width=r,this.height=i,o)for(var b in o){var A=o[b];(Array.isArray(A)?A[0]:A).resize({width:r,height:i})}else o=this._createDefaultAttachments(u,l,h,r,i);this.update({clearAttachments:!0,attachments:o,readBuffer:y,drawBuffers:m}),o&&p&&this.checkStatus()}},{key:"delete",value:function(){var e,t=os(this.ownResources);try{for(t.s();!(e=t.n()).done;){e.value.delete()}}catch(e){t.e(e)}finally{t.f()}return ci()(m()(n.prototype),"delete",this).call(this),this}},{key:"update",value:function(e){var t=e.attachments,r=void 0===t?{}:t,n=e.readBuffer,i=e.drawBuffers,a=e.clearAttachments,o=void 0!==a&&a,s=e.resizeAttachments,u=void 0===s||s;this.attach(r,{clearAttachments:o,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 e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.width,r=e.height;if(null===this.handle)return $a(void 0===t&&void 0===r),this.width=this.gl.drawingBufferWidth,this.height=this.gl.drawingBufferHeight,this;for(var n in void 0===t&&(t=this.gl.drawingBufferWidth),void 0===r&&(r=this.gl.drawingBufferHeight),t!==this.width&&r!==this.height&&ia.log(2,"Resizing framebuffer ".concat(this.id," to ").concat(t,"x").concat(r))(),this.attachments)this.attachments[n].resize({width:t,height:r});return this.width=t,this.height=r,this}},{key:"attach",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=r.clearAttachments,i=void 0!==n&&n,a=r.resizeAttachments,o=void 0===a||a,s={};i&&Object.keys(this.attachments).forEach((function(e){s[e]=null})),Object.assign(s,e);var u=this.gl.bindFramebuffer(36160,this.handle);for(var c in s){$a(void 0!==c,"Misspelled framebuffer binding point?");var l=Number(c),f=s[l],h=f;if(h)if(h instanceof Xo)this._attachRenderbuffer({attachment:l,renderbuffer:h});else if(Array.isArray(f)){var d=M()(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);o&&h&&h.resize({width:this.width,height:this.height})}this.gl.bindFramebuffer(36160,u||null),Object.assign(this.attachments,e),Object.keys(this.attachments).filter((function(e){return!t.attachments[e]})).forEach((function(e){delete t.attachments[e]}))}},{key:"checkStatus",value:function(){this.gl;var e=this.getStatus();if(36053!==e)throw new Error(function(e){return(cs.STATUS||{})[e]||"Framebuffer error ".concat(e)}(e));return this}},{key:"getStatus",value:function(){var e=this.gl,t=e.bindFramebuffer(36160,this.handle),r=e.checkFramebufferStatus(36160);return e.bindFramebuffer(36160,t||null),r}},{key:"clear",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.color,n=t.depth,i=t.stencil,a=t.drawBuffers,o=void 0===a?[]:a,s=this.gl.bindFramebuffer(36160,this.handle);return(r||n||i)&&Qo(this.gl,{color:r,depth:n,stencil:i}),o.forEach((function(t,r){Wo(e.gl,{drawBuffer:r,value:t})})),this.gl.bindFramebuffer(36160,s||null),this}},{key:"readPixels",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return ia.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 ia.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 ia.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 ia.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 ia.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 ia.error("Framebuffer.blit({...}) is no logner supported, use blit(source, target, opts)")(),null}},{key:"invalidate",value:function(e){var t=e.attachments,r=void 0===t?[]:t,n=e.x,i=void 0===n?0:n,a=e.y,o=void 0===a?0:a,s=e.width,u=e.height,c=ca(this.gl),l=c.bindFramebuffer(36008,this.handle);return 0===i&&0===o&&void 0===s&&void 0===u?c.invalidateFramebuffer(36008,r):c.invalidateFramebuffer(36008,r,i,o,s,u),c.bindFramebuffer(36008,l),this}},{key:"getAttachmentParameter",value:function(e,t,r){var n=this._getAttachmentParameterFallback(t);return null===n&&(this.gl.bindFramebuffer(36160,this.handle),n=this.gl.getFramebufferAttachmentParameter(36160,e,t),this.gl.bindFramebuffer(36160,null)),r&&n>1e3&&(n=to(this.gl,n)),n}},{key:"getAttachmentParameters",value:function(){var e,t=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={},a=os(n);try{for(a.s();!(e=a.n()).done;){var o=e.value,s=r?to(this.gl,o):o;i[s]=this.getAttachmentParameter(t,o,r)}}catch(e){a.e(e)}finally{a.f()}return i}},{key:"getParameters",value:function(){for(var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=Object.keys(this.attachments),r={},n=0,i=t;n<i.length;n++){var a=i[n],o=Number(a),s=e?to(this.gl,o):o;r[s]=this.getAttachmentParameters(o,e)}return r}},{key:"show",value:function(){return"undefined"!=typeof window&&window.open(ns(this),"luma-debug-texture"),this}},{key:"log",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(e>ia.level||"undefined"==typeof window)return this;t=t||"Framebuffer ".concat(this.id);var r=ns(this,{targetMaxHeight:100});return ia.image({logLevel:e,message:t,image:r},t)(),this}},{key:"bind",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.target,r=void 0===t?36160:t;return this.gl.bindFramebuffer(r,this.handle),this}},{key:"unbind",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.target,r=void 0===t?36160:t;return this.gl.bindFramebuffer(r,null),this}},{key:"_createDefaultAttachments",value:function(e,t,r,n,i){var a,o=null;e&&((o=o||{})[36064]=new Jo(this.gl,{id:"".concat(this.id,"-color0"),pixels:null,format:6408,type:5121,width:n,height:i,mipmaps:!1,parameters:(a={},A()(a,10241,9729),A()(a,10240,9729),A()(a,10242,33071),A()(a,10243,33071),a)}),this.ownResources.push(o[36064]));return t&&r?((o=o||{})[33306]=new Xo(this.gl,{id:"".concat(this.id,"-depth-stencil"),format:35056,width:n,height:111}),this.ownResources.push(o[33306])):t?((o=o||{})[36096]=new Xo(this.gl,{id:"".concat(this.id,"-depth"),format:33189,width:n,height:i}),this.ownResources.push(o[36096])):r&&$a(!1),o}},{key:"_unattach",value:function(e){var t=this.attachments[e];t&&(t instanceof Xo?this.gl.framebufferRenderbuffer(36160,e,36161,null):this.gl.framebufferTexture2D(36160,e,3553,null,0),delete this.attachments[e])}},{key:"_attachRenderbuffer",value:function(e){var t=e.attachment,r=void 0===t?36064:t,n=e.renderbuffer;this.gl.framebufferRenderbuffer(36160,r,36161,n.handle),this.attachments[r]=n}},{key:"_attachTexture",value:function(e){var t=e.attachment,r=void 0===t?36064:t,n=e.texture,i=e.layer,a=e.level,o=this.gl;switch(o.bindTexture(n.target,n.handle),n.target){case 35866:case 32879:ca(o).framebufferTextureLayer(36160,r,n.target,a,i);break;case 34067:var s=function(e){return e<34069?e+34069:e}(i);o.framebufferTexture2D(36160,r,s,n.handle,a);break;case 3553:o.framebufferTexture2D(36160,r,3553,n.handle,a);break;default:$a(!1,"Illegal texture type")}o.bindTexture(n.target,null),this.attachments[r]=n}},{key:"_setReadBuffer",value:function(e){var t,r=sa(t=this.gl)?t:null;r?r.readBuffer(e):$a(36064===e||1029===e,"Multiple render targets not supported"),this.readBuffer=e}},{key:"_setDrawBuffers",value:function(e){var t=this.gl,r=ca(t);if(r)r.drawBuffers(e);else{var n=t.getExtension("WEBGL_draw_buffers");n?n.drawBuffersWEBGL(e):$a(1===e.length&&(36064===e[0]||1029===e[0]),"Multiple render targets not supported")}this.drawBuffers=e}},{key:"_getAttachmentParameterFallback",value:function(e){var t=function(e){for(var t in e.luma=e.luma||{},e.luma.caps=e.luma.caps||{},Ps)void 0===e.luma.caps[t]&&(e.luma.caps[t]=Ls(e,t));return e.luma.caps}(this.gl);switch(e){case 36052:return t.WEBGL2?null:0;case 33298:case 33299:case 33300:case 33301:case 33302:case 33303:return t.WEBGL2?null:8;case 33297:return t.WEBGL2?null:5125;case 33296:return t.WEBGL2||t.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(e){return this.gl.bindFramebuffer(36160,e)}}],[{key:"isSupported",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.colorBufferFloat,n=t.colorBufferHalfFloat,i=!0;return r&&(i=Boolean(e.getExtension("EXT_color_buffer_float")||e.getExtension("WEBGL_color_buffer_float")||e.getExtension("OES_texture_float"))),n&&(i=i&&Boolean(e.getExtension("EXT_color_buffer_float")||e.getExtension("EXT_color_buffer_half_float"))),i}},{key:"getDefaultFramebuffer",value:function(e){return e.luma=e.luma||{},e.luma.defaultFramebuffer=e.luma.defaultFramebuffer||new n(e,{id:"default-framebuffer",handle:null,attachments:{}}),e.luma.defaultFramebuffer}}]),n}(uo,Symbol.toStringTag);var ls;cs.ATTACHMENT_PARAMETERS=[36049,36048,33296,33298,33299,33300,33301,33302,33303];var fs="WEBGL2",hs="VERTEX_ARRAY_OBJECT",ds="TIMER_QUERY",ps="INSTANCED_RENDERING",vs="MULTIPLE_RENDER_TARGETS",ys="ELEMENT_INDEX_UINT32",gs="BLEND_EQUATION_MINMAX",ms="FLOAT_BLEND",bs="COLOR_ENCODING_SRGB",As="TEXTURE_DEPTH",Bs="TEXTURE_FLOAT",ws="TEXTURE_HALF_FLOAT",_s="TEXTURE_FILTER_LINEAR_FLOAT",xs="TEXTURE_FILTER_LINEAR_HALF_FLOAT",Cs="TEXTURE_FILTER_ANISOTROPIC",Os="COLOR_ATTACHMENT_RGBA32F",Es="COLOR_ATTACHMENT_FLOAT",Ts="COLOR_ATTACHMENT_HALF_FLOAT",Ss="GLSL_FRAG_DATA",ks="GLSL_FRAG_DEPTH",Ms="GLSL_DERIVATIVES",Is="GLSL_TEXTURE_LOD";var Ps=(ls={},A()(ls,fs,[!1,!0]),A()(ls,hs,["OES_vertex_array_object",!0]),A()(ls,ds,["EXT_disjoint_timer_query","EXT_disjoint_timer_query_webgl2"]),A()(ls,ps,["ANGLE_instanced_arrays",!0]),A()(ls,vs,["WEBGL_draw_buffers",!0]),A()(ls,ys,["OES_element_index_uint",!0]),A()(ls,gs,["EXT_blend_minmax",!0]),A()(ls,ms,["EXT_float_blend"]),A()(ls,bs,["EXT_sRGB",!0]),A()(ls,As,["WEBGL_depth_texture",!0]),A()(ls,Bs,["OES_texture_float",!0]),A()(ls,ws,["OES_texture_half_float",!0]),A()(ls,_s,["OES_texture_float_linear"]),A()(ls,xs,["OES_texture_half_float_linear"]),A()(ls,Cs,["EXT_texture_filter_anisotropic"]),A()(ls,Os,[function(e){var t=new Jo(e,{format:6408,type:5126,dataFormat:6408}),r=new cs(e,{id:"test-framebuffer",check:!1,attachments:A()({},36064,t)}),n=r.getStatus();return t.delete(),r.delete(),36053===n},"EXT_color_buffer_float"]),A()(ls,Es,[!1,"EXT_color_buffer_float"]),A()(ls,Ts,["EXT_color_buffer_half_float"]),A()(ls,Ss,["WEBGL_draw_buffers",!0]),A()(ls,ks,["EXT_frag_depth",!0]),A()(ls,Ms,["OES_standard_derivatives",!0]),A()(ls,Is,["EXT_shader_texture_lod",!0]),ls);function Rs(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return Fs(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Fs(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function Fs(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Ds(e,t){return function(e,t){return(t=Array.isArray(t)?t:[t]).every((function(t){return Ls(e,t)}))}(e,t)}function Ls(e,t){return e.luma=e.luma||{},e.luma.caps=e.luma.caps||{},void 0===e.luma.caps[t]&&(e.luma.caps[t]=function(e,t){var r,n=Ps[t];$a(n,t);var i=sa(e)&&n[1]||n[0];if("function"==typeof i)r=i(e);else if(Array.isArray(i)){r=!0;var a,o=Rs(i);try{for(o.s();!(a=o.n()).done;){var s=a.value;r=r&&Boolean(e.getExtension(s))}}catch(e){o.e(e)}finally{o.f()}}else"string"==typeof i?r=Boolean(e.getExtension(i)):"boolean"==typeof i?r=i:$a(!1);return r}(e,t)),e.luma.caps[t]||ia.log(2,"Feature: ".concat(t," not supported"))(),e.luma.caps[t]}function js(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Gs(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?js(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):js(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Us=function(){function e(t,r){h()(this,e);var n=r.attributes,i=r.material,a=r.pbrDebug,o=r.imageBasedLightingEnvironment,s=r.lights,u=r.useTangents;this.gl=t,this.defines={MANUAL_SRGB:1,SRGB_FAST_APPROXIMATION:1},Ds(t,Is)&&(this.defines.USE_TEX_LOD=1),this.uniforms={u_Camera:[0,0,0],u_MetallicRoughnessValues:[1,1]},this.parameters={},this.generatedTextures=[],o&&(this.uniforms.u_DiffuseEnvSampler=o.getDiffuseEnvSampler(),this.uniforms.u_SpecularEnvSampler=o.getSpecularEnvSampler(),this.uniforms.u_brdfLUT=o.getBrdfTexture(),this.uniforms.u_ScaleIBLAmbient=[1,1]),a&&(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(o,"USE_IBL"),this.defineIfPresent(s,"USE_LIGHTS"),this.defineIfPresent(a,"PBR_DEBUG"),i&&this.parseMaterial(i)}return C()(e,[{key:"defineIfPresent",value:function(e,t){e&&(this.defines[t]=1)}},{key:"parseTexture",value:function(e,t){var r,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=e.texture&&e.texture.sampler&&e.texture.sampler.parameters||{},a=e.texture.source.image,o={};a.compressed?(r=a,o=A()({},this.gl.TEXTURE_MIN_FILTER,a.data.length>1?this.gl.LINEAR_MIPMAP_NEAREST:this.gl.LINEAR)):r={data:a};var s=new Jo(this.gl,Gs({id:e.name||e.id,parameters:Gs(Gs({},i),o),pixelStore:A()({},this.gl.UNPACK_FLIP_Y_WEBGL,!1)},r));this.uniforms[t]=s,this.defineIfPresent(n,n),this.generatedTextures.push(s)}},{key:"parsePbrMetallicRoughness",value:function(e){e.baseColorTexture&&this.parseTexture(e.baseColorTexture,"u_BaseColorSampler","HAS_BASECOLORMAP"),this.uniforms.u_BaseColorFactor=e.baseColorFactor||[1,1,1,1],e.metallicRoughnessTexture&&this.parseTexture(e.metallicRoughnessTexture,"u_MetallicRoughnessSampler","HAS_METALROUGHNESSMAP");var t=e.metallicFactor,r=void 0===t?1:t,n=e.roughnessFactor,i=void 0===n?1:n;this.uniforms.u_MetallicRoughnessValues=[r,i]}},{key:"parseMaterial",value:function(e){if(this.uniforms.pbr_uUnlit=Boolean(e.unlit),e.pbrMetallicRoughness&&this.parsePbrMetallicRoughness(e.pbrMetallicRoughness),e.normalTexture){this.parseTexture(e.normalTexture,"u_NormalSampler","HAS_NORMALMAP");var t=e.normalTexture.scale,r=void 0===t?1:t;this.uniforms.u_NormalScale=r}if(e.occlusionTexture){this.parseTexture(e.occlusionTexture,"u_OcclusionSampler","HAS_OCCLUSIONMAP");var n=e.occlusionTexture.strength,i=void 0===n?1:n;this.uniforms.u_OcclusionStrength=i}if(e.emissiveTexture&&(this.parseTexture(e.emissiveTexture,"u_EmissiveSampler","HAS_EMISSIVEMAP"),this.uniforms.u_EmissiveFactor=e.emissiveFactor||[0,0,0]),"MASK"===e.alphaMode){var a=e.alphaCutoff,o=void 0===a?.5:a;this.defines.ALPHA_CUTOFF=1,this.uniforms.u_AlphaCutoff=o}else"BLEND"===e.alphaMode&&(ia.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(e){return e.delete()}))}}]),e}();function Ns(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Hs(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ns(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ns(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Js(e){var t=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(e){return!1}}();return function(){var r,n=m()(e);if(t){var i=m()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return y()(this,r)}}var Vs=function(e){p()(r,e);var t=Js(r);function r(){return h()(this,r),t.apply(this,arguments)}return C()(r,[{key:"getShaders",value:function(){var e=ci()(m()(r.prototype),"getShaders",this).call(this);return e.modules.push(Ri.pbr),Hs(Hs({},e),{},{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 e=this.props.featureIds;ci()(m()(r.prototype),"initializeState",this).call(this);var t=this.getAttributeManager();e&&t.add({featureIdsPickingColors:{type:5121,size:3,noAlloc:!0,update:this.calculateFeatureIdsPickingColors}})}},{key:"updateState",value:function(e){ci()(m()(r.prototype),"updateState",this).call(this,e);var t=e.props,n=e.oldProps;t.pbrMaterial!==n.pbrMaterial&&this.updatePbrMaterialUniforms(t.pbrMaterial)}},{key:"draw",value:function(e){var t=this.props.featureIds;this.state.model&&(this.state.model.setUniforms({u_Camera:this.state.model.getUniforms().project_uCameraPosition,pickFeatureIds:Boolean(t)}),ci()(m()(r.prototype),"draw",this).call(this,e))}},{key:"getModel",value:function(e){var t=this.props,r=t.id,n=t.pbrMaterial,i=this.parseMaterial(n,e);this.setState({materialParser:i});var a,o=this.getShaders();return(a=e.attributes).COLOR_0||a.colors||(a.colors={constant:!0,value:new Float32Array([1,1,1])}),new Ri.Model(this.context.gl,Hs(Hs({},this.getShaders()),{},{id:r,geometry:e,defines:Hs(Hs(Hs({},o.defines),null==i?void 0:i.defines),{},{HAS_UV_REGIONS:e.attributes.uvRegions}),parameters:null==i?void 0:i.parameters,isInstanced:!0}))}},{key:"updatePbrMaterialUniforms",value:function(e){var t=this.state.model;if(t){var r=this.props.mesh,n=this.parseMaterial(e,r);this.setState({materialParser:n}),t.setUniforms(n.uniforms)}}},{key:"parseMaterial",value:function(e,t){var r,n=Boolean(e.pbrMetallicRoughness&&e.pbrMetallicRoughness.baseColorTexture);return null===(r=this.state.materialParser)||void 0===r||r.delete(),new Us(this.context.gl,{attributes:{NORMAL:t.attributes.normals,TEXCOORD_0:t.attributes.texCoords},material:Hs({unlit:n},e),pbrDebug:!1,imageBasedLightingEnvironment:null,lights:!0,useTangents:!1})}},{key:"calculateFeatureIdsPickingColors",value:function(e){for(var t=this.props.featureIds,r=new Uint8ClampedArray(t.length*e.size),n=[],i=0;i<t.length;i++)this.encodePickingColor(t[i],n),r[3*i]=n[0],r[3*i+1]=n[1],r[3*i+2]=n[2];e.value=r}},{key:"finalizeState",value:function(e){var t;ci()(m()(r.prototype),"finalizeState",this).call(this,e),null===(t=this.state.materialParser)||void 0===t||t.delete(),this.setState({materialParser:null})}}]),r}(B.SimpleMeshLayer);A()(Vs,"layerName","MeshLayer"),A()(Vs,"defaultProps",{pbrMaterial:{type:"object",value:null},featureIds:{type:"array",value:null,optional:!0}});var zs=function(e){return"boolean"==typeof e},Ks=function(e){return"function"==typeof e},qs=function(e){return null!==e&&"object"===mi()(e)},Xs=function(e){return qs(e)&&e.constructor==={}.constructor},Qs=function(e){return e&&"function"==typeof e[Symbol.iterator]},Ws=function(e){return e&&"function"==typeof e[Symbol.asyncIterator]},Zs=function(e){return"undefined"!=typeof Response&&e instanceof Response||e&&e.arrayBuffer&&e.text&&e.json},Ys=function(e){return"undefined"!=typeof Blob&&e instanceof Blob},$s=function(e){return function(e){return"undefined"!=typeof ReadableStream&&e instanceof ReadableStream||qs(e)&&Ks(e.tee)&&Ks(e.cancel)&&Ks(e.getReader)}(e)||function(e){return qs(e)&&Ks(e.read)&&Ks(e.pipe)&&zs(e.readable)}(e)};function eu(e,t){if(!e)throw new Error(t||"loader assertion failed.")}function tu(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ru(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?tu(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):tu(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function nu(e){var t;return!!e&&(Array.isArray(e)&&(e=e[0]),Array.isArray(null===(t=e)||void 0===t?void 0:t.extensions))}function iu(e){var t,r,n;return eu(e,"null loader"),eu(nu(e),"invalid loader"),Array.isArray(e)&&(n=e[1],e=ru(ru({},e=e[0]),{},{options:ru(ru({},e.options),n)})),(null!==(t=e)&&void 0!==t&&t.parseTextSync||null!==(r=e)&&void 0!==r&&r.parseText)&&(e.text=!0),e.text||(e.binary=!0),e}var au="",ou={};function su(e){for(var t in ou)if(e.startsWith(t)){var r=ou[t];e=e.replace(t,r)}return e.startsWith("http://")||e.startsWith("https://")||(e="".concat(au).concat(e)),e}var uu=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,cu=/^([-\w.]+\/[-\w.+]+)/;function lu(e){var t=cu.exec(e);return t?t[1]:e}function fu(e){var t=uu.exec(e);return t?t[1]:""}var hu=/\?.*/;function du(e){if(Zs(e)){var t=vu(e.url||"");return{url:t,type:lu(e.headers.get("content-type")||"")||fu(t)}}return Ys(e)?{url:vu(e.name||""),type:e.type||""}:"string"==typeof e?{url:vu(e),type:fu(e)}:{url:"",type:""}}function pu(e){return Zs(e)?e.headers["content-length"]||-1:Ys(e)?e.size:"string"==typeof e?e.length:e instanceof ArrayBuffer?e.byteLength:ArrayBuffer.isView(e)?e.byteLength:-1}function vu(e){return e.replace(hu,"")}function yu(e){return gu.apply(this,arguments)}function gu(){return(gu=Me()(Pe.a.mark((function e(t){var r,n,i,a,o,s,u;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!Zs(t)){e.next=2;break}return e.abrupt("return",t);case 2:return r={},(n=pu(t))>=0&&(r["content-length"]=String(n)),i=du(t),a=i.url,(o=i.type)&&(r["content-type"]=o),e.next=9,wu(t);case 9:return(s=e.sent)&&(r["x-first-bytes"]=s),"string"==typeof t&&(t=(new TextEncoder).encode(t)),u=new Response(t,{headers:r}),Object.defineProperty(u,"url",{value:a}),e.abrupt("return",u);case 15:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function mu(e){return bu.apply(this,arguments)}function bu(){return(bu=Me()(Pe.a.mark((function e(t){var r;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.ok){e.next=5;break}return e.next=3,Au(t);case 3:throw r=e.sent,new Error(r);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Au(e){return Bu.apply(this,arguments)}function Bu(){return(Bu=Me()(Pe.a.mark((function e(t){var r,n,i;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r="Failed to fetch resource ".concat(t.url," (").concat(t.status,"): "),e.prev=1,n=t.headers.get("Content-Type"),i=t.statusText,!n.includes("application/json")){e.next=11;break}return e.t0=i,e.t1=" ",e.next=9,t.text();case 9:e.t2=e.sent,i=e.t0+=e.t1.concat.call(e.t1,e.t2);case 11:r=(r+=i).length>60?"".concat(r.slice(0,60),"..."):r,e.next=17;break;case 15:e.prev=15,e.t3=e.catch(1);case 17:return e.abrupt("return",r);case 18:case"end":return e.stop()}}),e,null,[[1,15]])})))).apply(this,arguments)}function wu(e){return _u.apply(this,arguments)}function _u(){return(_u=Me()(Pe.a.mark((function e(t){var r,n,i,a;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=5,"string"!=typeof t){e.next=3;break}return e.abrupt("return","data:,".concat(t.slice(0,r)));case 3:if(!(t instanceof Blob)){e.next=8;break}return n=t.slice(0,5),e.next=7,new Promise((function(e){var t=new FileReader;t.onload=function(t){var r;return e(null==t?void 0:null===(r=t.target)||void 0===r?void 0:r.result)},t.readAsDataURL(n)}));case 7:return e.abrupt("return",e.sent);case 8:if(!(t instanceof ArrayBuffer)){e.next=12;break}return i=t.slice(0,r),a=xu(i),e.abrupt("return","data:base64,".concat(a));case 12:return e.abrupt("return",null);case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function xu(e){for(var t="",r=new Uint8Array(e),n=0;n<r.byteLength;n++)t+=String.fromCharCode(r[n]);return btoa(t)}function Cu(e,t){return Ou.apply(this,arguments)}function Ou(){return(Ou=Me()(Pe.a.mark((function e(t,r){var n;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("string"!=typeof t){e.next=7;break}return t=su(t),n=r,null!=r&&r.fetch&&"function"!=typeof(null==r?void 0:r.fetch)&&(n=r.fetch),e.next=6,fetch(t,n);case 6:return e.abrupt("return",e.sent);case 7:return e.next=9,yu(t);case 9:return e.abrupt("return",e.sent);case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Eu(){return!("object"===("undefined"==typeof process?"undefined":mi()(process))&&"[object process]"===String(process)&&!process.browser)||function(e){if("undefined"!=typeof window&&"object"===mi()(window.process)&&"renderer"===window.process.type)return!0;if("undefined"!=typeof process&&"object"===mi()(process.versions)&&Boolean(process.versions.electron))return!0;var t="object"===("undefined"==typeof navigator?"undefined":mi()(navigator))&&"string"==typeof navigator.userAgent&&navigator.userAgent,r=e||t;return!!(r&&r.indexOf("Electron")>=0)}()}var Tu=Eu();function Su(e){try{var t=window[e],r="__storage_test__";return t.setItem(r,r),t.removeItem(r),t}catch(e){return null}}var ku=function(){function e(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"sessionStorage";h()(this,e),this.storage=Su(n),this.id=t,this.config={},Object.assign(this.config,r),this._loadConfiguration()}return C()(e,[{key:"getConfiguration",value:function(){return this.config}},{key:"setConfiguration",value:function(e){return this.config={},this.updateConfiguration(e)}},{key:"updateConfiguration",value:function(e){if(Object.assign(this.config,e),this.storage){var t=JSON.stringify(this.config);this.storage.setItem(this.id,t)}return this}},{key:"_loadConfiguration",value:function(){var e={};if(this.storage){var t=this.storage.getItem(this.id);e=t?JSON.parse(t):{}}return Object.assign(this.config,e),this}}]),e}();function Mu(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:600,i=e.src.replace(/\(/g,"%28").replace(/\)/g,"%29");e.width>n&&(r=Math.min(r,n/e.width));var a=e.width*r,o=e.height*r,s=["font-size:1px;","padding:".concat(Math.floor(o/2),"px ").concat(Math.floor(a/2),"px;"),"line-height:".concat(o,"px;"),"background:url(".concat(i,");"),"background-size:".concat(a,"px ").concat(o,"px;"),"color:transparent;"].join("");return["".concat(t," %c+"),s]}var Iu={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 Pu(e){return"string"==typeof e?Iu[e.toUpperCase()]||Iu.WHITE:e}function Ru(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return Fu(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Fu(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function Fu(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Du(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["constructor"],n=Object.getPrototypeOf(e),i=Object.getOwnPropertyNames(n),a=Ru(i);try{var o=function(){var n=t.value;"function"==typeof e[n]&&(r.find((function(e){return n===e}))||(e[n]=e[n].bind(e)))};for(a.s();!(t=a.n()).done;)o()}catch(e){a.e(e)}finally{a.f()}}function Lu(e,t){if(!e)throw new Error(t||"Assertion failed")}var ju={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":mi()(process))&&process},Gu=ju.window||ju.self||ju.global,Uu=ju.process||{};console;function Nu(){var e;if(Tu&&Gu.performance)e=Gu.performance.now();else if(Uu.hrtime){var t=Uu.hrtime();e=1e3*t[0]+t[1]/1e6}else e=Date.now();return e}var Hu={debug:Tu&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},Ju={enabled:!0,level:0};function Vu(){}var zu={},Ku={once:!0};function qu(e){for(var t in e)for(var r in e[t])return r||"untitled";return"empty"}var Xu=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{id:""},r=t.id;h()(this,e),this.id=r,this.VERSION="8.8.25",this._startTs=Nu(),this._deltaTs=Nu(),this.LOG_THROTTLE_TIMEOUT=0,this._storage=new ku("__probe-".concat(this.id,"__"),Ju),this.userData={},this.timeStamp("".concat(this.id," started")),Du(this),Object.seal(this)}return C()(e,[{key:"level",get:function(){return this.getLevel()},set:function(e){this.setLevel(e)}},{key:"isEnabled",value:function(){return this._storage.config.enabled}},{key:"getLevel",value:function(){return this._storage.config.level}},{key:"getTotal",value:function(){return Number((Nu()-this._startTs).toPrecision(10))}},{key:"getDelta",value:function(){return Number((Nu()-this._deltaTs).toPrecision(10))}},{key:"priority",get:function(){return this.level},set:function(e){this.level=e}},{key:"getPriority",value:function(){return this.level}},{key:"enable",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this._storage.updateConfiguration({enabled:e}),this}},{key:"setLevel",value:function(e){return this._storage.updateConfiguration({level:e}),this}},{key:"assert",value:function(e,t){Lu(e,t)}},{key:"warn",value:function(e){return this._getLogFunction(0,e,Hu.warn,arguments,Ku)}},{key:"error",value:function(e){return this._getLogFunction(0,e,Hu.error,arguments)}},{key:"deprecated",value:function(e,t){return this.warn("`".concat(e,"` is deprecated and will be removed in a later version. Use `").concat(t,"` instead"))}},{key:"removed",value:function(e,t){return this.error("`".concat(e,"` has been removed. Use `").concat(t,"` instead"))}},{key:"probe",value:function(e,t){return this._getLogFunction(e,t,Hu.log,arguments,{time:!0,once:!0})}},{key:"log",value:function(e,t){return this._getLogFunction(e,t,Hu.debug,arguments)}},{key:"info",value:function(e,t){return this._getLogFunction(e,t,console.info,arguments)}},{key:"once",value:function(e,t){return this._getLogFunction(e,t,Hu.debug||Hu.info,arguments,Ku)}},{key:"table",value:function(e,t,r){return t?this._getLogFunction(e,t,console.table||Vu,r&&[r],{tag:qu(t)}):Vu}},{key:"image",value:function(e){var t=e.logLevel,n=e.priority,i=e.image,a=e.message,o=void 0===a?"":a,s=e.scale,u=void 0===s?1:s;return this._shouldLog(t||n)?Tu?function(e){var t=e.image,r=e.message,n=void 0===r?"":r,i=e.scale,a=void 0===i?1:i;if("string"==typeof t){var o=new Image;return o.onload=function(){var e,t=Mu(o,n,a);(e=console).log.apply(e,De()(t))},o.src=t,Vu}var s=t.nodeName||"";if("img"===s.toLowerCase()){var u;return(u=console).log.apply(u,De()(Mu(t,n,a))),Vu}if("canvas"===s.toLowerCase()){var c=new Image;return c.onload=function(){var e;return(e=console).log.apply(e,De()(Mu(c,n,a)))},c.src=t.toDataURL(),Vu}return Vu}({image:i,message:o,scale:u}):function(e){var t=e.image,n=(e.message,e.scale),i=void 0===n?1:n,a=null;try{a=r(94)}catch(e){}if(a)return function(){return a(t,{fit:"box",width:"".concat(Math.round(80*i),"%")}).then((function(e){return console.log(e)}))};return Vu}({image:i,message:o,scale:u}):Vu}},{key:"settings",value:function(){console.table?console.table(this._storage.config):console.log(this._storage.config)}},{key:"get",value:function(e){return this._storage.config[e]}},{key:"set",value:function(e,t){this._storage.updateConfiguration(A()({},e,t))}},{key:"time",value:function(e,t){return this._getLogFunction(e,t,console.time?console.time:console.info)}},{key:"timeEnd",value:function(e,t){return this._getLogFunction(e,t,console.timeEnd?console.timeEnd:console.info)}},{key:"timeStamp",value:function(e,t){return this._getLogFunction(e,t,console.timeStamp||Vu)}},{key:"group",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{collapsed:!1},n=r=Wu({logLevel:e,message:t,opts:r}),i=n.collapsed;return r.method=(i?console.groupCollapsed:console.group)||console.info,this._getLogFunction(r)}},{key:"groupCollapsed",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.group(e,t,Object.assign({},r,{collapsed:!0}))}},{key:"groupEnd",value:function(e){return this._getLogFunction(e,"",console.groupEnd||Vu)}},{key:"withGroup",value:function(e,t,r){this.group(e,t)();try{r()}finally{this.groupEnd(e)()}}},{key:"trace",value:function(){console.trace&&console.trace()}},{key:"_shouldLog",value:function(e){return this.isEnabled()&&this.getLevel()>=Qu(e)}},{key:"_getLogFunction",value:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],i=arguments.length>4?arguments[4]:void 0;if(this._shouldLog(e)){var a;i=Wu({logLevel:e,message:t,args:n,opts:i}),Lu(r=r||i.method),i.total=this.getTotal(),i.delta=this.getDelta(),this._deltaTs=Nu();var o=i.tag||i.message;if(i.once){if(zu[o])return Vu;zu[o]=Nu()}return t=Zu(this.id,i.message,i),(a=r).bind.apply(a,[console,t].concat(De()(i.args)))}return Vu}}]),e}();function Qu(e){if(!e)return 0;var t;switch(mi()(e)){case"number":t=e;break;case"object":t=e.logLevel||e.priority||0;break;default:return 0}return Lu(Number.isFinite(t)&&t>=0),t}function Wu(e){var t=e.logLevel,r=e.message;e.logLevel=Qu(t);for(var n=e.args?Array.from(e.args):[];n.length&&n.shift()!==r;);switch(e.args=n,mi()(t)){case"string":case"function":void 0!==r&&n.unshift(r),e.message=t;break;case"object":Object.assign(e,t)}"function"==typeof e.message&&(e.message=e.message());var i=mi()(e.message);return Lu("string"===i||"object"===i),Object.assign(e,e.opts)}function Zu(e,t,r){if("string"==typeof t){var n=r.time?function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8,r=Math.max(t-e.length,0);return"".concat(" ".repeat(r)).concat(e)}((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")):"";t=r.time?"".concat(e,": ").concat(n," ").concat(t):"".concat(e,": ").concat(t),i=t,a=r.color,o=r.background,Tu||"string"!=typeof i||(a&&(a=Pu(a),i="[".concat(a,"m").concat(i,"[39m")),o&&(a=Pu(o),i="[".concat(o+10,"m").concat(i,"[49m"))),t=i}var i,a,o,s;return t}Xu.VERSION="8.8.25";var Yu=new Xu({id:"loaders.gl"}),$u=function(){function e(){h()(this,e)}return C()(e,[{key:"log",value:function(){return function(){}}},{key:"info",value:function(){return function(){}}},{key:"warn",value:function(){return function(){}}},{key:"error",value:function(){return function(){}}}]),e}(),ec=function(){function e(){h()(this,e),Hn(this,"console",void 0),this.console=console}return C()(e,[{key:"log",value:function(){for(var e,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return(e=this.console.log).bind.apply(e,[this.console].concat(r))}},{key:"info",value:function(){for(var e,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return(e=this.console.info).bind.apply(e,[this.console].concat(r))}},{key:"warn",value:function(){for(var e,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return(e=this.console.warn).bind.apply(e,[this.console].concat(r))}},{key:"error",value:function(){for(var e,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return(e=this.console.error).bind.apply(e,[this.console].concat(r))}}]),e}(),tc=("undefined"!=typeof self&&self,"undefined"!=typeof window&&window,"undefined"!=typeof global&&global,"undefined"!=typeof document&&document,Boolean("object"!==("undefined"==typeof process?"undefined":mi()(process))||"[object process]"!==String(process)||process.browser)),rc="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version),nc=(rc&&parseFloat(rc[1]),{fetch:null,mimeType:void 0,nothrow:!1,log:new ec,CDN:"https://unpkg.com/@loaders.gl",worker:!0,maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:tc,_nodeWorkers:!1,_workerType:"",limit:0,_limitMB:0,batchSize:"auto",batchDebounceMs:0,metadata:!1,transforms:[]}),ic={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 ac(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return oc(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return oc(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function oc(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function sc(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function uc(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?sc(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):sc(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function cc(){globalThis.loaders=globalThis.loaders||{};var e=globalThis.loaders;return e._state=e._state||{},e._state}var lc=function(){var e=cc();return e.globalOptions=e.globalOptions||uc({},nc),e.globalOptions};function fc(e,t,r,n){return r=r||[],function(e,t){dc(e,null,nc,ic,t);var r,n=ac(t);try{for(n.s();!(r=n.n()).done;){var i=r.value,a=e&&e[i.id]||{},o=i.options&&i.options[i.id]||{},s=i.deprecatedOptions&&i.deprecatedOptions[i.id]||{};dc(a,i.id,o,s,t)}}catch(e){n.e(e)}finally{n.f()}}(e,r=Array.isArray(r)?r:[r]),vc(t,e,n)}function hc(e,t){var r=lc(),n=e||r;return"function"==typeof n.fetch?n.fetch:qs(n.fetch)?function(e){return Cu(e,n)}:null!=t&&t.fetch?null==t?void 0:t.fetch:Cu}function dc(e,t,r,n,i){var a=t||"Top level",o=t?"".concat(t,"."):"";for(var s in e){var u=!t&&qs(e[s]);if(!(s in r||"baseUri"===s&&!t||"workerUrl"===s&&t))if(s in n)Yu.warn("".concat(a," loader option '").concat(o).concat(s,"' no longer supported, use '").concat(n[s],"'"))();else if(!u){var c=pc(s,i);Yu.warn("".concat(a," loader option '").concat(o).concat(s,"' not recognized. ").concat(c))()}}}function pc(e,t){var r,n=e.toLowerCase(),i="",a=ac(t);try{for(a.s();!(r=a.n()).done;){var o=r.value;for(var s in o.options){if(e===s)return"Did you mean '".concat(o.id,".").concat(s,"'?");var u=s.toLowerCase();(n.startsWith(u)||u.startsWith(n))&&(i=i||"Did you mean '".concat(o.id,".").concat(s,"'?"))}}}catch(e){a.e(e)}finally{a.f()}return i}function vc(e,t,r){var n=uc({},e.options||{});return function(e,t){!t||"baseUri"in e||(e.baseUri=t)}(n,r),null===n.log&&(n.log=new $u),yc(n,lc()),yc(n,t),n}function yc(e,t){for(var r in t)if(r in t){var n=t[r];Xs(n)&&Xs(e[r])?e[r]=uc(uc({},e[r]),t[r]):e[r]=t[r]}}function gc(e,t){if(!e)throw new Error(t||"loaders.gl assertion failed.")}function mc(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"3.2.10";gc(e,"no worker provided");var r=e.version;return!(!t||!r)}var bc={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},Ac=bc.global||bc.self||bc.window||{},Bc="object"!==("undefined"==typeof process?"undefined":mi()(process))||"[object process]"!==String(process)||process.browser,wc="function"==typeof importScripts,_c="undefined"!=typeof window&&void 0!==window.orientation,xc="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version),Cc=(xc&&parseFloat(xc[1]),function e(){h()(this,e)}),Oc=new Map;function Ec(e){gc(e.source&&!e.url||!e.source&&e.url);var t=Oc.get(e.source||e.url);return t||(e.url&&(t=function(e){if(!e.startsWith("http"))return e;return Tc((t=e,"try {\n importScripts('".concat(t,"');\n} catch (error) {\n console.error(error);\n throw error;\n}")));var t}(e.url),Oc.set(e.url,t)),e.source&&(t=Tc(e.source),Oc.set(e.source,t))),gc(t),t}function Tc(e){var t=new Blob([e],{type:"application/javascript"});return URL.createObjectURL(t)}function Sc(e){return!!e&&(e instanceof ArrayBuffer||("undefined"!=typeof MessagePort&&e instanceof MessagePort||("undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap||"undefined"!=typeof OffscreenCanvas&&e instanceof OffscreenCanvas)))}var kc=function(){},Mc=function(){function e(t){h()(this,e),Hn(this,"name",void 0),Hn(this,"source",void 0),Hn(this,"url",void 0),Hn(this,"terminated",!1),Hn(this,"worker",void 0),Hn(this,"onMessage",void 0),Hn(this,"onError",void 0),Hn(this,"_loadableURL","");var r=t.name,n=t.source,i=t.url;gc(n||i),this.name=r,this.source=n,this.url=i,this.onMessage=kc,this.onError=function(e){return console.log(e)},this.worker=Bc?this._createBrowserWorker():this._createNodeWorker()}return C()(e,[{key:"destroy",value:function(){this.onMessage=kc,this.onError=kc,this.worker.terminate(),this.terminated=!0}},{key:"isRunning",get:function(){return Boolean(this.onMessage)}},{key:"postMessage",value:function(e,t){t=t||function e(t){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2?arguments[2]:void 0,i=n||new Set;if(t){if(Sc(t))i.add(t);else if(Sc(t.buffer))i.add(t.buffer);else if(ArrayBuffer.isView(t));else if(r&&"object"===mi()(t))for(var a in t)e(t[a],r,i)}else;return void 0===n?Array.from(i):[]}(e),this.worker.postMessage(e,t)}},{key:"_getErrorFromErrorEvent",value:function(e){var t="Failed to load ";return t+="worker ".concat(this.name," from ").concat(this.url,". "),e.message&&(t+="".concat(e.message," in ")),e.lineno&&(t+=":".concat(e.lineno,":").concat(e.colno)),new Error(t)}},{key:"_createBrowserWorker",value:function(){var e=this;this._loadableURL=Ec({source:this.source,url:this.url});var t=new Worker(this._loadableURL,{name:this.name});return t.onmessage=function(t){t.data?e.onMessage(t.data):e.onError(new Error("No data received"))},t.onerror=function(t){e.onError(e._getErrorFromErrorEvent(t)),e.terminated=!0},t.onmessageerror=function(e){return console.error(e)},t}},{key:"_createNodeWorker",value:function(){var e,t=this;if(this.url){var r=this.url.includes(":/")||this.url.startsWith("/")?this.url:"./".concat(this.url);e=new Cc(r,{eval:!1})}else{if(!this.source)throw new Error("no worker");e=new Cc(this.source,{eval:!0})}return e.on("message",(function(e){t.onMessage(e)})),e.on("error",(function(e){t.onError(e)})),e.on("exit",(function(e){})),e}}],[{key:"isSupported",value:function(){return"undefined"!=typeof Worker&&Bc||!Bc}}]),e}(),Ic=function(){function e(t,r){var n=this;h()(this,e),Hn(this,"name",void 0),Hn(this,"workerThread",void 0),Hn(this,"isRunning",!0),Hn(this,"result",void 0),Hn(this,"_resolve",(function(){})),Hn(this,"_reject",(function(){})),this.name=t,this.workerThread=r,this.result=new Promise((function(e,t){n._resolve=e,n._reject=t}))}return C()(e,[{key:"postMessage",value:function(e,t){this.workerThread.postMessage({source:"loaders.gl",type:e,payload:t})}},{key:"done",value:function(e){gc(this.isRunning),this.isRunning=!1,this._resolve(e)}},{key:"error",value:function(e){gc(this.isRunning),this.isRunning=!1,this._reject(e)}}]),e}();function Pc(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Rc(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Pc(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Pc(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Fc=function(){function e(t){h()(this,e),Hn(this,"name","unnamed"),Hn(this,"source",void 0),Hn(this,"url",void 0),Hn(this,"maxConcurrency",1),Hn(this,"maxMobileConcurrency",1),Hn(this,"onDebug",(function(){})),Hn(this,"reuseWorkers",!0),Hn(this,"props",{}),Hn(this,"jobQueue",[]),Hn(this,"idleQueue",[]),Hn(this,"count",0),Hn(this,"isDestroyed",!1),this.source=t.source,this.url=t.url,this.setProps(t)}var t,r;return C()(e,[{key:"destroy",value:function(){this.idleQueue.forEach((function(e){return e.destroy()})),this.isDestroyed=!0}},{key:"setProps",value:function(e){this.props=Rc(Rc({},this.props),e),void 0!==e.name&&(this.name=e.name),void 0!==e.maxConcurrency&&(this.maxConcurrency=e.maxConcurrency),void 0!==e.maxMobileConcurrency&&(this.maxMobileConcurrency=e.maxMobileConcurrency),void 0!==e.reuseWorkers&&(this.reuseWorkers=e.reuseWorkers),void 0!==e.onDebug&&(this.onDebug=e.onDebug)}},{key:"startJob",value:(r=Me()(Pe.a.mark((function e(t){var r,n,i,a=this,o=arguments;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=o.length>1&&void 0!==o[1]?o[1]:function(e,t,r){return e.done(r)},n=o.length>2&&void 0!==o[2]?o[2]:function(e,t){return e.error(t)},i=new Promise((function(e){return a.jobQueue.push({name:t,onMessage:r,onError:n,onStart:e}),a})),this._startQueuedJob(),e.next=6,i;case 6:return e.abrupt("return",e.sent);case 7:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"_startQueuedJob",value:(t=Me()(Pe.a.mark((function e(){var t,r,n;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.jobQueue.length){e.next=2;break}return e.abrupt("return");case 2:if(t=this._getAvailableWorker()){e.next=5;break}return e.abrupt("return");case 5:if(!(r=this.jobQueue.shift())){e.next=18;break}return this.onDebug({message:"Starting job",name:r.name,workerThread:t,backlog:this.jobQueue.length}),n=new Ic(r.name,t),t.onMessage=function(e){return r.onMessage(n,e.type,e.payload)},t.onError=function(e){return r.onError(n,e)},r.onStart(n),e.prev=12,e.next=15,n.result;case 15:return e.prev=15,this.returnWorkerToQueue(t),e.finish(15);case 18:case"end":return e.stop()}}),e,this,[[12,,15,18]])}))),function(){return t.apply(this,arguments)})},{key:"returnWorkerToQueue",value:function(e){this.isDestroyed||!this.reuseWorkers||this.count>this._getMaxConcurrency()?(e.destroy(),this.count--):this.idleQueue.push(e),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 e="".concat(this.name.toLowerCase()," (#").concat(this.count," of ").concat(this.maxConcurrency,")");return new Mc({name:e,source:this.source,url:this.url})}return null}},{key:"_getMaxConcurrency",value:function(){return _c?this.maxMobileConcurrency:this.maxConcurrency}}],[{key:"isSupported",value:function(){return Mc.isSupported()}}]),e}();function Dc(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return Lc(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Lc(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function Lc(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function jc(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Gc(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?jc(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):jc(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Uc={maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:!0,onDebug:function(){}},Nc=function(){function e(t){h()(this,e),Hn(this,"props",void 0),Hn(this,"workerPools",new Map),this.props=Gc({},Uc),this.setProps(t),this.workerPools=new Map}return C()(e,[{key:"destroy",value:function(){var e,t=Dc(this.workerPools.values());try{for(t.s();!(e=t.n()).done;){e.value.destroy()}}catch(e){t.e(e)}finally{t.f()}this.workerPools=new Map}},{key:"setProps",value:function(e){this.props=Gc(Gc({},this.props),e);var t,r=Dc(this.workerPools.values());try{for(r.s();!(t=r.n()).done;){t.value.setProps(this._getWorkerPoolProps())}}catch(e){r.e(e)}finally{r.f()}}},{key:"getWorkerPool",value:function(e){var t=e.name,r=e.source,n=e.url,i=this.workerPools.get(t);return i||((i=new Fc({name:t,source:r,url:n})).setProps(this._getWorkerPoolProps()),this.workerPools.set(t,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 Mc.isSupported()}},{key:"getWorkerFarm",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e._workerFarm=e._workerFarm||new e({}),e._workerFarm.setProps(t),e._workerFarm}}]),e}();Hn(Nc,"_workerFarm",void 0);function Hc(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t[e.id]||{},n="".concat(e.id,"-worker.js"),i=r.workerUrl;if(i||"compression"!==e.id||(i=t.workerUrl),"test"===t._workerType&&(i="modules/".concat(e.module,"/dist/").concat(n)),!i){var a=e.version;"latest"===a&&(a="latest");var o=a?"@".concat(a):"";i="https://unpkg.com/@loaders.gl/".concat(e.module).concat(o,"/dist/").concat(n)}return gc(i),i}function Jc(e,t){return!!Nc.isSupported()&&(!!(Bc||null!=t&&t._nodeWorkers)&&(e.worker&&(null==t?void 0:t.worker)))}function Vc(e,t,r,n,i){return zc.apply(this,arguments)}function zc(){return(zc=Me()(Pe.a.mark((function e(t,r,n,i,a){var o,s,u,c,l,f;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=t.id,s=Hc(t,n),u=Nc.getWorkerFarm(n),c=u.getWorkerPool({name:o,url:s}),n=JSON.parse(JSON.stringify(n)),i=JSON.parse(JSON.stringify(i||{})),e.next=8,c.startJob("process-on-worker",Kc.bind(null,a));case 8:return(l=e.sent).postMessage("process",{input:r,options:n,context:i}),e.next=12,l.result;case 12:return f=e.sent,e.next=15,f.result;case 15:return e.abrupt("return",e.sent);case 16:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Kc(e,t,r,n){return qc.apply(this,arguments)}function qc(){return(qc=Me()(Pe.a.mark((function e(t,r,n,i){var a,o,s,u,c;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.t0=n,e.next="done"===e.t0?3:"error"===e.t0?5:"process"===e.t0?7:20;break;case 3:return r.done(i),e.abrupt("break",21);case 5:return r.error(new Error(i.error)),e.abrupt("break",21);case 7:return a=i.id,o=i.input,s=i.options,e.prev=8,e.next=11,t(o,s);case 11:u=e.sent,r.postMessage("done",{id:a,result:u}),e.next=19;break;case 15:e.prev=15,e.t1=e.catch(8),c=e.t1 instanceof Error?e.t1.message:"unknown error",r.postMessage("error",{id:a,error:c});case 19:return e.abrupt("break",21);case 20:console.warn("parse-with-worker unknown message ".concat(n));case 21:case"end":return e.stop()}}),e,null,[[8,15]])})))).apply(this,arguments)}var Xc=r(33),Qc=r.n(Xc);r(40);function Wc(e){return e&&"object"===mi()(e)&&e.isBuffer}function Zc(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return Yc(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Yc(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function Yc(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function $c(e){if(Wc(e))return Wc(t=e)?new Uint8Array(t.buffer,t.byteOffset,t.length).slice().buffer:t;var t;if(e instanceof ArrayBuffer)return e;if(ArrayBuffer.isView(e))return 0===e.byteOffset&&e.byteLength===e.buffer.byteLength?e.buffer:e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);if("string"==typeof e){var r=e;return(new TextEncoder).encode(r).buffer}if(e&&"object"===mi()(e)&&e._toArrayBuffer)return e._toArrayBuffer();throw new Error("toArrayBuffer")}function el(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n,i=t.map((function(e){return e instanceof ArrayBuffer?new Uint8Array(e):e})),a=i.reduce((function(e,t){return e+t.byteLength}),0),o=new Uint8Array(a),s=0,u=Zc(i);try{for(u.s();!(n=u.n()).done;){var c=n.value;o.set(c,s),s+=c.byteLength}}catch(e){u.e(e)}finally{u.f()}return o.buffer}function tl(e,t,r){var n=void 0!==r?new Uint8Array(e).subarray(t,t+r):new Uint8Array(e).subarray(t);return new Uint8Array(n).buffer}function rl(e){return nl.apply(this,arguments)}function nl(){return(nl=Me()(Pe.a.mark((function e(t){var r,n,i,a,o,s,u;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=[],n=!1,i=!1,e.prev=3,o=Qc()(t);case 5:return e.next=7,o.next();case 7:if(!(n=!(s=e.sent).done)){e.next=13;break}u=s.value,r.push(u);case 10:n=!1,e.next=5;break;case 13:e.next=19;break;case 15:e.prev=15,e.t0=e.catch(3),i=!0,a=e.t0;case 19:if(e.prev=19,e.prev=20,!n||null==o.return){e.next=24;break}return e.next=24,o.return();case 24:if(e.prev=24,!i){e.next=27;break}throw a;case 27:return e.finish(24);case 28:return e.finish(19);case 29:return e.abrupt("return",el.apply(void 0,r));case 30:case"end":return e.stop()}}),e,null,[[3,15,19,29],[20,,24,28]])})))).apply(this,arguments)}var il=Pe.a.mark(al);function al(e,t){var r,n,i,a,o;return Pe.a.wrap((function(s){for(;;)switch(s.prev=s.next){case 0:r=(null==t?void 0:t.chunkSize)||262144,n=0,i=new TextEncoder;case 3:if(!(n<e.length)){s.next=11;break}return a=Math.min(e.length-n,r),o=e.slice(n,n+a),n+=a,s.next=9,i.encode(o);case 9:s.next=3;break;case 11:case"end":return s.stop()}}),il)}var ol=Pe.a.mark(sl);function sl(e){var t,r,n,i,a,o,s,u=arguments;return Pe.a.wrap((function(c){for(;;)switch(c.prev=c.next){case 0:t=u.length>1&&void 0!==u[1]?u[1]:{},r=t.chunkSize,n=void 0===r?262144:r,i=0;case 3:if(!(i<e.byteLength)){c.next=14;break}return a=Math.min(e.byteLength-i,n),o=new ArrayBuffer(a),s=new Uint8Array(e,i,a),new Uint8Array(o).set(s),i+=a,c.next=12,o;case 12:c.next=3;break;case 14:case"end":return c.stop()}}),ol)}var ul=r(27),cl=r.n(ul),ll=r(32),fl=r.n(ll);function hl(){return(hl=fl()(Pe.a.mark((function e(t,r){var n,i,a,o;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=(null==r?void 0:r.chunkSize)||1048576,i=0;case 2:if(!(i<t.size)){e.next=12;break}return a=i+n,e.next=6,cl()(t.slice(i,a).arrayBuffer());case 6:return o=e.sent,i=a,e.next=10,o;case 10:e.next=2;break;case 12:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function dl(e,t){return tc?function(e,t){return pl.apply(this,arguments)}(e,t):function(e,t){return vl.apply(this,arguments)}(e,t)}function pl(){return(pl=fl()(Pe.a.mark((function e(t,r){var n,i,a,o,s,u;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=t.getReader(),e.prev=1;case 2:return a=i||n.read(),null!=r&&r._streamReadAhead&&(i=n.read()),e.next=7,cl()(a);case 7:if(o=e.sent,s=o.done,u=o.value,!s){e.next=12;break}return e.abrupt("return");case 12:return e.next=14,$c(u);case 14:e.next=2;break;case 16:e.next=21;break;case 18:e.prev=18,e.t0=e.catch(1),n.releaseLock();case 21:case"end":return e.stop()}}),e,null,[[1,18]])})))).apply(this,arguments)}function vl(){return(vl=fl()(Pe.a.mark((function e(t,r){var n,i,a,o,s,u;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=!1,i=!1,e.prev=2,o=Qc()(t);case 4:return e.next=6,cl()(o.next());case 6:if(!(n=!(s=e.sent).done)){e.next=13;break}return u=s.value,e.next=10,$c(u);case 10:n=!1,e.next=4;break;case 13:e.next=19;break;case 15:e.prev=15,e.t0=e.catch(2),i=!0,a=e.t0;case 19:if(e.prev=19,e.prev=20,!n||null==o.return){e.next=24;break}return e.next=24,cl()(o.return());case 24:if(e.prev=24,!i){e.next=27;break}throw a;case 27:return e.finish(24);case 28:return e.finish(19);case 29:case"end":return e.stop()}}),e,null,[[2,15,19,29],[20,,24,28]])})))).apply(this,arguments)}function yl(e,t){if("string"==typeof e)return al(e,t);if(e instanceof ArrayBuffer)return sl(e,t);if(Ys(e))return function(e,t){return hl.apply(this,arguments)}(e,t);if($s(e))return dl(e,t);if(Zs(e))return dl(e.body,t);throw new Error("makeIterator")}var gl="Cannot convert supplied data type";function ml(e,t,r){if(t.text&&"string"==typeof e)return e;var n;if((n=e)&&"object"===mi()(n)&&n.isBuffer&&(e=e.buffer),e instanceof ArrayBuffer){var i=e;return t.text&&!t.binary?new TextDecoder("utf8").decode(i):i}if(ArrayBuffer.isView(e)){if(t.text&&!t.binary)return new TextDecoder("utf8").decode(e);var a=e.buffer,o=e.byteLength||e.length;return 0===e.byteOffset&&o===a.byteLength||(a=a.slice(e.byteOffset,e.byteOffset+o)),a}throw new Error(gl)}function bl(e,t,r){return Al.apply(this,arguments)}function Al(){return(Al=Me()(Pe.a.mark((function e(t,r,n){var i,a;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=t instanceof ArrayBuffer||ArrayBuffer.isView(t),"string"!=typeof t&&!i){e.next=3;break}return e.abrupt("return",ml(t,r));case 3:if(!Ys(t)){e.next=7;break}return e.next=6,yu(t);case 6:t=e.sent;case 7:if(!Zs(t)){e.next=21;break}return a=t,e.next=11,mu(a);case 11:if(!r.binary){e.next=17;break}return e.next=14,a.arrayBuffer();case 14:e.t0=e.sent,e.next=20;break;case 17:return e.next=19,a.text();case 19:e.t0=e.sent;case 20:return e.abrupt("return",e.t0);case 21:if($s(t)&&(t=yl(t,n)),!Qs(t)&&!Ws(t)){e.next=24;break}return e.abrupt("return",rl(t));case 24:throw new Error(gl);case 25:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Bl(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function wl(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Bl(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Bl(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function _l(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(r)return r;var n=wl({fetch:hc(t,e)},e);return Array.isArray(n.loaders)||(n.loaders=null),n}function xl(e,t){if(!t&&e&&!Array.isArray(e))return e;var r;if(e&&(r=Array.isArray(e)?e:[e]),t&&t.loaders){var n=Array.isArray(t.loaders)?t.loaders:[t.loaders];r=r?[].concat(De()(r),De()(n)):n}return r&&r.length?r:null}function Cl(e){var t=e&&e.lastIndexOf("/");return t>=0?e.substr(t+1):""}function Ol(e){var t=e&&e.lastIndexOf("/");return t>=0?e.substr(0,t):""}function El(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n="/";return(t=t.map((function(e,r){return r&&(e=e.replace(new RegExp("^".concat(n)),"")),r!==t.length-1&&(e=e.replace(new RegExp("".concat(n,"$")),"")),e}))).join(n)}r(37),r(50);var Tl=new ea({id:"loaders.gl"});var Sl=function(){var e=cc();return e.loaderRegistry=e.loaderRegistry||[],e.loaderRegistry};function kl(){return Sl()}function Ml(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Il(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ml(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ml(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Pl(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return Rl(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Rl(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function Rl(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Fl=/\.([^.]+)$/;function Dl(e){return Ll.apply(this,arguments)}function Ll(){return(Ll=Me()(Pe.a.mark((function e(t){var r,n,i,a,o=arguments;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=o.length>1&&void 0!==o[1]?o[1]:[],n=o.length>2?o[2]:void 0,i=o.length>3?o[3]:void 0,Ul(t)){e.next=5;break}return e.abrupt("return",null);case 5:if(!(a=jl(t,r,Il(Il({},n),{},{nothrow:!0}),i))){e.next=8;break}return e.abrupt("return",a);case 8:if(!Ys(t)){e.next=13;break}return e.next=11,t.slice(0,10).arrayBuffer();case 11:t=e.sent,a=jl(t,r,n,i);case 13:if(a||null!=n&&n.nothrow){e.next=15;break}throw new Error(Nl(t));case 15:return e.abrupt("return",a);case 16:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function jl(e){var t=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(!Ul(e))return null;if(t&&!Array.isArray(t))return iu(t);var i,a=[];(t&&(a=a.concat(t)),null!=r&&r.ignoreRegisteredLoaders)||(i=a).push.apply(i,De()(kl()));Hl(a);var o=Gl(e,a,r,n);if(!(o||null!=r&&r.nothrow))throw new Error(Nl(e));return o}function Gl(e,t,r,n){var i,a=du(e),o=a.url,s=a.type,u=o||(null==n?void 0:n.url),c=null,l="";(null!=r&&r.mimeType&&(c=Jl(t,null==r?void 0:r.mimeType),l="match forced by supplied MIME type ".concat(null==r?void 0:r.mimeType)),c=c||function(e,t){var r=t&&Fl.exec(t),n=r&&r[1];return n?function(e,t){t=t.toLowerCase();var r,n=Pl(e);try{for(n.s();!(r=n.n()).done;){var i,a=r.value,o=Pl(a.extensions);try{for(o.s();!(i=o.n()).done;){if(i.value.toLowerCase()===t)return a}}catch(e){o.e(e)}finally{o.f()}}}catch(e){n.e(e)}finally{n.f()}return null}(e,n):null}(t,u),l=l||(c?"matched url ".concat(u):""),c=c||Jl(t,s),l=l||(c?"matched MIME type ".concat(s):""),c=c||function(e,t){if(!t)return null;var r,n=Pl(e);try{for(n.s();!(r=n.n()).done;){var i=r.value;if("string"==typeof t){if(Vl(t,i))return i}else if(ArrayBuffer.isView(t)){if(zl(t.buffer,t.byteOffset,i))return i}else if(t instanceof ArrayBuffer){if(zl(t,0,i))return i}}}catch(e){n.e(e)}finally{n.f()}return null}(t,e),l=l||(c?"matched initial data ".concat(Kl(e)):""),c=c||Jl(t,null==r?void 0:r.fallbackMimeType),l=l||(c?"matched fallback MIME type ".concat(s):""))&&Tl.log(1,"selectLoader selected ".concat(null===(i=c)||void 0===i?void 0:i.name,": ").concat(l,"."));return c}function Ul(e){return!(e instanceof Response&&204===e.status)}function Nl(e){var t=du(e),r=t.url,i=t.type,a="No valid loader found (";a+=r?"".concat(n.filename(r),", "):"no url provided, ",a+="MIME type: ".concat(i?'"'.concat(i,'"'):"not provided",", ");var o=e?Kl(e):"";return a+=o?' first bytes: "'.concat(o,'"'):"first bytes: not available",a+=")"}function Hl(e){var t,r=Pl(e);try{for(r.s();!(t=r.n()).done;){iu(t.value)}}catch(e){r.e(e)}finally{r.f()}}function Jl(e,t){var r,n=Pl(e);try{for(n.s();!(r=n.n()).done;){var i=r.value;if(i.mimeTypes&&i.mimeTypes.includes(t))return i;if(t==="application/x.".concat(i.id))return i}}catch(e){n.e(e)}finally{n.f()}return null}function Vl(e,t){return t.testText?t.testText(e):(Array.isArray(t.tests)?t.tests:[t.tests]).some((function(t){return e.startsWith(t)}))}function zl(e,t,r){return(Array.isArray(r.tests)?r.tests:[r.tests]).some((function(n){return function(e,t,r,n){if(n instanceof ArrayBuffer)return function(e,t,r){if(r=r||e.byteLength,e.byteLength<r||t.byteLength<r)return!1;for(var n=new Uint8Array(e),i=new Uint8Array(t),a=0;a<n.length;++a)if(n[a]!==i[a])return!1;return!0}(n,e,n.byteLength);switch(mi()(n)){case"function":return n(e,r);case"string":var i=ql(e,t,n.length);return n===i;default:return!1}}(e,t,r,n)}))}function Kl(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5;if("string"==typeof e)return e.slice(0,t);if(ArrayBuffer.isView(e))return ql(e.buffer,e.byteOffset,t);if(e instanceof ArrayBuffer){var r=0;return ql(e,r,t)}return""}function ql(e,t,r){if(e.byteLength<t+r)return"";for(var n=new DataView(e),i="",a=0;a<r;a++)i+=String.fromCharCode(n.getUint8(t+a));return i}function Xl(e,t,r,n){return Ql.apply(this,arguments)}function Ql(){return(Ql=Me()(Pe.a.mark((function e(t,r,n,i){var a,o,s,u;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return gc(!i||"object"===mi()(i)),!r||Array.isArray(r)||nu(r)||(i=void 0,n=r,r=void 0),e.next=4,t;case 4:return t=e.sent,n=n||{},a=du(t),o=a.url,s=xl(r,i),e.next=11,Dl(t,s,n);case 11:if(u=e.sent){e.next=14;break}return e.abrupt("return",null);case 14:return n=fc(n,u,s,o),i=_l({url:o,parse:Xl,loaders:s},n,i),e.next=18,Wl(u,t,n,i);case 18:return e.abrupt("return",e.sent);case 19:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Wl(e,t,r,n){return Zl.apply(this,arguments)}function Zl(){return(Zl=Me()(Pe.a.mark((function e(t,r,n,i){var a,o,s,u,c,l,f,h;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return mc(t),Zs(r)&&(o=(a=r).ok,s=a.redirected,u=a.status,c=a.statusText,l=a.type,f=a.url,h=Object.fromEntries(a.headers.entries()),i.response={headers:h,ok:o,redirected:s,status:u,statusText:c,type:l,url:f}),e.next=4,bl(r,t,n);case 4:if(r=e.sent,!t.parseTextSync||"string"!=typeof r){e.next=8;break}return n.dataType="text",e.abrupt("return",t.parseTextSync(r,n,i,t));case 8:if(!Jc(t,n)){e.next=12;break}return e.next=11,Vc(t,r,n,i,Xl);case 11:return e.abrupt("return",e.sent);case 12:if(!t.parseText||"string"!=typeof r){e.next=16;break}return e.next=15,t.parseText(r,n,i,t);case 15:return e.abrupt("return",e.sent);case 16:if(!t.parse){e.next=20;break}return e.next=19,t.parse(r,n,i,t);case 19:return e.abrupt("return",e.sent);case 20:throw gc(!t.parseSync),new Error("".concat(t.id," loader - no parser found and worker is disabled"));case 22:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Yl(e,t,r,n){return $l.apply(this,arguments)}function $l(){return($l=Me()(Pe.a.mark((function e(t,r,n,i){var a,o;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(Array.isArray(r)||nu(r)||(void 0,n=r,r=void 0),a=hc(n),o=t,"string"!=typeof t){e.next=7;break}return e.next=6,a(t);case 6:o=e.sent;case 7:if(!Ys(t)){e.next=11;break}return e.next=10,a(t);case 10:o=e.sent;case 11:return e.next=13,Xl(o,r,n);case 13:return e.abrupt("return",e.sent);case 14:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var ef=r(55),tf=r.n(ef),rf=r(56),nf=r.n(rf),af=r(57),of=r.n(af);function sf(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}Math.max(6378137,6378137,6356752.314245179);function uf(e){return e}new Tt;function cf(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:uf;return"longitude"in e?(t[0]=r(e.longitude),t[1]=r(e.latitude),t[2]=e.height):"x"in e?(t[0]=r(e.x),t[1]=r(e.y),t[2]=e.z):(t[0]=r(e[0]),t[1]=r(e[1]),t[2]=e[2]),t}function lf(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return cf(e,t,it._cartographicRadians?uf:st)}function ff(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:uf;return"longitude"in t?(t.longitude=r(e[0]),t.latitude=r(e[1]),t.height=e[2]):"x"in t?(t.x=r(e[0]),t.y=r(e[1]),t.z=e[2]):(t[0]=r(e[0]),t[1]=r(e[1]),t[2]=e[2]),t}function hf(e,t){return ff(e,t,it._cartographicRadians?uf:ut)}var df=new Tt,pf=new Tt,vf=new Tt;var yf=new Tt,gf={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"}},mf={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},bf={east:new Tt,north:new Tt,up:new Tt,west:new Tt,south:new Tt,down:new Tt},Af=new Tt,Bf=new Tt,wf=new Tt;function _f(e,t,r,n,i,a){var o,s,u,c=gf[t]&&gf[t][r];tt(c&&(!n||n===c));var l=yf.copy(i);if(ht(l.x,0,1e-14)&&ht(l.y,0,1e-14)){var f=Math.sign(l.z);o=Af.fromArray(mf[t]),"east"!==t&&"west"!==t&&o.scale(f),s=Bf.fromArray(mf[r]),"east"!==r&&"west"!==r&&s.scale(f),u=wf.fromArray(mf[n]),"east"!==n&&"west"!==n&&u.scale(f)}else{var h=bf.up,d=bf.east,p=bf.north;d.set(-l.y,l.x,0).normalize(),e.geodeticSurfaceNormal(l,h),p.copy(h).cross(d);var v=bf.west,y=bf.south;bf.down.copy(h).scale(-1),v.copy(d).scale(-1),y.copy(p).scale(-1),o=bf[t],s=bf[r],u=bf[n]}return a[0]=o.x,a[1]=o.y,a[2]=o.z,a[3]=0,a[4]=s.x,a[5]=s.y,a[6]=s.z,a[7]=0,a[8]=u.x,a[9]=u.y,a[10]=u.z,a[11]=0,a[12]=l.x,a[13]=l.y,a[14]=l.z,a[15]=1,a}var xf=new Tt,Cf=new Tt,Of=new Tt,Ef=new Tt,Tf=new Tt,Sf=new Tt,kf=function(){function e(){var t=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;nf()(this,e),sf(this,"radii",void 0),sf(this,"radiiSquared",void 0),sf(this,"radiiToTheFourth",void 0),sf(this,"oneOverRadii",void 0),sf(this,"oneOverRadiiSquared",void 0),sf(this,"minimumRadius",void 0),sf(this,"maximumRadius",void 0),sf(this,"centerToleranceSquared",en),sf(this,"squaredXOverSquaredZ",void 0),tt(t>=0),tt(r>=0),tt(n>=0),this.radii=new Tt(t,r,n),this.radiiSquared=new Tt(t*t,r*r,n*n),this.radiiToTheFourth=new Tt(t*t*t*t,r*r*r*r,n*n*n*n),this.oneOverRadii=new Tt(0===t?0:1/t,0===r?0:1/r,0===n?0:1/n),this.oneOverRadiiSquared=new Tt(0===t?0:1/(t*t),0===r?0:1/(r*r),0===n?0:1/(n*n)),this.minimumRadius=Math.min(t,r,n),this.maximumRadius=Math.max(t,r,n),0!==this.radiiSquared.z&&(this.squaredXOverSquaredZ=this.radiiSquared.x/this.radiiSquared.z),Object.freeze(this)}return of()(e,[{key:"equals",value:function(e){return this===e||Boolean(e&&this.radii.equals(e.radii))}},{key:"toString",value:function(){return this.radii.toString()}},{key:"cartographicToCartesian",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0],r=Cf,n=Of,i=tf()(e,3),a=i[2];this.geodeticSurfaceNormalCartographic(e,r),n.copy(this.radiiSquared).scale(r);var o=Math.sqrt(r.dot(n));return n.scale(1/o),r.scale(a),n.add(r),n.to(t)}},{key:"cartesianToCartographic",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];Sf.from(e);var r=this.scaleToGeodeticSurface(Sf,Ef);if(r){var n=this.geodeticSurfaceNormal(r,Cf),i=Tf;i.copy(Sf).subtract(r);var a=Math.atan2(n.y,n.x),o=Math.asin(n.z),s=Math.sign(pe(i,Sf))*he(i);return hf([a,o,s],t)}}},{key:"eastNorthUpToFixedFrame",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Wr;return _f(this,"east","north","up",e,t)}},{key:"localFrameToFixedFrame",value:function(e,t,r,n){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:new Wr;return _f(this,e,t,r,n,i)}},{key:"geocentricSurfaceNormal",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];return xf.from(e).normalize().to(t)}},{key:"geodeticSurfaceNormalCartographic",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0],r=lf(e),n=r[0],i=r[1],a=Math.cos(i);return xf.set(a*Math.cos(n),a*Math.sin(n),Math.sin(i)).normalize(),xf.to(t)}},{key:"geodeticSurfaceNormal",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];return xf.from(e).scale(this.oneOverRadiiSquared).normalize().to(t)}},{key:"scaleToGeodeticSurface",value:function(e,t){return function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],n=t.oneOverRadii,i=t.oneOverRadiiSquared,a=t.centerToleranceSquared;df.from(e);var o=df.x,s=df.y,u=df.z,c=n.x,l=n.y,f=n.z,h=o*o*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=pf;if(g.copy(e).scale(y),v<a)return g.to(r);var m=i.x,b=i.y,A=i.z,B=vf;B.set(g.x*m*2,g.y*b*2,g.z*A*2);var w,_,x,C,O=(1-y)*df.len()/(.5*B.len()),E=0;do{var T=(w=1/(1+(O-=E)*m))*w,S=(_=1/(1+O*b))*_,k=(x=1/(1+O*A))*x,M=T*w,I=S*_,P=k*x,R=h*M*m+d*I*b+p*P*A,F=-2*R;E=(C=h*T+d*S+p*k-1)/F}while(Math.abs(C)>tn);return df.scale([w,_,x]).to(r)}}(e,this,t)}},{key:"scaleToGeocentricSurface",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];Ef.from(e);var r=Ef.x,n=Ef.y,i=Ef.z,a=this.oneOverRadiiSquared,o=1/Math.sqrt(r*r*a.x+n*n*a.y+i*i*a.z);return Ef.multiplyScalar(o).to(t)}},{key:"transformPositionToScaledSpace",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];return Ef.from(e).scale(this.oneOverRadii).to(t)}},{key:"transformPositionFromScaledSpace",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];return Ef.from(e).scale(this.radii).to(t)}},{key:"getSurfaceNormalIntersectionWithZAxis",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[0,0,0];tt(ht(this.radii.x,this.radii.y,rn)),tt(this.radii.z>0),Ef.from(e);var n=Ef.z*(1-this.squaredXOverSquaredZ);if(!(Math.abs(n)>=this.radii.z-t))return Ef.set(0,0,n).to(r)}}]),e}();sf(kf,"WGS84",new kf(6378137,6378137,6356752.314245179));var Mf=function e(t,r,n){h()(this,e),Hn(this,"item",void 0),Hn(this,"previous",void 0),Hn(this,"next",void 0),this.item=t,this.previous=r,this.next=n},If=function(){function e(){h()(this,e),Hn(this,"head",null),Hn(this,"tail",null),Hn(this,"_length",0)}return C()(e,[{key:"length",get:function(){return this._length}},{key:"add",value:function(e){var t=new Mf(e,this.tail,null);return this.tail?(this.tail.next=t,this.tail=t):(this.head=t,this.tail=t),++this._length,t}},{key:"remove",value:function(e){e&&(e.previous&&e.next?(e.previous.next=e.next,e.next.previous=e.previous):e.previous?(e.previous.next=null,this.tail=e.previous):e.next?(e.next.previous=null,this.head=e.next):(this.head=null,this.tail=null),e.next=null,e.previous=null,--this._length)}},{key:"splice",value:function(e,t){e!==t&&(this.remove(t),this._insert(e,t))}},{key:"_insert",value:function(e,t){var r=e.next;e.next=t,this.tail===e?this.tail=t:r.previous=t,t.next=r,t.previous=e,++this._length}}]),e}();function Pf(e){return null!=e}var Rf=function(){function e(){h()(this,e),Hn(this,"_list",void 0),Hn(this,"_sentinel",void 0),Hn(this,"_trimTiles",void 0),this._list=new If,this._sentinel=this._list.add("sentinel"),this._trimTiles=!1}return C()(e,[{key:"reset",value:function(){this._list.splice(this._list.tail,this._sentinel)}},{key:"touch",value:function(e){var t=e._cacheNode;Pf(t)&&this._list.splice(this._sentinel,t)}},{key:"add",value:function(e,t,r){Pf(t._cacheNode)||(t._cacheNode=this._list.add(t),r&&r(e,t))}},{key:"unloadTile",value:function(e,t,r){var n=t._cacheNode;Pf(n)&&(this._list.remove(n),t._cacheNode=void 0,r&&r(e,t))}},{key:"unloadTiles",value:function(e,t){var r=this._trimTiles;this._trimTiles=!1;for(var n=this._list,i=1024*e.maximumMemoryUsage*1024,a=this._sentinel,o=n.head;o!==a&&(e.gpuMemoryUsageInBytes>i||r);){var s=o.item;o=o.next,this.unloadTile(e,s,t)}}},{key:"trim",value:function(){this._trimTiles=!0}}]),e}();function Ff(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return Df(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Df(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function Df(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Lf=new Tt,jf=new Tt,Gf=new Vr([new Lr,new Lr,new Lr,new Lr,new Lr,new Lr]);function Uf(e,t){var r=e.cameraDirection,n=e.cameraUp,i=e.height,a=e.distanceScales.metersPerUnit,o=Hf(e,e.center),s=kf.WGS84.eastNorthUpToFixedFrame(o),u=e.unprojectPosition(e.cameraPosition),c=kf.WGS84.cartographicToCartesian(u,new Tt),l=new Tt(s.transformAsVector(new Tt(r).scale(a))).normalize(),f=new Tt(s.transformAsVector(new Tt(n).scale(a))).normalize();return function(e){var t=e.getFrustumPlanes(),r=Nf(t.near,e.cameraPosition),n=Hf(e,r),i=Hf(e,e.cameraPosition,jf),a=0;for(var o in Gf.planes[a++].fromPointNormal(n,Lf.copy(n).subtract(i)),t)if("near"!==o){var s=Nf(t[o],r,jf),u=Hf(e,s,jf);Gf.planes[a++].fromPointNormal(u,Lf.copy(n).subtract(u))}}(e),{camera:{position:c,direction:l,up:f},viewport:e,topDownViewport:new(0,e.constructor)({longitude:e.longitude,latitude:e.latitude,height:i,width:e.width,bearing:e.bearing,zoom:e.zoom,pitch:0}),height:i,cullingVolume:Gf,frameNumber:t,sseDenominator:1.15}}function Nf(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Tt,n=e.normal.dot(t);return r.copy(e.normal).scale(e.distance-n).add(t),r}function Hf(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Tt,n=e.unprojectPosition(t);return kf.WGS84.cartographicToCartesian(n,r)}var Jf=new Tt;function Vf(e,t){if(e instanceof Rr){var r=function(e){e.getColumn(0,Jf);var t=e.getColumn(1),r=e.getColumn(2);return Jf.add(t).add(r).len()}(e.halfAxes);return Math.log2(6356752.314245179/(r+t[2]))}if(e instanceof Rt){var n=e.radius;return Math.log2(6356752.314245179/(n+t[2]))}if(e.width&&e.height){var i=e.width,a=e.height;return(Math.log2(6378137/i)+Math.log2(6378137/a))/2}return 1}function zf(e,t,r){var n=kf.WGS84.cartographicToCartesian([e.xmax,e.ymax,e.zmax],new Tt),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+t[2]))}var Kf=0,qf=1,Xf=3,Qf=4,Wf=5,Zf=1,Yf=2,$f="empty",eh="scenegraph",th="pointcloud",rh="mesh",nh="I3S",ih="TILES3D",ah="geometricError",oh=1;function sh(e){return null!=e}var uh=new Tt,ch=new Tt,lh=new Tt;function fh(e,t,r){if(eu(e,"3D Tile: boundingVolume must be defined"),e.box)return function(e,t,r){var n=new Tt(e[0],e[1],e[2]);t.transform(n,n);var i=[];if(10===e.length){var a=e.slice(3,6),o=new gr;o.fromArray(e,6);var s=new Tt([1,0,0]),u=new Tt([0,1,0]),c=new Tt([0,0,1]);s.transformByQuaternion(o),s.scale(a[0]),u.transformByQuaternion(o),u.scale(a[1]),c.transformByQuaternion(o),c.scale(a[2]),i=[].concat(De()(s.toArray()),De()(u.toArray()),De()(c.toArray()))}else i=[].concat(De()(e.slice(3,6)),De()(e.slice(6,9)),De()(e.slice(9,12)));var l=t.transformAsVector(i.slice(0,3)),f=t.transformAsVector(i.slice(3,6)),h=t.transformAsVector(i.slice(6,9)),d=new qt([l[0],l[1],l[2],f[0],f[1],f[2],h[0],h[1],h[2]]);if(sh(r))return r.center=n,r.halfAxes=d,r;return new Rr(n,d)}(e.box,t,r);if(e.region){var n=M()(e.region,6),i=n[0],a=n[1],o=n[2],s=n[3],u=n[4],c=n[5],l=kf.WGS84.cartographicToCartesian([ct(i),ct(s),u],ch),f=kf.WGS84.cartographicToCartesian([ct(o),ct(a),c],lh),h=(new Tt).addVectors(l,f).multiplyScalar(.5),d=(new Tt).subVectors(l,f).len()/2;return hh([h[0],h[1],h[2],d],new Wr)}if(e.sphere)return hh(e.sphere,t,r);throw new Error("3D Tile: boundingVolume must contain a sphere, region, or box")}function hh(e,t,r){var n=new Tt(e[0],e[1],e[2]);t.transform(n,n);var i=t.getScale(uh),a=Math.max(Math.max(i[0],i[1]),i[2]),o=e[3]*a;return sh(r)?(r.center=n,r.radius=o,r):new Rt(n,o)}new Tt,new Tt,new Wr,new Tt,new Tt,new Tt;function dh(e,t){if(e.dynamicScreenSpaceError&&e.dynamicScreenSpaceErrorComputedDensity){var r=e.dynamicScreenSpaceErrorComputedDensity,n=e.dynamicScreenSpaceErrorFactor;return function(e,t){var r=e*t;return 1-Math.exp(-r*r)}(t,r)*n}return 0}var ph=new Tt,vh=new Tt,yh=new Tt,gh=new Tt,mh=new Tt,bh=new Wr,Ah=new Wr;function Bh(e,t){var r=t.topDownViewport,n=e.header.mbs[1],i=e.header.mbs[0],a=e.header.mbs[2],o=e.header.mbs[3],s=De()(e.boundingVolume.center),u=r.unprojectPosition(r.cameraPosition);kf.WGS84.cartographicToCartesian(u,ph),vh.copy(ph).subtract(s).normalize(),kf.WGS84.eastNorthUpToFixedFrame(s,bh),Ah.copy(bh).invert(),yh.copy(ph).transform(Ah);var c=Math.sqrt(yh[0]*yh[0]+yh[1]*yh[1]),l=c*c/yh[2];gh.copy([yh[0],yh[1],l]);var f=gh.transform(bh).subtract(s).normalize(),h=vh.cross(f).normalize().scale(o).add(s),d=kf.WGS84.cartesianToCartographic(h),p=r.project([i,n,a]),v=r.project(d);return mh.copy(p).subtract(v).magnitude()}var wh=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;h()(this,e),Hn(this,"_map",new Map),Hn(this,"_array",void 0),Hn(this,"_length",void 0),this._array=new Array(t),this._length=t}return C()(e,[{key:"length",get:function(){return this._length},set:function(e){this._length=e,e>this._array.length&&(this._array.length=e)}},{key:"values",get:function(){return this._array}},{key:"get",value:function(e){return eu(e<this._array.length),this._array[e]}},{key:"set",value:function(e,t){eu(e>=0),e>=this.length&&(this.length=e+1),this._map.has(this._array[e])&&this._map.delete(this._array[e]),this._array[e]=t,this._map.set(t,e)}},{key:"delete",value:function(e){var t=this._map.get(e);t>=0&&(this._array.splice(t,1),this._map.delete(e),this.length--)}},{key:"peek",value:function(){return this._array[this._length-1]}},{key:"push",value:function(e){if(!this._map.has(e)){var t=this.length++;this._array[t]=e,this._map.set(e,t)}}},{key:"pop",value:function(){var e=this._array[--this.length];return this._map.delete(e),e}},{key:"reserve",value:function(e){eu(e>=0),e>this._array.length&&(this._array.length=e)}},{key:"resize",value:function(e){eu(e>=0),this.length=e}},{key:"trim",value:function(e){null==e&&(e=this.length),this._array.length=e}},{key:"reset",value:function(){this._array=[],this._map=new Map,this._length=0}},{key:"find",value:function(e){return this._map.has(e)}}]),e}();function _h(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return xh(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return xh(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function xh(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Ch(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Oh(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ch(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ch(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Eh={loadSiblings:!1,skipLevelOfDetail:!1,maximumScreenSpaceError:2,updateTransforms:!0,onTraversalEnd:function(){},viewportTraversersMap:{},basePath:""},Th=function(){function e(t){h()(this,e),Hn(this,"options",void 0),Hn(this,"root",void 0),Hn(this,"requestedTiles",void 0),Hn(this,"selectedTiles",void 0),Hn(this,"emptyTiles",void 0),Hn(this,"lastUpdate",(new Date).getTime()),Hn(this,"updateDebounceTime",1e3),Hn(this,"_traversalStack",void 0),Hn(this,"_emptyTraversalStack",void 0),Hn(this,"_frameNumber",void 0),this.options=Oh(Oh({},Eh),t),this._traversalStack=new wh,this._emptyTraversalStack=new wh,this._frameNumber=null,this.root=null,this.selectedTiles={},this.requestedTiles={},this.emptyTiles={}}return C()(e,[{key:"traversalFinished",value:function(e){return!0}},{key:"traverse",value:function(e,t,r){this.root=e,this.options=Oh(Oh({},this.options),r),this.reset(),this.updateTile(e,t),this._frameNumber=t.frameNumber,this.executeTraversal(e,t)}},{key:"reset",value:function(){this.requestedTiles={},this.selectedTiles={},this.emptyTiles={},this._traversalStack.reset(),this._emptyTraversalStack.reset()}},{key:"executeTraversal",value:function(e,t){var r=this._traversalStack;for(e._selectionDepth=1,r.push(e);r.length>0;){var n=r.pop(),i=!1;this.canTraverse(n,t)&&(this.updateChildTiles(n,t),i=this.updateAndPushChildren(n,t,r,n.hasRenderContent?n._selectionDepth+1:n._selectionDepth));var a=n.parent,o=Boolean(!a||a._shouldRefine),s=!i;n.hasRenderContent?n.refine===Zf?(this.loadTile(n,t),this.selectTile(n,t)):n.refine===Yf&&(this.loadTile(n,t),s&&this.selectTile(n,t)):(this.emptyTiles[n.id]=n,this.loadTile(n,t),s&&this.selectTile(n,t)),this.touchTile(n,t),n._shouldRefine=i&&o}var u=(new Date).getTime();(this.traversalFinished(t)||u-this.lastUpdate>this.updateDebounceTime)&&(this.lastUpdate=u,this.options.onTraversalEnd(t))}},{key:"updateChildTiles",value:function(e,t){var r,n=_h(e.children);try{for(n.s();!(r=n.n()).done;){var i=r.value;this.updateTile(i,t)}}catch(e){n.e(e)}finally{n.f()}return!0}},{key:"updateAndPushChildren",value:function(e,t,r,n){var i=this.options,a=i.loadSiblings,o=i.skipLevelOfDetail,s=e.children;s.sort(this.compareDistanceToCamera.bind(this));var u,c=e.refine===Yf&&e.hasRenderContent&&!o,l=!1,f=!0,h=_h(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||a)&&(this.loadTile(d,t),this.touchTile(d,t)),c){var p=void 0;if(p=!!d._inRequestVolume&&(d.hasRenderContent?d.contentAvailable:this.executeEmptyTraversal(d,t)),!(f=f&&p))return!1}}}catch(e){h.e(e)}finally{h.f()}return l||(f=!1),f}},{key:"updateTile",value:function(e,t){this.updateTileVisibility(e,t)}},{key:"selectTile",value:function(e,t){this.shouldSelectTile(e)&&(e._selectedFrame=t.frameNumber,this.selectedTiles[e.id]=e)}},{key:"loadTile",value:function(e,t){this.shouldLoadTile(e)&&(e._requestedFrame=t.frameNumber,e._priority=e._getPriority(),this.requestedTiles[e.id]=e)}},{key:"touchTile",value:function(e,t){e.tileset._cache.touch(e),e._touchedFrame=t.frameNumber}},{key:"canTraverse",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return!!e.hasChildren&&(e.hasTilesetContent?!e.contentExpired:!(!n&&!e.isVisibleAndInRequestVolume)&&this.shouldRefine(e,t,r))}},{key:"shouldLoadTile",value:function(e){return e.hasUnloadedContent||e.contentExpired}},{key:"shouldSelectTile",value:function(e){return e.contentAvailable&&!this.options.skipLevelOfDetail}},{key:"shouldRefine",value:function(e,t,r){var n=e._screenSpaceError;return r&&(n=e.getScreenSpaceError(t,!0)),n>this.options.maximumScreenSpaceError}},{key:"updateTileVisibility",value:function(e,t){var r=[];if(this.options.viewportTraversersMap)for(var n in this.options.viewportTraversersMap){this.options.viewportTraversersMap[n]===t.viewport.id&&r.push(n)}else r.push(t.viewport.id);e.updateVisibility(t,r)}},{key:"compareDistanceToCamera",value:function(e,t){return e._distanceToCamera-t._distanceToCamera}},{key:"anyChildrenVisible",value:function(e,t){var r,n=!1,i=_h(e.children);try{for(i.s();!(r=i.n()).done;){var a=r.value;a.updateVisibility(t),n=n||a.isVisibleAndInRequestVolume}}catch(e){i.e(e)}finally{i.f()}return n}},{key:"executeEmptyTraversal",value:function(e,t){var r=!0,n=this._emptyTraversalStack;for(n.push(e);n.length>0&&r;){var i=n.pop();if(this.updateTile(i,t),i.isVisibleAndInRequestVolume||this.loadTile(i,t),this.touchTile(i,t),!i.hasRenderContent&&this.canTraverse(i,t,!1,!0)){var a,o=_h(i.children);try{for(o.s();!(a=o.n()).done;){var s=a.value;n.find(s)&&n.delete(s),n.push(s)}}catch(e){o.e(e)}finally{o.f()}}else i.contentAvailable||(r=!1)}return r}}]),e}();function Sh(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function kh(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Sh(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Sh(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Mh=new Tt;var Ih=function(){function e(t,r,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";h()(this,e),Hn(this,"tileset",void 0),Hn(this,"header",void 0),Hn(this,"id",void 0),Hn(this,"url",void 0),Hn(this,"parent",void 0),Hn(this,"refine",void 0),Hn(this,"type",void 0),Hn(this,"contentUrl",void 0),Hn(this,"lodMetricType",void 0),Hn(this,"lodMetricValue",void 0),Hn(this,"boundingVolume",void 0),Hn(this,"content",void 0),Hn(this,"contentState",void 0),Hn(this,"gpuMemoryUsageInBytes",void 0),Hn(this,"children",void 0),Hn(this,"depth",void 0),Hn(this,"viewportIds",void 0),Hn(this,"transform",void 0),Hn(this,"extensions",void 0),Hn(this,"userData",void 0),Hn(this,"computedTransform",void 0),Hn(this,"hasEmptyContent",void 0),Hn(this,"hasTilesetContent",void 0),Hn(this,"traverser",void 0),Hn(this,"_cacheNode",void 0),Hn(this,"_frameNumber",void 0),Hn(this,"_lodJudge",void 0),Hn(this,"_expireDate",void 0),Hn(this,"_expiredContent",void 0),Hn(this,"_shouldRefine",void 0),Hn(this,"_distanceToCamera",void 0),Hn(this,"_centerZDepth",void 0),Hn(this,"_screenSpaceError",void 0),Hn(this,"_visibilityPlaneMask",void 0),Hn(this,"_visible",void 0),Hn(this,"_inRequestVolume",void 0),Hn(this,"_stackLength",void 0),Hn(this,"_selectionDepth",void 0),Hn(this,"_touchedFrame",void 0),Hn(this,"_visitedFrame",void 0),Hn(this,"_selectedFrame",void 0),Hn(this,"_requestedFrame",void 0),Hn(this,"_priority",void 0),Hn(this,"_contentBoundingVolume",void 0),Hn(this,"_viewerRequestVolume",void 0),Hn(this,"_initialTransform",void 0),this.header=r,this.tileset=t,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=Kf,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 Th({}),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 Wr,this.transform=new Wr,this._initializeLodMetric(r),this._initializeTransforms(r),this._initializeBoundingVolumes(r),this._initializeContent(r),this._initializeRenderingState(r),this._lodJudge=null,this._expireDate=null,this._expiredContent=null,Object.seal(this)}var t;return C()(e,[{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===Xf||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===Kf}},{key:"contentExpired",get:function(){return this.contentState===Qf}},{key:"contentFailed",get:function(){return this.contentState===Wf}},{key:"getScreenSpaceError",value:function(e,t){switch(this.tileset.type){case nh:return Bh(this,e);case ih:return function(e,t,r){var n=e.tileset,i=e.parent&&e.parent.lodMetricValue||e.lodMetricValue,a=r?i:e.lodMetricValue;if(0===a)return 0;var o=Math.max(e._distanceToCamera,1e-7),s=t.height,u=t.sseDenominator,c=a*s*(n.options.viewDistanceScale||1)/(o*u);return c-=dh(n,o)}(this,e,t);default:throw new Error("Unsupported tileset type")}}},{key:"unselect",value:function(){this._selectedFrame=0}},{key:"_getPriority",value:function(){var e=this.tileset._traverser,t=e.options.skipLevelOfDetail,r=this.refine===Zf||t;if(r&&!this.isVisible&&void 0!==this._visible)return-1;if(this.tileset._frameNumber-this._touchedFrame>=1)return-1;if(this.contentState===Kf)return-1;var n=this.parent,i=n&&(!r||0===this._screenSpaceError||n.hasTilesetContent)?n._screenSpaceError:this._screenSpaceError,a=e.root?e.root._screenSpaceError:0;return Math.max(a-i,0)}},{key:"loadContent",value:(t=Me()(Pe.a.mark((function e(){var t,r,n,i;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.hasEmptyContent){e.next=2;break}return e.abrupt("return",!1);case 2:if(!this.content){e.next=4;break}return e.abrupt("return",!0);case 4:return this.contentExpired&&(this._expireDate=null),this.contentState=qf,e.next=9,this.tileset._requestScheduler.scheduleRequest(this.id,this._getPriority.bind(this));case 9:if(t=e.sent){e.next=13;break}return this.contentState=Kf,e.abrupt("return",!1);case 13:return e.prev=13,r=this.tileset.getTileUrl(this.contentUrl),n=this.tileset.loader,i=kh(kh({},this.tileset.loadOptions),{},A()({},n.id,kh(kh({},this.tileset.loadOptions[n.id]),{},{isTileset:"json"===this.type},this._getLoaderSpecificOptions(n.id)))),e.next=19,Yl(r,n,i);case 19:if(this.content=e.sent,!this.tileset.options.contentLoader){e.next=23;break}return e.next=23,this.tileset.options.contentLoader(this);case 23:return this._isTileset()&&this.tileset._initializeTileHeaders(this.content,this),this.contentState=Xf,this._onContentLoaded(),e.abrupt("return",!0);case 29:throw e.prev=29,e.t0=e.catch(13),this.contentState=Wf,e.t0;case 33:return e.prev=33,t.done(),e.finish(33);case 36:case"end":return e.stop()}}),e,this,[[13,29,33,36]])}))),function(){return t.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=Kf,!0}},{key:"updateVisibility",value:function(e,t){if(this._frameNumber!==e.frameNumber){var r=this.parent,n=r?r._visibilityPlaneMask:Vr.MASK_INDETERMINATE;if(this.tileset._traverser.options.updateTransforms){var i=r?r.computedTransform:this.tileset.modelMatrix;this._updateTransform(i)}this._distanceToCamera=this.distanceToTile(e),this._screenSpaceError=this.getScreenSpaceError(e,!1),this._visibilityPlaneMask=this.visibility(e,n),this._visible=this._visibilityPlaneMask!==Vr.MASK_OUTSIDE,this._inRequestVolume=this.insideViewerRequestVolume(e),this._frameNumber=e.frameNumber,this.viewportIds=t}}},{key:"visibility",value:function(e,t){var r=e.cullingVolume,n=this.boundingVolume;return r.computeVisibilityWithPlaneMask(n,t)}},{key:"contentVisibility",value:function(){return!0}},{key:"distanceToTile",value:function(e){var t=this.boundingVolume;return Math.sqrt(Math.max(t.distanceSquaredTo(e.camera.position),0))}},{key:"cameraSpaceZDepth",value:function(e){var t=e.camera,r=this.boundingVolume;return Mh.subVectors(r.center,t.position),t.direction.dot(Mh)}},{key:"insideViewerRequestVolume",value:function(e){var t=this._viewerRequestVolume;return!t||t.distanceSquaredTo(e.camera.position)<=0}},{key:"updateExpiration",value:function(){if(null!=this._expireDate&&this.contentReady&&!this.hasEmptyContent){var e=Date.now();Date.lessThan(this._expireDate,e)&&(this.contentState=Qf,this._expiredContent=this.content)}}},{key:"extras",get:function(){return this.header.extras}},{key:"_initializeLodMetric",value:function(e){"lodMetricType"in e?this.lodMetricType=e.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 e?this.lodMetricValue=e.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(e){this.transform=e.transform?new Wr(e.transform):new Wr;var t=this.parent,r=this.tileset,n=t&&t.computedTransform?t.computedTransform.clone():r.modelMatrix.clone();this.computedTransform=new Wr(n).multiplyRight(this.transform);var i=t&&t._initialTransform?t._initialTransform.clone():new Wr;this._initialTransform=new Wr(i).multiplyRight(this.transform)}},{key:"_initializeBoundingVolumes",value:function(e){this._contentBoundingVolume=null,this._viewerRequestVolume=null,this._updateBoundingVolume(e)}},{key:"_initializeContent",value:function(e){this.content={_tileset:this.tileset,_tile:this},this.hasEmptyContent=!0,this.contentState=Kf,this.hasTilesetContent=!1,e.contentUrl&&(this.content=null,this.hasEmptyContent=!1)}},{key:"_initializeRenderingState",value:function(e){this.depth=e.level||(this.parent?this.parent.depth+1:0),this._shouldRefine=!1,this._distanceToCamera=0,this._centerZDepth=0,this._screenSpaceError=0,this._visibilityPlaneMask=Vr.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(e){return e||this.parent&&this.parent.refine||Yf}},{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(e){this.boundingVolume=fh(e.boundingVolume,this.computedTransform,this.boundingVolume);var t=e.content;t&&(t.boundingVolume&&(this._contentBoundingVolume=fh(t.boundingVolume,this.computedTransform,this._contentBoundingVolume)),e.viewerRequestVolume&&(this._viewerRequestVolume=fh(e.viewerRequestVolume,this.computedTransform,this._viewerRequestVolume)))}},{key:"_updateTransform",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Wr,t=e.clone().multiplyRight(this.transform),r=!t.equals(this.computedTransform);r&&(this.computedTransform=t,this._updateBoundingVolume(this.header))}},{key:"_getLoaderSpecificOptions",value:function(e){switch(e){case"i3s":return kh(kh({},this.tileset.options.i3s),{},{tile:this.header,tileset:this.tileset.tileset,isTileHeader:!1});case"3d-tiles":case"cesium-ion":default:return{assetGltfUpAxis:(t=this.tileset.tileset).asset&&t.asset.gltfUpAxis||"Y"}}var t}}]),e}();function Ph(e){var t=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(e){return!1}}();return function(){var r,n=m()(e);if(t){var i=m()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return y()(this,r)}}var Rh=function(e){p()(r,e);var t=Ph(r);function r(){return h()(this,r),t.apply(this,arguments)}return C()(r,[{key:"compareDistanceToCamera",value:function(e,t){return 0===t._distanceToCamera&&0===e._distanceToCamera?t._centerZDepth-e._centerZDepth:t._distanceToCamera-e._distanceToCamera}},{key:"updateTileVisibility",value:function(e,t){if(ci()(m()(r.prototype),"updateTileVisibility",this).call(this,e,t),e.isVisibleAndInRequestVolume){var n=e.children.length>0;if(e.hasTilesetContent&&n){var i=e.children[0];return this.updateTileVisibility(i,t),void(e._visible=i._visible)}if(this.meetsScreenSpaceErrorEarly(e,t))e._visible=!1;else{var a=e.refine===Yf,o=e._optimChildrenWithinParent===oh;a&&o&&n&&!this.anyChildrenVisible(e,t)&&(e._visible=!1)}}}},{key:"meetsScreenSpaceErrorEarly",value:function(e,t){var r=e.parent;return!(!r||r.hasTilesetContent||r.refine!==Zf)&&!this.shouldRefine(e,t,!0)}}]),r}(Th),Fh=function(){function e(){h()(this,e),Hn(this,"frameNumberMap",new Map)}return C()(e,[{key:"register",value:function(e,t){var r=this.frameNumberMap.get(e)||new Map,n=r.get(t)||0;r.set(t,n+1),this.frameNumberMap.set(e,r)}},{key:"deregister",value:function(e,t){var r=this.frameNumberMap.get(e);if(r){var n=r.get(t)||1;r.set(t,n-1)}}},{key:"isZero",value:function(e,t){var r;return 0===((null===(r=this.frameNumberMap.get(e))||void 0===r?void 0:r.get(t))||0)}}]),e}(),Dh="REQUESTED",Lh="COMPLETED",jh="ERROR",Gh=function(){function e(){h()(this,e),Hn(this,"_statusMap",void 0),Hn(this,"pendingTilesRegister",new Fh),this._statusMap={}}return C()(e,[{key:"add",value:function(e,t,r,n){var i=this;if(!this._statusMap[t]){var a=n.frameNumber,o=n.viewport.id;this._statusMap[t]={request:e,callback:r,key:t,frameState:n,status:Dh},this.pendingTilesRegister.register(o,a),e().then((function(e){i._statusMap[t].status=Lh;var r=i._statusMap[t].frameState,a=r.frameNumber,o=r.viewport.id;i.pendingTilesRegister.deregister(o,a),i._statusMap[t].callback(e,n)})).catch((function(e){i._statusMap[t].status=jh;var n=i._statusMap[t].frameState,a=n.frameNumber,o=n.viewport.id;i.pendingTilesRegister.deregister(o,a),r(e)}))}}},{key:"update",value:function(e,t){if(this._statusMap[e]){var r=this._statusMap[e].frameState,n=r.frameNumber,i=r.viewport.id;this.pendingTilesRegister.deregister(i,n);var a=t.frameNumber,o=t.viewport.id;this.pendingTilesRegister.register(o,a),this._statusMap[e].frameState=t}}},{key:"find",value:function(e){return this._statusMap[e]}},{key:"hasPendingTiles",value:function(e,t){return!this.pendingTilesRegister.isZero(e,t)}}]),e}();function Uh(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Nh(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Uh(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Uh(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Hh(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return Jh(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Jh(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function Jh(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Vh(e){var t=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(e){return!1}}();return function(){var r,n=m()(e);if(t){var i=m()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return y()(this,r)}}var zh=function(e){p()(n,e);var t,r=Vh(n);function n(e){var t;return h()(this,n),t=r.call(this,e),Hn(yi()(t),"_tileManager",void 0),t._tileManager=new Gh,t}return C()(n,[{key:"traversalFinished",value:function(e){return!this._tileManager.hasPendingTiles(e.viewport.id,this._frameNumber||0)}},{key:"shouldRefine",value:function(e,t){return e._lodJudge=function(e,t){if(0===e.lodMetricValue||isNaN(e.lodMetricValue))return"DIG";var r=2*Bh(e,t);return r<2?"OUT":!e.header.children||r<=e.lodMetricValue?"DRAW":e.header.children?"DIG":"OUT"}(e,t),"DIG"===e._lodJudge}},{key:"updateChildTiles",value:function(e,t){var r,n=this,i=e.header.children||[],a=e.children,o=e.tileset,s=Hh(i);try{var u=function(){var i=r.value,s="".concat(i.id,"-").concat(t.viewport.id),u=a&&a.find((function(e){return e.id===s}));if(u)u&&n.updateTile(u,t);else{var c=function(){return n._loadTile(i.id,o)};n._tileManager.find(s)?n._tileManager.update(s,t):(o.tileset.nodePages&&(c=function(){return o.tileset.nodePagesTile.formTileFromNodePages(i.id)}),n._tileManager.add(c,s,(function(t){return n._onTileLoad(t,e,s)}),t))}};for(s.s();!(r=s.n()).done;)u()}catch(e){s.e(e)}finally{s.f()}return!1}},{key:"_loadTile",value:(t=Me()(Pe.a.mark((function e(t,r){var n,i,a;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=r.loader,i=r.getTileUrl("".concat(r.url,"/nodes/").concat(t)),a=Nh(Nh({},r.loadOptions),{},{i3s:Nh(Nh({},r.loadOptions.i3s),{},{isTileHeader:!0,loadContent:!1})}),e.next=5,Yl(i,n,a);case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e)}))),function(e,r){return t.apply(this,arguments)})},{key:"_onTileLoad",value:function(e,t,r){var n=new Ih(t.tileset,e,t,r);t.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}(Th);function Kh(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return qh(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return qh(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function qh(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Xh(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Qh(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Xh(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Xh(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Wh={description:"",ellipsoid:kf.WGS84,modelMatrix:new Wr,throttleRequests:!0,maxRequests:64,maximumMemoryUsage:32,maximumTilesSelected:0,debounceTime:0,onTileLoad:function(){},onTileUnload:function(){},onTileError:function(){},onTraversalComplete:function(e){return e},contentLoader:void 0,viewDistanceScale:1,maximumScreenSpaceError:8,loadTiles:!0,updateTransforms:!0,viewportTraversersMap:null,loadOptions:{fetch:{}},attributions:[],basePath:"",i3s:{}},Zh="Tiles In Tileset(s)",Yh=function(){function e(t,r){h()(this,e),Hn(this,"options",void 0),Hn(this,"loadOptions",void 0),Hn(this,"type",void 0),Hn(this,"tileset",void 0),Hn(this,"loader",void 0),Hn(this,"url",void 0),Hn(this,"basePath",void 0),Hn(this,"modelMatrix",void 0),Hn(this,"ellipsoid",void 0),Hn(this,"lodMetricType",void 0),Hn(this,"lodMetricValue",void 0),Hn(this,"refine",void 0),Hn(this,"root",void 0),Hn(this,"roots",void 0),Hn(this,"asset",void 0),Hn(this,"description",void 0),Hn(this,"properties",void 0),Hn(this,"extras",void 0),Hn(this,"attributions",void 0),Hn(this,"credits",void 0),Hn(this,"stats",void 0),Hn(this,"traverseCounter",void 0),Hn(this,"geometricError",void 0),Hn(this,"selectedTiles",void 0),Hn(this,"updatePromise",null),Hn(this,"tilesetInitializationPromise",void 0),Hn(this,"cartographicCenter",void 0),Hn(this,"cartesianCenter",void 0),Hn(this,"zoom",void 0),Hn(this,"boundingVolume",void 0),Hn(this,"gpuMemoryUsageInBytes",void 0),Hn(this,"dynamicScreenSpaceErrorComputedDensity",void 0),Hn(this,"_traverser",void 0),Hn(this,"_cache",void 0),Hn(this,"_requestScheduler",void 0),Hn(this,"_frameNumber",void 0),Hn(this,"_queryParamsString",void 0),Hn(this,"_queryParams",void 0),Hn(this,"_extensionsUsed",void 0),Hn(this,"_tiles",void 0),Hn(this,"_pendingCount",void 0),Hn(this,"lastUpdatedVieports",void 0),Hn(this,"_requestedTiles",void 0),Hn(this,"_emptyTiles",void 0),Hn(this,"frameStateData",void 0),Hn(this,"maximumMemoryUsage",void 0),eu(t),this.options=Qh(Qh({},Wh),r),this.tileset=t,this.loader=t.loader,this.type=t.type,this.url=t.url,this.basePath=t.basePath||n.dirname(this.url),this.modelMatrix=this.options.modelMatrix,this.ellipsoid=this.options.ellipsoid,this.lodMetricType=t.lodMetricType,this.lodMetricValue=t.lodMetricValue,this.refine=t.root.refine,this.loadOptions=this.options.loadOptions||{},this.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 Rf,this._requestScheduler=new Wn({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 zn({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(t)}var t,r,i;return C()(e,[{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(e){for(var t=[],r=0,n=Object.keys(e);r<n.length;r++){var i=n[r];t.push("".concat(i,"=").concat(e[i]))}switch(t.length){case 0:return"";case 1:return"?".concat(t[0]);default:return"?".concat(t.join("&"))}}(this._queryParams)),this._queryParamsString}},{key:"setProps",value:function(e){this.options=Qh(Qh({},this.options),e)}},{key:"setOptions",value:function(e){this.options=Qh(Qh({},this.options),e)}},{key:"getTileUrl",value:function(e){return e.startsWith("data:")?e:"".concat(e).concat(this.queryParams)}},{key:"hasExtension",value:function(e){return Boolean(this._extensionsUsed&&this._extensionsUsed.indexOf(e)>-1)}},{key:"update",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this.tilesetInitializationPromise.then((function(){!t&&e.lastUpdatedVieports?t=e.lastUpdatedVieports:e.lastUpdatedVieports=t,t&&e.doUpdate(t)}))}},{key:"selectTiles",value:(i=Me()(Pe.a.mark((function e(){var t,r=this,n=arguments;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=n.length>0&&void 0!==n[0]?n[0]:null,e.next=3,this.tilesetInitializationPromise;case 3:return t&&(this.lastUpdatedVieports=t),this.updatePromise||(this.updatePromise=new Promise((function(e){setTimeout((function(){r.lastUpdatedVieports&&r.doUpdate(r.lastUpdatedVieports),e(r._frameNumber),r.updatePromise=null}),r.options.debounceTime)}))),e.abrupt("return",this.updatePromise);case 6:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"doUpdate",value:function(e){if((!("loadTiles"in this.options)||this.options.loadTiles)&&!(this.traverseCounter>0)){var t=e instanceof Array?e:[e];this._cache.reset(),this._frameNumber++,this.traverseCounter=t.length;var r,n=[],i=Kh(t);try{for(i.s();!(r=i.n()).done;){var a=r.value.id;this._needTraverse(a)?n.push(a):this.traverseCounter--}}catch(e){i.e(e)}finally{i.f()}var o,s=Kh(t);try{for(s.s();!(o=s.n()).done;){var u=o.value,c=u.id;if(this.roots[c]||(this.roots[c]=this._initializeTileHeaders(this.tileset,null)),n.includes(c)){var l=Uf(u,this._frameNumber);this._traverser.traverse(this.roots[c],l,this.options)}}}catch(e){s.e(e)}finally{s.f()}}}},{key:"_needTraverse",value:function(e){var t=e;return this.options.viewportTraversersMap&&(t=this.options.viewportTraversersMap[e]),t===e}},{key:"_onTraversalEnd",value:function(e){var t=e.viewport.id;this.frameStateData[t]||(this.frameStateData[t]={selectedTiles:[],_requestedTiles:[],_emptyTiles:[]});var r=this.frameStateData[t],n=function(e,t,r){if(0===r||e.length<=r)return[e,[]];var n,i=[],a=t.viewport,o=a.longitude,s=a.latitude,u=Ff(e.entries());try{for(u.s();!(n=u.n()).done;){var c=M()(n.value,2),l=c[0],f=c[1],h=M()(f.header.mbs,2),d=h[0],p=h[1],v=Math.abs(o-d),y=Math.abs(s-p),g=Math.sqrt(y*y+v*v);i.push([l,g])}}catch(e){u.e(e)}finally{u.f()}for(var m=i.sort((function(e,t){return e[1]-t[1]})),b=[],A=0;A<r;A++)b.push(e[m[A][0]]);for(var B=[],w=r;w<m.length;w++)B.push(e[m[w][0]]);return[b,B]}(Object.values(this._traverser.selectedTiles),e,this.options.maximumTilesSelected),i=M()(n,2),a=i[0],o=i[1];r.selectedTiles=a;var s,u=Kh(o);try{for(u.s();!(s=u.n()).done;){s.value.unselect()}}catch(e){u.e(e)}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 e in this.selectedTiles=[],this._requestedTiles=[],this._emptyTiles=[],this.frameStateData){var t=this.frameStateData[e];this.selectedTiles=this.selectedTiles.concat(t.selectedTiles),this._requestedTiles=this._requestedTiles.concat(t._requestedTiles),this._emptyTiles=this._emptyTiles.concat(t._emptyTiles)}this.selectedTiles=this.options.onTraversalComplete(this.selectedTiles);var r,n=Kh(this.selectedTiles);try{for(n.s();!(r=n.n()).done;){var i=r.value;this._tiles[i.id]=i}}catch(e){n.e(e)}finally{n.f()}this._loadTiles(),this._unloadTiles(),this._updateStats()}},{key:"_tilesChanged",value:function(e,t){if(e.length!==t.length)return!0;var r=new Set(e.map((function(e){return e.id}))),n=new Set(t.map((function(e){return e.id}))),i=e.filter((function(e){return!n.has(e.id)})).length>0;return i=i||t.filter((function(e){return!r.has(e.id)})).length>0}},{key:"_loadTiles",value:function(){var e,t=Kh(this._requestedTiles);try{for(t.s();!(e=t.n()).done;){var r=e.value;r.contentUnloaded&&this._loadTile(r)}}catch(e){t.e(e)}finally{t.f()}}},{key:"_unloadTiles",value:function(){this._cache.unloadTiles(this,(function(e,t){return e._unloadTile(t)}))}},{key:"_updateStats",value:function(){var e,t=0,r=0,n=Kh(this.selectedTiles);try{for(n.s();!(e=n.n()).done;){var i=e.value;i.contentAvailable&&i.content&&(t++,i.content.pointCount?r+=i.content.pointCount:r+=i.content.vertexCount)}}catch(e){n.e(e)}finally{n.f()}this.stats.get("Tiles In View").count=this.selectedTiles.length,this.stats.get("Tiles To Render").count=t,this.stats.get("Points/Vertices").count=r}},{key:"_initializeTileSet",value:(r=Me()(Pe.a.mark((function e(t){return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.type!==nh){e.next=5;break}return this.calculateViewPropsI3S(),e.next=4,t.root;case 4:t.root=e.sent;case 5:this.root=this._initializeTileHeaders(t,null),this.type===ih&&(this._initializeTiles3DTileset(t),this.calculateViewPropsTiles3D()),this.type===nh&&this._initializeI3STileset();case 8:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"calculateViewPropsI3S",value:function(){var e,t=this.tileset.fullExtent;if(t){var r=t.xmin,n=t.xmax,i=t.ymin,a=t.ymax,o=t.zmin,s=t.zmax;return this.cartographicCenter=new Tt(r+(n-r)/2,i+(a-i)/2,o+(s-o)/2),this.cartesianCenter=kf.WGS84.cartographicToCartesian(this.cartographicCenter,new Tt),void(this.zoom=zf(t,this.cartographicCenter,this.cartesianCenter))}var u=null===(e=this.tileset.store)||void 0===e?void 0:e.extent;if(u){var c=M()(u,4),l=c[0],f=c[1],h=c[2],d=c[3];return this.cartographicCenter=new Tt(l+(h-l)/2,f+(d-f)/2,0),this.cartesianCenter=kf.WGS84.cartographicToCartesian(this.cartographicCenter,new Tt),void(this.zoom=function(e,t,r){var n=M()(e,4),i=n[0],a=n[1];return zf({xmin:i,xmax:n[2],ymin:a,ymax:n[3],zmin:0,zmax:0},t,r)}(u,this.cartographicCenter,this.cartesianCenter))}console.warn("Extent is not defined in the tileset header"),this.cartographicCenter=new Tt,this.zoom=1}},{key:"calculateViewPropsTiles3D",value:function(){var e=this.root;eu(e);var t=e.boundingVolume.center;if(!t)return console.warn("center was not pre-calculated for the root tile"),this.cartographicCenter=new Tt,void(this.zoom=1);0!==t[0]||0!==t[1]||0!==t[2]?this.cartographicCenter=kf.WGS84.cartesianToCartographic(t,new Tt):this.cartographicCenter=new Tt(0,0,-kf.WGS84.radii[0]),this.cartesianCenter=t,this.zoom=Vf(e.boundingVolume,this.cartographicCenter)}},{key:"_initializeStats",value:function(){this.stats.get(Zh),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(e,t){var r=new Ih(this,e.root,t);if(t&&(t.children.push(r),r.depth=t.depth+1),this.type===ih){var n=[];for(n.push(r);n.length>0;){var i=n.pop();this.stats.get(Zh).incrementCount();var a,o=Kh(i.header.children||[]);try{for(o.s();!(a=o.n()).done;){var s=a.value,u=new Ih(this,s,i);i.children.push(u),u.depth=i.depth+1,n.push(u)}}catch(e){o.e(e)}finally{o.f()}}}return r}},{key:"_initializeTraverser",value:function(){var e;switch(this.type){case ih:e=Rh;break;case nh:e=zh;break;default:e=Th}return new e({basePath:this.basePath,onTraversalEnd:this._onTraversalEnd.bind(this)})}},{key:"_destroyTileHeaders",value:function(e){this._destroySubtree(e)}},{key:"_loadTile",value:(t=Me()(Pe.a.mark((function e(t){var r;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,this._onStartTileLoading(),e.next=4,t.loadContent();case 4:r=e.sent,e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),this._onTileLoadError(t,e.t0);case 10:return e.prev=10,this._onEndTileLoading(),this._onTileLoad(t,r),e.finish(10);case 14:case"end":return e.stop()}}),e,this,[[0,7,10,14]])}))),function(e){return t.apply(this,arguments)})},{key:"_onTileLoadError",value:function(e,t){this.stats.get("Failed Tile Loads").incrementCount();var r=t.message||t.toString(),n=e.url;console.error("A 3D tile failed to load: ".concat(e.url," ").concat(r)),this.options.onTileError(e,r,n)}},{key:"_onTileLoad",value:function(e,t){if(t){if(this.type===nh){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(Zh).reset(),this.stats.get(Zh).addCount(i)}e&&e.content&&function(e,t){eu(e),eu(t);var r=t.rtcCenter,n=t.gltfUpAxis,i=e.computedTransform,a=e.boundingVolume.center,o=new Wr(i);switch(r&&o.translate(r),n){case"Z":break;case"Y":var s=(new Wr).rotateX(Math.PI/2);o=o.multiplyRight(s);break;case"X":var u=(new Wr).rotateY(-Math.PI/2);o=o.multiplyRight(u)}t.isQuantized&&o.translate(t.quantizedVolumeOffset).scale(t.quantizedVolumeScale);var c=new Tt(a);t.cartesianModelMatrix=o,t.cartesianOrigin=c;var l=kf.WGS84.cartesianToCartographic(c,new Tt),f=kf.WGS84.eastNorthUpToFixedFrame(c).invert();t.cartographicModelMatrix=f.multiplyRight(o),t.cartographicOrigin=l,t.coordinateSystem||(t.modelMatrix=t.cartographicModelMatrix)}(e,e.content),this._addTileToCache(e),this.options.onTileLoad(e)}}},{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(e){this._cache.add(this,e,(function(t){return t._updateCacheStats(e)}))}},{key:"_updateCacheStats",value:function(e){this.stats.get("Tiles Loaded").incrementCount(),this.stats.get("Tiles In Memory").incrementCount(),this.gpuMemoryUsageInBytes+=e.content.byteLength||0,this.stats.get("Tile Memory Use").count=this.gpuMemoryUsageInBytes}},{key:"_unloadTile",value:function(e){this.gpuMemoryUsageInBytes-=e.content&&e.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(e),e.unloadContent()}},{key:"_destroy",value:function(){var e=[];for(this.root&&e.push(this.root);e.length>0;){var t,r=e.pop(),n=Kh(r.children);try{for(n.s();!(t=n.n()).done;){var i=t.value;e.push(i)}}catch(e){n.e(e)}finally{n.f()}this._destroyTile(r)}this.root=null}},{key:"_destroySubtree",value:function(e){var t=e,r=[];for(r.push(t);r.length>0;){var n,i=Kh((e=r.pop()).children);try{for(i.s();!(n=i.n()).done;){var a=n.value;r.push(a)}}catch(e){i.e(e)}finally{i.f()}e!==t&&this._destroyTile(e)}t.children=[]}},{key:"_destroyTile",value:function(e){this._cache.unloadTile(this,e),this._unloadTile(e),e.destroy()}},{key:"_initializeTiles3DTileset",value:function(e){if(this.asset=e.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=e.properties,this.geometricError=e.geometricError,this._extensionsUsed=e.extensionsUsed,this.extras=e.extras}},{key:"_initializeI3STileset",value:function(){this.loadOptions.i3s&&"token"in this.loadOptions.i3s&&(this._queryParams.token=this.loadOptions.i3s.token)}}]),e}();var $h={COMPOSITE:"cmpt",POINT_CLOUD:"pnts",BATCHED_3D_MODEL:"b3dm",INSTANCED_3D_MODEL:"i3dm",GEOMETRY:"geom",VECTOR:"vect",GLTF:"glTF"};Object.keys($h);function ed(e,t,r){eu(e instanceof ArrayBuffer);var n=new TextDecoder("utf8"),i=new Uint8Array(e,t,r);return n.decode(i)}function td(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=new DataView(e);return"".concat(String.fromCharCode(r.getUint8(t+0))).concat(String.fromCharCode(r.getUint8(t+1))).concat(String.fromCharCode(r.getUint8(t+2))).concat(String.fromCharCode(r.getUint8(t+3)))}var rd={name:"Draco",id:"draco",module:"draco",shapes:["mesh"],version:"3.2.10",worker:!0,extensions:["drc"],mimeTypes:["application/octet-stream"],binary:!0,tests:["DRACO"],options:{draco:{decoderType:"object"===("undefined"==typeof WebAssembly?"undefined":mi()(WebAssembly))?"wasm":"js",libraryPath:"libs/",extraAttributes:{},attributeNameEntry:void 0}}};function nd(e){for(var t=1/0,r=1/0,n=1/0,i=-1/0,a=-1/0,o=-1/0,s=e.POSITION?e.POSITION.value:[],u=s&&s.length,c=0;c<u;c+=3){var l=s[c],f=s[c+1],h=s[c+2];t=l<t?l:t,r=f<r?f:r,n=h<n?h:n,i=l>i?l:i,a=f>a?f:a,o=h>o?h:o}return[[t,r,n],[i,a,o]]}function id(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return ad(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ad(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function ad(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var od=function(){function e(t,r){h()(this,e),Hn(this,"fields",void 0),Hn(this,"metadata",void 0),function(e,t){if(!e)throw new Error(t||"loader assertion failed.")}(Array.isArray(t)),function(e){var t,r={},n=id(e);try{for(n.s();!(t=n.n()).done;){var i=t.value;r[i.name]&&console.warn("Schema: duplicated field name",i.name,i),r[i.name]=!0}}catch(e){n.e(e)}finally{n.f()}}(t),this.fields=t,this.metadata=r||new Map}return C()(e,[{key:"compareTo",value:function(e){if(this.metadata!==e.metadata)return!1;if(this.fields.length!==e.fields.length)return!1;for(var t=0;t<this.fields.length;++t)if(!this.fields[t].compareTo(e.fields[t]))return!1;return!0}},{key:"select",value:function(){for(var t=Object.create(null),r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];for(var a=0,o=n;a<o.length;a++){var s=o[a];t[s]=!0}var u=this.fields.filter((function(e){return t[e.name]}));return new e(u,this.metadata)}},{key:"selectAt",value:function(){for(var t=this,r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];var a=n.map((function(e){return t.fields[e]})).filter(Boolean);return new e(a,this.metadata)}},{key:"assign",value:function(t){var r,n=this.metadata;if(t instanceof e){var i=t;r=i.fields,n=sd(sd(new Map,this.metadata),i.metadata)}else r=t;var a,o=Object.create(null),s=id(this.fields);try{for(s.s();!(a=s.n()).done;){var u=a.value;o[u.name]=u}}catch(e){s.e(e)}finally{s.f()}var c,l=id(r);try{for(l.s();!(c=l.n()).done;){var f=c.value;o[f.name]=f}}catch(e){l.e(e)}finally{l.f()}return new e(Object.values(o),n)}}]),e}();function sd(e,t){return new Map([].concat(De()(e||new Map),De()(t||new Map)))}var ud,cd=function(){function e(t,r){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new Map;h()(this,e),Hn(this,"name",void 0),Hn(this,"type",void 0),Hn(this,"nullable",void 0),Hn(this,"metadata",void 0),this.name=t,this.type=r,this.nullable=n,this.metadata=i}return C()(e,[{key:"typeId",get:function(){return this.type&&this.type.typeId}},{key:"clone",value:function(){return new e(this.name,this.type,this.nullable,this.metadata)}},{key:"compareTo",value:function(e){return this.name===e.name&&this.type===e.type&&this.nullable===e.nullable&&this.metadata===e.metadata}},{key:"toString",value:function(){return"".concat(this.type).concat(this.nullable?", nullable":"").concat(this.metadata?", metadata: ".concat(this.metadata):"")}}]),e}();function ld(e){var t=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(e){return!1}}();return function(){var r,n=m()(e);if(t){var i=m()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return y()(this,r)}}!function(e){e[e.NONE=0]="NONE",e[e.Null=1]="Null",e[e.Int=2]="Int",e[e.Float=3]="Float",e[e.Binary=4]="Binary",e[e.Utf8=5]="Utf8",e[e.Bool=6]="Bool",e[e.Decimal=7]="Decimal",e[e.Date=8]="Date",e[e.Time=9]="Time",e[e.Timestamp=10]="Timestamp",e[e.Interval=11]="Interval",e[e.List=12]="List",e[e.Struct=13]="Struct",e[e.Union=14]="Union",e[e.FixedSizeBinary=15]="FixedSizeBinary",e[e.FixedSizeList=16]="FixedSizeList",e[e.Map=17]="Map",e[e.Dictionary=-1]="Dictionary",e[e.Int8=-2]="Int8",e[e.Int16=-3]="Int16",e[e.Int32=-4]="Int32",e[e.Int64=-5]="Int64",e[e.Uint8=-6]="Uint8",e[e.Uint16=-7]="Uint16",e[e.Uint32=-8]="Uint32",e[e.Uint64=-9]="Uint64",e[e.Float16=-10]="Float16",e[e.Float32=-11]="Float32",e[e.Float64=-12]="Float64",e[e.DateDay=-13]="DateDay",e[e.DateMillisecond=-14]="DateMillisecond",e[e.TimestampSecond=-15]="TimestampSecond",e[e.TimestampMillisecond=-16]="TimestampMillisecond",e[e.TimestampMicrosecond=-17]="TimestampMicrosecond",e[e.TimestampNanosecond=-18]="TimestampNanosecond",e[e.TimeSecond=-19]="TimeSecond",e[e.TimeMillisecond=-20]="TimeMillisecond",e[e.TimeMicrosecond=-21]="TimeMicrosecond",e[e.TimeNanosecond=-22]="TimeNanosecond",e[e.DenseUnion=-23]="DenseUnion",e[e.SparseUnion=-24]="SparseUnion",e[e.IntervalDayTime=-25]="IntervalDayTime",e[e.IntervalYearMonth=-26]="IntervalYearMonth"}(ud||(ud={}));var fd=function(){function e(){h()(this,e)}return C()(e,[{key:"typeId",get:function(){return ud.NONE}},{key:"compareTo",value:function(e){return this===e}}],[{key:"isNull",value:function(e){return e&&e.typeId===ud.Null}},{key:"isInt",value:function(e){return e&&e.typeId===ud.Int}},{key:"isFloat",value:function(e){return e&&e.typeId===ud.Float}},{key:"isBinary",value:function(e){return e&&e.typeId===ud.Binary}},{key:"isUtf8",value:function(e){return e&&e.typeId===ud.Utf8}},{key:"isBool",value:function(e){return e&&e.typeId===ud.Bool}},{key:"isDecimal",value:function(e){return e&&e.typeId===ud.Decimal}},{key:"isDate",value:function(e){return e&&e.typeId===ud.Date}},{key:"isTime",value:function(e){return e&&e.typeId===ud.Time}},{key:"isTimestamp",value:function(e){return e&&e.typeId===ud.Timestamp}},{key:"isInterval",value:function(e){return e&&e.typeId===ud.Interval}},{key:"isList",value:function(e){return e&&e.typeId===ud.List}},{key:"isStruct",value:function(e){return e&&e.typeId===ud.Struct}},{key:"isUnion",value:function(e){return e&&e.typeId===ud.Union}},{key:"isFixedSizeBinary",value:function(e){return e&&e.typeId===ud.FixedSizeBinary}},{key:"isFixedSizeList",value:function(e){return e&&e.typeId===ud.FixedSizeList}},{key:"isMap",value:function(e){return e&&e.typeId===ud.Map}},{key:"isDictionary",value:function(e){return e&&e.typeId===ud.Dictionary}}]),e}(),hd=(Symbol.toStringTag,Symbol.toStringTag,function(e,t){p()(n,e);var r=ld(n);function n(e,t){var i;return h()(this,n),i=r.call(this),Hn(yi()(i),"isSigned",void 0),Hn(yi()(i),"bitWidth",void 0),i.isSigned=e,i.bitWidth=t,i}return C()(n,[{key:"typeId",get:function(){return ud.Int}},{key:t,get:function(){return"Int"}},{key:"toString",value:function(){return"".concat(this.isSigned?"I":"Ui","nt").concat(this.bitWidth)}}]),n}(fd,Symbol.toStringTag)),dd=function(e){p()(r,e);var t=ld(r);function r(){return h()(this,r),t.call(this,!0,8)}return r}(hd),pd=function(e){p()(r,e);var t=ld(r);function r(){return h()(this,r),t.call(this,!0,16)}return r}(hd),vd=function(e){p()(r,e);var t=ld(r);function r(){return h()(this,r),t.call(this,!0,32)}return r}(hd),yd=function(e){p()(r,e);var t=ld(r);function r(){return h()(this,r),t.call(this,!1,8)}return r}(hd),gd=function(e){p()(r,e);var t=ld(r);function r(){return h()(this,r),t.call(this,!1,16)}return r}(hd),md=function(e){p()(r,e);var t=ld(r);function r(){return h()(this,r),t.call(this,!1,32)}return r}(hd),bd=32,Ad=64,Bd=function(e,t){p()(n,e);var r=ld(n);function n(e){var t;return h()(this,n),t=r.call(this),Hn(yi()(t),"precision",void 0),t.precision=e,t}return C()(n,[{key:"typeId",get:function(){return ud.Float}},{key:t,get:function(){return"Float"}},{key:"toString",value:function(){return"Float".concat(this.precision)}}]),n}(fd,Symbol.toStringTag),wd=function(e){p()(r,e);var t=ld(r);function r(){return h()(this,r),t.call(this,bd)}return r}(Bd),_d=function(e){p()(r,e);var t=ld(r);function r(){return h()(this,r),t.call(this,Ad)}return r}(Bd),xd=(Symbol.toStringTag,Symbol.toStringTag,{DAY:0,MILLISECOND:1}),Cd=(Symbol.toStringTag,{SECOND:1,MILLISECOND:1e3,MICROSECOND:1e6,NANOSECOND:1e9}),Od=(Symbol.toStringTag,Symbol.toStringTag,{DAY_TIME:0,YEAR_MONTH:1}),Ed=(Symbol.toStringTag,function(e,t){p()(n,e);var r=ld(n);function n(e,t){var i;return h()(this,n),i=r.call(this),Hn(yi()(i),"listSize",void 0),Hn(yi()(i),"children",void 0),i.listSize=e,i.children=[t],i}return C()(n,[{key:"typeId",get:function(){return ud.FixedSizeList}},{key:"valueType",get:function(){return this.children[0].type}},{key:"valueField",get:function(){return this.children[0]}},{key:t,get:function(){return"FixedSizeList"}},{key:"toString",value:function(){return"FixedSizeList[".concat(this.listSize,"]<").concat(this.valueType,">")}}]),n}(fd,Symbol.toStringTag));Symbol.toStringTag;function Td(e,t,r){var n=function(e){switch(e.constructor){case Int8Array:return new dd;case Uint8Array:return new yd;case Int16Array:return new pd;case Uint16Array:return new gd;case Int32Array:return new vd;case Uint32Array:return new md;case Float32Array:return new wd;case Float64Array:return new _d;default:throw new Error("array type not supported")}}(t.value),i=r||function(e){var t=new Map;"byteOffset"in e&&t.set("byteOffset",e.byteOffset.toString(10));"byteStride"in e&&t.set("byteStride",e.byteStride.toString(10));"normalized"in e&&t.set("normalized",e.normalized.toString());return t}(t);return new cd(e,new Ed(t.size,new cd("value",n)),!1,i)}function Sd(e,t,r){var n=Md(t.metadata),i=[],a=function(e){var t={};for(var r in e){var n=e[r];t[n.name||"undefined"]=n}return t}(t.attributes);for(var o in e){var s=kd(o,e[o],a[o]);i.push(s)}if(r){var u=kd("indices",r);i.push(u)}return new od(i,n)}function kd(e,t,r){return Td(e,t,r?Md(r.metadata):void 0)}function Md(e){var t=new Map;for(var r in e)t.set("".concat(r,".string"),JSON.stringify(e[r]));return t}function Id(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return Pd(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Pd(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function Pd(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Rd(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Fd(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Rd(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Rd(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Dd={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},Ld={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array},jd=function(){function e(t){h()(this,e),Hn(this,"draco",void 0),Hn(this,"decoder",void 0),Hn(this,"metadataQuerier",void 0),this.draco=t,this.decoder=new this.draco.Decoder,this.metadataQuerier=new this.draco.MetadataQuerier}return C()(e,[{key:"destroy",value:function(){this.draco.destroy(this.decoder),this.draco.destroy(this.metadataQuerier)}},{key:"parseSync",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=new this.draco.DecoderBuffer;r.Init(new Int8Array(e),e.byteLength),this._disableAttributeTransforms(t);var n=this.decoder.GetEncodedGeometryType(r),i=n===this.draco.TRIANGULAR_MESH?new this.draco.Mesh:new this.draco.PointCloud;try{var a;switch(n){case this.draco.TRIANGULAR_MESH:a=this.decoder.DecodeBufferToMesh(r,i);break;case this.draco.POINT_CLOUD:a=this.decoder.DecodeBufferToPointCloud(r,i);break;default:throw new Error("DRACO: Unknown geometry type.")}if(!a.ok()||!i.ptr){var o="DRACO decompression failed: ".concat(a.error_msg());throw new Error(o)}var s=this._getDracoLoaderData(i,n,t),u=this._getMeshData(i,s,t),c=nd(u.attributes),l=Sd(u.attributes,s,u.indices),f=Fd(Fd({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(e,t,r){var n=this._getTopLevelMetadata(e),i=this._getDracoAttributes(e,r);return{geometry_type:t,num_attributes:e.num_attributes(),num_points:e.num_points(),num_faces:e instanceof this.draco.Mesh?e.num_faces():0,metadata:n,attributes:i}}},{key:"_getDracoAttributes",value:function(e,t){for(var r={},n=0;n<e.num_attributes();n++){var i=this.decoder.GetAttribute(e,n),a=this._getAttributeMetadata(e,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:a};var o=this._getQuantizationTransform(i,t);o&&(r[i.unique_id()].quantization_transform=o);var s=this._getOctahedronTransform(i,t);s&&(r[i.unique_id()].octahedron_transform=s)}return r}},{key:"_getMeshData",value:function(e,t,r){var n=this._getMeshAttributes(t,e,r);if(!n.POSITION)throw new Error("DRACO: No position attribute found.");if(e instanceof this.draco.Mesh)switch(r.topology){case"triangle-strip":return{topology:"triangle-strip",mode:4,attributes:n,indices:{value:this._getTriangleStripIndices(e),size:1}};case"triangle-list":default:return{topology:"triangle-list",mode:5,attributes:n,indices:{value:this._getTriangleListIndices(e),size:1}}}return{topology:"point-list",mode:0,attributes:n}}},{key:"_getMeshAttributes",value:function(e,t,r){for(var n={},i=0,a=Object.values(e.attributes);i<a.length;i++){var o=a[i],s=this._deduceAttributeName(o,r);o.name=s;var u=this._getAttributeValues(t,o),c=u.value,l=u.size;n[s]={value:c,size:l,byteOffset:o.byte_offset,byteStride:o.byte_stride,normalized:o.normalized}}return n}},{key:"_getTriangleListIndices",value:function(e){var t=3*e.num_faces(),r=4*t,n=this.draco._malloc(r);try{return this.decoder.GetTrianglesUInt32Array(e,r,n),new Uint32Array(this.draco.HEAPF32.buffer,n,t).slice()}finally{this.draco._free(n)}}},{key:"_getTriangleStripIndices",value:function(e){var t=new this.draco.DracoInt32Array;try{return this.decoder.GetTriangleStripsFromMesh(e,t),function(e){for(var t=e.size(),r=new Int32Array(t),n=0;n<t;n++)r[n]=e.GetValue(n);return r}(t)}finally{this.draco.destroy(t)}}},{key:"_getAttributeValues",value:function(e,t){var r,n=Ld[t.data_type],i=t.num_components,a=e.num_points()*i,o=a*n.BYTES_PER_ELEMENT,s=function(e,t){switch(t){case Float32Array:return e.DT_FLOAT32;case Int8Array:return e.DT_INT8;case Int16Array:return e.DT_INT16;case Int32Array:return e.DT_INT32;case Uint8Array:return e.DT_UINT8;case Uint16Array:return e.DT_UINT16;case Uint32Array:return e.DT_UINT32;default:return e.DT_INVALID}}(this.draco,n),u=this.draco._malloc(o);try{var c=this.decoder.GetAttribute(e,t.attribute_index);this.decoder.GetAttributeDataArrayForAllPoints(e,c,s,o,u),r=new n(this.draco.HEAPF32.buffer,u,a).slice()}finally{this.draco._free(u)}return{value:r,size:i}}},{key:"_deduceAttributeName",value:function(e,t){for(var r=e.unique_id,n=0,i=Object.entries(t.extraAttributes||{});n<i.length;n++){var a=M()(i[n],2),o=a[0];if(a[1]===r)return o}var s=e.attribute_type;for(var u in Dd){if(this.draco[u]===s)return Dd[u]}var c=t.attributeNameEntry||"name";return e.metadata[c]?e.metadata[c].string:"CUSTOM_ATTRIBUTE_".concat(r)}},{key:"_getTopLevelMetadata",value:function(e){var t=this.decoder.GetMetadata(e);return this._getDracoMetadata(t)}},{key:"_getAttributeMetadata",value:function(e,t){var r=this.decoder.GetAttributeMetadata(e,t);return this._getDracoMetadata(r)}},{key:"_getDracoMetadata",value:function(e){if(!e||!e.ptr)return{};for(var t={},r=this.metadataQuerier.NumEntries(e),n=0;n<r;n++){var i=this.metadataQuerier.GetEntryName(e,n);t[i]=this._getDracoMetadataField(e,i)}return t}},{key:"_getDracoMetadataField",value:function(e,t){var r=new this.draco.DracoInt32Array;try{this.metadataQuerier.GetIntEntryArray(e,t,r);var n=function(e){for(var t=e.size(),r=new Int32Array(t),n=0;n<t;n++)r[n]=e.GetValue(n);return r}(r);return{int:this.metadataQuerier.GetIntEntry(e,t),string:this.metadataQuerier.GetStringEntry(e,t),double:this.metadataQuerier.GetDoubleEntry(e,t),intArray:n}}finally{this.draco.destroy(r)}}},{key:"_disableAttributeTransforms",value:function(e){var t,r=e.quantizedAttributes,n=void 0===r?[]:r,i=e.octahedronAttributes,a=void 0===i?[]:i,o=Id([].concat(De()(n),De()(a)));try{for(o.s();!(t=o.n()).done;){var s=t.value;this.decoder.SkipAttributeTransform(this.draco[s])}}catch(e){o.e(e)}finally{o.f()}}},{key:"_getQuantizationTransform",value:function(e,t){var r=this,n=t.quantizedAttributes,i=void 0===n?[]:n,a=e.attribute_type();if(i.map((function(e){return r.decoder[e]})).includes(a)){var o=new this.draco.AttributeQuantizationTransform;try{if(o.InitFromAttribute(e))return{quantization_bits:o.quantization_bits(),range:o.range(),min_values:new Float32Array([1,2,3]).map((function(e){return o.min_value(e)}))}}finally{this.draco.destroy(o)}}return null}},{key:"_getOctahedronTransform",value:function(e,t){var r=this,n=t.octahedronAttributes,i=void 0===n?[]:n,a=e.attribute_type();if(i.map((function(e){return r.decoder[e]})).includes(a)){var o=new this.draco.AttributeQuantizationTransform;try{if(o.InitFromAttribute(e))return{quantization_bits:o.quantization_bits()}}finally{this.draco.destroy(o)}}return null}}]),e}();var Gd=r(28),Ud={};function Nd(e){return Hd.apply(this,arguments)}function Hd(){return(Hd=Me()(Pe.a.mark((function e(t){var r,n,i=arguments;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.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&&(t=Jd(t,r,n)),Ud[t]=Ud[t]||Vd(t),e.next=6,Ud[t];case 6:return e.abrupt("return",e.sent);case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Jd(e,t,r){if(e.startsWith("http"))return e;var n=r.modules||{};return n[e]?n[e]:Bc?r.CDN?(gc(r.CDN.startsWith("http")),"".concat(r.CDN,"/").concat(t,"@").concat("3.2.10","/dist/libs/").concat(e)):wc?"../src/libs/".concat(e):"modules/".concat(t,"/src/libs/").concat(e):"modules/".concat(t,"/dist/libs/").concat(e)}function Vd(e){return zd.apply(this,arguments)}function zd(){return(zd=Me()(Pe.a.mark((function e(t){var r,n,i;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.endsWith("wasm")){e.next=7;break}return e.next=3,fetch(t);case 3:return r=e.sent,e.next=6,r.arrayBuffer();case 6:return e.abrupt("return",e.sent);case 7:if(Bc){e.next=20;break}if(e.prev=8,e.t0=Gd&&Gd.requireFromFile,!e.t0){e.next=14;break}return e.next=13,Gd.requireFromFile(t);case 13:e.t0=e.sent;case 14:return e.abrupt("return",e.t0);case 17:return e.prev=17,e.t1=e.catch(8),e.abrupt("return",null);case 20:if(!wc){e.next=22;break}return e.abrupt("return",importScripts(t));case 22:return e.next=24,fetch(t);case 24:return n=e.sent,e.next=27,n.text();case 27:return i=e.sent,e.abrupt("return",Kd(i,t));case 29:case"end":return e.stop()}}),e,null,[[8,17]])})))).apply(this,arguments)}function Kd(e,t){if(!Bc)return Gd.requireFromString&&Gd.requireFromString(e,t);if(wc)return eval.call(Ac,e),null;var r=document.createElement("script");r.id=t;try{r.appendChild(document.createTextNode(e))}catch(t){r.text=e}return document.body.appendChild(r),null}function qd(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Xd(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?qd(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):qd(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Qd,Wd="https://www.gstatic.com/draco/versioned/decoders/".concat("1.4.1","/draco_decoder.js"),Zd="https://www.gstatic.com/draco/versioned/decoders/".concat("1.4.1","/draco_wasm_wrapper.js"),Yd="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 $d(e){return ep.apply(this,arguments)}function ep(){return(ep=Me()(Pe.a.mark((function e(t){var r;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.modules||{},Qd=r.draco3d?Qd||r.draco3d.createDecoderModule({}).then((function(e){return{draco:e}})):Qd||tp(t),e.next=4,Qd;case 4:return e.abrupt("return",e.sent);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function tp(e){return rp.apply(this,arguments)}function rp(){return(rp=Me()(Pe.a.mark((function e(t){var r,n,i,a;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.t0=t.draco&&t.draco.decoderType,e.next="js"===e.t0?3:(e.t0,7);break;case 3:return e.next=5,Nd(Wd,"draco",t);case 5:return r=e.sent,e.abrupt("break",21);case 7:return e.t1=Promise,e.next=10,Nd(Zd,"draco",t);case 10:return e.t2=e.sent,e.next=13,Nd(Yd,"draco",t);case 13:return e.t3=e.sent,e.t4=[e.t2,e.t3],e.next=17,e.t1.all.call(e.t1,e.t4);case 17:i=e.sent,a=M()(i,2),r=a[0],n=a[1];case 21:return r=r||globalThis.DracoDecoderModule,e.next=24,np(r,n);case 24:return e.abrupt("return",e.sent);case 25:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function np(e,t){var r={};return t&&(r.wasmBinary=t),new Promise((function(t){e(Xd(Xd({},r),{},{onModuleLoaded:function(e){return t({draco:e})}}))}))}function ip(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ap(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ip(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ip(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var op=ap(ap({},rd),{},{parse:function(e,t){return sp.apply(this,arguments)}});function sp(){return(sp=Me()(Pe.a.mark((function e(t,r){var n,i,a;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,$d(r);case 2:return n=e.sent,i=n.draco,a=new jd(i),e.prev=5,e.abrupt("return",a.parseSync(t,null==r?void 0:r.draco));case 7:return e.prev=7,a.destroy(),e.finish(7);case 10:case"end":return e.stop()}}),e,null,[[5,,7,10]])})))).apply(this,arguments)}var up,cp=(up={},A()(up,5130,Float64Array),A()(up,5126,Float32Array),A()(up,5123,Uint16Array),A()(up,5125,Uint32Array),A()(up,5121,Uint8Array),A()(up,5120,Int8Array),A()(up,5122,Int16Array),A()(up,5124,Int32Array),up),lp={DOUBLE:5130,FLOAT:5126,UNSIGNED_SHORT:5123,UNSIGNED_INT:5125,UNSIGNED_BYTE:5121,BYTE:5120,SHORT:5122,INT:5124},fp=function(){function e(){h()(this,e)}return C()(e,null,[{key:"fromTypedArray",value:function(e){for(var t in e=ArrayBuffer.isView(e)?e.constructor:e,cp){if(cp[t]===e)return t}throw new Error("Failed to convert GL type")}},{key:"fromName",value:function(e){var t=lp[e];if(!t)throw new Error("Failed to convert GL type");return t}},{key:"getArrayType",value:function(e){switch(e){case 33635:case 32819:case 32820:return Uint16Array;default:var t=cp[e];if(!t)throw new Error("Failed to convert GL type");return t}}},{key:"getByteSize",value:function(t){return e.getArrayType(t).BYTES_PER_ELEMENT}},{key:"validate",value:function(t){return Boolean(e.getArrayType(t))}},{key:"createTypedArray",value:function(t,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)/e.getByteSize(t));var a=e.getArrayType(t);return new a(r,n,i)}}]),e}(),hp=function(){function e(t,r){h()(this,e),Hn(this,"json",void 0),Hn(this,"buffer",void 0),Hn(this,"featuresLength",0),Hn(this,"_cachedTypedArrays",{}),this.json=t,this.buffer=r}return C()(e,[{key:"getExtension",value:function(e){return this.json.extensions&&this.json.extensions[e]}},{key:"hasProperty",value:function(e){return Boolean(this.json[e])}},{key:"getGlobalProperty",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5125,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,n=this.json[e];return n&&Number.isFinite(n.byteOffset)?this._getTypedArrayFromBinary(e,t,r,1,n.byteOffset):n}},{key:"getPropertyArray",value:function(e,t,r){var n=this.json[e];return n&&Number.isFinite(n.byteOffset)?("componentType"in n&&(t=fp.fromName(n.componentType)),this._getTypedArrayFromBinary(e,t,r,this.featuresLength,n.byteOffset)):this._getTypedArrayFromArray(e,t,n)}},{key:"getProperty",value:function(e,t,r,n,i){var a=this.json[e];if(!a)return a;var o=this.getPropertyArray(e,t,r);if(1===r)return o[n];for(var s=0;s<r;++s)i[s]=o[r*n+s];return i}},{key:"_getTypedArrayFromBinary",value:function(e,t,r,n,i){var a=this._cachedTypedArrays,o=a[e];return o||(o=fp.createTypedArray(t,this.buffer.buffer,this.buffer.byteOffset+i,n*r),a[e]=o),o}},{key:"_getTypedArrayFromArray",value:function(e,t,r){var n=this._cachedTypedArrays,i=n[e];return i||(i=fp.createTypedArray(t,r),n[e]=i),i}}]),e}(),dp={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},pp={SCALAR:function(e,t){return e[t]},VEC2:function(e,t){return[e[2*t+0],e[2*t+1]]},VEC3:function(e,t){return[e[3*t+0],e[3*t+1],e[3*t+2]]},VEC4:function(e,t){return[e[4*t+0],e[4*t+1],e[4*t+2],e[4*t+3]]},MAT2:function(e,t){return[e[4*t+0],e[4*t+1],e[4*t+2],e[4*t+3]]},MAT3:function(e,t){return[e[9*t+0],e[9*t+1],e[9*t+2],e[9*t+3],e[9*t+4],e[9*t+5],e[9*t+6],e[9*t+7],e[9*t+8]]},MAT4:function(e,t){return[e[16*t+0],e[16*t+1],e[16*t+2],e[16*t+3],e[16*t+4],e[16*t+5],e[16*t+6],e[16*t+7],e[16*t+8],e[16*t+9],e[16*t+10],e[16*t+11],e[16*t+12],e[16*t+13],e[16*t+14],e[16*t+15]]}},vp={SCALAR:function(e,t,r){t[r]=e},VEC2:function(e,t,r){t[2*r+0]=e[0],t[2*r+1]=e[1]},VEC3:function(e,t,r){t[3*r+0]=e[0],t[3*r+1]=e[1],t[3*r+2]=e[2]},VEC4:function(e,t,r){t[4*r+0]=e[0],t[4*r+1]=e[1],t[4*r+2]=e[2],t[4*r+3]=e[3]},MAT2:function(e,t,r){t[4*r+0]=e[0],t[4*r+1]=e[1],t[4*r+2]=e[2],t[4*r+3]=e[3]},MAT3:function(e,t,r){t[9*r+0]=e[0],t[9*r+1]=e[1],t[9*r+2]=e[2],t[9*r+3]=e[3],t[9*r+4]=e[4],t[9*r+5]=e[5],t[9*r+6]=e[6],t[9*r+7]=e[7],t[9*r+8]=e[8],t[9*r+9]=e[9]},MAT4:function(e,t,r){t[16*r+0]=e[0],t[16*r+1]=e[1],t[16*r+2]=e[2],t[16*r+3]=e[3],t[16*r+4]=e[4],t[16*r+5]=e[5],t[16*r+6]=e[6],t[16*r+7]=e[7],t[16*r+8]=e[8],t[16*r+9]=e[9],t[16*r+10]=e[10],t[16*r+11]=e[11],t[16*r+12]=e[12],t[16*r+13]=e[13],t[16*r+14]=e[14],t[16*r+15]=e[15]}};var yp=function(e){return void 0!==e};function gp(e,t,r){if(!t)return null;var n=e.getExtension("3DTILES_batch_table_hierarchy"),i=t.HIERARCHY;return i&&(console.warn("3D Tile Parser: HIERARCHY is deprecated. Use 3DTILES_batch_table_hierarchy."),t.extensions=t.extensions||{},t.extensions["3DTILES_batch_table_hierarchy"]=i,n=i),n?function(e,t){var r,n,i,a,o=e.instancesLength,s=e.classes,u=e.classIds,c=e.parentCounts,l=e.parentIds,f=o;yp(u.byteOffset)&&(u.componentType=defaultValue(u.componentType,5123),u.type=AttributeType.SCALAR,i=getBinaryAccessor(u),u=i.createArrayBufferView(t.buffer,t.byteOffset+u.byteOffset,o));if(yp(c))for(yp(c.byteOffset)&&(c.componentType=defaultValue(c.componentType,5123),c.type=AttributeType.SCALAR,i=getBinaryAccessor(c),c=i.createArrayBufferView(t.buffer,t.byteOffset+c.byteOffset,o)),a=new Uint16Array(o),f=0,r=0;r<o;++r)a[r]=f,f+=c[r];yp(l)&&yp(l.byteOffset)&&(l.componentType=defaultValue(l.componentType,5123),l.type=AttributeType.SCALAR,i=getBinaryAccessor(l),l=i.createArrayBufferView(t.buffer,t.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,t);s[r].instances=combine(v,p)}var y=new Array(h).fill(0),g=new Uint16Array(o);for(r=0;r<o;++r)n=u[r],g[r]=y[n],++y[n];var m={classes:s,classIds:u,classIndexes:g,parentCounts:c,parentIndexes:a,parentIds:l};return function(e){for(var t=e.classIds.length,r=0;r<t;++r)bp(e,r,stack)}(m),m}(n,r):null}function mp(e,t,r){if(e){var n=e.parentCounts;return e.parentIds?r(e,t):n>0?function(e,t,r){var n=e.classIds,i=e.parentCounts,a=e.parentIds,o=e.parentIndexes,s=n.length,u=scratchVisited;u.length=Math.max(u.length,s);var c=++marker,l=scratchStack;l.length=0,l.push(t);for(;l.length>0;)if(t=l.pop(),u[t]!==c){u[t]=c;var f=r(e,t);if(yp(f))return f;for(var h=i[t],d=o[t],p=0;p<h;++p){var v=a[d+p];v!==t&&l.push(v)}}return null}(e,t,r):function(e,t,r){var n=!0;for(;n;){var i=r(e,t);if(yp(i))return i;var a=e.parentIds[t];n=a!==t,t=a}throw new Error("traverseHierarchySingleParent")}(e,t,r)}}function bp(e,t,r){var n=e.parentCounts,i=e.parentIds,a=e.parentIndexes,o=e.classIds.length;if(yp(i)){assert(t<o,"Parent index ".concat(t," exceeds the total number of instances: ").concat(o)),assert(-1===r.indexOf(t),"Circular dependency detected in the batch table hierarchy."),r.push(t);for(var s=yp(n)?n[t]:1,u=yp(n)?a[t]:t,c=0;c<s;++c){var l=i[u+c];l!==t&&bp(e,l,r)}r.pop(t)}}function Ap(e){return null!=e}var Bp=function(e,t){return e},wp={HIERARCHY:!0,extensions:!0,extras:!0},_p=function(){function e(t,r,n){var i,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};for(var o in h()(this,e),Hn(this,"json",void 0),Hn(this,"binary",void 0),Hn(this,"featureCount",void 0),Hn(this,"_extensions",void 0),Hn(this,"_properties",void 0),Hn(this,"_binaryProperties",void 0),Hn(this,"_hierarchy",void 0),eu(n>=0),this.json=t||{},this.binary=r,this.featureCount=n,this._extensions=(null===(i=this.json)||void 0===i?void 0:i.extensions)||{},this._properties={},this.json)wp[o]||(this._properties[o]=this.json[o]);this._binaryProperties=this._initializeBinaryProperties(),a["3DTILES_batch_table_hierarchy"]&&(this._hierarchy=gp(this,this.json,this.binary))}return C()(e,[{key:"getExtension",value:function(e){return this.json&&this.json.extensions&&this.json.extensions[e]}},{key:"memorySizeInBytes",value:function(){return 0}},{key:"isClass",value:function(e,t){return this._checkBatchId(e),eu("string"==typeof t,t),!!this._hierarchy&&Ap(mp(this._hierarchy,e,(function(e,r){var n=e.classIds[r];return e.classes[n].name===t})))}},{key:"isExactClass",value:function(e,t){return eu("string"==typeof t,t),this.getExactClassName(e)===t}},{key:"getExactClassName",value:function(e){if(this._checkBatchId(e),this._hierarchy){var t=this._hierarchy.classIds[e];return this._hierarchy.classes[t].name}}},{key:"hasProperty",value:function(e,t){return this._checkBatchId(e),eu("string"==typeof t,t),Ap(this._properties[t])||this._hasPropertyInHierarchy(e,t)}},{key:"getPropertyNames",value:function(e,t){var r;this._checkBatchId(e),(t=Ap(t)?t:[]).length=0;var n=Object.keys(this._properties);return(r=t).push.apply(r,De()(n)),this._hierarchy&&this._getPropertyNamesInHierarchy(e,t),t}},{key:"getProperty",value:function(e,t){if(this._checkBatchId(e),eu("string"==typeof t,t),this._binaryProperties){var r=this._binaryProperties[t];if(Ap(r))return this._getBinaryProperty(r,e)}var n=this._properties[t];if(Ap(n))return Bp(n[e]);if(this._hierarchy){var i=this._getHierarchyProperty(e,t);if(Ap(i))return i}}},{key:"setProperty",value:function(e,t,r){var n=this.featureCount;if(this._checkBatchId(e),eu("string"==typeof t,t),this._binaryProperties){var i=this._binaryProperties[t];if(i)return void this._setBinaryProperty(i,e,r)}if(!this._hierarchy||!this._setHierarchyProperty(this,e,t,r)){var a=this._properties[t];Ap(a)||(this._properties[t]=new Array(n),a=this._properties[t]),a[e]=Bp(r)}}},{key:"_checkBatchId",value:function(e){if(!(e>=0&&e<this.featureCount))throw new Error("batchId not in range [0, featureCount - 1].")}},{key:"_getBinaryProperty",value:function(e,t){return e.unpack(e.typedArray,t)}},{key:"_setBinaryProperty",value:function(e,t,r){e.pack(r,e.typedArray,t)}},{key:"_initializeBinaryProperties",value:function(){var e=null;for(var t in this._properties){var r=this._properties[t],n=this._initializeBinaryProperty(t,r);n&&((e=e||{})[t]=n)}return e}},{key:"_initializeBinaryProperty",value:function(e,t){if("byteOffset"in t){var r=t;eu(this.binary,"Property ".concat(e," requires a batch table binary.")),eu(r.type,"Property ".concat(e," requires a type."));var n=function(e,t,r,n){var i=e.componentType;eu(e.componentType);var a="string"==typeof i?fp.fromName(i):i,o=dp[e.type],s=pp[e.type],u=vp[e.type];return r+=e.byteOffset,{values:fp.createTypedArray(a,t,r,o*n),type:a,size:o,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(e,t){if(!this._hierarchy)return!1;var r=mp(this._hierarchy,e,(function(e,r){var n=e.classIds[r];return Ap(e.classes[n].instances[t])}));return Ap(r)}},{key:"_getPropertyNamesInHierarchy",value:function(e,t){mp(this._hierarchy,e,(function(e,r){var n=e.classIds[r],i=e.classes[n].instances;for(var a in i)i.hasOwnProperty(a)&&-1===t.indexOf(a)&&t.push(a)}))}},{key:"_getHierarchyProperty",value:function(e,t){var r=this;return mp(this._hierarchy,e,(function(e,n){var i=e.classIds[n],a=e.classes[i],o=e.classIndexes[n],s=a.instances[t];return Ap(s)?Ap(s.typedArray)?r._getBinaryProperty(s,o):Bp(s[o]):null}))}},{key:"_setHierarchyProperty",value:function(e,t,r,n){var i=this,a=mp(this._hierarchy,t,(function(e,a){var o=e.classIds[a],s=e.classes[o],u=e.classIndexes[a],c=s.instances[r];return!!Ap(c)&&(eu(a===t,'Inherited property "'.concat(r,'" is read-only.')),Ap(c.typedArray)?i._setBinaryProperty(c,u,n):c[u]=Bp(n),!0)}));return Ap(a)}}]),e}();function xp(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=new DataView(t);if(e.magic=n.getUint32(r,!0),r+=4,e.version=n.getUint32(r,!0),r+=4,e.byteLength=n.getUint32(r,!0),r+=4,1!==e.version)throw new Error("3D Tile Version ".concat(e.version," not supported"));return r}function Cp(e,t,r){var n,i=new DataView(t);e.header=e.header||{};var a=i.getUint32(r,!0);r+=4;var o=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=a,s=o,u=0,a=0,o=0,console.warn("b3dm tile in legacy format.")):u>=570425344&&(r-=4,n=s,s=a,u=o,a=0,o=0,console.warn("b3dm tile in legacy format.")),e.header.featureTableJsonByteLength=a,e.header.featureTableBinaryByteLength=o,e.header.batchTableJsonByteLength=s,e.header.batchTableBinaryByteLength=u,e.header.batchLength=n,r}function Op(e,t,r,n){return r=function(e,t,r,n){var i=e.header,a=i.featureTableJsonByteLength,o=i.featureTableBinaryByteLength,s=i.batchLength;if(e.featureTableJson={BATCH_LENGTH:s||0},a>0){var u=ed(t,r,a);e.featureTableJson=JSON.parse(u)}return r+=a,e.featureTableBinary=new Uint8Array(t,r,o),r+=o}(e,t,r),r=function(e,t,r,n){var i=e.header,a=i.batchTableJsonByteLength,o=i.batchTableBinaryByteLength;if(a>0){var s=ed(t,r,a);e.batchTableJson=JSON.parse(s),r+=a,o>0&&(e.batchTableBinary=new Uint8Array(t,r,o),e.batchTableBinary=new Uint8Array(e.batchTableBinary),r+=o)}return r}(e,t,r)}function Ep(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0],r=e>>11&31,n=e>>5&63,i=31&e;return t[0]=r<<3,t[1]=n<<2,t[2]=i<<3,t}function Tp(e,t,r){if(!(t||e&&e.batchIds&&r))return null;var n=e.batchIds,i=e.isRGB565,a=e.pointCount;if(n&&r){for(var o=new Uint8ClampedArray(3*a),s=0;s<a;s++){var u=n[s],c=r.getProperty(u,"dimensions").map((function(e){return 255*e}));o[3*s]=c[0],o[3*s+1]=c[1],o[3*s+2]=c[2]}return{type:5121,value:o,size:3,normalized:!0}}if(i){for(var l=new Uint8ClampedArray(3*a),f=0;f<a;f++){var h=Ep(t[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 t&&t.length===3*a?{type:5121,value:t,size:3,normalized:!0}:{type:5121,value:t,size:4,normalized:!0}}function Sp(e,t){if(!e)throw new Error("math.gl assertion failed. ".concat(t))}new $r,new Tt,new $r,new $r,new Uint8Array(1);function kp(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:255;return lt(e,0,t)/t*2-1}function Mp(e){return e<0?-1:1}function Ip(e,t,r,n){if(Sp(n),e<0||e>r||t<0||t>r)throw new Error("x and y must be unsigned normalized integers between 0 and ".concat(r));if(n.x=kp(e,r),n.y=kp(t,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))*Mp(i),n.y=(1-Math.abs(i))*Mp(n.y)}return n.normalize()}function Pp(e,t,r){return Ip(e,t,255,r)}var Rp=new Tt;function Fp(e,t,r){return e.isQuantized?r["3d-tiles"]&&r["3d-tiles"].decodeQuantizedPositions?(e.isQuantized=!1,function(e,t){for(var r=new Tt,n=new Float32Array(3*e.pointCount),i=0;i<e.pointCount;i++)r.set(t[3*i],t[3*i+1],t[3*i+2]).scale(1/e.quantizedRange).multiply(e.quantizedVolumeScale).add(e.quantizedVolumeOffset).toArray(n,3*i);return n}(e,t)):{type:5123,value:t,size:3,normalized:!0}:t}function Dp(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Lp(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Dp(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Dp(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function jp(e,t,r,n,i){return Gp.apply(this,arguments)}function Gp(){return(Gp=Me()(Pe.a.mark((function e(t,r,n,i,a){var o,s,u;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=xp(t,r,n),n=Cp(t,r,n),n=Op(t,r,n),Up(t),o=Np(t),s=o.featureTable,u=o.batchTable,e.next=7,zp(t,s,u,i,a);case 7:return Hp(t,s,i),Jp(t,s,u),Vp(t,s),e.abrupt("return",n);case 11:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Up(e){e.attributes={positions:null,colors:null,normals:null,batchIds:null},e.isQuantized=!1,e.isTranslucent=!1,e.isRGB565=!1,e.isOctEncoded16P=!1}function Np(e){var t=new hp(e.featureTableJson,e.featureTableBinary),r=t.getGlobalProperty("POINTS_LENGTH");if(!Number.isFinite(r))throw new Error("POINTS_LENGTH must be defined");t.featuresLength=r,e.featuresLength=r,e.pointsLength=r,e.pointCount=r,e.rtcCenter=t.getGlobalProperty("RTC_CENTER",5126,3);var n=function(e,t){var r=null;if(!e.batchIds&&t.hasProperty("BATCH_ID")&&(e.batchIds=t.getPropertyArray("BATCH_ID",5123,1),e.batchIds)){var n=t.getGlobalProperty("BATCH_LENGTH");if(!n)throw new Error("Global property: BATCH_LENGTH must be defined when BATCH_ID is defined.");var i=e.batchTableJson,a=e.batchTableBinary;r=new _p(i,a,n)}return r}(e,t);return{featureTable:t,batchTable:n}}function Hp(e,t,r){if(!e.attributes.positions)if(t.hasProperty("POSITION"))e.attributes.positions=t.getPropertyArray("POSITION",5126,3);else if(t.hasProperty("POSITION_QUANTIZED")){var n=t.getPropertyArray("POSITION_QUANTIZED",5123,3);if(e.isQuantized=!0,e.quantizedRange=65535,e.quantizedVolumeScale=t.getGlobalProperty("QUANTIZED_VOLUME_SCALE",5126,3),!e.quantizedVolumeScale)throw new Error("QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");if(e.quantizedVolumeOffset=t.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",5126,3),!e.quantizedVolumeOffset)throw new Error("QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");e.attributes.positions=Fp(e,n,r)}if(!e.attributes.positions)throw new Error("Either POSITION or POSITION_QUANTIZED must be defined.")}function Jp(e,t,r){if(!e.attributes.colors){var n=null;t.hasProperty("RGBA")?(n=t.getPropertyArray("RGBA",5121,4),e.isTranslucent=!0):t.hasProperty("RGB")?n=t.getPropertyArray("RGB",5121,3):t.hasProperty("RGB565")&&(n=t.getPropertyArray("RGB565",5123,1),e.isRGB565=!0),e.attributes.colors=Tp(e,n,r)}t.hasProperty("CONSTANT_RGBA")&&(e.constantRGBA=t.getGlobalProperty("CONSTANT_RGBA",5121,4))}function Vp(e,t){if(!e.attributes.normals){var r=null;t.hasProperty("NORMAL")?r=t.getPropertyArray("NORMAL",5126,3):t.hasProperty("NORMAL_OCT16P")&&(r=t.getPropertyArray("NORMAL_OCT16P",5121,2),e.isOctEncoded16P=!0),e.attributes.normals=function(e,t){if(!t)return null;if(e.isOctEncoded16P){for(var r=new Float32Array(3*e.pointsLength),n=0;n<e.pointsLength;n++)Pp(t[2*n],t[2*n+1],Rp),Rp.toArray(r,3*n);return{type:5126,size:2,value:r}}return{type:5126,size:2,value:t}}(e,r)}}function zp(e,t,r,n,i){return Kp.apply(this,arguments)}function Kp(){return(Kp=Me()(Pe.a.mark((function e(t,r,n,i,a){var o,s,u,c,l,f,h,d;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((c=t.batchTableJson&&t.batchTableJson.extensions&&t.batchTableJson.extensions["3DTILES_draco_point_compression"])&&(u=c.properties),!(l=r.getExtension("3DTILES_draco_point_compression"))){e.next=15;break}if(s=l.properties,f=l.byteOffset,h=l.byteLength,s&&Number.isFinite(f)&&h){e.next=9;break}throw new Error("Draco properties, byteOffset, and byteLength must be defined");case 9:o=t.featureTableBinary.slice(f,f+h),t.hasPositions=Number.isFinite(s.POSITION),t.hasColors=Number.isFinite(s.RGB)||Number.isFinite(s.RGBA),t.hasNormals=Number.isFinite(s.NORMAL),t.hasBatchIds=Number.isFinite(s.BATCH_ID),t.isTranslucent=Number.isFinite(s.RGBA);case 15:if(o){e.next=17;break}return e.abrupt("return",!0);case 17:return d={buffer:o,properties:Lp(Lp({},s),u),featureTableProperties:s,batchTableProperties:u,dequantizeInShader:!1},e.next=20,qp(t,d,i,a);case 20:return e.abrupt("return",e.sent);case 21:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function qp(e,t,r,n){return Xp.apply(this,arguments)}function Xp(){return(Xp=Me()(Pe.a.mark((function e(t,r,n,i){var a,o,s,u,c,l,f,h,d,p,v,y,g,m,b;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=i.parse,delete(o=Lp(Lp({},n),{},{draco:Lp(Lp({},n.draco),{},{extraAttributes:r.batchTableProperties||{}})}))["3d-tiles"],e.next=5,a(r.buffer,op,o);case 5:if(s=e.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,t.quantizedVolumeScale=new Tt(v,v,v),t.quantizedVolumeOffset=new Tt(p.minValues),t.quantizedRange=(1<<p.quantizationBits)-1,t.isQuantizedDraco=!0),d&&(t.octEncodedRange=(1<<s.NORMAL.data.quantization.quantizationBits)-1,t.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);t.attributes=Lp({positions:u,colors:Tp(t,c,void 0),normals:l,batchIds:f},y);case 17:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Qp,Wp,Zp="https://unpkg.com/@loaders.gl/textures@".concat("3.2.10","/dist/libs/basis_encoder.wasm"),Yp="https://unpkg.com/@loaders.gl/textures@".concat("3.2.10","/dist/libs/basis_encoder.js");function $p(e){return ev.apply(this,arguments)}function ev(){return(ev=Me()(Pe.a.mark((function e(t){var r;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(r=t.modules||{}).basis){e.next=3;break}return e.abrupt("return",r.basis);case 3:return Qp=Qp||tv(t),e.next=6,Qp;case 6:return e.abrupt("return",e.sent);case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function tv(e){return rv.apply(this,arguments)}function rv(){return(rv=Me()(Pe.a.mark((function e(t){var r,n,i,a;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=null,n=null,e.t0=Promise,e.next=5,Nd("basis_transcoder.js","textures",t);case 5:return e.t1=e.sent,e.next=8,Nd("basis_transcoder.wasm","textures",t);case 8:return e.t2=e.sent,e.t3=[e.t1,e.t2],e.next=12,e.t0.all.call(e.t0,e.t3);case 12:return i=e.sent,a=M()(i,2),r=a[0],n=a[1],r=r||globalThis.BASIS,e.next=19,nv(r,n);case 19:return e.abrupt("return",e.sent);case 20:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function nv(e,t){var r={};return t&&(r.wasmBinary=t),new Promise((function(t){e(r).then((function(e){var r=e.BasisFile;(0,e.initializeBasis)(),t({BasisFile:r})}))}))}function iv(e){return av.apply(this,arguments)}function av(){return(av=Me()(Pe.a.mark((function e(t){var r;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(r=t.modules||{}).basisEncoder){e.next=3;break}return e.abrupt("return",r.basisEncoder);case 3:return Wp=Wp||ov(t),e.next=6,Wp;case 6:return e.abrupt("return",e.sent);case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ov(e){return sv.apply(this,arguments)}function sv(){return(sv=Me()(Pe.a.mark((function e(t){var r,n,i,a;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=null,n=null,e.t0=Promise,e.next=5,Nd(Yp,"textures",t);case 5:return e.t1=e.sent,e.next=8,Nd(Zp,"textures",t);case 8:return e.t2=e.sent,e.t3=[e.t1,e.t2],e.next=12,e.t0.all.call(e.t0,e.t3);case 12:return i=e.sent,a=M()(i,2),r=a[0],n=a[1],r=r||globalThis.BASIS,e.next=19,uv(r,n);case 19:return e.abrupt("return",e.sent);case 20:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function uv(e,t){var r={};return t&&(r.wasmBinary=t),new Promise((function(t){e(r).then((function(e){var r=e.BasisFile,n=e.KTX2File,i=e.initializeBasis,a=e.BasisEncoder;i(),t({BasisFile:r,KTX2File:n,BasisEncoder:a})}))}))}var cv={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 lv(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return fv(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return fv(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function fv(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var hv=["","WEBKIT_","MOZ_"],dv={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"},pv=null;function vv(e){if(!pv){e=e||function(){try{return document.createElement("canvas").getContext("webgl")}catch(e){return null}}()||void 0,pv=new Set;var t,r=lv(hv);try{for(r.s();!(t=r.n()).done;){var n=t.value;for(var i in dv)if(e&&e.getExtension("".concat(n).concat(i))){var a=dv[i];pv.add(a)}}}catch(e){r.e(e)}finally{r.f()}}return pv}new Uint8Array([0]);var yv,gv,mv,bv,Av,Bv,wv,_v,xv;(xv=yv||(yv={}))[xv.NONE=0]="NONE",xv[xv.BASISLZ=1]="BASISLZ",xv[xv.ZSTD=2]="ZSTD",xv[xv.ZLIB=3]="ZLIB",function(e){e[e.BASICFORMAT=0]="BASICFORMAT"}(gv||(gv={})),function(e){e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.ETC1S=163]="ETC1S",e[e.UASTC=166]="UASTC"}(mv||(mv={})),function(e){e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.SRGB=1]="SRGB"}(bv||(bv={})),function(e){e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.LINEAR=1]="LINEAR",e[e.SRGB=2]="SRGB",e[e.ITU=3]="ITU",e[e.NTSC=4]="NTSC",e[e.SLOG=5]="SLOG",e[e.SLOG2=6]="SLOG2"}(Av||(Av={})),function(e){e[e.ALPHA_STRAIGHT=0]="ALPHA_STRAIGHT",e[e.ALPHA_PREMULTIPLIED=1]="ALPHA_PREMULTIPLIED"}(Bv||(Bv={})),function(e){e[e.RGB=0]="RGB",e[e.RRR=3]="RRR",e[e.GGG=4]="GGG",e[e.AAA=15]="AAA"}(wv||(wv={})),function(e){e[e.RGB=0]="RGB",e[e.RGBA=3]="RGBA",e[e.RRR=4]="RRR",e[e.RRRG=5]="RRRG"}(_v||(_v={}));var Cv=[171,75,84,88,32,50,48,187,13,10,26,10];function Ov(e){var t=new Uint8Array(e);return!(t.byteLength<Cv.length||t[0]!==Cv[0]||t[1]!==Cv[1]||t[2]!==Cv[2]||t[3]!==Cv[3]||t[4]!==Cv[4]||t[5]!==Cv[5]||t[6]!==Cv[6]||t[7]!==Cv[7]||t[8]!==Cv[8]||t[9]!==Cv[9]||t[10]!==Cv[10]||t[11]!==Cv[11])}var Ev={etc1:{basisFormat:0,compressed:!0,format:cv.COMPRESSED_RGB_ETC1_WEBGL},etc2:{basisFormat:1,compressed:!0},bc1:{basisFormat:2,compressed:!0,format:cv.COMPRESSED_RGB_S3TC_DXT1_EXT},bc3:{basisFormat:3,compressed:!0,format:cv.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:cv.COMPRESSED_RGB_PVRTC_4BPPV1_IMG},"pvrtc1-4-rgba":{basisFormat:9,compressed:!0,format:cv.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG},"astc-4x4":{basisFormat:10,compressed:!0,format:cv.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 Tv(){return(Tv=Me()(Pe.a.mark((function e(t,r){var n,i,a,o,s,u;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("auto"!==r.basis.containerFormat){e.next=11;break}if(!Ov(t)){e.next=6;break}return e.next=4,iv(r);case 4:return n=e.sent,e.abrupt("return",Mv(n.KTX2File,t,r));case 6:return e.next=8,$p(r);case 8:return i=e.sent,a=i.BasisFile,e.abrupt("return",Sv(a,t,r));case 11:e.t0=r.basis.module,e.next="encoder"===e.t0?14:(e.t0,22);break;case 14:return e.next=16,iv(r);case 16:o=e.sent,e.t1=r.basis.containerFormat,e.next="ktx2"===e.t1?20:(e.t1,21);break;case 20:return e.abrupt("return",Mv(o.KTX2File,t,r));case 21:return e.abrupt("return",Sv(o.BasisFile,t,r));case 22:return e.next=24,$p(r);case 24:return s=e.sent,u=s.BasisFile,e.abrupt("return",Sv(u,t,r));case 27:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Sv(e,t,r){var n=new e(new Uint8Array(t));try{if(!n.startTranscoding())throw new Error("Failed to start basis transcoding");for(var i=n.getNumImages(),a=[],o=0;o<i;o++){for(var s=n.getNumLevels(o),u=[],c=0;c<s;c++)u.push(kv(n,o,c,r));a.push(u)}return a}finally{n.close(),n.delete()}}function kv(e,t,r,n){var i=e.getImageWidth(t,r),a=e.getImageHeight(t,r),o=e.getHasAlpha(),s=Pv(n,o),u=s.compressed,c=s.format,l=s.basisFormat,f=e.getImageTranscodedSizeInBytes(t,r,l),h=new Uint8Array(f);if(!e.transcodeImage(h,t,r,l,0,0))throw new Error("failed to start Basis transcoding");return{width:i,height:a,data:h,compressed:u,format:c,hasAlpha:o}}function Mv(e,t,r){var n=new e(new Uint8Array(t));try{if(!n.startTranscoding())throw new Error("failed to start KTX2 transcoding");for(var i=n.getLevels(),a=[],o=0;o<i;o++){a.push(Iv(n,o,r));break}return[a]}finally{n.close(),n.delete()}}function Iv(e,t,r){var n=e.getImageLevelInfo(t,0,0),i=n.alphaFlag,a=n.height,o=n.width,s=Pv(r,i),u=s.compressed,c=s.format,l=s.basisFormat,f=e.getImageTranscodedSizeInBytes(t,0,0,l),h=new Uint8Array(f);if(!e.transcodeImage(h,t,0,0,l,0,-1,-1))throw new Error("Failed to transcode KTX2 image");return{width:o,height:a,data:h,compressed:u,hasAlpha:i,format:c}}function Pv(e,t){var r=e&&e.basis&&e.basis.format;return"auto"===r&&(r=Rv()),"object"===mi()(r)&&(r=t?r.alpha:r.noAlpha),r=r.toLowerCase(),Ev[r]}function Rv(){var e=vv();return e.has("astc")?"astc-4x4":e.has("dxt")?{alpha:"bc3",noAlpha:"bc1"}:e.has("pvrtc")?{alpha:"pvrtc1-4-rgba",noAlpha:"pvrtc1-4-rgb"}:e.has("etc1")?"etc1":e.has("etc2")?"etc2":"rgb565"}function Fv(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Dv(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Fv(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Fv(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Lv={name:"Basis",id:"basis",module:"textures",version:"3.2.10",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"}}},jv=Dv(Dv({},Lv),{},{parse:function(e,t){return Tv.apply(this,arguments)}}),Gv=globalThis._parseImageNode,Uv="undefined"!=typeof Image,Nv="undefined"!=typeof ImageBitmap,Hv=Boolean(Gv),Jv=!!tc||Hv;function Vv(e){var t=Kv(e);if(!t)throw new Error("Not an image");return t}function zv(e){switch(Vv(e)){case"data":return e;case"image":case"imagebitmap":var t=document.createElement("canvas"),r=t.getContext("2d");if(!r)throw new Error("getImageData");return t.width=e.width,t.height=e.height,r.drawImage(e,0,0),r.getImageData(0,0,e.width,e.height);default:throw new Error("getImageData")}}function Kv(e){return"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap?"imagebitmap":"undefined"!=typeof Image&&e instanceof Image?"image":e&&"object"===mi()(e)&&e.data&&e.width&&e.height?"data":null}var qv=/^data:image\/svg\+xml/,Xv=/\.svg((\?|#).*)?$/;function Qv(e){return e&&(qv.test(e)||Xv.test(e))}function Wv(e,t){if(Qv(t)){var r=(new TextDecoder).decode(e);try{"function"==typeof unescape&&"function"==typeof encodeURIComponent&&(r=unescape(encodeURIComponent(r)))}catch(e){throw new Error(e.message)}return"data:image/svg+xml;base64,".concat(btoa(r))}return Zv(e,t)}function Zv(e,t){if(Qv(t))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(e)])}function Yv(e,t,r){return $v.apply(this,arguments)}function $v(){return($v=Me()(Pe.a.mark((function e(t,r,n){var i,a,o;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=Wv(t,n),a=self.URL||self.webkitURL,o="string"!=typeof i&&a.createObjectURL(i),e.prev=3,e.next=6,ey(o||i,r);case 6:return e.abrupt("return",e.sent);case 7:return e.prev=7,o&&a.revokeObjectURL(o),e.finish(7);case 10:case"end":return e.stop()}}),e,null,[[3,,7,10]])})))).apply(this,arguments)}function ey(e,t){return ty.apply(this,arguments)}function ty(){return(ty=Me()(Pe.a.mark((function e(t,r){var n;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((n=new Image).src=t,!(r.image&&r.image.decode&&n.decode)){e.next=6;break}return e.next=5,n.decode();case 5:return e.abrupt("return",n);case 6:return e.next=8,new Promise((function(e,r){try{n.onload=function(){return e(n)},n.onerror=function(e){return r(new Error("Could not load image ".concat(t,": ").concat(e)))}}catch(e){r(e)}}));case 8:return e.abrupt("return",e.sent);case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var ry={},ny=!0;function iy(e,t,r){return ay.apply(this,arguments)}function ay(){return(ay=Me()(Pe.a.mark((function e(t,r,n){var i,a,o;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!Qv(n)){e.next=7;break}return e.next=3,Yv(t,r,n);case 3:a=e.sent,i=a,e.next=8;break;case 7:i=Zv(t,n);case 8:return o=r&&r.imagebitmap,e.next=11,oy(i,o);case 11:return e.abrupt("return",e.sent);case 12:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function oy(e){return sy.apply(this,arguments)}function sy(){return(sy=Me()(Pe.a.mark((function e(t){var r,n=arguments;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!uy(r=n.length>1&&void 0!==n[1]?n[1]:null)&&ny||(r=null),!r){e.next=13;break}return e.prev=3,e.next=6,createImageBitmap(t,r);case 6:return e.abrupt("return",e.sent);case 9:e.prev=9,e.t0=e.catch(3),console.warn(e.t0),ny=!1;case 13:return e.next=15,createImageBitmap(t);case 15:return e.abrupt("return",e.sent);case 16:case"end":return e.stop()}}),e,null,[[3,9]])})))).apply(this,arguments)}function uy(e){for(var t in e||ry)return!1;return!0}function cy(e){var t=ly(e);return function(e){var t=ly(e);if(!(t.byteLength>=24&&2303741511===t.getUint32(0,!1)))return null;return{mimeType:"image/png",width:t.getUint32(16,!1),height:t.getUint32(20,!1)}}(t)||function(e){var t=ly(e);if(!(t.byteLength>=3&&65496===t.getUint16(0,!1)&&255===t.getUint8(2)))return null;var r=function(){for(var e=new Set([65499,65476,65484,65501,65534]),t=65504;t<65520;++t)e.add(t);var r=new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502]);return{tableMarkers:e,sofMarkers:r}}(),n=r.tableMarkers,i=r.sofMarkers,a=2;for(;a+9<t.byteLength;){var o=t.getUint16(a,!1);if(i.has(o))return{mimeType:"image/jpeg",height:t.getUint16(a+5,!1),width:t.getUint16(a+7,!1)};if(!n.has(o))return null;a+=2,a+=t.getUint16(a,!1)}return null}(t)||function(e){var t=ly(e);if(!(t.byteLength>=10&&1195984440===t.getUint32(0,!1)))return null;return{mimeType:"image/gif",width:t.getUint16(6,!0),height:t.getUint16(8,!0)}}(t)||function(e){var t=ly(e);if(!(t.byteLength>=14&&16973===t.getUint16(0,!1)&&t.getUint32(2,!0)===t.byteLength))return null;return{mimeType:"image/bmp",width:t.getUint32(18,!0),height:t.getUint32(22,!0)}}(t)}function ly(e){if(e instanceof DataView)return e;if(ArrayBuffer.isView(e))return new DataView(e.buffer);if(e instanceof ArrayBuffer)return new DataView(e);throw new Error("toDataView")}function fy(e,t){return hy.apply(this,arguments)}function hy(){return(hy=Me()(Pe.a.mark((function e(t,r){var n,i,a;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=cy(t)||{},i=n.mimeType,eu(a=globalThis._parseImageNode),e.next=5,a(t,i);case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function dy(){return(dy=Me()(Pe.a.mark((function e(t,r,n){var i,a,o,s,u;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=(r=r||{}).image||{},a=i.type||"auto",o=(n||{}).url,s=py(a),e.t0=s,e.next="imagebitmap"===e.t0?8:"image"===e.t0?12:"data"===e.t0?16:20;break;case 8:return e.next=10,iy(t,r,o);case 10:return u=e.sent,e.abrupt("break",21);case 12:return e.next=14,Yv(t,r,o);case 14:return u=e.sent,e.abrupt("break",21);case 16:return e.next=18,fy(t,r);case 18:return u=e.sent,e.abrupt("break",21);case 20:eu(!1);case 21:return"data"===a&&(u=zv(u)),e.abrupt("return",u);case 23:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function py(e){switch(e){case"auto":case"data":return function(){if(Nv)return"imagebitmap";if(Uv)return"image";if(Jv)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}();default:return function(e){switch(e){case"auto":return Nv||Uv||Jv;case"imagebitmap":return Nv;case"image":return Uv;case"data":return Jv;default:throw new Error("@loaders.gl/images: image ".concat(e," not supported in this environment"))}}(e),e}}var vy={id:"image",module:"images",name:"Images",version:"3.2.10",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(e,t,r){return dy.apply(this,arguments)},tests:[function(e){return Boolean(cy(new DataView(e)))}],options:{image:{type:"auto",decode:!0}}};function yy(e,t,r){if(e.byteLength<=t+r)return"";for(var n=new DataView(e),i="",a=0;a<r;a++)i+=String.fromCharCode(n.getUint8(t+a));return i}function gy(e){try{return JSON.parse(e)}catch(t){throw new Error('Failed to parse JSON from data starting with "'.concat(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5;if("string"==typeof e)return e.slice(0,t);if(ArrayBuffer.isView(e))return yy(e.buffer,e.byteOffset,t);if(e instanceof ArrayBuffer){var r=0;return yy(e,r,t)}return""}(e),'"'))}}function my(e,t){if(!e)throw new Error(t||"assert failed: gltf")}function by(e,t){if(e.startsWith("data:")||e.startsWith("http:")||e.startsWith("https:"))return e;var r=t.baseUri||t.uri;if(!r)throw new Error("'baseUri' must be provided to resolve relative url ".concat(e));return r.substr(0,r.lastIndexOf("/")+1)+e}function Ay(e,t,r){var n=e.bufferViews[r];my(n);var i=t[n.buffer];my(i);var a=(n.byteOffset||0)+i.byteOffset;return new Uint8Array(i.arrayBuffer,a,n.byteLength)}function By(e,t){return eu(e>=0),eu(t>0),e+(t-1)&~(t-1)}function wy(e,t,r){var n;if(e instanceof ArrayBuffer)n=new Uint8Array(e);else{var i=e.byteOffset,a=e.byteLength;n=new Uint8Array(e.buffer||e.arrayBuffer,i,a)}return t.set(n,r),r+By(n.byteLength,4)}var _y=["SCALAR","VEC2","VEC3","VEC4"],xy=[[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Uint32Array,5125],[Float32Array,5126],[Float64Array,5130]],Cy=new Map(xy),Oy={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Ey={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},Ty={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function Sy(e){return _y[e-1]||_y[0]}function ky(e){var t=Cy.get(e.constructor);if(!t)throw new Error("Illegal typed array");return t}function My(e,t){var r=Ty[e.componentType],n=Oy[e.type],i=Ey[e.componentType],a=e.count*n,o=e.count*n*i;return my(o>=0&&o<=t.byteLength),{ArrayType:r,length:a,byteLength:o}}function Iy(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return Py(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Py(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function Py(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Ry(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Fy(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ry(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ry(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Dy,Ly={asset:{version:"2.0",generator:"loaders.gl"},buffers:[]},jy=function(){function e(t){h()(this,e),Hn(this,"gltf",void 0),Hn(this,"sourceBuffers",void 0),Hn(this,"byteLength",void 0),this.gltf=t||{json:Fy({},Ly),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 C()(e,[{key:"json",get:function(){return this.gltf.json}},{key:"getApplicationData",value:function(e){return this.json[e]}},{key:"getExtraData",value:function(e){return(this.json.extras||{})[e]}},{key:"getExtension",value:function(e){var t=this.getUsedExtensions().find((function(t){return t===e})),r=this.json.extensions||{};return t?r[e]||!0:null}},{key:"getRequiredExtension",value:function(e){return this.getRequiredExtensions().find((function(t){return t===e}))?this.getExtension(e):null}},{key:"getRequiredExtensions",value:function(){return this.json.extensionsRequired||[]}},{key:"getUsedExtensions",value:function(){return this.json.extensionsUsed||[]}},{key:"getObjectExtension",value:function(e,t){return(e.extensions||{})[t]}},{key:"getScene",value:function(e){return this.getObject("scenes",e)}},{key:"getNode",value:function(e){return this.getObject("nodes",e)}},{key:"getSkin",value:function(e){return this.getObject("skins",e)}},{key:"getMesh",value:function(e){return this.getObject("meshes",e)}},{key:"getMaterial",value:function(e){return this.getObject("materials",e)}},{key:"getAccessor",value:function(e){return this.getObject("accessors",e)}},{key:"getTexture",value:function(e){return this.getObject("textures",e)}},{key:"getSampler",value:function(e){return this.getObject("samplers",e)}},{key:"getImage",value:function(e){return this.getObject("images",e)}},{key:"getBufferView",value:function(e){return this.getObject("bufferViews",e)}},{key:"getBuffer",value:function(e){return this.getObject("buffers",e)}},{key:"getObject",value:function(e,t){if("object"===mi()(t))return t;var r=this.json[e]&&this.json[e][t];if(!r)throw new Error("glTF file error: Could not find ".concat(e,"[").concat(t,"]"));return r}},{key:"getTypedArrayForBufferView",value:function(e){var t=(e=this.getBufferView(e)).buffer,r=this.gltf.buffers[t];my(r);var n=(e.byteOffset||0)+r.byteOffset;return new Uint8Array(r.arrayBuffer,n,e.byteLength)}},{key:"getTypedArrayForAccessor",value:function(e){e=this.getAccessor(e);var t=this.getBufferView(e.bufferView),r=this.getBuffer(t.buffer).data,n=My(e,t),i=n.ArrayType,a=n.length;return new i(r,t.byteOffset+e.byteOffset,a)}},{key:"getTypedArrayForImageData",value:function(e){e=this.getAccessor(e);var t=this.getBufferView(e.bufferView),r=this.getBuffer(t.buffer).data,n=t.byteOffset||0;return new Uint8Array(r,n,t.byteLength)}},{key:"addApplicationData",value:function(e,t){return this.json[e]=t,this}},{key:"addExtraData",value:function(e,t){return this.json.extras=this.json.extras||{},this.json.extras[e]=t,this}},{key:"addObjectExtension",value:function(e,t,r){return e.extensions=e.extensions||{},e.extensions[t]=r,this.registerUsedExtension(t),this}},{key:"setObjectExtension",value:function(e,t,r){(e.extensions||{})[t]=r}},{key:"removeObjectExtension",value:function(e,t){var r=e.extensions||{},n=r[t];return delete r[t],n}},{key:"addExtension",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return my(t),this.json.extensions=this.json.extensions||{},this.json.extensions[e]=t,this.registerUsedExtension(e),t}},{key:"addRequiredExtension",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return my(t),this.addExtension(e,t),this.registerRequiredExtension(e),t}},{key:"registerUsedExtension",value:function(e){this.json.extensionsUsed=this.json.extensionsUsed||[],this.json.extensionsUsed.find((function(t){return t===e}))||this.json.extensionsUsed.push(e)}},{key:"registerRequiredExtension",value:function(e){this.registerUsedExtension(e),this.json.extensionsRequired=this.json.extensionsRequired||[],this.json.extensionsRequired.find((function(t){return t===e}))||this.json.extensionsRequired.push(e)}},{key:"removeExtension",value:function(e){this.json.extensionsRequired&&this._removeStringFromArray(this.json.extensionsRequired,e),this.json.extensionsUsed&&this._removeStringFromArray(this.json.extensionsUsed,e),this.json.extensions&&delete this.json.extensions[e]}},{key:"setDefaultScene",value:function(e){this.json.scene=e}},{key:"addScene",value:function(e){var t=e.nodeIndices;return this.json.scenes=this.json.scenes||[],this.json.scenes.push({nodes:t}),this.json.scenes.length-1}},{key:"addNode",value:function(e){var t=e.meshIndex,r=e.matrix;this.json.nodes=this.json.nodes||[];var n={mesh:t};return r&&(n.matrix=r),this.json.nodes.push(n),this.json.nodes.length-1}},{key:"addMesh",value:function(e){var t=e.attributes,r=e.indices,n=e.material,i=e.mode,a=void 0===i?4:i,o={primitives:[{attributes:this._addAttributes(t),mode:a}]};if(r){var s=this._addIndices(r);o.primitives[0].indices=s}return Number.isFinite(n)&&(o.primitives[0].material=n),this.json.meshes=this.json.meshes||[],this.json.meshes.push(o),this.json.meshes.length-1}},{key:"addPointCloud",value:function(e){var t={primitives:[{attributes:this._addAttributes(e),mode:0}]};return this.json.meshes=this.json.meshes||[],this.json.meshes.push(t),this.json.meshes.length-1}},{key:"addImage",value:function(e,t){var r=cy(e),n=t||(null==r?void 0:r.mimeType),i={bufferView:this.addBufferView(e),mimeType:n};return this.json.images=this.json.images||[],this.json.images.push(i),this.json.images.length-1}},{key:"addBufferView",value:function(e){var t=e.byteLength;my(Number.isFinite(t)),this.sourceBuffers=this.sourceBuffers||[],this.sourceBuffers.push(e);var r={buffer:0,byteOffset:this.byteLength,byteLength:t};return this.byteLength+=By(t,4),this.json.bufferViews=this.json.bufferViews||[],this.json.bufferViews.push(r),this.json.bufferViews.length-1}},{key:"addAccessor",value:function(e,t){var r={bufferView:e,type:Sy(t.size),componentType:t.componentType,count:t.count,max:t.max,min:t.min};return this.json.accessors=this.json.accessors||[],this.json.accessors.push(r),this.json.accessors.length-1}},{key:"addBinaryBuffer",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{size:3},r=this.addBufferView(e),n={min:t.min,max:t.max};n.min&&n.max||(n=this._getAccessorMinMax(e,t.size));var i={size:t.size,componentType:ky(e),count:Math.round(e.length/t.size),min:n.min,max:n.max};return this.addAccessor(r,Object.assign(i,t))}},{key:"addTexture",value:function(e){var t={source:e.imageIndex};return this.json.textures=this.json.textures||[],this.json.textures.push(t),this.json.textures.length-1}},{key:"addMaterial",value:function(e){return this.json.materials=this.json.materials||[],this.json.materials.push(e),this.json.materials.length-1}},{key:"createBinaryChunk",value:function(){var e,t;this.gltf.buffers=[];var r,n=this.byteLength,i=new ArrayBuffer(n),a=new Uint8Array(i),o=0,s=Iy(this.sourceBuffers||[]);try{for(s.s();!(r=s.n()).done;){o=wy(r.value,a,o)}}catch(e){s.e(e)}finally{s.f()}null!==(e=this.json)&&void 0!==e&&null!==(t=e.buffers)&&void 0!==t&&t[0]?this.json.buffers[0].byteLength=n:this.json.buffers=[{byteLength:n}],this.gltf.binary=i,this.sourceBuffers=[i]}},{key:"_removeStringFromArray",value:function(e,t){for(var r=!0;r;){var n=e.indexOf(t);n>-1?e.splice(n,1):r=!1}}},{key:"_addAttributes",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={};for(var r in e){var n=e[r],i=this._getGltfAttributeName(r),a=this.addBinaryBuffer(n.value,n);t[i]=a}return t}},{key:"_addIndices",value:function(e){return this.addBinaryBuffer(e,{size:1})}},{key:"_getGltfAttributeName",value:function(e){switch(e.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 e}}},{key:"_getAccessorMinMax",value:function(e,t){var r={min:null,max:null};if(e.length<t)return r;r.min=[],r.max=[];var n,i=Iy(e.subarray(0,t));try{for(i.s();!(n=i.n()).done;){var a=n.value;r.min.push(a),r.max.push(a)}}catch(e){i.e(e)}finally{i.f()}for(var o=t;o<e.length;o+=t)for(var s=0;s<t;s++)r.min[0+s]=Math.min(r.min[0+s],e[o+s]),r.max[0+s]=Math.max(r.max[0+s],e[o+s]);return r}}]),e}(),Gy=("undefined"==typeof WebAssembly||mi()(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"),Uy="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",Ny=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]),Hy=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]),Jy={0:"",1:"meshopt_decodeFilterOct",2:"meshopt_decodeFilterQuat",3:"meshopt_decodeFilterExp",NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},Vy={0:"meshopt_decodeVertexBuffer",1:"meshopt_decodeIndexBuffer",2:"meshopt_decodeIndexSequence",ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"};function zy(e,t,r,n,i){return Ky.apply(this,arguments)}function Ky(){return(Ky=Me()(Pe.a.mark((function e(t,r,n,i,a){var o,s,u=arguments;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=u.length>5&&void 0!==u[5]?u[5]:"NONE",e.next=3,qy();case 3:Yy(s=e.sent,s.exports[Vy[a]],t,r,n,i,s.exports[Jy[o||"NONE"]]);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function qy(){return Xy.apply(this,arguments)}function Xy(){return(Xy=Me()(Pe.a.mark((function e(){return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Dy||(Dy=Qy()),e.abrupt("return",Dy);case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Qy(){return Wy.apply(this,arguments)}function Wy(){return(Wy=Me()(Pe.a.mark((function e(){var t,r;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=Gy,WebAssembly.validate(Ny)&&(t=Uy,console.log("Warning: meshopt_decoder is using experimental SIMD support")),e.next=4,WebAssembly.instantiate(Zy(t),{});case 4:return r=e.sent,e.next=7,r.instance.exports.__wasm_call_ctors();case 7:return e.abrupt("return",r.instance);case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Zy(e){for(var t=new Uint8Array(e.length),r=0;r<e.length;++r){var n=e.charCodeAt(r);t[r]=n>96?n-71:n>64?n-65:n>47?n+4:n>46?63:62}for(var i=0,a=0;a<e.length;++a)t[i++]=t[a]<60?Hy[t[a]]:64*(t[a]-60)+t[++a];return t.buffer.slice(0,i)}function Yy(e,t,r,n,i,a,o){var s=e.exports.sbrk,u=n+3&-4,c=s(u*i),l=s(a.length),f=new Uint8Array(e.exports.memory.buffer);f.set(a,l);var h=t(c,n,i,l,a.length);if(0===h&&o&&o(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 $y(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return eg(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return eg(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function eg(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var tg="EXT_meshopt_compression";function rg(e,t){return ng.apply(this,arguments)}function ng(){return(ng=Me()(Pe.a.mark((function e(t,r){var n,i,a,o,s,u;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=new jy(t),null!=r&&null!==(n=r.gltf)&&void 0!==n&&n.decompressMeshes){e.next=3;break}return e.abrupt("return");case 3:a=[],o=$y(t.json.bufferViews||[]);try{for(o.s();!(s=o.n()).done;)u=s.value,a.push(ig(i,u))}catch(e){o.e(e)}finally{o.f()}return e.next=8,Promise.all(a);case 8:i.removeExtension("EXT_meshopt_compression");case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ig(e,t){return ag.apply(this,arguments)}function ag(){return(ag=Me()(Pe.a.mark((function e(t,r){var n,i,a,o,s,u,c,l,f,h,d,p,v,y;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(n=t.getObjectExtension(r,"EXT_meshopt_compression"))){e.next=9;break}return i=n.byteOffset,a=void 0===i?0:i,o=n.byteLength,s=void 0===o?0:o,u=n.byteStride,c=n.count,l=n.mode,f=n.filter,h=void 0===f?"NONE":f,d=n.buffer,p=t.gltf.buffers[d],v=new Uint8Array(p.arrayBuffer,p.byteOffset+a,s),y=new Uint8Array(t.gltf.buffers[r.buffer].arrayBuffer,r.byteOffset,r.byteLength),e.next=8,zy(y,c,u,v,l,h);case 8:return e.abrupt("return",y);case 9:return e.abrupt("return",null);case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var og=["image/png","image/jpeg","image/gif"],sg={};function ug(e){return void 0===sg[e]&&(sg[e]=function(e){switch(e){case"image/webp":return function(){if(!tc)return!1;try{return 0===document.createElement("canvas").toDataURL("image/webp").indexOf("data:image/webp")}catch(e){return!1}}();case"image/svg":return tc;default:if(!tc){var t=globalThis._parseImageNode;return Boolean(t)&&og.includes(e)}return!0}}(e)),sg[e]}function cg(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return lg(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return lg(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function lg(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var fg="EXT_texture_webp";function hg(e,t){var r=new jy(e);if(ug("image/webp")){var n,i=cg(r.json.textures||[]);try{for(i.s();!(n=i.n()).done;){var a=n.value,o=r.getObjectExtension(a,"EXT_texture_webp");o&&(a.source=o.source),r.removeObjectExtension(a,"EXT_texture_webp")}}catch(e){i.e(e)}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 dg(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return pg(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return pg(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function pg(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var vg="KHR_texture_basisu";function yg(e,t){var r,n=new jy(e),i=dg(n.json.textures||[]);try{for(i.s();!(r=i.n()).done;){var a=r.value,o=n.getObjectExtension(a,"KHR_texture_basisu");o&&(a.source=o.source),n.removeObjectExtension(a,"KHR_texture_basisu")}}catch(e){i.e(e)}finally{i.f()}n.removeExtension("KHR_texture_basisu")}function gg(e){var t={};for(var r in e){var n=e[r];if("indices"!==r){var i=mg(n);t[r]=i}}return t}function mg(e){var t=function(e){var t=e,r=1,n=0;e&&e.value&&(t=e.value,r=e.size||1);t&&(ArrayBuffer.isView(t)||(t=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!e)return null;if(Array.isArray(e))return new t(e);if(r&&!(e instanceof t))return new t(e);return e}(t,Float32Array)),n=t.length/r);return{buffer:t,size:r,count:n}}(e),r=t.buffer,n=t.size;return{value:r,size:n,byteOffset:0,count:t.count,type:Sy(n),componentType:ky(r)}}function bg(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ag(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?bg(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):bg(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Bg=Pe.a.mark(Pg);function wg(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return _g(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return _g(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function _g(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var xg="KHR_draco_mesh_compression";function Cg(e,t,r){var n,i=new jy(e),a=wg(Pg(i));try{for(a.s();!(n=a.n()).done;){var o=n.value;i.getObjectExtension(o,"KHR_draco_mesh_compression")}}catch(e){a.e(e)}finally{a.f()}}function Og(e,t,r){return Eg.apply(this,arguments)}function Eg(){return(Eg=Me()(Pe.a.mark((function e(t,r,n){var i,a,o,s,u,c;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=r&&null!==(i=r.gltf)&&void 0!==i&&i.decompressMeshes){e.next=2;break}return e.abrupt("return");case 2:a=new jy(t),o=[],s=wg(Pg(a));try{for(s.s();!(u=s.n()).done;)c=u.value,a.getObjectExtension(c,"KHR_draco_mesh_compression")&&o.push(Sg(a,c,r,n))}catch(e){s.e(e)}finally{s.f()}return e.next=8,Promise.all(o);case 8:a.removeExtension("KHR_draco_mesh_compression");case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Tg(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=new jy(e),i=wg(n.json.meshes||[]);try{for(i.s();!(t=i.n()).done;){var a=t.value;Mg(a,r),n.addRequiredExtension("KHR_draco_mesh_compression")}}catch(e){i.e(e)}finally{i.f()}}function Sg(e,t,r,n){return kg.apply(this,arguments)}function kg(){return(kg=Me()(Pe.a.mark((function e(t,r,n,i){var a,o,s,u,c,l,f,h,d,p,v,y,g,m;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=t.getObjectExtension(r,"KHR_draco_mesh_compression")){e.next=3;break}return e.abrupt("return");case 3:return o=t.getTypedArrayForBufferView(a.bufferView),s=tl(o.buffer,o.byteOffset),u=i.parse,delete(c=Ag({},n))["3d-tiles"],e.next=10,u(s,op,c,i);case 10:for(l=e.sent,f=gg(l.attributes),h=0,d=Object.entries(f);h<d.length;h++)p=M()(d[h],2),v=p[0],y=p[1],v in r.attributes&&(g=r.attributes[v],null!=(m=t.getAccessor(g))&&m.min&&null!=m&&m.max&&(y.min=m.min,y.max=m.max));r.attributes=f,l.indices&&(r.indices=mg(l.indices)),Ig(r);case 16:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Mg(e,t){var r,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:4,i=arguments.length>3?arguments[3]:void 0,a=arguments.length>4?arguments[4]:void 0;if(!i.DracoWriter)throw new Error("options.gltf.DracoWriter not provided");var o=i.DracoWriter.encodeSync({attributes:e}),s=null==a?void 0:null===(r=a.parseSync)||void 0===r?void 0:r.call(a,{attributes:e}),u=i._addFauxAttributes(s.attributes),c=i.addBufferView(o),l={primitives:[{attributes:u,mode:n,extensions:A()({},"KHR_draco_mesh_compression",{bufferView:c,attributes:u})}]};return l}function Ig(e){if(!e.attributes&&Object.keys(e.attributes).length>0)throw new Error("glTF: Empty primitive detected: Draco decompression failure?")}function Pg(e){var t,r,n,i,a,o;return Pe.a.wrap((function(s){for(;;)switch(s.prev=s.next){case 0:t=wg(e.json.meshes||[]),s.prev=1,t.s();case 3:if((r=t.n()).done){s.next=24;break}n=r.value,i=wg(n.primitives),s.prev=6,i.s();case 8:if((a=i.n()).done){s.next=14;break}return o=a.value,s.next=12,o;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),t.e(s.t1);case 29:return s.prev=29,t.f(),s.finish(29);case 32:case"end":return s.stop()}}),Bg,null,[[1,26,29,32],[6,16,19,22]])}function Rg(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return Fg(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Fg(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function Fg(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Dg="KHR_lights_punctual";function Lg(e){return jg.apply(this,arguments)}function jg(){return(jg=Me()(Pe.a.mark((function e(t){var r,n,i,a,o,s,u;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=new jy(t),n=r.json,(i=r.getExtension("KHR_lights_punctual"))&&(r.json.lights=i.lights,r.removeExtension("KHR_lights_punctual")),a=Rg(n.nodes||[]);try{for(a.s();!(o=a.n()).done;)s=o.value,(u=r.getObjectExtension(s,"KHR_lights_punctual"))&&(s.light=u.light),r.removeObjectExtension(s,"KHR_lights_punctual")}catch(e){a.e(e)}finally{a.f()}case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Gg(e){return Ug.apply(this,arguments)}function Ug(){return(Ug=Me()(Pe.a.mark((function e(t){var r,n,i,a,o,s,u;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=new jy(t),(n=r.json).lights&&(my(!(i=r.addExtension("KHR_lights_punctual")).lights),i.lights=n.lights,delete n.lights),r.json.lights){a=Rg(r.json.lights);try{for(a.s();!(o=a.n()).done;)s=o.value,u=s.node,r.addObjectExtension(u,"KHR_lights_punctual",s)}catch(e){a.e(e)}finally{a.f()}delete r.json.lights}case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ng(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return Hg(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Hg(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function Hg(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Jg="KHR_materials_unlit";function Vg(e){return zg.apply(this,arguments)}function zg(){return(zg=Me()(Pe.a.mark((function e(t){var r,n,i,a,o;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=new jy(t),n=r.json,r.removeExtension("KHR_materials_unlit"),i=Ng(n.materials||[]);try{for(i.s();!(a=i.n()).done;)o=a.value,o.extensions&&o.extensions.KHR_materials_unlit&&(o.unlit=!0),r.removeObjectExtension(o,"KHR_materials_unlit")}catch(e){i.e(e)}finally{i.f()}case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Kg(e){var t=new jy(e),r=t.json;if(t.materials){var n,i=Ng(r.materials||[]);try{for(i.s();!(n=i.n()).done;){var a=n.value;a.unlit&&(delete a.unlit,t.addObjectExtension(a,"KHR_materials_unlit",{}),t.addExtension("KHR_materials_unlit"))}}catch(e){i.e(e)}finally{i.f()}}}function qg(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return Xg(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Xg(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function Xg(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Qg="KHR_techniques_webgl";function Wg(e){return Zg.apply(this,arguments)}function Zg(){return(Zg=Me()(Pe.a.mark((function e(t){var r,n,i,a,o,s,u,c;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=new jy(t),n=r.json,i=r.getExtension("KHR_techniques_webgl")){a=em(i,r),o=qg(n.materials||[]);try{for(o.s();!(s=o.n()).done;)u=s.value,(c=r.getObjectExtension(u,"KHR_techniques_webgl"))&&(u.technique=Object.assign({},c,a[c.technique]),u.technique.values=tm(u.technique,r)),r.removeObjectExtension(u,"KHR_techniques_webgl")}catch(e){o.e(e)}finally{o.f()}r.removeExtension("KHR_techniques_webgl")}case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Yg(e,t){return $g.apply(this,arguments)}function $g(){return($g=Me()(Pe.a.mark((function e(t,r){return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function em(e,t){var r=e.programs,n=void 0===r?[]:r,i=e.shaders,a=void 0===i?[]:i,o=e.techniques,s=void 0===o?[]:o,u=new TextDecoder;return a.forEach((function(e){if(!Number.isFinite(e.bufferView))throw new Error("KHR_techniques_webgl: no shader code");e.code=u.decode(t.getTypedArrayForBufferView(e.bufferView))})),n.forEach((function(e){e.fragmentShader=a[e.fragmentShader],e.vertexShader=a[e.vertexShader]})),s.forEach((function(e){e.program=n[e.program]})),s}function tm(e,t){var r=Object.assign({},e.values);return Object.keys(e.uniforms||{}).forEach((function(t){!e.uniforms[t].value||t in r||(r[t]=e.uniforms[t].value)})),Object.keys(r).forEach((function(e){"object"===mi()(r[e])&&void 0!==r[e].index&&(r[e].texture=t.getTexture(r[e].index))})),r}function rm(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return nm(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return nm(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function nm(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var im=[i,a,o,s,u,c,l];function am(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,i=im.filter((function(e){return um(e.name,r)})),a=rm(i);try{for(a.s();!(t=a.n()).done;){var o,s=t.value;null===(o=s.preprocess)||void 0===o||o.call(s,e,r,n)}}catch(e){a.e(e)}finally{a.f()}}function om(e){return sm.apply(this,arguments)}function sm(){return(sm=Me()(Pe.a.mark((function e(t){var r,n,i,a,o,s,u,c=arguments;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=c.length>1&&void 0!==c[1]?c[1]:{},n=c.length>2?c[2]:void 0,i=im.filter((function(e){return um(e.name,r)})),a=rm(i),e.prev=4,a.s();case 6:if((o=a.n()).done){e.next=12;break}return s=o.value,e.next=10,null===(u=s.decode)||void 0===u?void 0:u.call(s,t,r,n);case 10:e.next=6;break;case 12:e.next=17;break;case 14:e.prev=14,e.t0=e.catch(4),a.e(e.t0);case 17:return e.prev=17,a.f(),e.finish(17);case 20:case"end":return e.stop()}}),e,null,[[4,14,17,20]])})))).apply(this,arguments)}function um(e,t){var r,n=(null==t?void 0:null===(r=t.gltf)||void 0===r?void 0:r.excludeExtensions)||{};return!(e in n&&!n[e])}function cm(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return lm(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return lm(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function lm(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function fm(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return hm(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return hm(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function hm(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var dm,pm={accessors:"accessor",animations:"animation",buffers:"buffer",bufferViews:"bufferView",images:"image",materials:"material",meshes:"mesh",nodes:"node",samplers:"sampler",scenes:"scene",skins:"skin",textures:"texture"},vm={accessor:"accessors",animations:"animation",buffer:"buffers",bufferView:"bufferViews",image:"images",material:"materials",mesh:"meshes",node:"nodes",sampler:"samplers",scene:"scenes",skin:"skins",texture:"textures"},ym=function(){function e(){h()(this,e),Hn(this,"idToIndexMap",{animations:{},accessors:{},buffers:{},bufferViews:{},images:{},materials:{},meshes:{},nodes:{},samplers:{},scenes:{},skins:{},textures:{}}),Hn(this,"json",void 0)}return C()(e,[{key:"normalize",value:function(e,t){this.json=e.json;var r=e.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(!t.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(e){var t,r=new jy(e),n=r.json,i=cm(n.images||[]);try{for(i.s();!(t=i.n()).done;){var a=t.value,o=r.getObjectExtension(a,"KHR_binary_glTF");o&&Object.assign(a,o),r.removeObjectExtension(a,"KHR_binary_glTF")}}catch(e){i.e(e)}finally{i.f()}n.buffers&&n.buffers[0]&&delete n.buffers[0].uri,r.removeExtension("KHR_binary_glTF")}(e),this._convertObjectIdsToArrayIndices(r),this._updateObjects(r),this._updateMaterial(r)}},{key:"_addAsset",value:function(e){e.asset=e.asset||{},e.asset.version="2.0",e.asset.generator=e.asset.generator||"Normalized to glTF 2.0 by loaders.gl"}},{key:"_convertTopLevelObjectsToArrays",value:function(e){for(var t in pm)this._convertTopLevelObjectToArray(e,t)}},{key:"_convertTopLevelObjectToArray",value:function(e,t){var r=e[t];if(r&&!Array.isArray(r))for(var n in e[t]=[],r){var i=r[n];i.id=i.id||n;var a=e[t].length;e[t].push(i),this.idToIndexMap[t][n]=a}}},{key:"_convertObjectIdsToArrayIndices",value:function(e){for(var t in pm)this._convertIdsToIndices(e,t);"scene"in e&&(e.scene=this._convertIdToIndex(e.scene,"scene"));var r,n=fm(e.textures);try{for(n.s();!(r=n.n()).done;){var i=r.value;this._convertTextureIds(i)}}catch(e){n.e(e)}finally{n.f()}var a,o=fm(e.meshes);try{for(o.s();!(a=o.n()).done;){var s=a.value;this._convertMeshIds(s)}}catch(e){o.e(e)}finally{o.f()}var u,c=fm(e.nodes);try{for(c.s();!(u=c.n()).done;){var l=u.value;this._convertNodeIds(l)}}catch(e){c.e(e)}finally{c.f()}var f,h=fm(e.scenes);try{for(h.s();!(f=h.n()).done;){var d=f.value;this._convertSceneIds(d)}}catch(e){h.e(e)}finally{h.f()}}},{key:"_convertTextureIds",value:function(e){e.source&&(e.source=this._convertIdToIndex(e.source,"image"))}},{key:"_convertMeshIds",value:function(e){var t,r=fm(e.primitives);try{for(r.s();!(t=r.n()).done;){var n=t.value,i=n.attributes,a=n.indices,o=n.material;for(var s in i)i[s]=this._convertIdToIndex(i[s],"accessor");a&&(n.indices=this._convertIdToIndex(a,"accessor")),o&&(n.material=this._convertIdToIndex(o,"material"))}}catch(e){r.e(e)}finally{r.f()}}},{key:"_convertNodeIds",value:function(e){var t=this;e.children&&(e.children=e.children.map((function(e){return t._convertIdToIndex(e,"node")}))),e.meshes&&(e.meshes=e.meshes.map((function(e){return t._convertIdToIndex(e,"mesh")})))}},{key:"_convertSceneIds",value:function(e){var t=this;e.nodes&&(e.nodes=e.nodes.map((function(e){return t._convertIdToIndex(e,"node")})))}},{key:"_convertIdsToIndices",value:function(e,t){e[t]||(console.warn("gltf v1: json doesn't contain attribute ".concat(t)),e[t]=[]);var r,n=fm(e[t]);try{for(n.s();!(r=n.n()).done;){var i=r.value;for(var a in i){var o=i[a],s=this._convertIdToIndex(o,a);i[a]=s}}}catch(e){n.e(e)}finally{n.f()}}},{key:"_convertIdToIndex",value:function(e,t){var r=vm[t];if(r in this.idToIndexMap){var n=this.idToIndexMap[r][e];if(!Number.isFinite(n))throw new Error("gltf v1: failed to resolve ".concat(t," with id ").concat(e));return n}return e}},{key:"_updateObjects",value:function(e){var t,r=fm(this.json.buffers);try{for(r.s();!(t=r.n()).done;){delete t.value.type}}catch(e){r.e(e)}finally{r.f()}}},{key:"_updateMaterial",value:function(e){var t,r=fm(e.materials);try{var n=function(){var r=t.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===(a=r.values)||void 0===a?void 0:a.texture2d_0)||(null===(o=r.values)||void 0===o?void 0:o.diffuseTex),s=e.textures.findIndex((function(e){return e.id===n}));-1!==s&&(r.pbrMetallicRoughness.baseColorTexture={index:s})};for(r.s();!(t=r.n()).done;){var i,a,o;n()}}catch(e){r.e(e)}finally{r.f()}}}]),e}();function gm(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(new ym).normalize(e,t)}function mm(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function bm(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?mm(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):mm(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Am={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Bm={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},wm=10240,_m=10241,xm=10242,Cm=10243,Om=10497,Em=9729,Tm=9986,Sm={magFilter:wm,minFilter:_m,wrapS:xm,wrapT:Cm},km=(dm={},A()(dm,wm,Em),A()(dm,_m,Tm),A()(dm,xm,Om),A()(dm,Cm,Om),dm);var Mm=function(){function e(){h()(this,e),Hn(this,"baseUri",""),Hn(this,"json",{}),Hn(this,"buffers",[]),Hn(this,"images",[])}return C()(e,[{key:"postProcess",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.json,n=e.buffers,i=void 0===n?[]:n,a=e.images,o=void 0===a?[]:a,s=e.baseUri,u=void 0===s?"":s;return my(r),this.baseUri=u,this.json=r,this.buffers=i,this.images=o,this._resolveTree(this.json,t),this.json}},{key:"_resolveTree",value:function(e){var t=this;arguments.length>1&&void 0!==arguments[1]&&arguments[1];e.bufferViews&&(e.bufferViews=e.bufferViews.map((function(e,r){return t._resolveBufferView(e,r)}))),e.images&&(e.images=e.images.map((function(e,r){return t._resolveImage(e,r)}))),e.samplers&&(e.samplers=e.samplers.map((function(e,r){return t._resolveSampler(e,r)}))),e.textures&&(e.textures=e.textures.map((function(e,r){return t._resolveTexture(e,r)}))),e.accessors&&(e.accessors=e.accessors.map((function(e,r){return t._resolveAccessor(e,r)}))),e.materials&&(e.materials=e.materials.map((function(e,r){return t._resolveMaterial(e,r)}))),e.meshes&&(e.meshes=e.meshes.map((function(e,r){return t._resolveMesh(e,r)}))),e.nodes&&(e.nodes=e.nodes.map((function(e,r){return t._resolveNode(e,r)}))),e.skins&&(e.skins=e.skins.map((function(e,r){return t._resolveSkin(e,r)}))),e.scenes&&(e.scenes=e.scenes.map((function(e,r){return t._resolveScene(e,r)}))),void 0!==e.scene&&(e.scene=e.scenes[this.json.scene])}},{key:"getScene",value:function(e){return this._get("scenes",e)}},{key:"getNode",value:function(e){return this._get("nodes",e)}},{key:"getSkin",value:function(e){return this._get("skins",e)}},{key:"getMesh",value:function(e){return this._get("meshes",e)}},{key:"getMaterial",value:function(e){return this._get("materials",e)}},{key:"getAccessor",value:function(e){return this._get("accessors",e)}},{key:"getCamera",value:function(e){return null}},{key:"getTexture",value:function(e){return this._get("textures",e)}},{key:"getSampler",value:function(e){return this._get("samplers",e)}},{key:"getImage",value:function(e){return this._get("images",e)}},{key:"getBufferView",value:function(e){return this._get("bufferViews",e)}},{key:"getBuffer",value:function(e){return this._get("buffers",e)}},{key:"_get",value:function(e,t){if("object"===mi()(t))return t;var r=this.json[e]&&this.json[e][t];return r||console.warn("glTF file error: Could not find ".concat(e,"[").concat(t,"]")),r}},{key:"_resolveScene",value:function(e,t){var r=this;return e.id=e.id||"scene-".concat(t),e.nodes=(e.nodes||[]).map((function(e){return r.getNode(e)})),e}},{key:"_resolveNode",value:function(e,t){var r=this;return e.id=e.id||"node-".concat(t),e.children&&(e.children=e.children.map((function(e){return r.getNode(e)}))),void 0!==e.mesh?e.mesh=this.getMesh(e.mesh):void 0!==e.meshes&&e.meshes.length&&(e.mesh=e.meshes.reduce((function(e,t){var n=r.getMesh(t);return e.id=n.id,e.primitives=e.primitives.concat(n.primitives),e}),{primitives:[]})),void 0!==e.camera&&(e.camera=this.getCamera(e.camera)),void 0!==e.skin&&(e.skin=this.getSkin(e.skin)),e}},{key:"_resolveSkin",value:function(e,t){return e.id=e.id||"skin-".concat(t),e.inverseBindMatrices=this.getAccessor(e.inverseBindMatrices),e}},{key:"_resolveMesh",value:function(e,t){var r=this;return e.id=e.id||"mesh-".concat(t),e.primitives&&(e.primitives=e.primitives.map((function(e){var t=(e=bm({},e)).attributes;for(var n in e.attributes={},t)e.attributes[n]=r.getAccessor(t[n]);return void 0!==e.indices&&(e.indices=r.getAccessor(e.indices)),void 0!==e.material&&(e.material=r.getMaterial(e.material)),e}))),e}},{key:"_resolveMaterial",value:function(e,t){if(e.id=e.id||"material-".concat(t),e.normalTexture&&(e.normalTexture=bm({},e.normalTexture),e.normalTexture.texture=this.getTexture(e.normalTexture.index)),e.occlusionTexture&&(e.occlustionTexture=bm({},e.occlustionTexture),e.occlusionTexture.texture=this.getTexture(e.occlusionTexture.index)),e.emissiveTexture&&(e.emmisiveTexture=bm({},e.emmisiveTexture),e.emissiveTexture.texture=this.getTexture(e.emissiveTexture.index)),e.emissiveFactor||(e.emissiveFactor=e.emmisiveTexture?[1,1,1]:[0,0,0]),e.pbrMetallicRoughness){e.pbrMetallicRoughness=bm({},e.pbrMetallicRoughness);var r=e.pbrMetallicRoughness;r.baseColorTexture&&(r.baseColorTexture=bm({},r.baseColorTexture),r.baseColorTexture.texture=this.getTexture(r.baseColorTexture.index)),r.metallicRoughnessTexture&&(r.metallicRoughnessTexture=bm({},r.metallicRoughnessTexture),r.metallicRoughnessTexture.texture=this.getTexture(r.metallicRoughnessTexture.index))}return e}},{key:"_resolveAccessor",value:function(e,t){var r,n;if(e.id=e.id||"accessor-".concat(t),void 0!==e.bufferView&&(e.bufferView=this.getBufferView(e.bufferView)),e.bytesPerComponent=(r=e.componentType,Bm[r]),e.components=(n=e.type,Am[n]),e.bytesPerElement=e.bytesPerComponent*e.components,e.bufferView){var i=e.bufferView.buffer,a=My(e,e.bufferView),o=a.ArrayType,s=a.byteLength,u=(e.bufferView.byteOffset||0)+(e.byteOffset||0)+i.byteOffset,c=i.arrayBuffer.slice(u,u+s);e.bufferView.byteStride&&(c=this._getValueFromInterleavedBuffer(i,u,e.bufferView.byteStride,e.bytesPerElement,e.count)),e.value=new o(c)}return e}},{key:"_getValueFromInterleavedBuffer",value:function(e,t,r,n,i){for(var a=new Uint8Array(i*n),o=0;o<i;o++){var s=t+o*r;a.set(new Uint8Array(e.arrayBuffer.slice(s,s+n)),o*n)}return a.buffer}},{key:"_resolveTexture",value:function(e,t){return e.id=e.id||"texture-".concat(t),e.sampler="sampler"in e?this.getSampler(e.sampler):km,e.source=this.getImage(e.source),e}},{key:"_resolveSampler",value:function(e,t){for(var r in e.id=e.id||"sampler-".concat(t),e.parameters={},e){var n=this._enumSamplerParameter(r);void 0!==n&&(e.parameters[n]=e[r])}return e}},{key:"_enumSamplerParameter",value:function(e){return Sm[e]}},{key:"_resolveImage",value:function(e,t){e.id=e.id||"image-".concat(t),void 0!==e.bufferView&&(e.bufferView=this.getBufferView(e.bufferView));var r=this.images[t];return r&&(e.image=r),e}},{key:"_resolveBufferView",value:function(e,t){var r=e.buffer,n=bm(bm({id:"bufferView-".concat(t)},e),{},{buffer:this.buffers[r]}),i=this.buffers[r].arrayBuffer,a=this.buffers[r].byteOffset||0;return"byteOffset"in e&&(a+=e.byteOffset),n.data=new Uint8Array(i,a,e.byteLength),n}},{key:"_resolveCamera",value:function(e,t){return e.id=e.id||"camera-".concat(t),e.perspective,e.orthographic,e}}]),e}();function Im(e,t){return(new Mm).postProcess(e,t)}function Pm(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return"".concat(String.fromCharCode(e.getUint8(t+0))).concat(String.fromCharCode(e.getUint8(t+1))).concat(String.fromCharCode(e.getUint8(t+2))).concat(String.fromCharCode(e.getUint8(t+3)))}function Rm(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=new DataView(e),i=r.magic,a=void 0===i?1735152710:i,o=n.getUint32(t,!1);return o===a||1735152710===o}function Fm(e,t,r){eu(e.header.byteLength>20);var n=t.getUint32(r+0,!0),i=t.getUint32(r+4,!0);return r+=8,eu(0===i),Lm(e,t,r,n),r+=n,r+=jm(e,t,r,e.header.byteLength)}function Dm(e,t,r,n){return eu(e.header.byteLength>20),function(e,t,r,n){for(;r+8<=e.header.byteLength;){var i=t.getUint32(r+0,!0),a=t.getUint32(r+4,!0);switch(r+=8,a){case 1313821514:Lm(e,t,r,i);break;case 5130562:jm(e,t,r,i);break;case 0:n.strict||Lm(e,t,r,i);break;case 1:n.strict||jm(e,t,r,i)}r+=By(i,4)}}(e,t,r,n),r+e.header.byteLength}function Lm(e,t,r,n){var i=new Uint8Array(t.buffer,r,n),a=new TextDecoder("utf8").decode(i);return e.json=JSON.parse(a),By(n,4)}function jm(e,t,r,n){return e.header.hasBinChunk=!0,e.binChunks.push({byteOffset:r,byteLength:n,arrayBuffer:t.buffer}),By(n,4)}function Gm(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return Um(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Um(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function Um(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Nm(e,t){return Hm.apply(this,arguments)}function Hm(){return(Hm=Me()(Pe.a.mark((function e(t,r){var n,i,a,o,s,u,c,l,f,h,d=arguments;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=d.length>2&&void 0!==d[2]?d[2]:0,i=d.length>3?d[3]:void 0,a=d.length>4?d[4]:void 0,Jm(t,r,n,i),gm(t,{normalize:null==i?void 0:null===(o=i.gltf)||void 0===o?void 0:o.normalize}),am(t,i,a),l=[],null==i||null===(s=i.gltf)||void 0===s||!s.loadBuffers||!t.json.buffers){e.next=10;break}return e.next=10,Vm(t,i,a);case 10:return null!=i&&null!==(u=i.gltf)&&void 0!==u&&u.loadImages&&(f=Km(t,i,a),l.push(f)),h=om(t,i,a),l.push(h),e.next=15,Promise.all(l);case 15:return e.abrupt("return",null!=i&&null!==(c=i.gltf)&&void 0!==c&&c.postProcess?Im(t,i):t);case 16:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Jm(e,t,r,n){(n.uri&&(e.baseUri=n.uri),t instanceof ArrayBuffer&&!Rm(t,r,n))&&(t=(new TextDecoder).decode(t));if("string"==typeof t)e.json=gy(t);else if(t instanceof ArrayBuffer){var i={};r=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=(arguments.length>3&&void 0!==arguments[3]&&arguments[3],new DataView(t)),i=Pm(n,r+0),a=n.getUint32(r+4,!0),o=n.getUint32(r+8,!0);switch(Object.assign(e,{header:{byteOffset:r,byteLength:o,hasBinChunk:!1},type:i,version:a,json:{},binChunks:[]}),r+=12,e.version){case 1:return Fm(e,n,r);case 2:return Dm(e,n,r,{});default:throw new Error("Invalid GLB version ".concat(e.version,". Only supports v1 and v2."))}}(i,t,r,n.glb),my("glTF"===i.type,"Invalid GLB magic string ".concat(i.type)),e._glb=i,e.json=i.json}else my(!1,"GLTF: must be ArrayBuffer or string");var a=e.json.buffers||[];if(e.buffers=new Array(a.length).fill(null),e._glb&&e._glb.header.hasBinChunk){var o=e._glb.binChunks;e.buffers[0]={arrayBuffer:o[0].arrayBuffer,byteOffset:o[0].byteOffset,byteLength:o[0].byteLength}}var s=e.json.images||[];e.images=new Array(s.length).fill({})}function Vm(e,t,r){return zm.apply(this,arguments)}function zm(){return(zm=Me()(Pe.a.mark((function e(t,r,n){var i,a,o,s,u,c,l,f;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=t.json.buffers||[],a=0;case 2:if(!(a<i.length)){e.next=22;break}if(!(o=i[a]).uri){e.next=18;break}return my(n.fetch),c=by(o.uri,r),e.next=10,null==n?void 0:null===(s=n.fetch)||void 0===s?void 0:s.call(n,c);case 10:return l=e.sent,e.next=13,null==l?void 0:null===(u=l.arrayBuffer)||void 0===u?void 0:u.call(l);case 13:f=e.sent,t.buffers[a]={arrayBuffer:f,byteOffset:0,byteLength:f.byteLength},delete o.uri,e.next=19;break;case 18:null===t.buffers[a]&&(t.buffers[a]={arrayBuffer:new ArrayBuffer(o.byteLength),byteOffset:0,byteLength:o.byteLength});case 19:++a,e.next=2;break;case 22:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Km(e,t,r){return qm.apply(this,arguments)}function qm(){return(qm=Me()(Pe.a.mark((function e(t,r,n){var i,a,o,s,u,c;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=Xm(t),a=t.json.images||[],o=[],s=Gm(i);try{for(s.s();!(u=s.n()).done;)c=u.value,o.push(Qm(t,a[c],c,r,n))}catch(e){s.e(e)}finally{s.f()}return e.next=7,Promise.all(o);case 7:return e.abrupt("return",e.sent);case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Xm(e){var t,r=new Set,n=Gm(e.json.textures||[]);try{for(n.s();!(t=n.n()).done;){var i=t.value;void 0!==i.source&&r.add(i.source)}}catch(e){n.e(e)}finally{n.f()}return Array.from(r).sort()}function Qm(e,t,r,n,i){return Wm.apply(this,arguments)}function Wm(){return(Wm=Me()(Pe.a.mark((function e(t,r,n,i,a){var o,s,u,c,l,f,h;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=a.fetch,s=a.parse,!r.uri||r.hasOwnProperty("bufferView")){e.next=9;break}return c=by(r.uri,i),e.next=5,o(c);case 5:return l=e.sent,e.next=8,l.arrayBuffer();case 8:u=e.sent;case 9:return Number.isFinite(r.bufferView)&&(f=Ay(t.json,t.buffers,r.bufferView),u=tl(f.buffer,f.byteOffset,f.byteLength)),my(u,"glTF image has no data"),e.next=13,s(u,[vy,jv],{mimeType:r.mimeType,basis:i.basis||{format:Rv()}},a);case 13:(h=e.sent)&&h[0]&&(h={compressed:!0,mipmaps:!1,width:h[0].width,height:h[0].height,data:h[0]}),t.images=t.images||[],t.images[n]=h;case 17:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Zm(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ym(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Zm(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Zm(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var $m={name:"glTF",id:"gltf",module:"gltf",version:"3.2.10",extensions:["gltf","glb"],mimeTypes:["model/gltf+json","model/gltf-binary"],text:!0,binary:!0,tests:["glTF"],parse:function(e){return eb.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 eb(){return(eb=Me()(Pe.a.mark((function e(t){var r,n,i,a,o,s=arguments;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=s.length>1&&void 0!==s[1]?s[1]:{},n=s.length>2?s[2]:void 0,(r=Ym(Ym({},$m.options),r)).gltf=Ym(Ym({},$m.options.gltf),r.gltf),i=r.byteOffset,a=void 0===i?0:i,o={},e.next=8,Nm(o,t,a,r,n);case 8:return e.abrupt("return",e.sent);case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var tb=0,rb=1;function nb(e,t,r,n){e.rotateYtoZ=!0;var i=e.byteOffset+e.byteLength-r;if(0===i)throw new Error("glTF byte length must be greater than 0.");return e.gltfUpAxis=n["3d-tiles"]&&n["3d-tiles"].assetGltfUpAxis?n["3d-tiles"].assetGltfUpAxis:"Y",e.gltfArrayBuffer=tl(t,r,i),e.gltfByteOffset=0,e.gltfByteLength=i,r%4==0||console.warn("".concat(e.type,": embedded glb is not aligned to a 4-byte boundary.")),e.byteOffset+e.byteLength}function ib(e,t,r,n){return ab.apply(this,arguments)}function ab(){return(ab=Me()(Pe.a.mark((function e(t,r,n,i){var a,o,s;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=n["3d-tiles"]||{},ob(t,r,n),!a.loadGLTF){e.next=16;break}if(o=i.parse,s=i.fetch,!t.gltfUrl){e.next=9;break}return e.next=7,s(t.gltfUrl,n);case 7:t.gltfArrayBuffer=e.sent,t.gltfByteOffset=0;case 9:if(!t.gltfArrayBuffer){e.next=16;break}return e.next=12,o(t.gltfArrayBuffer,$m,n,i);case 12:t.gltf=e.sent,delete t.gltfArrayBuffer,delete t.gltfByteOffset,delete t.gltfByteLength;case 16:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ob(e,t,r){switch(t){case tb:var n=new Uint8Array(e.gltfArrayBuffer,e.gltfByteOffset),i=(new TextDecoder).decode(n);e.gltfUrl=i.replace(/[\s\0]+$/,""),delete e.gltfArrayBuffer,delete e.gltfByteOffset,delete e.gltfByteLength;break;case rb:break;default:throw new Error("b3dm: Illegal glTF format field")}}function sb(e,t,r,n,i){return ub.apply(this,arguments)}function ub(){return(ub=Me()(Pe.a.mark((function e(t,r,n,i,a){var o,s;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=cb(t,r,n,i,a),e.next=3,ib(t,rb,i,a);case 3:return(s=null==t?void 0:null===(o=t.gltf)||void 0===o?void 0:o.extensions)&&s.CESIUM_RTC&&(t.rtcCenter=s.CESIUM_RTC.center),e.abrupt("return",n);case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function cb(e,t,r,n,i){r=nb(e,t,r=Op(e,t,r=Cp(e,t,r=xp(e,t,r))),n);var a=new hp(e.featureTableJson,e.featureTableBinary);return e.rtcCenter=a.getGlobalProperty("RTC_CENTER",5126,3),r}function lb(e,t,r,n,i){return fb.apply(this,arguments)}function fb(){return(fb=Me()(Pe.a.mark((function e(t,r,n,i,a){return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=hb(t,r,n,i,a),e.next=3,ib(t,t.gltfFormat,i,a);case 3:return e.abrupt("return",n);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function hb(e,t,r,n,i){if(r=xp(e,t,r),1!==e.version)throw new Error("Instanced 3D Model version ".concat(e.version," is not supported"));r=Cp(e,t,r);var a=new DataView(t);if(e.gltfFormat=a.getUint32(r,!0),r=nb(e,t,r=Op(e,t,r+=4),n),0===e.featureTableJsonByteLength)throw new Error("i3dm parser: featureTableJsonByteLength is zero.");var o=new hp(e.featureTableJson,e.featureTableBinary),s=o.getGlobalProperty("INSTANCES_LENGTH");if(o.featuresLength=s,!Number.isFinite(s))throw new Error("i3dm parser: INSTANCES_LENGTH must be defined");e.eastNorthUp=o.getGlobalProperty("EAST_NORTH_UP"),e.rtcCenter=o.getGlobalProperty("RTC_CENTER",5126,3);new _p(e.batchTableJson,e.batchTableBinary,s);return function(e,t,r,n){for(var i=[new Array(n),e._batchTable][0],a=new Tt,o=(new Tt,new Tt,new Tt,new qt),s=new gr,u=new Tt,c={},l=new Wr,f=[],h=[],d=new Tt,p=new Tt,v=0;v<n;v++){var y=void 0;if(t.hasProperty("POSITION"))y=t.getProperty("POSITION",5126,3,v,a);else if(t.hasProperty("POSITION_QUANTIZED")){y=t.getProperty("POSITION_QUANTIZED",5123,3,v,a);var g=t.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=t.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.");a.copy(y),c.translation=a,e.normalUp=t.getProperty("NORMAL_UP",5126,3,v,f),e.normalRight=t.getProperty("NORMAL_RIGHT",5126,3,v,h);if(e.normalUp){if(!e.normalRight)throw new Error("i3dm: Custom orientation requires both NORMAL_UP and NORMAL_RIGHT.");e.hasCustomOrientation=!0}else{if(e.octNormalUp=t.getProperty("NORMAL_UP_OCT32P",5123,2,f),e.octNormalRight=t.getProperty("NORMAL_RIGHT_OCT32P",5123,2,h),e.octNormalUp){if(!e.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")}e.eastNorthUp?(kf.WGS84.eastNorthUpToFixedFrame(a,l),l.getRotationMatrix3(o)):o.identity()}!1,s.fromMatrix3(o),c.rotation=s,u.set(1,1,1);var A=t.getProperty("SCALE",5126,1,v);Number.isFinite(A)&&u.multiplyByScalar(A);var B=t.getProperty("SCALE_NON_UNIFORM",5126,3,v,f);B&&u.scale(B),c.scale=u;var w=t.getProperty("BATCH_ID",5123,1,v);void 0===w&&(w=v);var _=(new Wr).fromQuaternion(c.rotation);l.identity(),l.translate(c.translation),l.multiplyRight(_),l.scale(c.scale);var x=l.clone();i[v]={modelMatrix:x,batchId:w}}e.instances=i}(e,o,0,s),r}function db(e,t,r,n,i,a){return pb.apply(this,arguments)}function pb(){return(pb=Me()(Pe.a.mark((function e(t,r,n,i,a,o){var s,u;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=xp(t,r,n),s=new DataView(r),t.tilesLength=s.getUint32(n,!0),n+=4,t.tiles=[];case 5:if(!(t.tiles.length<t.tilesLength&&t.byteLength-n>12)){e.next=13;break}return u={},t.tiles.push(u),e.next=10,o(r,n,i,a,u);case 10:n=e.sent,e.next=5;break;case 13:return e.abrupt("return",n);case 14:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function vb(e,t,r,n){return yb.apply(this,arguments)}function yb(){return(yb=Me()(Pe.a.mark((function e(t,r,n,i){var a;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.rotateYtoZ=!0,t.gltfUpAxis=n["3d-tiles"]&&n["3d-tiles"].assetGltfUpAxis?n["3d-tiles"].assetGltfUpAxis:"Y",a=i.parse,e.next=5,a(r,$m,n,i);case 5:t.gltf=e.sent;case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function gb(e){return mb.apply(this,arguments)}function mb(){return(mb=Me()(Pe.a.mark((function e(t){var r,n,i,a,o=arguments;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=o.length>1&&void 0!==o[1]?o[1]:0,n=o.length>2?o[2]:void 0,i=o.length>3?o[3]:void 0,(a=o.length>4&&void 0!==o[4]?o[4]:{}).byteOffset=r,a.type=td(t,r),e.t0=a.type,e.next=e.t0===$h.COMPOSITE?9:e.t0===$h.BATCHED_3D_MODEL?12:e.t0===$h.GLTF?15:e.t0===$h.INSTANCED_3D_MODEL?18:e.t0===$h.POINT_CLOUD?21:24;break;case 9:return e.next=11,db(a,t,r,n,i,gb);case 11:return e.abrupt("return",e.sent);case 12:return e.next=14,sb(a,t,r,n,i);case 14:return e.abrupt("return",e.sent);case 15:return e.next=17,vb(a,t,n,i);case 17:return e.abrupt("return",e.sent);case 18:return e.next=20,lb(a,t,r,n,i);case 20:return e.abrupt("return",e.sent);case 21:return e.next=23,jp(a,t,r,n,i);case 23:return e.abrupt("return",e.sent);case 24:throw new Error("3DTileLoader: unknown type ".concat(a.type));case 25:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function bb(){return(bb=Me()(Pe.a.mark((function e(t){var r,n,i,a,o,s,u;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(1952609651===new Uint32Array(t.slice(0,4))[0]){e.next=3;break}throw new Error("Wrong subtree file magic number");case 3:if(1===new Uint32Array(t.slice(4,8))[0]){e.next=6;break}throw new Error("Wrong subtree file verson, must be 1");case 6:if(r=wb(t.slice(8,16)),n=new Uint8Array(t,24,r),i=new TextDecoder("utf8"),a=i.decode(n),o=JSON.parse(a),s=wb(t.slice(16,24)),u=new ArrayBuffer(0),s&&(u=t.slice(24+r)),!("bufferView"in o.tileAvailability)){e.next=18;break}return e.next=17,Ab(o,"tileAvailability",u);case 17:o.tileAvailability.explicitBitstream=e.sent;case 18:if(!("bufferView"in o.contentAvailability)){e.next=22;break}return e.next=21,Ab(o,"contentAvailability",u);case 21:o.contentAvailability.explicitBitstream=e.sent;case 22:if(!("bufferView"in o.childSubtreeAvailability)){e.next=26;break}return e.next=25,Ab(o,"childSubtreeAvailability",u);case 25:o.childSubtreeAvailability.explicitBitstream=e.sent;case 26:return e.abrupt("return",o);case 27:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ab(e,t,r){return Bb.apply(this,arguments)}function Bb(){return(Bb=Me()(Pe.a.mark((function e(t,r,n){var i,a,o,s,u;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=t[r].bufferView,a=t.bufferViews[i],!(o=t.buffers[a.buffer]).uri){e.next=11;break}return e.next=6,Cu(o.uri);case 6:return s=e.sent,e.next=9,s.arrayBuffer();case 9:return u=e.sent,e.abrupt("return",new Uint8Array(u,a.byteOffset,a.byteLength));case 11:return e.abrupt("return",new Uint8Array(n,a.byteOffset,a.byteLength));case 12:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function wb(e){var t=new DataView(e),r=t.getUint32(0,!0),n=t.getUint32(4,!0);return r+Math.pow(2,32)*n}var _b={id:"3d-tiles-subtree",name:"3D Tiles Subtree",module:"3d-tiles",version:"3.2.10",extensions:["subtree"],mimeTypes:["application/octet-stream"],tests:["subtree"],parse:function(e){return bb.apply(this,arguments)},options:{}},xb={QUADTREE:4,OCTREE:8};function Cb(e){return Ob.apply(this,arguments)}function Ob(){return(Ob=Me()(Pe.a.mark((function e(t){var r,n,i,a,o,s,u,c,l,f,h,d,p,v,y,g,m,b,A,B,w,_,x,C,O,E,T,S,k,M,I,P,R,F,D,L,j,G,U,N;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.options,n=t.parentData,i=void 0===n?{mortonIndex:0,x:0,y:0,z:0}:n,a=t.childIndex,o=void 0===a?0:a,s=t.globalData,u=void 0===s?{level:0,mortonIndex:0,x:0,y:0,z:0}:s,c=t.subtree,l=t.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=xb[h],A=1&o,B=o>>1&1,w=o>>2&1,_=(Math.pow(b,f)-1)/(b-1),x=Sb(i.mortonIndex,o),C=_+x,O=Sb(i.x,A),E=Sb(i.y,B),T=Sb(i.z,w),S=!1,f+1>d&&(S=Eb(c.childSubtreeAvailability,x)),k=Sb(u.x,O),M=Sb(u.y,E),I=Sb(u.z,T),P=f+u.level,!S){e.next=38;break}return R="".concat(g,"/").concat(y),F=kb(R,P,k,M,I),e.next=25,Yl(F,_b);case 25:D=e.sent,c=D,u.mortonIndex=x,u.x=O,u.y=E,u.z=T,u.level=f,x=0,C=0,O=0,E=0,T=0,f=0;case 38:if(Eb(c.tileAvailability,C)&&!(f>p)){e.next=41;break}return e.abrupt("return",m);case 41:Eb(c.contentAvailability,C)&&(m.contentUrl=kb(v,P,k,M,I)),L=f+1,j={mortonIndex:x,x:O,y:E,z:T},G=0;case 46:if(!(G<b)){e.next=54;break}return e.next=49,Cb({subtree:c,options:r,parentData:j,childIndex:G,level:L,globalData:u});case 49:((U=e.sent).contentUrl||U.children.length)&&(N=Tb(U,P+1,{childTileX:O,childTileY:E,childTileZ:T},r),m.children.push(N));case 51:G++,e.next=46;break;case 54:return e.abrupt("return",m);case 55:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Eb(e,t){return"constant"in e?Boolean(e.constant):!!e.explicitBitstream&&(r=t,n=e.explicitBitstream,i=Math.floor(r/8),a=r%8,1==(n[i]>>a&1));var r,n,i,a}function Tb(e,t,r,n){var i=n.basePath,a=n.refine,o=n.getRefine,s=n.lodMetricType,u=n.getTileType,c=n.rootLodMetricValue,l=n.rootBoundingVolume,f=e.contentUrl&&e.contentUrl.replace("".concat(i,"/"),""),h=c/Math.pow(2,t),d=function(e,t,r){if(t.region){var n=r.childTileX,i=r.childTileY,a=r.childTileZ,o=M()(t.region,6),s=o[0],u=o[1],c=o[2],l=o[3],f=o[4],h=o[5],d=Math.pow(2,e),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*a,f+y*(a+1)]}}return console.warn("Unsupported bounding volume type: ",t),null}(t,l,r);return{children:e.children,contentUrl:e.contentUrl,content:{uri:f},id:e.contentUrl,refine:o(a),type:u(e),lodMetricType:s,lodMetricValue:h,boundingVolume:d}}function Sb(e,t){return parseInt(e.toString(2)+t.toString(2),2)}function kb(e,t,r,n,i){var a=function(e){var t={};for(var r in e)t["{".concat(r,"}")]=e[r];return t}({level:t,x:r,y:n,z:i});return e.replace(/{level}|{x}|{y}|{z}/gi,(function(e){return a[e]}))}function Mb(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return Ib(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ib(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function Ib(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Pb(e){if(!e.contentUrl)return $f;var t=e.contentUrl.split(".").pop();switch(t){case"pnts":return th;case"i3dm":case"b3dm":case"glb":case"gltf":return eh;default:return t}}function Rb(e){switch(e){case"REPLACE":case"replace":return Yf;case"ADD":case"add":return Zf;default:return e}}function Fb(e,t){if(/^[a-z][0-9a-z+.-]*:/i.test(t)){var r=new URL(e,"".concat(t,"/"));return decodeURI(r.toString())}return e.startsWith("/")?e:"".concat(t,"/").concat(e)}function Db(e,t){if(!e)return null;if(e.content){var r=e.content.uri||e.content.url;e.contentUrl=Fb(r,t.basePath)}return e.id=e.contentUrl,e.lodMetricType=ah,e.lodMetricValue=e.geometricError,e.transformMatrix=e.transform,e.type=Pb(e),e.refine=Rb(e.refine),e}function Lb(e){var t=e.basePath,r=Db(e.root,e),n=[];for(n.push(r);n.length>0;){var i,a=Mb((n.pop()||{}).children||[]);try{for(a.s();!(i=a.n()).done;){var o=i.value;Db(o,{basePath:t}),n.push(o)}}catch(e){a.e(e)}finally{a.f()}}return r}function jb(e){return Gb.apply(this,arguments)}function Gb(){return(Gb=Me()(Pe.a.mark((function e(t){var r,n,i,a,o,s,u,c,l,f,h,d,p,v;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.root){e.next=2;break}return e.abrupt("return",null);case 2:return r=t.basePath,n=t.root.extensions["3DTILES_implicit_tiling"],i=n.subdivisionScheme,a=n.maximumLevel,o=n.subtreeLevels,s=n.subtrees.uri,u=kb(s,0,0,0,0),c=Fb(u,r),e.next=9,Yl(c,_b);case 9:return l=e.sent,f=Fb(t.root.content.uri,r),h=t.root.refine,d=t.root.geometricError,p=t.root.boundingVolume,v={contentUrlTemplate:f,subtreesUriTemplate:s,subdivisionScheme:i,subtreeLevels:o,maximumLevel:a,refine:h,basePath:r,lodMetricType:ah,rootLodMetricValue:d,rootBoundingVolume:p,getTileType:Pb,getRefine:Rb},e.next=17,Ub(t.root,l,v);case 17:return e.abrupt("return",e.sent);case 18:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ub(e,t,r){return Nb.apply(this,arguments)}function Nb(){return(Nb=Me()(Pe.a.mark((function e(t,r,n){var i,a,o;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t){e.next=2;break}return e.abrupt("return",null);case 2:return t.lodMetricType=ah,t.lodMetricValue=t.geometricError,t.transformMatrix=t.transform,e.next=7,Cb({subtree:r,options:n});case 7:return i=e.sent,a=i.children,(o=i.contentUrl)&&(t.contentUrl=o,t.content={uri:o.replace("".concat(n.basePath,"/"),"")}),t.refine=Rb(t.refine),t.type=Pb(t),t.children=a,t.id=t.contentUrl,e.abrupt("return",t);case 16:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Hb={id:"3d-tiles",name:"3D Tiles",module:"3d-tiles",version:"3.2.10",extensions:["cmpt","pnts","b3dm","i3dm"],mimeTypes:["application/octet-stream"],tests:["cmpt","pnts","b3dm","i3dm"],parse:function(e,t,r){return Xb.apply(this,arguments)},options:{"3d-tiles":{loadGLTF:!0,decodeQuantizedPositions:!1,isTileset:"auto",assetGltfUpAxis:null}}};function Jb(e){return n.dirname(e.url)}function Vb(e,t,r){return zb.apply(this,arguments)}function zb(){return(zb=Me()(Pe.a.mark((function e(t,r,n){var i;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i={content:{featureIds:null}},0,e.next=4,gb(t,0,r,n,i.content);case 4:return e.abrupt("return",i.content);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Kb(e,t,r){return qb.apply(this,arguments)}function qb(){return(qb=Me()(Pe.a.mark((function e(t,r,n){var i,a;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((a=JSON.parse((new TextDecoder).decode(t))).loader=r.loader||Hb,a.url=n.url,a.basePath=Jb(a),!Qb(a)){e.next=10;break}return e.next=7,jb(a);case 7:e.t0=e.sent,e.next=11;break;case 10:e.t0=Lb(a);case 11:return a.root=e.t0,a.type=ih,a.lodMetricType=ah,a.lodMetricValue=(null===(i=a.root)||void 0===i?void 0:i.lodMetricValue)||0,e.abrupt("return",a);case 16:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Xb(){return(Xb=Me()(Pe.a.mark((function e(t,r,n){var i;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=r["3d-tiles"]||{},!("auto"===i.isTileset?n.url&&-1!==n.url.indexOf(".json"):i.isTileset)){e.next=8;break}return e.next=5,Kb(t,r,n);case 5:t=e.sent,e.next=11;break;case 8:return e.next=10,Vb(t,r,n);case 10:t=e.sent;case 11:return e.abrupt("return",t);case 12:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Qb(e){var t,r;return(null==e?void 0:null===(t=e.extensionsRequired)||void 0===t?void 0:t.includes("3DTILES_implicit_tiling"))&&(null==e?void 0:null===(r=e.extensionsUsed)||void 0===r?void 0:r.includes("3DTILES_implicit_tiling"))}function Wb(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Zb(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Wb(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Wb(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Yb(e){var t=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(e){return!1}}();return function(){var r,n=m()(e);if(t){var i=m()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return y()(this,r)}}var $b=[0],eA={getPointColor:{type:"accessor",value:[0,0,0,255]},pointSize:1,data:null,loader:Hb,onTilesetLoad:{type:"function",value:function(e){},compare:!1},onTileLoad:{type:"function",value:function(e){},compare:!1},onTileUnload:{type:"function",value:function(e){},compare:!1},onTileError:{type:"function",value:function(e,t,r){},compare:!1},_getMeshColor:{type:"function",value:function(e){return[255,255,255]},compare:!1}},tA=function(e){p()(n,e);var t,r=Yb(n);function n(){var e;h()(this,n);for(var t=arguments.length,i=new Array(t),a=0;a<t;a++)i[a]=arguments[a];return e=r.call.apply(r,[this].concat(i)),A()(yi()(e),"state",void 0),e}return C()(n,[{key:"initializeState",value:function(){"onTileLoadFail"in this.props&&B.log.removed("onTileLoadFail","onTileError")(),this.state={layerMap:{},tileset3d:null,activeViewports:{},lastUpdatedViewports:null}}},{key:"isLoaded",get:function(){var e=this.state.tileset3d;return null!==e&&e.isLoaded()}},{key:"shouldUpdateState",value:function(e){return e.changeFlags.somethingChanged}},{key:"updateState",value:function(e){var t=e.props,r=e.oldProps,n=e.changeFlags;if(t.data&&t.data!==r.data&&this._loadTileset(t.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 a=this.state.layerMap;for(var o in a)a[o].needsUpdate=!0}}},{key:"activateViewport",value:function(e){var t=this.state,r=t.activeViewports,n=t.lastUpdatedViewports;this.internalState.viewport=e,r[e.id]=e;var i=null==n?void 0:n[e.id];i&&e.equals(i)||(this.setChangeFlags({viewportChanged:!0}),this.setNeedsUpdate())}},{key:"getPickingInfo",value:function(e){var t=e.info,r=e.sourceLayer,n=this.state.layerMap,i=r&&r.id;if(i){var a=i.substring(this.id.length+1),o=a.substring(a.indexOf("-")+1);t.object=n[o]&&n[o].tile}return t}},{key:"filterSubLayer",value:function(e){var t=e.layer,r=e.viewport,n=t.props.tile,i=r.id;return n.selected&&n.viewportIds.includes(i)}},{key:"_updateAutoHighlight",value:function(e){e.sourceLayer&&e.sourceLayer.updateAutoHighlight(e)}},{key:"_loadTileset",value:(t=Me()(Pe.a.mark((function e(t){var r,n,i,a,o,s,u;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.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]),a={loadOptions:Zb({},n)},!i.preload){e.next=10;break}return e.next=7,i.preload(t,n);case 7:(o=e.sent).headers&&(a.loadOptions.fetch=Zb(Zb({},a.loadOptions.fetch),{},{headers:o.headers})),Object.assign(a,o);case 10:return e.next=12,Yl(t,i,a.loadOptions);case 12:s=e.sent,u=new Yh(s,Zb({onTileLoad:this._onTileLoad.bind(this),onTileUnload:this._onTileUnload.bind(this),onTileError:this.props.onTileError},a)),this.setState({tileset3d:u,layerMap:{}}),this._updateTileset(this.state.activeViewports),this.props.onTilesetLoad(u);case 17:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"_onTileLoad",value:function(e){var t=this.state.lastUpdatedViewports;this.props.onTileLoad(e),this._updateTileset(t),this.setNeedsUpdate()}},{key:"_onTileUnload",value:function(e){delete this.state.layerMap[e.id],this.props.onTileUnload(e)}},{key:"_updateTileset",value:function(e){var t=this;if(e){var r=this.state.tileset3d,n=this.context.timeline,i=Object.keys(e).length;n&&i&&r&&r.selectTiles(Object.values(e)).then((function(e){t.state.frameNumber!==e&&t.setState({frameNumber:e})}))}}},{key:"_getSubLayer",value:function(e,t){if(!e.content)return null;switch(e.type){case th:return this._makePointCloudLayer(e,t);case eh:return this._make3DModelLayer(e);case rh:return this._makeSimpleMeshLayer(e,t);default:throw new Error("Tile3DLayer: Failed to render layer of type ".concat(e.content.type))}}},{key:"_makePointCloudLayer",value:function(e,t){var r=e.content,n=r.attributes,i=r.pointCount,a=r.constantRGBA,o=r.cartographicOrigin,s=r.modelMatrix,u=n.positions,c=n.normals,l=n.colors;if(!u)return null;var f=t&&t.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",B.PointCloudLayer))({pointSize:d},this.getSubLayerProps({id:"pointcloud"}),{id:"".concat(this.id,"-pointcloud-").concat(e.id),tile:e,data:f,coordinateSystem:B.COORDINATE_SYSTEM.METER_OFFSETS,coordinateOrigin:o,modelMatrix:s,getColor:a||p,_offset:0})}},{key:"_make3DModelLayer",value:function(e){var t=e.content,r=t.gltf,n=t.instances,i=t.cartographicOrigin,a=t.modelMatrix;return new(this.getSubLayerClass("scenegraph",B.ScenegraphLayer))({_lighting:"pbr"},this.getSubLayerProps({id:"scenegraph"}),{id:"".concat(this.id,"-scenegraph-").concat(e.id),tile:e,data:n||$b,scenegraph:r,coordinateSystem:B.COORDINATE_SYSTEM.METER_OFFSETS,coordinateOrigin:i,modelMatrix:a,getTransformMatrix:function(e){return e.modelMatrix},getPosition:[0,0,0],_offset:0})}},{key:"_makeSimpleMeshLayer",value:function(e,t){var r=e.content,n=r.attributes,i=r.indices,a=r.modelMatrix,o=r.cartographicOrigin,s=r.coordinateSystem,u=void 0===s?B.COORDINATE_SYSTEM.METER_OFFSETS:s,c=r.material,l=r.featureIds,f=this.props._getMeshColor,h=t&&t.props.mesh||new Ri.Geometry({drawMode:4,attributes:rA(n),indices:i});return new(this.getSubLayerClass("mesh",Vs))(this.getSubLayerProps({id:"mesh"}),{id:"".concat(this.id,"-mesh-").concat(e.id),tile:e,mesh:h,data:$b,getColor:f(e),pbrMaterial:c,modelMatrix:a,coordinateOrigin:o,coordinateSystem:u,featureIds:l,_offset:0})}},{key:"renderLayers",value:function(){var e=this,t=this.state,r=t.tileset3d,n=t.layerMap;return r?r.tiles.map((function(t){var r=n[t.id]=n[t.id]||{tile:t},i=r.layer;return t.selected&&(i?r.needsUpdate&&(i=e._getSubLayer(t,i),r.needsUpdate=!1):i=e._getSubLayer(t)),r.layer=i,i})).filter(Boolean):null}}]),n}(B.CompositeLayer);function rA(e){var t={};return t.positions=Zb(Zb({},e.positions),{},{value:new Float32Array(e.positions.value)}),e.normals&&(t.normals=e.normals),e.texCoords&&(t.texCoords=e.texCoords),e.colors&&(t.colors=e.colors),e.uvRegions&&(t.uvRegions=e.uvRegions),t}A()(tA,"defaultProps",eA),A()(tA,"layerName","Tile3DLayer");var nA={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 iA(e){var t=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(e){return!1}}();return function(){var r,n=m()(e);if(t){var i=m()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return y()(this,r)}}function aA(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function oA(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?aA(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):aA(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var sA=[1],uA=oA(oA({},si.defaultProps),{},{elevationData:In,texture:oA(oA({},In),{},{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:[nA]});function cA(e){return Array.isArray(e)?e.join(";"):e||""}var lA=function(e){p()(r,e);var t=iA(r);function r(){var e;h()(this,r);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return e=t.call.apply(t,[this].concat(i)),A()(yi()(e),"state",void 0),e}return C()(r,[{key:"updateState",value:function(e){var t=e.props,r=e.oldProps,n=t.elevationData!==r.elevationData;if(n){var i=t.elevationData,a=i&&(Array.isArray(i)||i.includes("{x}")&&i.includes("{y}"));this.setState({isTiled:a})}var o=n||t.meshMaxError!==r.meshMaxError||t.elevationDecoder!==r.elevationDecoder||t.bounds!==r.bounds;if(!this.state.isTiled&&o){var s=this.loadTerrain(t);this.setState({terrain:s})}t.workerUrl&&B.log.removed("workerUrl","loadOptions.terrain.workerUrl")()}},{key:"loadTerrain",value:function(e){var t,r=e.elevationData,n=e.bounds,i=e.elevationDecoder,a=e.meshMaxError,o=e.signal;if(!r)return null;var s=this.getLoadOptions();return s=oA(oA({},s),{},{terrain:oA(oA({skirtHeight:this.state.isTiled?2*a:0},null===(t=s)||void 0===t?void 0:t.terrain),{},{bounds:n,meshMaxError:a,elevationDecoder:i})}),(0,this.props.fetch)(r,{propName:"elevationData",layer:this,loadOptions:s,signal:o})}},{key:"getTiledTerrainData",value:function(e){var t=this.props,r=t.elevationData,n=t.fetch,i=t.texture,a=t.elevationDecoder,o=t.meshMaxError,s=this.context.viewport,u=Rn(r,e),c=i&&Rn(i,e),l=e.signal,f=[0,0],h=[0,0];if(s.isGeospatial){var d=e.bbox;f=s.projectFlat([d.west,d.south]),h=s.projectFlat([d.east,d.north])}else{var p=e.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:a,meshMaxError:o,signal:l}),g=c?n(c,{propName:"texture",layer:this,loaders:[],signal:l}).catch((function(e){return null})):Promise.resolve(null);return Promise.all([y,g])}},{key:"renderSubLayers",value:function(e){var t=this.getSubLayerClass("mesh",B.SimpleMeshLayer),r=this.props,n=r.color,i=r.wireframe,a=r.material,o=e.data;if(!o)return null;var s=M()(o,2),u=s[0],c=s[1];return new t(e,{data:sA,mesh:u,texture:c,_instanced:!1,coordinateSystem:B.COORDINATE_SYSTEM.CARTESIAN,getPosition:function(e){return[0,0,0]},getColor:n,wireframe:i,material:a})}},{key:"onViewportLoad",value:function(e){if(e){var t=this.state.zRange,r=e.map((function(e){return e.content})).filter(Boolean).map((function(e){return e[0].header.boundingBox.map((function(e){return e[2]}))}));if(0!==r.length){var n=Math.min.apply(Math,De()(r.map((function(e){return e[0]})))),i=Math.max.apply(Math,De()(r.map((function(e){return e[1]}))));(!t||n<t[0]||i>t[1])&&this.setState({zRange:[n,i]})}}}},{key:"renderLayers",value:function(){var e=this.props,t=e.color,r=e.material,n=e.elevationData,i=e.texture,a=e.wireframe,o=e.meshMaxError,s=e.elevationDecoder,u=e.tileSize,c=e.maxZoom,l=e.minZoom,f=e.extent,h=e.maxRequests,d=e.onTileLoad,p=e.onTileUnload,v=e.onTileError,y=e.maxCacheSize,g=e.maxCacheByteSize,m=e.refinementStrategy;return this.state.isTiled?new si(this.getSubLayerProps({id:"tiles"}),{getTileData:this.getTiledTerrainData.bind(this),renderSubLayers:this.renderSubLayers.bind(this),updateTriggers:{getTileData:{elevationData:cA(n),texture:cA(i),meshMaxError:o,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",B.SimpleMeshLayer))(this.getSubLayerProps({id:"mesh"}),{data:sA,mesh:this.state.terrain,texture:i,_instanced:!1,getPosition:function(e){return[0,0,0]},getColor:t,material:r,wireframe:a})}}]),r}(B.CompositeLayer);A()(lA,"defaultProps",uA),A()(lA,"layerName","TerrainLayer");function fA(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.start,n=void 0===r?0:r,i=t.end,a=void 0===i?e.length:i,o=t.size||2,s=0,u=n,c=a-o;u<a;u+=o)s+=(e[u]-e[c])*(e[u+1]+e[c+1]),c=u;return s/2}function hA(e,t,r,n,i,a){var o,s;if(void 0===a&&(a=fA(e,{start:t,end:r,size:n})),i===a<0)for(o=t;o<r;o+=n)s=RA(o,e[o],e[o+1],s);else for(o=r-n;o>=t;o-=n)s=RA(o,e[o],e[o+1],s);return s&&TA(s,s.next)&&(FA(s),s=s.next),s}function dA(e,t){if(!e)return e;t||(t=e);var r,n=e;do{if(r=!1,n.steiner||!TA(n,n.next)&&0!==EA(n.prev,n,n.next))n=n.next;else{if(FA(n),(n=t=n.prev)===n.next)break;r=!0}}while(r||n!==t);return t}function pA(e,t,r,n,i,a,o){if(e){!o&&a&&function(e,t,r,n){var i=e;do{null===i.z&&(i.z=_A(i.x,i.y,t,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,function(e){var t,r,n,i,a,o,s,u,c=1;do{for(i=e,e=null,u=null,n=0;i;){for(n++,o=i,a=0,r=0;r<c&&(a++,o=o.nextZ);r++);for(s=c;a>0||s>0&&o;)0!==a&&(0===s||!o||i.z<=o.z)?(t=i,i=i.nextZ,a--):(t=o,o=o.nextZ,s--),u?u.nextZ=t:e=t,t.prevZ=u,u=t;i=o}u.nextZ=null,c*=2}while(n>1)}(i)}(e,n,i,a);for(var s,u,c=e;e.prev!==e.next;)if(s=e.prev,u=e.next,a?yA(e,n,i,a):vA(e))t.push(s.i/r),t.push(e.i/r),t.push(u.i/r),FA(e),e=u.next,c=u.next;else if((e=u)===c){o?1===o?pA(e=gA(dA(e),t,r),t,r,n,i,a,2):2===o&&mA(e,t,r,n,i,a):pA(dA(e),t,r,n,i,a,1);break}}}function vA(e){var t=e.prev,r=e,n=e.next;if(EA(t,r,n)>=0)return!1;for(var i=e.next.next;i!==e.prev;){if(CA(t.x,t.y,r.x,r.y,n.x,n.y,i.x,i.y)&&EA(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function yA(e,t,r,n){var i=e.prev,a=e,o=e.next;if(EA(i,a,o)>=0)return!1;for(var s=i.x<a.x?i.x<o.x?i.x:o.x:a.x<o.x?a.x:o.x,u=i.y<a.y?i.y<o.y?i.y:o.y:a.y<o.y?a.y:o.y,c=i.x>a.x?i.x>o.x?i.x:o.x:a.x>o.x?a.x:o.x,l=i.y>a.y?i.y>o.y?i.y:o.y:a.y>o.y?a.y:o.y,f=_A(s,u,t,r,n),h=_A(c,l,t,r,n),d=e.prevZ,p=e.nextZ;d&&d.z>=f&&p&&p.z<=h;){if(d!==e.prev&&d!==e.next&&CA(i.x,i.y,a.x,a.y,o.x,o.y,d.x,d.y)&&EA(d.prev,d,d.next)>=0)return!1;if(d=d.prevZ,p!==e.prev&&p!==e.next&&CA(i.x,i.y,a.x,a.y,o.x,o.y,p.x,p.y)&&EA(p.prev,p,p.next)>=0)return!1;p=p.nextZ}for(;d&&d.z>=f;){if(d!==e.prev&&d!==e.next&&CA(i.x,i.y,a.x,a.y,o.x,o.y,d.x,d.y)&&EA(d.prev,d,d.next)>=0)return!1;d=d.prevZ}for(;p&&p.z<=h;){if(p!==e.prev&&p!==e.next&&CA(i.x,i.y,a.x,a.y,o.x,o.y,p.x,p.y)&&EA(p.prev,p,p.next)>=0)return!1;p=p.nextZ}return!0}function gA(e,t,r){var n=e;do{var i=n.prev,a=n.next.next;!TA(i,a)&&SA(i,n,n.next,a)&&IA(i,a)&&IA(a,i)&&(t.push(i.i/r),t.push(n.i/r),t.push(a.i/r),FA(n),FA(n.next),n=e=a),n=n.next}while(n!==e);return dA(n)}function mA(e,t,r,n,i,a){var o=e;do{for(var s=o.next.next;s!==o.prev;){if(o.i!==s.i&&OA(o,s)){var u=PA(o,s);return o=dA(o,o.next),u=dA(u,u.next),pA(o,t,r,n,i,a),void pA(u,t,r,n,i,a)}s=s.next}o=o.next}while(o!==e)}function bA(e,t,r,n,i){var a,o,s,u=[];for(a=0,o=t.length;a<o;a++)(s=hA(e,t[a]*n,a<o-1?t[a+1]*n:e.length,n,!1,i&&i[a+1]))===s.next&&(s.steiner=!0),u.push(xA(s));for(u.sort(AA),a=0;a<u.length;a++)BA(u[a],r),r=dA(r,r.next);return r}function AA(e,t){return e.x-t.x}function BA(e,t){if(t=function(e,t){var r,n=t,i=e.x,a=e.y,o=-1/0;do{if(a<=n.y&&a>=n.next.y&&n.next.y!==n.y){var s=n.x+(a-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=i&&s>o){if(o=s,s===i){if(a===n.y)return n;if(a===n.next.y)return n.next}r=n.x<n.next.x?n:n.next}}n=n.next}while(n!==t);if(!r)return null;if(i===o)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&&CA(a<f?i:o,a,l,f,a<f?o:i,a,n.x,n.y)&&(u=Math.abs(a-n.y)/(i-n.x),IA(n,e)&&(u<h||u===h&&(n.x>r.x||n.x===r.x&&wA(r,n)))&&(r=n,h=u)),n=n.next}while(n!==c);return r}(e,t)){var r=PA(t,e);dA(t,t.next),dA(r,r.next)}}function wA(e,t){return EA(e.prev,e,t.prev)<0&&EA(t.next,e,e.next)<0}function _A(e,t,r,n,i){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-r)*i)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-n)*i)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function xA(e){var t=e,r=e;do{(t.x<r.x||t.x===r.x&&t.y<r.y)&&(r=t),t=t.next}while(t!==e);return r}function CA(e,t,r,n,i,a,o,s){return(i-o)*(t-s)-(e-o)*(a-s)>=0&&(e-o)*(n-s)-(r-o)*(t-s)>=0&&(r-o)*(a-s)-(i-o)*(n-s)>=0}function OA(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var r=e;do{if(r.i!==e.i&&r.next.i!==e.i&&r.i!==t.i&&r.next.i!==t.i&&SA(r,r.next,e,t))return!0;r=r.next}while(r!==e);return!1}(e,t)&&(IA(e,t)&&IA(t,e)&&function(e,t){var r=e,n=!1,i=(e.x+t.x)/2,a=(e.y+t.y)/2;do{r.y>a!=r.next.y>a&&r.next.y!==r.y&&i<(r.next.x-r.x)*(a-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==e);return n}(e,t)&&(EA(e.prev,e,t.prev)||EA(e,t.prev,t))||TA(e,t)&&EA(e.prev,e,e.next)>0&&EA(t.prev,t,t.next)>0)}function EA(e,t,r){return(t.y-e.y)*(r.x-t.x)-(t.x-e.x)*(r.y-t.y)}function TA(e,t){return e.x===t.x&&e.y===t.y}function SA(e,t,r,n){var i=MA(EA(e,t,r)),a=MA(EA(e,t,n)),o=MA(EA(r,n,e)),s=MA(EA(r,n,t));return i!==a&&o!==s||(!(0!==i||!kA(e,r,t))||(!(0!==a||!kA(e,n,t))||(!(0!==o||!kA(r,e,n))||!(0!==s||!kA(r,t,n)))))}function kA(e,t,r){return t.x<=Math.max(e.x,r.x)&&t.x>=Math.min(e.x,r.x)&&t.y<=Math.max(e.y,r.y)&&t.y>=Math.min(e.y,r.y)}function MA(e){return e>0?1:e<0?-1:0}function IA(e,t){return EA(e.prev,e,e.next)<0?EA(e,t,e.next)>=0&&EA(e,e.prev,t)>=0:EA(e,t,e.prev)<0||EA(e,e.next,t)<0}function PA(e,t){var r=new DA(e.i,e.x,e.y),n=new DA(t.i,t.x,t.y),i=e.next,a=t.prev;return e.next=t,t.prev=e,r.next=i,i.prev=r,n.next=r,r.prev=n,a.next=n,n.prev=a,n}function RA(e,t,r,n){var i=new DA(e,t,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 FA(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function DA(e,t,r){this.i=e,this.x=t,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function LA(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return jA(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return jA(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function jA(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function GA(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function UA(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?GA(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):GA(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function NA(e,t,r){var n=HA(e),i=Object.keys(n).filter((function(e){return n[e]!==Array}));return function(e,t,r){for(var n=t.pointPositionsCount,i=t.pointFeaturesCount,a=t.linePositionsCount,o=t.linePathsCount,s=t.lineFeaturesCount,u=t.polygonPositionsCount,c=t.polygonObjectsCount,l=t.polygonRingsCount,f=t.polygonFeaturesCount,h=t.propArrayTypes,d=t.coordLength,p=r.numericPropKeys,v=void 0===p?[]:p,y=r.PositionDataType,g=void 0===y?Float32Array:y,m=(e[0]&&"id"in e[0]),b=e.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:[]},B={type:"LineString",pathIndices:a>65535?new Uint32Array(o+1):new Uint16Array(o+1),positions:new g(a*d),globalFeatureIds:new b(a),featureIds:s>65535?new Uint32Array(a):new Uint16Array(a),numericProps:{},properties:[],fields:[]},w={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,B,w];_<x.length;_++){var C,O=x[_],E=LA(v);try{for(E.s();!(C=E.n()).done;){var T=C.value,S=h[T];O.numericProps[T]=new S(O.positions.length/d)}}catch(e){E.e(e)}finally{E.f()}}B.pathIndices[o]=a,w.polygonIndices[c]=u,w.primitivePolygonIndices[l]=u;var k,M={pointPosition:0,pointFeature:0,linePosition:0,linePath:0,lineFeature:0,polygonPosition:0,polygonObject:0,polygonRing:0,polygonFeature:0,feature:0},I=LA(e);try{for(I.s();!(k=I.n()).done;){var P=k.value,R=P.geometry,F=P.properties||{};switch(R.type){case"Point":JA(R,A,M,d,F),A.properties.push(QA(F,v)),m&&A.fields.push({id:P.id}),M.pointFeature++;break;case"LineString":VA(R,B,M,d,F),B.properties.push(QA(F,v)),m&&B.fields.push({id:P.id}),M.lineFeature++;break;case"Polygon":zA(R,w,M,d,F),w.properties.push(QA(F,v)),m&&w.fields.push({id:P.id}),M.polygonFeature++;break;default:throw new Error("Invalid geometry type")}M.feature++}}catch(e){I.e(e)}finally{I.f()}return function(e,t,r,n){return{points:UA(UA({},e),{},{positions:{value:e.positions,size:n},globalFeatureIds:{value:e.globalFeatureIds,size:1},featureIds:{value:e.featureIds,size:1},numericProps:qA(e.numericProps,1)}),lines:UA(UA({},t),{},{positions:{value:t.positions,size:n},pathIndices:{value:t.pathIndices,size:1},globalFeatureIds:{value:t.globalFeatureIds,size:1},featureIds:{value:t.featureIds,size:1},numericProps:qA(t.numericProps,1)}),polygons:UA(UA({},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:qA(r.numericProps,1)})}}(A,B,w,d)}(e,UA({propArrayTypes:n},t),{numericPropKeys:r&&r.numericPropKeys||i,PositionDataType:r?r.PositionDataType:Float32Array})}function HA(e){var t,r={},n=LA(e);try{for(n.s();!(t=n.n()).done;){var i=t.value;if(i.properties)for(var a in i.properties){var o=i.properties[a];r[a]=WA(o,r[a])}}}catch(e){n.e(e)}finally{n.f()}return r}function JA(e,t,r,n,i){t.positions.set(e.data,r.pointPosition*n);var a=e.data.length/n;XA(t,i,r.pointPosition,a),t.globalFeatureIds.fill(r.feature,r.pointPosition,r.pointPosition+a),t.featureIds.fill(r.pointFeature,r.pointPosition,r.pointPosition+a),r.pointPosition+=a}function VA(e,t,r,n,i){t.positions.set(e.data,r.linePosition*n);var a=e.data.length/n;XA(t,i,r.linePosition,a),t.globalFeatureIds.fill(r.feature,r.linePosition,r.linePosition+a),t.featureIds.fill(r.lineFeature,r.linePosition,r.linePosition+a);for(var o=0,s=e.indices.length;o<s;++o){var u=e.indices[o],c=o===s-1?e.data.length:e.indices[o+1];t.pathIndices[r.linePath++]=r.linePosition,r.linePosition+=(c-u)/n}}function zA(e,t,r,n,i){t.positions.set(e.data,r.polygonPosition*n);var a=e.data.length/n;XA(t,i,r.polygonPosition,a),t.globalFeatureIds.fill(r.feature,r.polygonPosition,r.polygonPosition+a),t.featureIds.fill(r.polygonFeature,r.polygonPosition,r.polygonPosition+a);for(var o=0,s=e.indices.length;o<s;++o){var u=r.polygonPosition;t.polygonIndices[r.polygonObject++]=u;for(var c=e.areas[o],l=e.indices[o],f=e.indices[o+1],h=0,d=l.length;h<d;++h){var p=l[h],v=h===d-1?void 0===f?e.data.length:f[0]:l[h+1];t.primitivePolygonIndices[r.polygonRing++]=r.polygonPosition,r.polygonPosition+=(v-p)/n}KA(t,c,l,{startPosition:u,endPosition:r.polygonPosition,coordLength:n})}}function KA(e,t,r,n){for(var i=n.startPosition,a=n.endPosition,o=n.coordLength,s=i*o,u=a*o,c=e.positions.subarray(s,u),l=r[0],f=function(e,t){var r,n,i,a,o,s,u,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2,l=arguments.length>3?arguments[3]:void 0,f=t&&t.length,h=f?t[0]*c:e.length,d=hA(e,0,h,c,!0,l&&l[0]),p=[];if(!d||d.next===d.prev)return p;if(f&&(d=bA(e,t,d,c,l)),e.length>80*c){a=n=e[0],o=i=e[1];for(var v=c;v<h;v+=c)(s=e[v])<a&&(a=s),(u=e[v+1])<o&&(o=u),s>n&&(n=s),u>i&&(i=u);r=0!==(r=Math.max(n-a,i-o))?1/r:0}return pA(d,p,c,a,o,r),p}(c,r.slice(1).map((function(e){return(e-l)/o})),o,t),h=0,d=f.length;h<d;++h)e.triangles.push(i+f[h])}function qA(e,t){var r={};for(var n in e)r[n]={value:e[n],size:t};return r}function XA(e,t,r,n){for(var i in e.numericProps)if(i in t){var a=t[i];e.numericProps[i].fill(a,r,r+n)}}function QA(e,t){var r={};for(var n in e)t.includes(n)||(r[n]=e[n]);return r}function WA(e,t){return t!==Array&&Number.isFinite(e)?t===Float64Array||Math.fround(e)!==e?Float64Array:Float32Array:Array}var ZA=r(41),YA=r.n(ZA);function $A(e){for(var t,r,n=0,i=0,a=e.length-1;i<e.length;a=i++)t=e[i],n+=((r=e[a])[0]-t[0])*(t[1]+r[1]);return n}function eB(e,t,r){t&&r&&(1===e?t.id=r.readVarint():2===e?function(e,t){var r=e.readVarint()+e.pos;for(;e.pos<r;){var n=t._keys[e.readVarint()],i=t._values[e.readVarint()];t.properties[n]=i}}(r,t):3===e?t.type=r.readVarint():4===e&&(t._geometry=r.pos))}var tB=function(){function e(t,r,n,i,a){h()(this,e),Hn(this,"properties",void 0),Hn(this,"extent",void 0),Hn(this,"type",void 0),Hn(this,"id",void 0),Hn(this,"_pbf",void 0),Hn(this,"_geometry",void 0),Hn(this,"_keys",void 0),Hn(this,"_values",void 0),this.properties={},this.extent=n,this.type=0,this.id=null,this._pbf=t,this._geometry=-1,this._keys=i,this._values=a,t.readFields(eB,this,r)}return C()(e,[{key:"loadGeometry",value:function(){var e=this._pbf;e.pos=this._geometry;for(var t,r=e.readVarint()+e.pos,n=1,i=0,a=0,o=0,s=[];e.pos<r;){if(i<=0){var u=e.readVarint();n=7&u,i=u>>3}if(i--,1===n||2===n)a+=e.readSVarint(),o+=e.readSVarint(),1===n&&(t&&s.push(t),t=[]),t&&t.push([a,o]);else{if(7!==n)throw new Error("unknown command ".concat(n));t&&t.push(t[0].slice())}}return t&&s.push(t),s}},{key:"bbox",value:function(){var e=this._pbf;e.pos=this._geometry;for(var t=e.readVarint()+e.pos,r=1,n=0,i=0,a=0,o=1/0,s=-1/0,u=1/0,c=-1/0;e.pos<t;){if(n<=0){var l=e.readVarint();r=7&l,n=l>>3}if(n--,1===r||2===r)(i+=e.readSVarint())<o&&(o=i),i>s&&(s=i),(a+=e.readSVarint())<u&&(u=a),a>c&&(c=a);else if(7!==r)throw new Error("unknown command ".concat(r))}return[o,u,s,c]}},{key:"_toGeoJSON",value:function(t){var r,n,i=this.loadGeometry(),a=e.types[this.type];switch(this.type){case 1:var o=[];for(r=0;r<i.length;r++)o[r]=i[r][0];t(i=o,this);break;case 2:for(r=0;r<i.length;r++)t(i[r],this);break;case 3:for(i=function(e){var t=e.length;if(t<=1)return[e];for(var r,n,i=[],a=0;a<t;a++){var o=$A(e[a]);0!==o&&(void 0===n&&(n=o<0),n===o<0?(r&&i.push(r),r=[e[a]]):r&&r.push(e[a]))}return r&&i.push(r),i}(i),r=0;r<i.length;r++)for(n=0;n<i[r].length;n++)t(i[r][n],this)}1===i.length?i=i[0]:a="Multi".concat(a);var s={type:"Feature",geometry:{type:a,coordinates:i},properties:this.properties};return null!==this.id&&(s.id=this.id),s}},{key:"toGeoJSON",value:function(e){if("function"==typeof e)return this._toGeoJSON(e);var t=e.x,r=e.y,n=e.z,i=this.extent*Math.pow(2,n),a=this.extent*t,o=this.extent*r;return this._toGeoJSON((function(e){for(var t=0;t<e.length;t++){var r=e[t];r[0]=360*(r[0]+a)/i-180;var n=180-360*(r[1]+o)/i;r[1]=360/Math.PI*Math.atan(Math.exp(n*Math.PI/180))-90}}))}}],[{key:"types",get:function(){return["Unknown","Point","LineString","Polygon"]}}]),e}(),rB=function(){function e(t,r){h()(this,e),Hn(this,"version",void 0),Hn(this,"name",void 0),Hn(this,"extent",void 0),Hn(this,"length",void 0),Hn(this,"_pbf",void 0),Hn(this,"_keys",void 0),Hn(this,"_values",void 0),Hn(this,"_features",void 0),this.version=1,this.name="",this.extent=4096,this.length=0,this._pbf=t,this._keys=[],this._values=[],this._features=[],t.readFields(nB,this,r),this.length=this._features.length}return C()(e,[{key:"feature",value:function(e){if(e<0||e>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[e];var t=this._pbf.readVarint()+this._pbf.pos;return new tB(this._pbf,t,this.extent,this._keys,this._values)}}]),e}();function nB(e,t,r){t&&r&&(15===e?t.version=r.readVarint():1===e?t.name=r.readString():5===e?t.extent=r.readVarint():2===e?t._features.push(r.pos):3===e?t._keys.push(r.readString()):4===e&&t._values.push(function(e){var t=null,r=e.readVarint()+e.pos;for(;e.pos<r;){var n=e.readVarint()>>3;t=1===n?e.readString():2===n?e.readFloat():3===n?e.readDouble():4===n?e.readVarint64():5===n?e.readVarint():6===n?e.readSVarint():7===n?e.readBoolean():null}return t}(r)))}var iB,aB,oB,sB,uB,cB,lB,fB=function e(t,r){h()(this,e),Hn(this,"layers",void 0),this.layers=t.readFields(hB,{},r)};function hB(e,t,r){if(3===e&&r){var n=new rB(r,r.readVarint()+r.pos);n.length&&t&&(t[n.name]=n)}}function dB(e){var t=e.indices.length;if(t<=1)return{type:"Polygon",data:e.data,areas:[[fA(e.data)]],indices:[e.indices]};for(var r,n,i,a=[],o=[],s=[],u=[],c=0,l=0;l<t;l++){i=e.indices[l]-c,n=e.indices[l+1]-c||e.data.length;var f=fA(e.data.slice(i,n));if(0!==f)void 0===r&&(r=f<0),r===f<0?(u.length&&(a.push(s),o.push(u)),u=[i],s=[f]):(s.push(f),u.push(i));else{var h=e.data.slice(0,i),d=e.data.slice(n);e.data=h.concat(d),c+=n-i}}return s&&a.push(s),u.length&&o.push(u),{type:"Polygon",areas:a,indices:o,data:e.data}}function pB(e,t,r){t&&r&&(1===e?t.id=r.readVarint():2===e?function(e,t){var r=e.readVarint()+e.pos;for(;e.pos<r;){var n=t._keys[e.readVarint()],i=t._values[e.readVarint()];t.properties[n]=i}}(r,t):3===e?t.type=r.readVarint():4===e&&(t._geometry=r.pos))}function vB(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return yB(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return yB(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function yB(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function gB(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function mB(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?gB(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):gB(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var bB=function(){function e(t,r,n,i,a,o){h()(this,e),Hn(this,"properties",void 0),Hn(this,"extent",void 0),Hn(this,"type",void 0),Hn(this,"id",void 0),Hn(this,"_pbf",void 0),Hn(this,"_geometry",void 0),Hn(this,"_keys",void 0),Hn(this,"_values",void 0),Hn(this,"_geometryInfo",void 0),this.properties={},this.extent=n,this.type=0,this.id=null,this._pbf=t,this._geometry=-1,this._keys=i,this._values=a,this._geometryInfo=o,t.readFields(pB,this,r)}return C()(e,[{key:"loadGeometry",value:function(){var e=this._pbf;e.pos=this._geometry,iB=e.readVarint()+e.pos,aB=1,sB=0,uB=0,cB=0,lB=0;for(var t=[],r=[];e.pos<iB;)if(sB<=0&&(oB=e.readVarint(),aB=7&oB,sB=oB>>3),sB--,1===aB||2===aB)uB+=e.readSVarint(),cB+=e.readSVarint(),1===aB&&t.push(lB),r.push(uB,cB),lB+=2;else{if(7!==aB)throw new Error("unknown command ".concat(aB));if(lB>0){var n=t[t.length-1];r.push(r[n],r[n+1]),lB+=2}}return{data:r,indices:t}}},{key:"_toBinaryCoordinates",value:function(e){var t,r=this.loadGeometry();e(r.data,this);switch(this.type){case 1:this._geometryInfo.pointFeaturesCount++,this._geometryInfo.pointPositionsCount+=r.indices.length,t=mB({type:"Point"},r);break;case 2:this._geometryInfo.lineFeaturesCount++,this._geometryInfo.linePathsCount+=r.indices.length,this._geometryInfo.linePositionsCount+=r.data.length/2,t=mB({type:"LineString"},r);break;case 3:t=dB(r),this._geometryInfo.polygonFeaturesCount++,this._geometryInfo.polygonObjectsCount+=t.indices.length;var n,i=vB(t.indices);try{for(i.s();!(n=i.n()).done;){var a=n.value;this._geometryInfo.polygonRingsCount+=a.length}}catch(e){i.e(e)}finally{i.f()}this._geometryInfo.polygonPositionsCount+=t.data.length/2;break;default:throw new Error("Invalid geometry type: ".concat(this.type))}var o={type:"Feature",geometry:t,properties:this.properties};return null!==this.id&&(o.id=this.id),o}},{key:"toBinaryCoordinates",value:function(e){if("function"==typeof e)return this._toBinaryCoordinates(e);var t=e.x,r=e.y,n=e.z,i=this.extent*Math.pow(2,n),a=this.extent*t,o=this.extent*r;return this._toBinaryCoordinates((function(e){return function(e,t,r,n){for(var i=0,a=e.length;i<a;i+=2){e[i]=360*(e[i]+t)/n-180;var o=180-360*(e[i+1]+r)/n;e[i+1]=360/Math.PI*Math.atan(Math.exp(o*Math.PI/180))-90}}(e,a,o,i)}))}}]),e}(),AB=function(){function e(t,r){h()(this,e),Hn(this,"version",void 0),Hn(this,"name",void 0),Hn(this,"extent",void 0),Hn(this,"length",void 0),Hn(this,"_pbf",void 0),Hn(this,"_keys",void 0),Hn(this,"_values",void 0),Hn(this,"_features",void 0),this.version=1,this.name="",this.extent=4096,this.length=0,this._pbf=t,this._keys=[],this._values=[],this._features=[],t.readFields(BB,this,r),this.length=this._features.length}return C()(e,[{key:"feature",value:function(e,t){if(e<0||e>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[e];var r=this._pbf.readVarint()+this._pbf.pos;return new bB(this._pbf,r,this.extent,this._keys,this._values,t)}}]),e}();function BB(e,t,r){t&&r&&(15===e?t.version=r.readVarint():1===e?t.name=r.readString():5===e?t.extent=r.readVarint():2===e?t._features.push(r.pos):3===e?t._keys.push(r.readString()):4===e&&t._values.push(function(e){var t=null,r=e.readVarint()+e.pos;for(;e.pos<r;){var n=e.readVarint()>>3;t=1===n?e.readString():2===n?e.readFloat():3===n?e.readDouble():4===n?e.readVarint64():5===n?e.readVarint():6===n?e.readSVarint():7===n?e.readBoolean():null}return t}(r)))}var wB=function e(t,r){h()(this,e),Hn(this,"layers",void 0),this.layers=t.readFields(_B,{},r)};function _B(e,t,r){if(3===e&&r){var n=new AB(r,r.readVarint()+r.pos);n.length&&t&&(t[n.name]=n)}}function xB(e,t){var r,n,i=function(e){var t;if(null==e||!e.mvt)throw new Error("mvt options required");var r="wgs84"===(null===(t=e.mvt)||void 0===t?void 0:t.coordinates),n=e.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 e.mvt}(t),a=(null==t?void 0:null===(r=t.gis)||void 0===r?void 0:r.format)||(null==t?void 0:null===(n=t.mvt)||void 0===n?void 0:n.shape);switch(a){case"columnar-table":return{shape:"columnar-table",data:CB(e,i)};case"geojson-row-table":return{shape:"geojson-row-table",data:OB(e,i)};case"geojson":return OB(e,i);case"binary-geometry":case"binary":return CB(e,i);default:throw new Error(a)}}function CB(e,t){var r=function(e,t){var r=[],n={coordLength:2,pointPositionsCount:0,pointFeaturesCount:0,linePositionsCount:0,linePathsCount:0,lineFeaturesCount:0,polygonPositionsCount:0,polygonObjectsCount:0,polygonRingsCount:0,polygonFeaturesCount:0};if(e.byteLength<=0)return[r,n];var i=new wB(new YA.a(e));return(t&&Array.isArray(t.layers)?t.layers:Object.keys(i.layers)).forEach((function(e){var a=i.layers[e];if(a)for(var o=0;o<a.length;o++){var s=TB(a.feature(o,n),t,e);r.push(s)}})),[r,n]}(e,t),n=M()(r,2),i=NA(n[0],n[1]);return i.byteLength=e.byteLength,i}function OB(e,t){if(e.byteLength<=0)return[];var r=[],n=new fB(new YA.a(e));return(Array.isArray(t.layers)?t.layers:Object.keys(n.layers)).forEach((function(e){var i=n.layers[e];if(i)for(var a=0;a<i.length;a++){var o=EB(i.feature(a),t,e);r.push(o)}})),r}function EB(e,t,r){var n=e.toGeoJSON("wgs84"===t.coordinates?t.tileIndex:SB);return t.layerProperty&&(n.properties[t.layerProperty]=r),n}function TB(e,t,r){var n=e.toBinaryCoordinates("wgs84"===t.coordinates?t.tileIndex:kB);return t.layerProperty&&n.properties&&(n.properties[t.layerProperty]=r),n}function SB(e,t){for(var r=t.extent,n=0;n<e.length;n++){var i=e[n];i[0]/=r,i[1]/=r}}function kB(e,t){for(var r=t.extent,n=0,i=e.length;n<i;++n)e[n]/=r}function MB(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function IB(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?MB(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):MB(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var PB,RB={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}}};IB(IB({},RB),{},{parse:(PB=Me()(Pe.a.mark((function e(t,r){return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",xB(t,r));case 1:case"end":return e.stop()}}),e)}))),function(e,t){return PB.apply(this,arguments)}),parseSync:xB,binary:!0});function FB(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function DB(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return LB(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return LB(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function LB(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function jB(e,t){var r=null==t?void 0:t.globalFeatureId;return void 0!==r?function(e,t){var r,n=DB(NB(e));try{for(n.s();!(r=n.n()).done;){for(var i=r.value,a=0,o=i.featureIds.value[0],s=0;s<i.featureIds.value.length;s++){var u=i.featureIds.value[s];if(u!==o){if(t===i.globalFeatureIds.value[a])return HB(i,a,s);a=s,o=u}}if(t===i.globalFeatureIds.value[a])return HB(i,a,i.featureIds.value.length)}}catch(e){n.e(e)}finally{n.f()}throw new Error("featureId:".concat(t," not found"))}(e,r):GB(e,null==t?void 0:t.type)}function GB(e,t){return function(e){var t,r=[],n=DB(e);try{for(n.s();!(t=n.n()).done;){var i=t.value;if(0!==i.featureIds.value.length){for(var a=0,o=i.featureIds.value[0],s=0;s<i.featureIds.value.length;s++){var u=i.featureIds.value[s];u!==o&&(r.push(HB(i,a,s)),a=s,o=u)}r.push(HB(i,a,i.featureIds.value.length))}}}catch(e){n.e(e)}finally{n.f()}return r}(NB(e,t))}function UB(e,t,r){switch(e.type){case"Point":return function(e,t,r){var n=JB(e.positions,t,r);if(n.length>1)return{type:"MultiPoint",coordinates:n};return{type:"Point",coordinates:n[0]}}(e,t,r);case"LineString":return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1/0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1/0,n=e.positions,i=e.pathIndices.value.filter((function(e){return e>=t&&e<=r})),a=i.length>2;if(!a){var o=JB(n,i[0],i[1]);return{type:"LineString",coordinates:o}}for(var s=[],u=0;u<i.length-1;u++){var c=JB(n,i[u],i[u+1]);s.push(c)}return{type:"MultiLineString",coordinates:s}}(e,t,r);case"Polygon":return function e(t){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=t.positions,a=t.polygonIndices.value.filter((function(e){return e>=r&&e<=n})),o=t.primitivePolygonIndices.value.filter((function(e){return e>=r&&e<=n})),s=a.length>2;if(!s){for(var u=[],c=0;c<o.length-1;c++){var l=o[c],f=o[c+1],h=JB(i,l,f);u.push(h)}return{type:"Polygon",coordinates:u}}for(var d=[],p=0;p<a.length-1;p++){var v=a[p],y=a[p+1],g=e(t,v,y).coordinates;d.push(g)}return{type:"MultiPolygon",coordinates:d}}(e,t,r);default:var n=e;throw new Error("Unsupported geometry type: ".concat(null==n?void 0:n.type))}}function NB(e,t){if(!Boolean(e.points||e.lines||e.polygons))return e.type=t||function(e){if(e.pathIndices)return"LineString";if(e.polygonIndices)return"Polygon";return"Point"}(e),[e];var r=[];return e.points&&(e.points.type="Point",r.push(e.points)),e.lines&&(e.lines.type="LineString",r.push(e.lines)),e.polygons&&(e.polygons.type="Polygon",r.push(e.polygons)),r}function HB(e,t,r){return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?FB(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):FB(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({type:"Feature",geometry:UB(e,t,r),properties:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=(arguments.length>2&&arguments[2],Object.assign({},e.properties[e.featureIds.value[t]]));for(var n in e.numericProps)r[n]=e.numericProps[n].value[t];return r}(e,t,r)},function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;arguments.length>2&&arguments[2];return e.fields&&e.fields[e.featureIds.value[t]]}(e,t,r))}function JB(e,t,r){t=t||0,r=r||e.value.length/e.size;for(var n=[],i=t;i<r;i++){for(var a=Array(),o=i*e.size;o<(i+1)*e.size;o++)a.push(Number(e.value[o]));n.push(a)}return n}function VB(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function zB(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?VB(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):VB(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var KB={Point:qB,MultiPoint:function(e,t,r){return XB(e,t,r)},LineString:QB,MultiLineString:function(e,t,r){return e.map((function(e){return QB(e,t,r)}))},Polygon:WB,MultiPolygon:function(e,t,r){return e.map((function(e){return WB(e,t,r)}))}};function qB(e,t,r){var n=M()(e,2),i=n[0],a=n[1],o=M()(t,2),s=o[0],u=o[1],c=ft(s[0],u[0],i),l=ft(s[1],u[1],a);return r.unprojectFlat([c,l])}function XB(e,t,r){return e.map((function(e){return qB(e,t,r)}))}function QB(e,t,r){return XB(e,t,r)}function WB(e,t,r){return e.map((function(e){return XB(e,t,r)}))}function ZB(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return YB(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return YB(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function YB(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var $B=["points","lines","polygons"];function ew(e,t,r,n){var i=e.featureIds.value;if(!i.length)return-1;var a=0,o=i[i.length-1]+1;if(n){var s=function(e,t){if(!e.__layers){for(var r={},n=e.properties,i=0;i<n.length;i++){var a=n[i].layerName;a&&(r[a]?r[a][1]=i:r[a]=[i,i])}e.__layers=r}return e.__layers[t]}(e,n);if(!s)return-1;a=s[0],o=s[1]+1}var u=-1;if(t in e.numericProps){var c=e.numericProps[t].value.findIndex((function(e,t){return e===r&&i[t]>=a&&i[t]<o}));return c>=0?e.globalFeatureIds.value[c]:-1}return t?u=tw(e.properties,(function(e){return e[t]===r}),a,o):e.fields&&(u=tw(e.fields,(function(e){return e.id===r}),a,o)),u>=0?function(e,t){if(!e.__ids){for(var r=[],n=e.featureIds.value,i=e.globalFeatureIds.value,a=0;a<n.length;a++)r[n[a]]=i[a];e.__ids=r}return e.__ids[t]}(e,u):-1}function tw(e,t,r,n){for(var i=r;i<n;i++)if(t(e[i],i))return i;return-1}function rw(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return nw(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return nw(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},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 a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function nw(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function iw(e){var t=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(e){return!1}}();return function(){var r,n=m()(e);if(t){var i=m()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return y()(this,r)}}function aw(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ow(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?aw(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):aw(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var sw=ow(ow({},B.GeoJsonLayer.defaultProps),{},{onDataLoad:{type:"function",value:null,optional:!0,compare:!1},uniqueIdProperty:"",highlightedFeatureId:null,loaders:[RB],binary:!0}),uw=function(e){p()(n,e);var t,r=iw(n);function n(){return h()(this,n),r.apply(this,arguments)}return C()(n,[{key:"initializeState",value:function(){ci()(m()(n.prototype),"initializeState",this).call(this);var e=void 0===this.context.viewport.resolution&&this.props.binary;this.setState({binary:e,data:null,tileJSON:null})}},{key:"isLoaded",get:function(){return this.state&&this.state.data&&this.state.tileset&&ci()(m()(n.prototype),"isLoaded",this)}},{key:"updateState",value:function(e){var t,r=e.props,i=e.oldProps,a=e.context,o=e.changeFlags;o.dataChanged&&this._updateTileData(),null!==(t=this.state)&&void 0!==t&&t.data&&(ci()(m()(n.prototype),"updateState",this).call(this,{props:r,oldProps:i,context:a,changeFlags:o}),this._setWGS84PropertyForTiles());var s=r.highlightColor;s!==i.highlightColor&&Array.isArray(s)&&this.setState({highlightColor:s})}},{key:"_updateTileData",value:(t=Me()(Pe.a.mark((function e(){var t,r,n,i,a;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=this.props.data,r=null,"string"!=typeof t||/(?=.*{z})(?=.*{x})(?=.*({y}|{-y}))/.test(t)){e.next=18;break}return n=this.props,i=n.onDataLoad,a=n.fetch,this.setState({data:null,tileJSON:null}),e.prev=5,e.next=8,a(t,{propName:"data",layer:this,loaders:[]});case 8:r=e.sent,e.next=15;break;case 11:e.prev=11,e.t0=e.catch(5),this.raiseError(e.t0,"loading TileJSON"),t=null;case 15:i&&i(r,{propName:"data",layer:this}),e.next=19;break;case 18:t.tilejson&&(r=t);case 19:r&&(t=r.tiles),this.setState({data:t,tileJSON:r});case 21:case"end":return e.stop()}}),e,this,[[5,11]])}))),function(){return t.apply(this,arguments)})},{key:"_getTilesetOptions",value:function(){var e=ci()(m()(n.prototype),"_getTilesetOptions",this).call(this),t=this.state.tileJSON,r=this.props,i=r.minZoom,a=r.maxZoom;return t&&(Number.isFinite(t.minzoom)&&t.minzoom>i&&(e.minZoom=t.minzoom),Number.isFinite(t.maxzoom)&&(!Number.isFinite(a)||t.maxzoom<a)&&(e.maxZoom=t.maxzoom)),e}},{key:"renderLayers",value:function(){var e;return null!==(e=this.state)&&void 0!==e&&e.data?ci()(m()(n.prototype),"renderLayers",this).call(this):null}},{key:"getTileData",value:function(e){var t,r=this.state,n=r.data,i=r.binary,a=e.index,o=e.signal,s=Rn(n,e);if(!s)return Promise.reject("Invalid URL");var u=this.getLoadOptions();return(0,this.props.fetch)(s,{propName:"data",layer:this,loadOptions:u=ow(ow({},u),{},{mimeType:"application/x-protobuf",mvt:ow(ow({},null===(t=u)||void 0===t?void 0:t.mvt),{},{coordinates:this.context.viewport.resolution?"wgs84":"local",tileIndex:a}),gis:i?{format:"binary"}:{}}),signal:o})}},{key:"renderSubLayers",value:function(e){var t=e.tile.index,r=t.x,i=t.y,a=t.z,o=Math.pow(2,a),s=512/o,u=-s,c=512*r/o,l=512*(1-i/o),f=(new Wr).scale([s,u,1]);e.autoHighlight=!1,this.context.viewport.resolution||(e.modelMatrix=f,e.coordinateOrigin=[c,l,0],e.coordinateSystem=B.COORDINATE_SYSTEM.CARTESIAN,e.extensions=[].concat(De()(e.extensions||[]),[new B.ClipExtension]));var h=ci()(m()(n.prototype),"renderSubLayers",this).call(this,e);return!this.state.binary||h instanceof B.GeoJsonLayer||B.log.warn("renderSubLayers() must return GeoJsonLayer when using binary:true")(),h}},{key:"_updateAutoHighlight",value:function(e){var t,r,n=this.props.uniqueIdProperty,i=this.state,a=i.hoveredFeatureId,o=i.hoveredFeatureLayerName,s=e.object;s&&(t=cw(s,n),r=lw(s));var u=this.props.highlightColor;"function"==typeof u&&(u=u(e)),a===t&&o===r||this.setState({highlightColor:u,hoveredFeatureId:t,hoveredFeatureLayerName:r})}},{key:"getPickingInfo",value:function(e){var t=ci()(m()(n.prototype),"getPickingInfo",this).call(this,e),r=Boolean(this.context.viewport.resolution);if(this.state.binary&&-1!==t.index){var i=e.sourceLayer.props.data;t.object=jB(i,{globalFeatureId:t.index})}return t.object&&!r&&(t.object=hw(t.object,t.tile.bbox,this.context.viewport)),t}},{key:"getSubLayerPropsByTile",value:function(e){return{highlightedObjectIndex:this.getHighlightedObjectIndex(e),highlightColor:this.state.highlightColor}}},{key:"getHighlightedObjectIndex",value:function(e){var t=this.state,r=t.hoveredFeatureId,n=t.hoveredFeatureLayerName,i=t.binary,a=this.props,o=a.uniqueIdProperty,s=a.highlightedFeatureId,u=e.content,c=fw(s);if(!(fw(r)||c))return-1;var l=c?s:r;return Array.isArray(u)?u.findIndex((function(e){var t=cw(e,o)===l,r=c||lw(e)===n;return t&&r})):u&&i?function(e,t,r,n){var i,a=ZB($B);try{for(a.s();!(i=a.n()).done;){var o=i.value,s=e[o]&&ew(e[o],t,r,n);if(s>=0)return s}}catch(e){a.e(e)}finally{a.f()}return-1}(u,o,l,c?"":n):-1}},{key:"_pickObjects",value:function(e){var t=this.context,r=t.deck,n=t.viewport,i=n.width,a=n.height,o=n.x,s=n.y,u=[this.id];return r.pickObjects({x:o,y:s,width:i,height:a,layerIds:u,maxObjects:e})}},{key:"getRenderedFeatures",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,r=this._pickObjects(t),n=new Set,i=[],a=rw(r);try{for(a.s();!(e=a.n()).done;){var o=e.value,s=cw(o.object,this.props.uniqueIdProperty);void 0===s?i.push(o.object):n.has(s)||(n.add(s),i.push(o.object))}}catch(e){a.e(e)}finally{a.f()}return i}},{key:"_setWGS84PropertyForTiles",value:function(){var e=this;this.state.tileset.selectedTiles.forEach((function(t){t.hasOwnProperty("dataInWGS84")||Object.defineProperty(t,"dataInWGS84",{get:function(){if(!t.content)return null;if(e.state.binary&&Array.isArray(t.content)&&!t.content.length)return[];var r,n=t.bbox;if(void 0===t._contentWGS84&&(r=n,Number.isFinite(r.west)&&Number.isFinite(r.north)&&Number.isFinite(r.east)&&Number.isFinite(r.south))){var i=e.state.binary?jB(t.content):t.content;t._contentWGS84=i.map((function(t){return hw(t,n,e.context.viewport)}))}return t._contentWGS84}})}))}}]),n}(si);function cw(e,t){return e.properties&&t?e.properties[t]:"id"in e?e.id:void 0}function lw(e){var t;return(null===(t=e.properties)||void 0===t?void 0:t.layerName)||null}function fw(e){return null!=e&&""!==e}function hw(e,t,r){var n=ow(ow({},e),{},{geometry:{type:e.geometry.type}});return Object.defineProperty(n.geometry,"coordinates",{get:function(){return function(e,t,r){var n=[r.projectFlat([t.west,t.north]),r.projectFlat([t.east,t.south])];return zB(zB({},e),{},{coordinates:KB[e.type](e.coordinates,n,r)})}(e.geometry,t,r).coordinates}}),n}A()(uw,"layerName","MVTLayer"),A()(uw,"defaultProps",sw);for(var dw={},pw=0;pw<"0123456789bcdefghjkmnpqrstuvwxyz".length;pw++)dw["0123456789bcdefghjkmnpqrstuvwxyz".charAt(pw)]=pw;function vw(e){var t=function(e){for(var t,r=!0,n=90,i=-90,a=180,o=-180,s=0,u=0,c=e.length;u<c;u++){var l=e[u].toLowerCase();s=dw[l];for(var f=4;f>=0;f--){var h=s>>f&1;r?(t=(a+o)/2,1===h?o=t:a=t):(t=(n+i)/2,1===h?i=t:n=t),r=!r}}return[i,o,n,a]}(e),r=M()(t,4),n=r[0],i=r[1],a=r[2],o=r[3];return[o,a,o,n,i,n,i,a,o,a]}function yw(e){var t=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(e){return!1}}();return function(){var r,n=m()(e);if(t){var i=m()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return y()(this,r)}}var gw=function(e){p()(r,e);var t=yw(r);function r(){return h()(this,r),t.apply(this,arguments)}return C()(r,[{key:"indexToBounds",value:function(){var e=this.props,t=e.data,r=e.getGeohash;return{data:t,_normalize:!1,positionFormat:"XY",getPolygon:function(e,t){return vw(r(e,t))}}}}]),r}(S);A()(gw,"layerName","GeohashLayer"),A()(gw,"defaultProps",{getGeohash:{type:"accessor",value:function(e){return e.geohash}}}),r.d(t,"GreatCircleLayer",(function(){return _})),r.d(t,"S2Layer",(function(){return J})),r.d(t,"QuadkeyLayer",(function(){return Se})),r.d(t,"TileLayer",(function(){return si})),r.d(t,"TripsLayer",(function(){return di})),r.d(t,"H3ClusterLayer",(function(){return Pi})),r.d(t,"H3HexagonLayer",(function(){return Si})),r.d(t,"Tile3DLayer",(function(){return tA})),r.d(t,"TerrainLayer",(function(){return lA})),r.d(t,"MVTLayer",(function(){return uw})),r.d(t,"GeohashLayer",(function(){return gw})),r.d(t,"_GeoCellLayer",(function(){return S})),r.d(t,"_getURLFromTemplate",(function(){return Rn})),r.d(t,"_Tileset2D",(function(){return ei})),r.d(t,"_Tile2DHeader",(function(){return Re}))}])}));
|